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