← Documents Documentation/ABI/testing/debugfs-wilco-ec GitHub 원문 ↗

Linux 6.18.37 · ABI / testing

Wilco Embedded Controller debugfs ABI

Chrome OS FAFT를 위한 H1 GPIO state bitfield와 Wilco EC raw mailbox command의 message type·MBOX payload·response 출력 규칙을 설명합니다.

Source pathDocumentation/ABI/testing/debugfs-wilco-ec
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

H1 GPIO state bitfield

debugfs-wilco-ec:1-12

h1_gpio는 ENTRY_TO_FACT_MODE를 BIT(0), SPI_CHROME_SEL을 BIT(1)에 담아 0x%02x 형식으로 출력해 FAFT에서 H1 GPIO 설정을 검사합니다.

Raw EC mailbox command와 response

debugfs-wilco-ec:14-45

raw write의 byte 0-1은 wilco_ec_msg_type이고 byte 2+는 MBOX[0]부터 시작하는 request data입니다. 최소 type 2 bytes와 data 1 byte가 필요하며 read는 response를 raw hex와 decoded ASCII로 보여 줍니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
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]. At least three bytes are required
27 for writing, two for the type and at least a single byte of
28 data.
29
30 Example::
31
32 // Request EC info type 3 (EC firmware build date)
33 // Corresponds with sending type 0x00f0 with
34 // MBOX = [38, 00, 03, 00]
35 $ echo 00 f0 38 00 03 00 > /sys/kernel/debug/wilco_ec/raw
36 // View the result. The decoded ASCII result "12/21/18" is
37 // included after the raw hex.
38 // Corresponds with MBOX = [00, 00, 31, 32, 2f, 32, 31, 38, ...]
39 $ cat /sys/kernel/debug/wilco_ec/raw
40 00 00 31 32 2f 32 31 2f 31 38 00 38 00 01 00 2f 00 ..12/21/18.8...
41
42 Note that the first 16 bytes of the received MBOX[] will be
43 printed, even if some of the data is junk, and skipping bytes
44 17 to 32. It is up to you to know how many of the first bytes of
45 data are the actual response.
46

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

Chrome OS FAFT H1 GPIO 확인

1-12
항목내용
What/sys/kernel/debug/wilco_ec/h1_gpio
Date2019년 4월
KernelVersion5.2
DescriptionChrome OS의 FAFT(Fully Automated Firmware Testing) test 일부로 H1 chip이 몇몇 GPIO line을 올바르게 설정하는지 확인해야 합니다. h1_gpio attribute가 이 line의 상태를 노출합니다.
BIT(0)ENTRY_TO_FACT_MODE
BIT(1)SPI_CHROME_SEL
Output format"0x%02x\n"

Wilco EC raw mailbox interface

14-45
항목내용
What/sys/kernel/debug/wilco_ec/raw
Date2019년 1월
KernelVersion5.1
DescriptionEC에 raw mailbox command를 쓰고 그 응답을 읽습니다.

Raw에 hexadecimal 문장을 쓰면 그 byte sequence를 EC로 보냅니다. 그런 다음 raw를 읽어 response bytes를 읽을 수 있습니다.

Write에서 byte 0-1은 enum wilco_ec_msg_type 중 하나인 message type을 나타냅니다. Byte 2 이후는 MBOX[0]부터 시작해 request에 전달되는 data입니다. Write에는 type 두 bytes와 최소 data 한 byte, 즉 적어도 세 bytes가 필요합니다.

EC info type 3, 즉 EC firmware build date를 요청하는 예입니다. Type 0x00f0과 MBOX = [38, 00, 03, 00] 전송에 해당합니다.

$ echo 00 f0 38 00 03 00 > /sys/kernel/debug/wilco_ec/raw

결과를 봅니다. Decoded ASCII 결과 "12/21/18"이 raw hex 뒤에 포함됩니다. MBOX = [00, 00, 31, 32, 2f, 32, 31, 38, ...]에 해당합니다.

$ cat /sys/kernel/debug/wilco_ec/raw
00 00 31 32 2f 32 31 2f 31 38 00 38 00 01 00 2f 00  ..12/21/18.8...

수신한 MBOX[]의 첫 16 bytes는 일부 data가 junk여도 출력하고 byte 17부터 32까지는 건너뜁니다. 첫 data bytes 중 몇 개가 실제 response인지는 사용자가 알아야 합니다.

Wilco EC raw mailbox byte layout
Write byte 0 and 1enum wilco_ec_msg_typeExample 0x00f0
Write byte 2 and laterMBOX[0] request dataAt least one data byteEC mailbox command
Read responseFirst 16 MBOX bytes printed even with junkBytes 17 through 32 skippedCaller identifies actual response length

Raw write는 2-byte message type 뒤에 MBOX payload를 붙이고 read는 앞부분 response와 사람이 읽을 수 있는 ASCII를 출력한다.