Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma
[sfrench/cifs-2.6.git] / Documentation / ABI / testing / debugfs-wilco-ec
1 What:           /sys/kernel/debug/wilco_ec/h1_gpio
2 Date:           April 2019
3 KernelVersion:  5.2
4 Description:
5                 As part of Chrome OS's FAFT (Fully Automated Firmware Testing)
6                 tests, we need to ensure that the H1 chip is properly setting
7                 some GPIO lines. The h1_gpio attribute exposes the state
8                 of the lines:
9                 - ENTRY_TO_FACT_MODE in BIT(0)
10                 - SPI_CHROME_SEL in BIT(1)
11
12                 Output will formatted with "0x%02x\n".
13
14 What:           /sys/kernel/debug/wilco_ec/raw
15 Date:           January 2019
16 KernelVersion:  5.1
17 Description:
18                 Write and read raw mailbox commands to the EC.
19
20                 You can write a hexadecimal sentence to raw, and that series of
21                 bytes will be sent to the EC. Then, you can read the bytes of
22                 response by reading from raw.
23
24                 For writing, bytes 0-1 indicate the message type, one of enum
25                 wilco_ec_msg_type. Byte 2+ consist of the data passed in the
26                 request, starting at MBOX[0]
27
28                 At least three bytes are required for writing, two for the type
29                 and at least a single byte of data. Only the first
30                 EC_MAILBOX_DATA_SIZE bytes of MBOX will be used.
31
32                 Example:
33                 // Request EC info type 3 (EC firmware build date)
34                 // Corresponds with sending type 0x00f0 with
35                 // MBOX = [38, 00, 03, 00]
36                 $ echo 00 f0 38 00 03 00 > /sys/kernel/debug/wilco_ec/raw
37                 // View the result. The decoded ASCII result "12/21/18" is
38                 // included after the raw hex.
39                 // Corresponds with MBOX = [00, 00, 31, 32, 2f, 32, 31, 38, ...]
40                 $ cat /sys/kernel/debug/wilco_ec/raw
41                 00 00 31 32 2f 32 31 2f 31 38 00 38 00 01 00 2f 00  ..12/21/18.8...
42
43                 Note that the first 32 bytes of the received MBOX[] will be
44                 printed, even if some of the data is junk. It is up to you to
45                 know how many of the first bytes of data are the actual
46                 response.