← Documents Documentation/devicetree/bindings/mailbox/hisilicon,hi6220-mailbox.txt GitHub 원문 ↗

Linux 6.18.37 · Devicetree Bindings

HiSilicon Hi6220 Mailbox

Hi6220의 IPC register·shared slot buffer와 IRQ acknowledgement 계약입니다.

Source pathDocumentation/devicetree/bindings/mailbox/hisilicon,hi6220-mailbox.txt
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약과 해설

hisilicon,hi6220-mailbox.txt:1-74

세 cell의 slot_id, dst_irq, ack_irq 의미와 TX/RX client 예제를 설명합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 Hisilicon Hi6220 Mailbox Driver
2 ===============================
3
4 Hisilicon Hi6220 mailbox supports up to 32 channels. Each channel
5 is unidirectional with a maximum message size of 8 words. I/O is
6 performed using register access (there is no DMA) and the cell
7 raises an interrupt when messages are received.
8
9 Mailbox Device Node:
10 ====================
11
12 Required properties:
13 --------------------
14 - compatible: Shall be "hisilicon,hi6220-mbox"
15 - reg: Contains the mailbox register address range (base
16 address and length); the first item is for IPC
17 registers, the second item is shared buffer for
18 slots.
19 - #mbox-cells: Common mailbox binding property to identify the number
20 of cells required for the mailbox specifier. Must be 3.
21 <&phandle slot_id dst_irq ack_irq>
22 phandle: Label name of mailbox controller
23 slot_id: Slot id used either for TX or RX
24 dst_irq: IRQ identifier index number which used by MCU
25 ack_irq: IRQ identifier index number with generating a
26 TX/RX interrupt to application processor,
27 mailbox driver uses it to acknowledge interrupt
28 - interrupts: Contains the interrupt information for the mailbox
29 device. The format is dependent on which interrupt
30 controller the SoCs use.
31
32 Optional Properties:
33 --------------------
34 - hi6220,mbox-tx-noirq: Property of MCU firmware's feature, so mailbox driver
35 use this flag to ask MCU to enable "automatic idle
36 flag" mode or IRQ generated mode to acknowledge a TX
37 completion.
38
39 Example:
40 --------
41
42 mailbox: mailbox@f7510000 {
43 compatible = "hisilicon,hi6220-mbox";
44 reg = <0x0 0xf7510000 0x0 0x1000>, /* IPC_S */
45 <0x0 0x06dff800 0x0 0x0800>; /* Mailbox */
46 interrupt-parent = <&gic>;
47 interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>;
48 #mbox-cells = <3>;
49 };
50
51
52 Mailbox client
53 ===============
54
55 Required properties:
56 --------------------
57 - compatible: Many (See the client docs).
58 - mboxes: Standard property to specify a Mailbox (See ./mailbox.txt)
59 Cells must match 'mbox-cells' (See Mailbox Device Node above).
60
61 Optional Properties:
62 --------------------
63 - mbox-names: Name given to channels seen in the 'mboxes' property.
64
65 Example:
66 --------
67
68 stub_clock: stub_clock {
69 compatible = "hisilicon,hi6220-stub-clk";
70 hisilicon,hi6220-clk-sram = <&sram>;
71 #clock-cells = <1>;
72 mbox-names = "mbox-tx", "mbox-rx";
73 mboxes = <&mailbox 1 0 11>, <&mailbox 0 1 10>;
74 };
75

3. 한국어 전문 번역

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

Hi6220 mailbox controller

1-38

HiSilicon 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를 활성화하도록 요청합니다.

Hi6220 mailbox specifier
순서Cell역할
phandle&mailboxController label
1slot_idTX 또는 RX slot
2dst_irqMCU IRQ identifier
3ack_irqAP TX/RX acknowledgement IRQ

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-64

Client의 `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>;
};