요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
Raw EC mailbox command와 response
debugfs-wilco-ec:14-45raw 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 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
What: /sys/kernel/debug/wilco_ec/h1_gpio
Date: April 2019
KernelVersion: 5.2
Description:
As part of Chrome OS's FAFT (Fully Automated Firmware Testing)
tests, we need to ensure that the H1 chip is properly setting
some GPIO lines. The h1_gpio attribute exposes the state
of the lines:
- ENTRY_TO_FACT_MODE in BIT(0)
- SPI_CHROME_SEL in BIT(1)
Output will formatted with "0x%02x\n".
What: /sys/kernel/debug/wilco_ec/raw
Date: January 2019
KernelVersion: 5.1
Description:
Write and read raw mailbox commands to the EC.
You can write a hexadecimal sentence to raw, and that series of
bytes will be sent to the EC. Then, you can read the bytes of
response by reading from raw.
For writing, bytes 0-1 indicate the message type, one of enum
wilco_ec_msg_type. Byte 2+ consist of the data passed in the
request, starting at MBOX[0]. At least three bytes are required
for writing, two for the type and at least a single byte of
data.
Example::
// Request EC info type 3 (EC firmware build date)
// Corresponds with sending type 0x00f0 with
// MBOX = [38, 00, 03, 00]
$ echo 00 f0 38 00 03 00 > /sys/kernel/debug/wilco_ec/raw
// View the result. The decoded ASCII result "12/21/18" is
// included after the raw hex.
// Corresponds with 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...
Note that the first 16 bytes of the received MBOX[] will be
printed, even if some of the data is junk, and skipping bytes
17 to 32. It is up to you to know how many of the first bytes of
data are the actual response.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Chrome OS FAFT H1 GPIO 확인
1-12| 항목 | 내용 |
|---|---|
| What | /sys/kernel/debug/wilco_ec/h1_gpio |
| Date | 2019년 4월 |
| KernelVersion | 5.2 |
| Description | Chrome 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 |
| Date | 2019년 1월 |
| KernelVersion | 5.1 |
| Description | EC에 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인지는 사용자가 알아야 합니다.
Raw write는 2-byte message type 뒤에 MBOX payload를 붙이고 read는 앞부분 response와 사람이 읽을 수 있는 ASCII를 출력한다.
H1 GPIO state bitfield
debugfs-wilco-ec:1-12h1_gpio는 ENTRY_TO_FACT_MODE를 BIT(0), SPI_CHROME_SEL을 BIT(1)에 담아 0x%02x 형식으로 출력해 FAFT에서 H1 GPIO 설정을 검사합니다.