1*c66ec88fSEmmanuel VadotDevice tree bindings for MVEBU Device Bus controllers 2*c66ec88fSEmmanuel Vadot 3*c66ec88fSEmmanuel VadotThe Device Bus controller available in some Marvell's SoC allows to control 4*c66ec88fSEmmanuel Vadotdifferent types of standard memory and I/O devices such as NOR, NAND, and FPGA. 5*c66ec88fSEmmanuel VadotThe actual devices are instantiated from the child nodes of a Device Bus node. 6*c66ec88fSEmmanuel Vadot 7*c66ec88fSEmmanuel VadotRequired properties: 8*c66ec88fSEmmanuel Vadot 9*c66ec88fSEmmanuel Vadot - compatible: Armada 370/XP SoC are supported using the 10*c66ec88fSEmmanuel Vadot "marvell,mvebu-devbus" compatible string. 11*c66ec88fSEmmanuel Vadot 12*c66ec88fSEmmanuel Vadot Orion5x SoC are supported using the 13*c66ec88fSEmmanuel Vadot "marvell,orion-devbus" compatible string. 14*c66ec88fSEmmanuel Vadot 15*c66ec88fSEmmanuel Vadot - reg: A resource specifier for the register space. 16*c66ec88fSEmmanuel Vadot This is the base address of a chip select within 17*c66ec88fSEmmanuel Vadot the controller's register space. 18*c66ec88fSEmmanuel Vadot (see the example below) 19*c66ec88fSEmmanuel Vadot 20*c66ec88fSEmmanuel Vadot - #address-cells: Must be set to 1 21*c66ec88fSEmmanuel Vadot - #size-cells: Must be set to 1 22*c66ec88fSEmmanuel Vadot - ranges: Must be set up to reflect the memory layout with four 23*c66ec88fSEmmanuel Vadot integer values for each chip-select line in use: 24*c66ec88fSEmmanuel Vadot 0 <physical address of mapping> <size> 25*c66ec88fSEmmanuel Vadot 26*c66ec88fSEmmanuel VadotOptional properties: 27*c66ec88fSEmmanuel Vadot 28*c66ec88fSEmmanuel Vadot - devbus,keep-config This property can optionally be used to keep 29*c66ec88fSEmmanuel Vadot using the timing parameters set by the 30*c66ec88fSEmmanuel Vadot bootloader. It makes all the timing properties 31*c66ec88fSEmmanuel Vadot described below unused. 32*c66ec88fSEmmanuel Vadot 33*c66ec88fSEmmanuel VadotTiming properties for child nodes: 34*c66ec88fSEmmanuel Vadot 35*c66ec88fSEmmanuel VadotRead parameters: 36*c66ec88fSEmmanuel Vadot 37*c66ec88fSEmmanuel Vadot - devbus,turn-off-ps: Defines the time during which the controller does not 38*c66ec88fSEmmanuel Vadot drive the AD bus after the completion of a device read. 39*c66ec88fSEmmanuel Vadot This prevents contentions on the Device Bus after a read 40*c66ec88fSEmmanuel Vadot cycle from a slow device. 41*c66ec88fSEmmanuel Vadot Mandatory, except if devbus,keep-config is used. 42*c66ec88fSEmmanuel Vadot 43*c66ec88fSEmmanuel Vadot - devbus,bus-width: Defines the bus width, in bits (e.g. <16>). 44*c66ec88fSEmmanuel Vadot Mandatory, except if devbus,keep-config is used. 45*c66ec88fSEmmanuel Vadot 46*c66ec88fSEmmanuel Vadot - devbus,badr-skew-ps: Defines the time delay from from A[2:0] toggle, 47*c66ec88fSEmmanuel Vadot to read data sample. This parameter is useful for 48*c66ec88fSEmmanuel Vadot synchronous pipelined devices, where the address 49*c66ec88fSEmmanuel Vadot precedes the read data by one or two cycles. 50*c66ec88fSEmmanuel Vadot Mandatory, except if devbus,keep-config is used. 51*c66ec88fSEmmanuel Vadot 52*c66ec88fSEmmanuel Vadot - devbus,acc-first-ps: Defines the time delay from the negation of 53*c66ec88fSEmmanuel Vadot ALE[0] to the cycle that the first read data is sampled 54*c66ec88fSEmmanuel Vadot by the controller. 55*c66ec88fSEmmanuel Vadot Mandatory, except if devbus,keep-config is used. 56*c66ec88fSEmmanuel Vadot 57*c66ec88fSEmmanuel Vadot - devbus,acc-next-ps: Defines the time delay between the cycle that 58*c66ec88fSEmmanuel Vadot samples data N and the cycle that samples data N+1 59*c66ec88fSEmmanuel Vadot (in burst accesses). 60*c66ec88fSEmmanuel Vadot Mandatory, except if devbus,keep-config is used. 61*c66ec88fSEmmanuel Vadot 62*c66ec88fSEmmanuel Vadot - devbus,rd-setup-ps: Defines the time delay between DEV_CSn assertion to 63*c66ec88fSEmmanuel Vadot DEV_OEn assertion. If set to 0 (default), 64*c66ec88fSEmmanuel Vadot DEV_OEn and DEV_CSn are asserted at the same cycle. 65*c66ec88fSEmmanuel Vadot This parameter has no affect on <acc-first-ps> parameter 66*c66ec88fSEmmanuel Vadot (no affect on first data sample). Set <rd-setup-ps> 67*c66ec88fSEmmanuel Vadot to a value smaller than <acc-first-ps>. 68*c66ec88fSEmmanuel Vadot Mandatory for "marvell,mvebu-devbus" compatible string, 69*c66ec88fSEmmanuel Vadot except if devbus,keep-config is used. 70*c66ec88fSEmmanuel Vadot 71*c66ec88fSEmmanuel Vadot - devbus,rd-hold-ps: Defines the time between the last data sample to the 72*c66ec88fSEmmanuel Vadot de-assertion of DEV_CSn. If set to 0 (default), 73*c66ec88fSEmmanuel Vadot DEV_OEn and DEV_CSn are de-asserted at the same cycle 74*c66ec88fSEmmanuel Vadot (the cycle of the last data sample). 75*c66ec88fSEmmanuel Vadot This parameter has no affect on DEV_OEn de-assertion. 76*c66ec88fSEmmanuel Vadot DEV_OEn is always de-asserted the next cycle after 77*c66ec88fSEmmanuel Vadot last data sampled. Also this parameter has no 78*c66ec88fSEmmanuel Vadot affect on <turn-off-ps> parameter. 79*c66ec88fSEmmanuel Vadot Set <rd-hold-ps> to a value smaller than <turn-off-ps>. 80*c66ec88fSEmmanuel Vadot Mandatory for "marvell,mvebu-devbus" compatible string, 81*c66ec88fSEmmanuel Vadot except if devbus,keep-config is used. 82*c66ec88fSEmmanuel Vadot 83*c66ec88fSEmmanuel VadotWrite parameters: 84*c66ec88fSEmmanuel Vadot 85*c66ec88fSEmmanuel Vadot - devbus,ale-wr-ps: Defines the time delay from the ALE[0] negation cycle 86*c66ec88fSEmmanuel Vadot to the DEV_WEn assertion. 87*c66ec88fSEmmanuel Vadot Mandatory. 88*c66ec88fSEmmanuel Vadot 89*c66ec88fSEmmanuel Vadot - devbus,wr-low-ps: Defines the time during which DEV_WEn is active. 90*c66ec88fSEmmanuel Vadot A[2:0] and Data are kept valid as long as DEV_WEn 91*c66ec88fSEmmanuel Vadot is active. This parameter defines the setup time of 92*c66ec88fSEmmanuel Vadot address and data to DEV_WEn rise. 93*c66ec88fSEmmanuel Vadot Mandatory. 94*c66ec88fSEmmanuel Vadot 95*c66ec88fSEmmanuel Vadot - devbus,wr-high-ps: Defines the time during which DEV_WEn is kept 96*c66ec88fSEmmanuel Vadot inactive (high) between data beats of a burst write. 97*c66ec88fSEmmanuel Vadot DEV_A[2:0] and Data are kept valid (do not toggle) for 98*c66ec88fSEmmanuel Vadot <wr-high-ps> - <tick> ps. 99*c66ec88fSEmmanuel Vadot This parameter defines the hold time of address and 100*c66ec88fSEmmanuel Vadot data after DEV_WEn rise. 101*c66ec88fSEmmanuel Vadot Mandatory. 102*c66ec88fSEmmanuel Vadot 103*c66ec88fSEmmanuel Vadot - devbus,sync-enable: Synchronous device enable. 104*c66ec88fSEmmanuel Vadot 1: True 105*c66ec88fSEmmanuel Vadot 0: False 106*c66ec88fSEmmanuel Vadot Mandatory for "marvell,mvebu-devbus" compatible string, 107*c66ec88fSEmmanuel Vadot except if devbus,keep-config is used. 108*c66ec88fSEmmanuel Vadot 109*c66ec88fSEmmanuel VadotAn example for an Armada XP GP board, with a 16 MiB NOR device as child 110*c66ec88fSEmmanuel Vadotis showed below. Note that the Device Bus driver is in charge of allocating 111*c66ec88fSEmmanuel Vadotthe mbus address decoding window for each of its child devices. 112*c66ec88fSEmmanuel VadotThe window is created using the chip select specified in the child 113*c66ec88fSEmmanuel Vadotdevice node together with the base address and size specified in the ranges 114*c66ec88fSEmmanuel Vadotproperty. For instance, in the example below the allocated decoding window 115*c66ec88fSEmmanuel Vadotwill start at base address 0xf0000000, with a size 0x1000000 (16 MiB) 116*c66ec88fSEmmanuel Vadotfor chip select 0 (a.k.a DEV_BOOTCS). 117*c66ec88fSEmmanuel Vadot 118*c66ec88fSEmmanuel VadotThis address window handling is done in this mvebu-devbus only as a temporary 119*c66ec88fSEmmanuel Vadotsolution. It will be removed when the support for mbus device tree binding is 120*c66ec88fSEmmanuel Vadotadded. 121*c66ec88fSEmmanuel Vadot 122*c66ec88fSEmmanuel VadotThe reg property implicitly specifies the chip select as this: 123*c66ec88fSEmmanuel Vadot 124*c66ec88fSEmmanuel Vadot 0x10400: DEV_BOOTCS 125*c66ec88fSEmmanuel Vadot 0x10408: DEV_CS0 126*c66ec88fSEmmanuel Vadot 0x10410: DEV_CS1 127*c66ec88fSEmmanuel Vadot 0x10418: DEV_CS2 128*c66ec88fSEmmanuel Vadot 0x10420: DEV_CS3 129*c66ec88fSEmmanuel Vadot 130*c66ec88fSEmmanuel VadotExample: 131*c66ec88fSEmmanuel Vadot 132*c66ec88fSEmmanuel Vadot devbus-bootcs@d0010400 { 133*c66ec88fSEmmanuel Vadot ranges = <0 0xf0000000 0x1000000>; /* @addr 0xf0000000, size 0x1000000 */ 134*c66ec88fSEmmanuel Vadot #address-cells = <1>; 135*c66ec88fSEmmanuel Vadot #size-cells = <1>; 136*c66ec88fSEmmanuel Vadot 137*c66ec88fSEmmanuel Vadot /* Device Bus parameters are required */ 138*c66ec88fSEmmanuel Vadot 139*c66ec88fSEmmanuel Vadot /* Read parameters */ 140*c66ec88fSEmmanuel Vadot devbus,bus-width = <8>; 141*c66ec88fSEmmanuel Vadot devbus,turn-off-ps = <60000>; 142*c66ec88fSEmmanuel Vadot devbus,badr-skew-ps = <0>; 143*c66ec88fSEmmanuel Vadot devbus,acc-first-ps = <124000>; 144*c66ec88fSEmmanuel Vadot devbus,acc-next-ps = <248000>; 145*c66ec88fSEmmanuel Vadot devbus,rd-setup-ps = <0>; 146*c66ec88fSEmmanuel Vadot devbus,rd-hold-ps = <0>; 147*c66ec88fSEmmanuel Vadot 148*c66ec88fSEmmanuel Vadot /* Write parameters */ 149*c66ec88fSEmmanuel Vadot devbus,sync-enable = <0>; 150*c66ec88fSEmmanuel Vadot devbus,wr-high-ps = <60000>; 151*c66ec88fSEmmanuel Vadot devbus,wr-low-ps = <60000>; 152*c66ec88fSEmmanuel Vadot devbus,ale-wr-ps = <60000>; 153*c66ec88fSEmmanuel Vadot 154*c66ec88fSEmmanuel Vadot flash@0 { 155*c66ec88fSEmmanuel Vadot compatible = "cfi-flash"; 156*c66ec88fSEmmanuel Vadot 157*c66ec88fSEmmanuel Vadot /* 16 MiB */ 158*c66ec88fSEmmanuel Vadot reg = <0 0x1000000>; 159*c66ec88fSEmmanuel Vadot bank-width = <2>; 160*c66ec88fSEmmanuel Vadot #address-cells = <1>; 161*c66ec88fSEmmanuel Vadot #size-cells = <1>; 162*c66ec88fSEmmanuel Vadot 163*c66ec88fSEmmanuel Vadot /* 164*c66ec88fSEmmanuel Vadot * We split the 16 MiB in two partitions, 165*c66ec88fSEmmanuel Vadot * just as an example. 166*c66ec88fSEmmanuel Vadot */ 167*c66ec88fSEmmanuel Vadot partition@0 { 168*c66ec88fSEmmanuel Vadot label = "First"; 169*c66ec88fSEmmanuel Vadot reg = <0 0x800000>; 170*c66ec88fSEmmanuel Vadot }; 171*c66ec88fSEmmanuel Vadot 172*c66ec88fSEmmanuel Vadot partition@800000 { 173*c66ec88fSEmmanuel Vadot label = "Second"; 174*c66ec88fSEmmanuel Vadot reg = <0x800000 0x800000>; 175*c66ec88fSEmmanuel Vadot }; 176*c66ec88fSEmmanuel Vadot }; 177*c66ec88fSEmmanuel Vadot }; 178