162306a36Sopenharmony_ciWhat: /sys/kernel/debug/wilco_ec/h1_gpio 262306a36Sopenharmony_ciDate: April 2019 362306a36Sopenharmony_ciKernelVersion: 5.2 462306a36Sopenharmony_ciDescription: 562306a36Sopenharmony_ci As part of Chrome OS's FAFT (Fully Automated Firmware Testing) 662306a36Sopenharmony_ci tests, we need to ensure that the H1 chip is properly setting 762306a36Sopenharmony_ci some GPIO lines. The h1_gpio attribute exposes the state 862306a36Sopenharmony_ci of the lines: 962306a36Sopenharmony_ci - ENTRY_TO_FACT_MODE in BIT(0) 1062306a36Sopenharmony_ci - SPI_CHROME_SEL in BIT(1) 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_ci Output will formatted with "0x%02x\n". 1362306a36Sopenharmony_ci 1462306a36Sopenharmony_ciWhat: /sys/kernel/debug/wilco_ec/raw 1562306a36Sopenharmony_ciDate: January 2019 1662306a36Sopenharmony_ciKernelVersion: 5.1 1762306a36Sopenharmony_ciDescription: 1862306a36Sopenharmony_ci Write and read raw mailbox commands to the EC. 1962306a36Sopenharmony_ci 2062306a36Sopenharmony_ci You can write a hexadecimal sentence to raw, and that series of 2162306a36Sopenharmony_ci bytes will be sent to the EC. Then, you can read the bytes of 2262306a36Sopenharmony_ci response by reading from raw. 2362306a36Sopenharmony_ci 2462306a36Sopenharmony_ci For writing, bytes 0-1 indicate the message type, one of enum 2562306a36Sopenharmony_ci wilco_ec_msg_type. Byte 2+ consist of the data passed in the 2662306a36Sopenharmony_ci request, starting at MBOX[0]. At least three bytes are required 2762306a36Sopenharmony_ci for writing, two for the type and at least a single byte of 2862306a36Sopenharmony_ci data. 2962306a36Sopenharmony_ci 3062306a36Sopenharmony_ci Example:: 3162306a36Sopenharmony_ci 3262306a36Sopenharmony_ci // Request EC info type 3 (EC firmware build date) 3362306a36Sopenharmony_ci // Corresponds with sending type 0x00f0 with 3462306a36Sopenharmony_ci // MBOX = [38, 00, 03, 00] 3562306a36Sopenharmony_ci $ echo 00 f0 38 00 03 00 > /sys/kernel/debug/wilco_ec/raw 3662306a36Sopenharmony_ci // View the result. The decoded ASCII result "12/21/18" is 3762306a36Sopenharmony_ci // included after the raw hex. 3862306a36Sopenharmony_ci // Corresponds with MBOX = [00, 00, 31, 32, 2f, 32, 31, 38, ...] 3962306a36Sopenharmony_ci $ cat /sys/kernel/debug/wilco_ec/raw 4062306a36Sopenharmony_ci 00 00 31 32 2f 32 31 2f 31 38 00 38 00 01 00 2f 00 ..12/21/18.8... 4162306a36Sopenharmony_ci 4262306a36Sopenharmony_ci Note that the first 16 bytes of the received MBOX[] will be 4362306a36Sopenharmony_ci printed, even if some of the data is junk, and skipping bytes 4462306a36Sopenharmony_ci 17 to 32. It is up to you to know how many of the first bytes of 4562306a36Sopenharmony_ci data are the actual response. 46