xref: /linux/Documentation/ABI/testing/debugfs-wilco-ec (revision 9e2b0e0be64227ba8f09008d32d75280595a5464)
1*9e2b0e0bSNick CrewsWhat:		/sys/kernel/debug/wilco_ec/h1_gpio
2*9e2b0e0bSNick CrewsDate:		April 2019
3*9e2b0e0bSNick CrewsKernelVersion:	5.2
4*9e2b0e0bSNick CrewsDescription:
5*9e2b0e0bSNick Crews		As part of Chrome OS's FAFT (Fully Automated Firmware Testing)
6*9e2b0e0bSNick Crews		tests, we need to ensure that the H1 chip is properly setting
7*9e2b0e0bSNick Crews		some GPIO lines. The h1_gpio attribute exposes the state
8*9e2b0e0bSNick Crews		of the lines:
9*9e2b0e0bSNick Crews		- ENTRY_TO_FACT_MODE in BIT(0)
10*9e2b0e0bSNick Crews		- SPI_CHROME_SEL in BIT(1)
11*9e2b0e0bSNick Crews
12*9e2b0e0bSNick Crews		Output will formatted with "0x%02x\n".
13*9e2b0e0bSNick Crews
14b787bb12SNick CrewsWhat:		/sys/kernel/debug/wilco_ec/raw
15b787bb12SNick CrewsDate:		January 2019
16b787bb12SNick CrewsKernelVersion:	5.1
17b787bb12SNick CrewsDescription:
18b787bb12SNick Crews		Write and read raw mailbox commands to the EC.
19b787bb12SNick Crews
2014e14aafSNick Crews		You can write a hexadecimal sentence to raw, and that series of
2114e14aafSNick Crews		bytes will be sent to the EC. Then, you can read the bytes of
2214e14aafSNick Crews		response by reading from raw.
23b787bb12SNick Crews
2414e14aafSNick Crews		For writing, bytes 0-1 indicate the message type, one of enum
2514e14aafSNick Crews		wilco_ec_msg_type. Byte 2+ consist of the data passed in the
2614e14aafSNick Crews		request, starting at MBOX[0]
2714e14aafSNick Crews
2814e14aafSNick Crews		At least three bytes are required for writing, two for the type
2914e14aafSNick Crews		and at least a single byte of data. Only the first
3014e14aafSNick Crews		EC_MAILBOX_DATA_SIZE bytes of MBOX will be used.
31b787bb12SNick Crews
32b787bb12SNick Crews		Example:
33b787bb12SNick Crews		// Request EC info type 3 (EC firmware build date)
3414e14aafSNick Crews		// Corresponds with sending type 0x00f0 with
3514e14aafSNick Crews		// MBOX = [38, 00, 03, 00]
3614e14aafSNick Crews		$ echo 00 f0 38 00 03 00 > /sys/kernel/debug/wilco_ec/raw
37b787bb12SNick Crews		// View the result. The decoded ASCII result "12/21/18" is
38b787bb12SNick Crews		// included after the raw hex.
3914e14aafSNick Crews		// Corresponds with MBOX = [00, 00, 31, 32, 2f, 32, 31, 38, ...]
4014e14aafSNick Crews		$ cat /sys/kernel/debug/wilco_ec/raw
4114e14aafSNick Crews		00 00 31 32 2f 32 31 2f 31 38 00 38 00 01 00 2f 00  ..12/21/18.8...
4214e14aafSNick Crews
4314e14aafSNick Crews		Note that the first 32 bytes of the received MBOX[] will be
4414e14aafSNick Crews		printed, even if some of the data is junk. It is up to you to
4514e14aafSNick Crews		know how many of the first bytes of data are the actual
4614e14aafSNick Crews		response.
47