← Documents Documentation/devicetree/bindings/mailbox/mailbox.txt GitHub 원문 ↗

Linux 6.18.37 · Devicetree Bindings

Generic Mailbox Controller and Client

공통 mailbox channel specifier, 이름, shared memory 연결 규칙입니다.

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

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

1. 요약·해설

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

요약과 해설

mailbox.txt:1-60

Controller의 cell 형식과 client의 mboxes·mbox-names·shmem 관계를 설명합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 * Generic Mailbox Controller and client driver bindings
2
3 Generic binding to provide a way for Mailbox controller drivers to
4 assign appropriate mailbox channel to client drivers.
5
6 * Mailbox Controller
7
8 Required property:
9 - #mbox-cells: Must be at least 1. Number of cells in a mailbox
10 specifier.
11
12 Example:
13 mailbox: mailbox {
14 ...
15 #mbox-cells = <1>;
16 };
17
18
19 * Mailbox Client
20
21 Required property:
22 - mboxes: List of phandle and mailbox channel specifiers.
23
24 Optional property:
25 - mbox-names: List of identifier strings for each mailbox channel.
26 - shmem : List of phandle pointing to the shared memory(SHM) area between the
27 users of these mailboxes for IPC, one for each mailbox. This shared
28 memory can be part of any memory reserved for the purpose of this
29 communication between the mailbox client and the remote.
30
31
32 Example:
33 pwr_cntrl: power {
34 ...
35 mbox-names = "pwr-ctrl", "rpc";
36 mboxes = <&mailbox 0 &mailbox 1>;
37 };
38
39 Example with shared memory(shmem):
40
41 sram: sram@50000000 {
42 compatible = "mmio-sram";
43 reg = <0x50000000 0x10000>;
44
45 #address-cells = <1>;
46 #size-cells = <1>;
47 ranges = <0 0x50000000 0x10000>;
48
49 cl_shmem: shmem@0 {
50 compatible = "client-shmem";
51 reg = <0x0 0x200>;
52 };
53 };
54
55 client@2e000000 {
56 ...
57 mboxes = <&mailbox 0>;
58 shmem = <&cl_shmem>;
59 ..
60 };
61

3. 한국어 전문 번역

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

공통 mailbox controller 바인딩

1-18

공통 mailbox 바인딩은 mailbox controller driver가 client driver에 적절한 mailbox channel을 할당하는 방법을 제공합니다. Controller의 필수 `#mbox-cells`는 mailbox specifier에 들어가는 cell 수이며 최소 1이어야 합니다.

mailbox: mailbox {
        ...
        #mbox-cells = <1>;
};
공통 mailbox 참조 관계
Mailbox controller#mbox-cells
Client mboxesphandle + channel specifier
mbox-names각 channel 식별자
shmemClient와 remote 사이 IPC memory

Controller가 specifier 형식을 선언하고 client가 이름과 선택적 shared memory를 함께 참조합니다.

Client channel 목록과 이름

19-38

Client의 필수 `mboxes`는 phandle과 mailbox channel specifier의 목록입니다. 선택적인 `mbox-names`는 각 mailbox channel에 대응하는 identifier 문자열 목록입니다.

선택적인 `shmem`은 mailbox 사용자 사이 IPC에 쓰는 shared memory(SHM) 영역을 가리키는 phandle 목록이며 mailbox마다 하나씩 대응합니다. 이 shared memory는 client와 remote의 통신을 위해 예약된 어떤 memory 영역의 일부여도 됩니다.

첫 번째 예제의 power controller client는 `pwr-ctrl`과 `rpc`라는 두 이름을 붙이고 mailbox controller의 channel 0과 1을 참조합니다.

pwr_cntrl: power {
        ...
        mbox-names = "pwr-ctrl", "rpc";
        mboxes = <&mailbox 0 &mailbox 1>;
};

Shared memory client 예제

39-60

Shared memory 예제는 `0x50000000`의 0x10000-byte MMIO SRAM 안에 offset 0, 크기 0x200의 `client-shmem` 영역을 만듭니다. Client는 mailbox channel 0과 `cl_shmem` phandle을 함께 지정해 IPC channel과 그 shared memory를 연결합니다.

sram: sram@50000000 {
        compatible = "mmio-sram";
        reg = <0x50000000 0x10000>;

        #address-cells = <1>;
        #size-cells = <1>;
        ranges = <0 0x50000000 0x10000>;

        cl_shmem: shmem@0 {
                compatible = "client-shmem";
                reg = <0x0 0x200>;
        };
};

client@2e000000 {
        ...
        mboxes = <&mailbox 0>;
        shmem = <&cl_shmem>;
        ..
};