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