← Documents Documentation/devicetree/bindings/powerpc/fsl/mpc5200.txt GitHub 원문 ↗

Linux 6.18.37 · Devicetree Bindings

MPC5200

MPC5200·MPC5200B SoC compatible, child device, GPT, PSC, GPIO, FEC와 PIC binding입니다.

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

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

1. 요약·해설

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

요약과 해설

mpc5200.txt:1-198

5200B의 backward-compatible 명명 규칙부터 SoC child 목록과 GPT watchdog·GPIO·interrupt, PSC mode, MII와 MPIC cell encoding까지 한 문서에서 정리합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 MPC5200 Device Tree Bindings
2 ----------------------------
3
4 (c) 2006-2009 Secret Lab Technologies Ltd
5 Grant Likely <[email protected]>
6
7 Naming conventions
8 ------------------
9 For mpc5200 on-chip devices, the format for each compatible value is
10 <chip>-<device>[-<mode>]. The OS should be able to match a device driver
11 to the device based solely on the compatible value. If two drivers
12 match on the compatible list; the 'most compatible' driver should be
13 selected.
14
15 The split between the MPC5200 and the MPC5200B leaves a bit of a
16 conundrum. How should the compatible property be set up to provide
17 maximum compatibility information; but still accurately describe the
18 chip? For the MPC5200; the answer is easy. Most of the SoC devices
19 originally appeared on the MPC5200. Since they didn't exist anywhere
20 else; the 5200 compatible properties will contain only one item;
21 "fsl,mpc5200-<device>".
22
23 The 5200B is almost the same as the 5200, but not quite. It fixes
24 silicon bugs and it adds a small number of enhancements. Most of the
25 devices either provide exactly the same interface as on the 5200. A few
26 devices have extra functions but still have a backwards compatible mode.
27 To express this information as completely as possible, 5200B device trees
28 should have two items in the compatible list:
29 compatible = "fsl,mpc5200b-<device>","fsl,mpc5200-<device>";
30
31 It is *strongly* recommended that 5200B device trees follow this convention
32 (instead of only listing the base mpc5200 item).
33
34 ie. ethernet on mpc5200: compatible = "fsl,mpc5200-fec";
35 ethernet on mpc5200b: compatible = "fsl,mpc5200b-fec", "fsl,mpc5200-fec";
36
37 Modal devices, like PSCs, also append the configured function to the
38 end of the compatible field. ie. A PSC in i2s mode would specify
39 "fsl,mpc5200-psc-i2s", not "fsl,mpc5200-i2s". This convention is chosen to
40 avoid naming conflicts with non-psc devices providing the same
41 function. For example, "fsl,mpc5200-spi" and "fsl,mpc5200-psc-spi" describe
42 the mpc5200 simple spi device and a PSC spi mode respectively.
43
44 At the time of writing, exact chip may be either 'fsl,mpc5200' or
45 'fsl,mpc5200b'.
46
47 The soc node
48 ------------
49 This node describes the on chip SOC peripherals. Every mpc5200 based
50 board will have this node, and as such there is a common naming
51 convention for SOC devices.
52
53 Required properties:
54 name description
55 ---- -----------
56 ranges Memory range of the internal memory mapped registers.
57 Should be <0 [baseaddr] 0xc000>
58 reg Should be <[baseaddr] 0x100>
59 compatible mpc5200: "fsl,mpc5200-immr"
60 mpc5200b: "fsl,mpc5200b-immr"
61 system-frequency 'fsystem' frequency in Hz; XLB, IPB, USB and PCI
62 clocks are derived from the fsystem clock.
63 bus-frequency IPB bus frequency in Hz. Clock rate
64 used by most of the soc devices.
65
66 soc child nodes
67 ---------------
68 Any on chip SOC devices available to Linux must appear as soc5200 child nodes.
69
70 Note: The tables below show the value for the mpc5200. A mpc5200b device
71 tree should use the "fsl,mpc5200b-<device>","fsl,mpc5200-<device>" form.
72
73 Required soc5200 child nodes:
74 name compatible Description
75 ---- ---------- -----------
76 cdm@<addr> fsl,mpc5200-cdm Clock Distribution
77 interrupt-controller@<addr> fsl,mpc5200-pic need an interrupt
78 controller to boot
79 bestcomm@<addr> fsl,mpc5200-bestcomm Bestcomm DMA controller
80
81 Recommended soc5200 child nodes; populate as needed for your board
82 name compatible Description
83 ---- ---------- -----------
84 timer@<addr> fsl,mpc5200-gpt General purpose timers
85 gpio@<addr> fsl,mpc5200-gpio MPC5200 simple gpio controller
86 gpio@<addr> fsl,mpc5200-gpio-wkup MPC5200 wakeup gpio controller
87 rtc@<addr> fsl,mpc5200-rtc Real time clock
88 mscan@<addr> fsl,mpc5200-mscan CAN bus controller
89 pci@<addr> fsl,mpc5200-pci PCI bridge
90 serial@<addr> fsl,mpc5200-psc-uart PSC in serial mode
91 i2s@<addr> fsl,mpc5200-psc-i2s PSC in i2s mode
92 ac97@<addr> fsl,mpc5200-psc-ac97 PSC in ac97 mode
93 spi@<addr> fsl,mpc5200-psc-spi PSC in spi mode
94 irda@<addr> fsl,mpc5200-psc-irda PSC in IrDA mode
95 spi@<addr> fsl,mpc5200-spi MPC5200 spi device
96 ethernet@<addr> fsl,mpc5200-fec MPC5200 ethernet device
97 ata@<addr> fsl,mpc5200-ata IDE ATA interface
98 i2c@<addr> fsl,mpc5200-i2c I2C controller
99 usb@<addr> fsl,mpc5200-ohci,ohci-be USB controller
100 xlb@<addr> fsl,mpc5200-xlb XLB arbitrator
101
102 fsl,mpc5200-gpt nodes
103 ---------------------
104 On the mpc5200 and 5200b, GPT0 has a watchdog timer function. If the board
105 design supports the internal wdt, then the device node for GPT0 should
106 include the empty property 'fsl,has-wdt'. Note that this does not activate
107 the watchdog. The timer will function as a GPT if the timer api is used, and
108 it will function as watchdog if the watchdog device is used. The watchdog
109 mode has priority over the gpt mode, i.e. if the watchdog is activated, any
110 gpt api call to this timer will fail with -EBUSY.
111
112 If you add the property
113 fsl,wdt-on-boot = <n>;
114 GPT0 will be marked as in-use watchdog, i.e. blocking every gpt access to it.
115 If n>0, the watchdog is started with a timeout of n seconds. If n=0, the
116 configuration of the watchdog is not touched. This is useful in two cases:
117 - just mark GPT0 as watchdog, blocking gpt accesses, and configure it later;
118 - do not touch a configuration assigned by the boot loader which supervises
119 the boot process itself.
120
121 The watchdog will respect the CONFIG_WATCHDOG_NOWAYOUT option.
122
123 An mpc5200-gpt can be used as a single line GPIO controller. To do so,
124 add the following properties to the gpt node:
125 gpio-controller;
126 #gpio-cells = <2>;
127 When referencing the GPIO line from another node, the first cell must always
128 be zero and the second cell represents the gpio flags and described in the
129 gpio device tree binding.
130
131 An mpc5200-gpt can be used as a single line edge sensitive interrupt
132 controller. To do so, add the following properties to the gpt node:
133 interrupt-controller;
134 #interrupt-cells = <1>;
135 When referencing the IRQ line from another node, the cell represents the
136 sense mode; 1 for edge rising, 2 for edge falling.
137
138 fsl,mpc5200-psc nodes
139 ---------------------
140 The PSCs should include a cell-index which is the index of the PSC in
141 hardware. cell-index is used to determine which shared SoC registers to
142 use when setting up PSC clocking. cell-index number starts at '0'. ie:
143 PSC1 has 'cell-index = <0>'
144 PSC4 has 'cell-index = <3>'
145
146 PSC in i2s mode: The mpc5200 and mpc5200b PSCs are not compatible when in
147 i2s mode. An 'mpc5200b-psc-i2s' node cannot include 'mpc5200-psc-i2s' in the
148 compatible field.
149
150
151 fsl,mpc5200-gpio and fsl,mpc5200-gpio-wkup nodes
152 ------------------------------------------------
153 Each GPIO controller node should have the empty property gpio-controller and
154 #gpio-cells set to 2. First cell is the GPIO number which is interpreted
155 according to the bit numbers in the GPIO control registers. The second cell
156 is for flags which is currently unused.
157
158 fsl,mpc5200-fec nodes
159 ---------------------
160 The FEC node can specify one of the following properties to configure
161 the MII link:
162 - fsl,7-wire-mode - An empty property that specifies the link uses 7-wire
163 mode instead of MII
164 - current-speed - Specifies that the MII should be configured for a fixed
165 speed. This property should contain two cells. The
166 first cell specifies the speed in Mbps and the second
167 should be '0' for half duplex and '1' for full duplex
168 - phy-handle - Contains a phandle to an Ethernet PHY.
169
170 Interrupt controller (fsl,mpc5200-pic) node
171 -------------------------------------------
172 The mpc5200 pic binding splits hardware IRQ numbers into two levels. The
173 split reflects the layout of the PIC hardware itself, which groups
174 interrupts into one of three groups; CRIT, MAIN or PERP. Also, the
175 Bestcomm dma engine has its own set of interrupt sources which are
176 cascaded off of peripheral interrupt 0, which the driver interprets as a
177 fourth group, SDMA.
178
179 The interrupts property for device nodes using the mpc5200 pic consists
180 of three cells; <L1 L2 level>
181
182 L1 := [CRIT=0, MAIN=1, PERP=2, SDMA=3]
183 L2 := interrupt number; directly mapped from the value in the
184 "ICTL PerStat, MainStat, CritStat Encoded Register"
185 level := [LEVEL_HIGH=0, EDGE_RISING=1, EDGE_FALLING=2, LEVEL_LOW=3]
186
187 For external IRQs, use the following interrupt property values (how to
188 specify external interrupts is a frequently asked question):
189 External interrupts:
190 external irq0: interrupts = <0 0 n>;
191 external irq1: interrupts = <1 1 n>;
192 external irq2: interrupts = <1 2 n>;
193 external irq3: interrupts = <1 3 n>;
194 'n' is sense (0: level high, 1: edge rising, 2: edge falling 3: level low)
195
196 fsl,mpc5200-mscan nodes
197 -----------------------
198 See file Documentation/devicetree/bindings/powerpc/fsl/mpc5200.txt
199

3. 한국어 전문 번역

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

문서 소개

1-6

이 문서는 MPC5200 Device Tree Binding을 정의합니다. 저작권은 2006-2009 Secret Lab Technologies Ltd에 있으며 작성자는 Grant Likely `<[email protected]>`입니다.

Compatible 명명 규칙

7-45

MPC5200 on-chip device의 `compatible` 값은 `<chip>-<device>[-<mode>]` 형식을 사용합니다. OS는 `compatible` 값만으로 device driver를 일치시킬 수 있어야 하며, 둘 이상의 driver가 목록과 일치하면 가장 호환성이 높은 driver를 선택해야 합니다.

MPC5200 SoC device 대부분은 MPC5200에서 처음 등장했으므로 MPC5200의 `compatible`에는 `fsl,mpc5200-<device>` 하나만 둡니다. MPC5200B는 MPC5200과 거의 같지만 silicon bug 수정과 일부 기능 향상이 있습니다. 같은 interface나 backward-compatible mode를 정확히 표현하기 위해 MPC5200B device tree는 두 값을 나열해야 합니다.

compatible = "fsl,mpc5200b-<device>","fsl,mpc5200-<device>";

MPC5200B에서 base `mpc5200` 항목만 쓰지 말고 이 두 항목 규칙을 따르는 것을 강하게 권장합니다. Ethernet device의 비교 예제는 다음과 같습니다.

ie. ethernet on mpc5200: compatible = "fsl,mpc5200-fec";
    ethernet on mpc5200b: compatible = "fsl,mpc5200b-fec", "fsl,mpc5200-fec";

PSC 같은 modal device는 설정한 기능을 `compatible` 끝에 붙입니다. I2S mode의 PSC는 `fsl,mpc5200-i2s`가 아니라 `fsl,mpc5200-psc-i2s`를 사용합니다. 이는 같은 기능을 제공하는 non-PSC device와의 이름 충돌을 피하기 위한 것으로, `fsl,mpc5200-spi`는 simple SPI device, `fsl,mpc5200-psc-spi`는 PSC SPI mode를 뜻합니다.

문서 작성 시점의 정확한 chip compatible은 `fsl,mpc5200` 또는 `fsl,mpc5200b`입니다.

SoC node

46-65

SoC node는 on-chip peripheral을 기술합니다. 모든 MPC5200 기반 board에 이 node가 있으므로 공통 SoC device 명명 규칙을 사용합니다.

필수 property설명
ranges내부 memory-mapped register의 memory range입니다. `<0 [baseaddr] 0xc000>`이어야 합니다.
reg`<[baseaddr] 0x100>`이어야 합니다.
compatibleMPC5200은 `fsl,mpc5200-immr`, MPC5200B는 `fsl,mpc5200b-immr`입니다.
system-frequency`fsystem` frequency를 Hz로 지정합니다. XLB, IPB, USB, PCI clock은 fsystem clock에서 파생됩니다.
bus-frequencyIPB bus frequency를 Hz로 지정하며 대부분의 SoC device가 사용하는 clock rate입니다.

SoC child node

66-101

Linux에서 사용할 수 있는 모든 on-chip SoC device는 `soc5200` child node로 나타나야 합니다. 아래 표의 값은 MPC5200 기준이며 MPC5200B device tree는 `fsl,mpc5200b-<device>`, `fsl,mpc5200-<device>` 형식을 사용해야 합니다.

필수 nodecompatible설명
cdm@<addr>fsl,mpc5200-cdmClock Distribution
interrupt-controller@<addr>fsl,mpc5200-picBoot에 필요한 interrupt controller
bestcomm@<addr>fsl,mpc5200-bestcommBestcomm DMA controller

다음 child node는 권장 항목이며 board에 필요한 device만 채웁니다.

권장 nodecompatible설명
timer@<addr>fsl,mpc5200-gptGeneral-purpose timer
gpio@<addr>fsl,mpc5200-gpioSimple GPIO controller
gpio@<addr>fsl,mpc5200-gpio-wkupWakeup GPIO controller
rtc@<addr>fsl,mpc5200-rtcReal-time clock
mscan@<addr>fsl,mpc5200-mscanCAN bus controller
pci@<addr>fsl,mpc5200-pciPCI bridge
serial@<addr>fsl,mpc5200-psc-uartPSC serial mode
i2s@<addr>fsl,mpc5200-psc-i2sPSC I2S mode
ac97@<addr>fsl,mpc5200-psc-ac97PSC AC97 mode
spi@<addr>fsl,mpc5200-psc-spiPSC SPI mode
irda@<addr>fsl,mpc5200-psc-irdaPSC IrDA mode
spi@<addr>fsl,mpc5200-spiMPC5200 SPI device
ethernet@<addr>fsl,mpc5200-fecEthernet device
ata@<addr>fsl,mpc5200-ataIDE ATA interface
i2c@<addr>fsl,mpc5200-i2cI2C controller
usb@<addr>fsl,mpc5200-ohci,ohci-beUSB controller
xlb@<addr>fsl,mpc5200-xlbXLB arbitrator

GPT watchdog

102-121

MPC5200과 MPC5200B에서 GPT0은 watchdog timer 기능을 가집니다. Board가 내부 watchdog을 지원하면 GPT0 node에 빈 `fsl,has-wdt` property를 넣습니다. 이 property 자체는 watchdog을 활성화하지 않습니다.

Timer API를 사용하면 GPT로, watchdog device를 사용하면 watchdog으로 동작합니다. Watchdog mode가 GPT mode보다 우선하므로 watchdog을 활성화한 뒤 이 timer에 GPT API를 호출하면 `-EBUSY`로 실패합니다.

다음 property를 추가하면 GPT0을 사용 중인 watchdog으로 표시합니다.

fsl,wdt-on-boot = <n>;

n이 0보다 크면 timeout n초로 watchdog을 시작합니다. n이 0이면 기존 watchdog 설정을 건드리지 않습니다. 이를 통해 GPT0을 watchdog으로 예약하고 나중에 설정하거나, boot process를 감독하는 boot loader가 배정한 설정을 유지할 수 있습니다.

Watchdog은 `CONFIG_WATCHDOG_NOWAYOUT` option을 따릅니다.

GPT GPIO와 interrupt controller

122-137

MPC5200 GPT는 single-line GPIO controller로 사용할 수 있습니다. GPT node에 다음 property를 추가합니다.

gpio-controller;
#gpio-cells = <2>;

다른 node에서 이 GPIO line을 참조할 때 첫 cell은 항상 0이고 두 번째 cell은 GPIO device-tree binding이 정의한 GPIO flag입니다.

MPC5200 GPT는 single-line edge-sensitive interrupt controller로도 사용할 수 있습니다. GPT node에 다음 property를 추가합니다.

interrupt-controller;
#interrupt-cells = <1>;

다른 node에서 IRQ line을 참조할 때 cell은 sense mode를 뜻합니다. 1은 rising edge, 2는 falling edge입니다.

PSC node

138-150

PSC node는 hardware 안의 PSC index를 나타내는 `cell-index`를 포함해야 합니다. PSC clock 설정에서 사용할 shared SoC register를 선택하는 데 이 값이 쓰이며 번호는 0부터 시작합니다.

PSC1 has 'cell-index = <0>'
PSC4 has 'cell-index = <3>'

I2S mode에서는 MPC5200 PSC와 MPC5200B PSC가 호환되지 않습니다. 따라서 `mpc5200b-psc-i2s` node의 compatible field에 `mpc5200-psc-i2s`를 함께 넣을 수 없습니다.

GPIO controller node

151-157

`fsl,mpc5200-gpio`와 `fsl,mpc5200-gpio-wkup` node에는 빈 `gpio-controller` property와 값 2인 `#gpio-cells`를 넣어야 합니다. 첫 cell은 GPIO control register의 bit 번호에 따라 해석하는 GPIO 번호이고, 두 번째 cell은 현재 사용하지 않는 flag입니다.

FEC node

158-169

FEC node는 MII link를 설정하기 위해 다음 property 중 하나를 지정할 수 있습니다.

  • `fsl,7-wire-mode`: MII 대신 7-wire mode를 사용함을 나타내는 빈 property입니다.
  • `current-speed`: MII를 fixed speed로 설정합니다. 첫 cell은 Mbps 단위 speed이고 두 번째 cell은 half duplex이면 0, full duplex이면 1입니다.
  • `phy-handle`: Ethernet PHY를 가리키는 phandle입니다.

MPIC interrupt controller

170-195

`fsl,mpc5200-pic` binding은 hardware IRQ 번호를 두 level로 나눕니다. PIC hardware가 interrupt를 CRIT, MAIN, PERP 세 group으로 묶는 구조를 반영한 것입니다. Bestcomm DMA engine의 자체 interrupt source는 peripheral interrupt 0에 cascade되며 driver는 이를 네 번째 group SDMA로 해석합니다.

MPC5200 PIC를 사용하는 device node의 `interrupts` property는 `<L1 L2 level>` 세 cell로 구성됩니다.

Cell값과 의미
L1CRIT=0, MAIN=1, PERP=2, SDMA=3
L2`ICTL PerStat, MainStat, CritStat Encoded Register` 값에서 직접 mapping한 interrupt 번호
levelLEVEL_HIGH=0, EDGE_RISING=1, EDGE_FALLING=2, LEVEL_LOW=3

외부 IRQ는 다음 `interrupts` 값을 사용합니다. n은 sense이며 0은 level high, 1은 rising edge, 2는 falling edge, 3은 level low입니다.

external irq0:        interrupts = <0 0 n>;
external irq1:        interrupts = <1 1 n>;
external irq2:        interrupts = <1 2 n>;
external irq3:        interrupts = <1 3 n>;

MSCAN node

196-198

`fsl,mpc5200-mscan` node에 대해서는 원문이 `Documentation/devicetree/bindings/powerpc/fsl/mpc5200.txt` 파일을 참조하라고 안내합니다.