요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
Hisilicon Hi6220 Mailbox Driver
===============================
Hisilicon Hi6220 mailbox supports up to 32 channels. Each channel
is unidirectional with a maximum message size of 8 words. I/O is
performed using register access (there is no DMA) and the cell
raises an interrupt when messages are received.
Mailbox Device Node:
====================
Required properties:
--------------------
- compatible: Shall be "hisilicon,hi6220-mbox"
- reg: Contains the mailbox register address range (base
address and length); the first item is for IPC
registers, the second item is shared buffer for
slots.
- #mbox-cells: Common mailbox binding property to identify the number
of cells required for the mailbox specifier. Must be 3.
<&phandle slot_id dst_irq ack_irq>
phandle: Label name of mailbox controller
slot_id: Slot id used either for TX or RX
dst_irq: IRQ identifier index number which used by MCU
ack_irq: IRQ identifier index number with generating a
TX/RX interrupt to application processor,
mailbox driver uses it to acknowledge interrupt
- interrupts: Contains the interrupt information for the mailbox
device. The format is dependent on which interrupt
controller the SoCs use.
Optional Properties:
--------------------
- hi6220,mbox-tx-noirq: Property of MCU firmware's feature, so mailbox driver
use this flag to ask MCU to enable "automatic idle
flag" mode or IRQ generated mode to acknowledge a TX
completion.
Example:
--------
mailbox: mailbox@f7510000 {
compatible = "hisilicon,hi6220-mbox";
reg = <0x0 0xf7510000 0x0 0x1000>, /* IPC_S */
<0x0 0x06dff800 0x0 0x0800>; /* Mailbox */
interrupt-parent = <&gic>;
interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>;
#mbox-cells = <3>;
};
Mailbox client
===============
Required properties:
--------------------
- compatible: Many (See the client docs).
- mboxes: Standard property to specify a Mailbox (See ./mailbox.txt)
Cells must match 'mbox-cells' (See Mailbox Device Node above).
Optional Properties:
--------------------
- mbox-names: Name given to channels seen in the 'mboxes' property.
Example:
--------
stub_clock: stub_clock {
compatible = "hisilicon,hi6220-stub-clk";
hisilicon,hi6220-clk-sram = <&sram>;
#clock-cells = <1>;
mbox-names = "mbox-tx", "mbox-rx";
mboxes = <&mailbox 1 0 11>, <&mailbox 0 1 10>;
};
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Hi6220 mailbox controller
1-38HiSilicon Hi6220 mailbox는 최대 32개 단방향 channel과 최대 8-word message를 지원합니다. I/O는 DMA 없이 register access로 수행하며 message를 받으면 cell이 interrupt를 발생시킵니다.
필수 `compatible`은 `hisilicon,hi6220-mbox`입니다. `reg`의 첫 번째 항목은 IPC register, 두 번째 항목은 slot용 shared buffer의 base address와 길이입니다. `interrupts`는 SoC가 사용하는 interrupt controller 형식에 맞춰 mailbox interrupt 정보를 지정합니다.
`#mbox-cells`는 3이어야 하며 specifier는 `<&phandle slot_id dst_irq ack_irq>`입니다. `slot_id`는 TX 또는 RX slot, `dst_irq`는 MCU가 사용하는 IRQ identifier index, `ack_irq`는 application processor에 TX/RX interrupt를 발생시키는 IRQ index이며 mailbox driver가 이 interrupt를 acknowledge하는 데 사용합니다.
선택적인 `hi6220,mbox-tx-noirq`는 MCU firmware 기능을 나타냅니다. Mailbox driver는 이 flag를 사용해 TX completion을 acknowledge할 때 MCU가 `automatic idle flag` mode 또는 IRQ-generated mode를 활성화하도록 요청합니다.
Slot과 두 IRQ identifier의 역할을 순서대로 정리합니다.
IPC와 shared buffer 예제
39-51예제는 `0xf7510000`의 IPC_S register region과 `0x06dff800`의 mailbox shared slot buffer를 연결하고 GIC SPI 94를 level-high interrupt로 사용합니다.
mailbox: mailbox@f7510000 {
compatible = "hisilicon,hi6220-mbox";
reg = <0x0 0xf7510000 0x0 0x1000>, /* IPC_S */
<0x0 0x06dff800 0x0 0x0800>; /* Mailbox */
interrupt-parent = <&gic>;
interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>;
#mbox-cells = <3>;
};
Hi6220 client 속성
52-64Client의 `compatible`은 각 client 문서에서 정의합니다. 필수 `mboxes`는 `./mailbox.txt`의 표준 속성이며 controller의 세 cell 형식과 일치해야 합니다. 선택적인 `mbox-names`는 `mboxes`에서 보이는 channel에 이름을 붙입니다.
TX와 RX stub clock 예제
65-74예제 `hisilicon,hi6220-stub-clk` client는 `mbox-tx`에 slot 1, dst IRQ 0, ack IRQ 11을 지정하고 `mbox-rx`에 slot 0, dst IRQ 1, ack IRQ 10을 지정합니다.
stub_clock: stub_clock {
compatible = "hisilicon,hi6220-stub-clk";
hisilicon,hi6220-clk-sram = <&sram>;
#clock-cells = <1>;
mbox-names = "mbox-tx", "mbox-rx";
mboxes = <&mailbox 1 0 11>, <&mailbox 0 1 10>;
};
요약과 해설
hisilicon,hi6220-mailbox.txt:1-74세 cell의 slot_id, dst_irq, ack_irq 의미와 TX/RX client 예제를 설명합니다.