19e2b0e0bSNick CrewsWhat: /sys/kernel/debug/wilco_ec/h1_gpio 29e2b0e0bSNick CrewsDate: April 2019 39e2b0e0bSNick CrewsKernelVersion: 5.2 49e2b0e0bSNick CrewsDescription: 59e2b0e0bSNick Crews As part of Chrome OS's FAFT (Fully Automated Firmware Testing) 69e2b0e0bSNick Crews tests, we need to ensure that the H1 chip is properly setting 79e2b0e0bSNick Crews some GPIO lines. The h1_gpio attribute exposes the state 89e2b0e0bSNick Crews of the lines: 99e2b0e0bSNick Crews - ENTRY_TO_FACT_MODE in BIT(0) 109e2b0e0bSNick Crews - SPI_CHROME_SEL in BIT(1) 119e2b0e0bSNick Crews 129e2b0e0bSNick Crews Output will formatted with "0x%02x\n". 139e2b0e0bSNick 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 262ad1f7a9SNick Crews request, starting at MBOX[0]. At least three bytes are required 272ad1f7a9SNick Crews for writing, two for the type and at least a single byte of 282ad1f7a9SNick Crews data. 29b787bb12SNick Crews 30*54a19b4dSMauro Carvalho Chehab Example:: 31*54a19b4dSMauro Carvalho Chehab 32b787bb12SNick Crews // Request EC info type 3 (EC firmware build date) 3314e14aafSNick Crews // Corresponds with sending type 0x00f0 with 3414e14aafSNick Crews // MBOX = [38, 00, 03, 00] 3514e14aafSNick Crews $ echo 00 f0 38 00 03 00 > /sys/kernel/debug/wilco_ec/raw 36b787bb12SNick Crews // View the result. The decoded ASCII result "12/21/18" is 37b787bb12SNick Crews // included after the raw hex. 3814e14aafSNick Crews // Corresponds with MBOX = [00, 00, 31, 32, 2f, 32, 31, 38, ...] 3914e14aafSNick Crews $ cat /sys/kernel/debug/wilco_ec/raw 4014e14aafSNick Crews 00 00 31 32 2f 32 31 2f 31 38 00 38 00 01 00 2f 00 ..12/21/18.8... 4114e14aafSNick Crews 422ad1f7a9SNick Crews Note that the first 16 bytes of the received MBOX[] will be 432ad1f7a9SNick Crews printed, even if some of the data is junk, and skipping bytes 442ad1f7a9SNick Crews 17 to 32. It is up to you to know how many of the first bytes of 452ad1f7a9SNick Crews data are the actual response. 46