13edad321SEzequiel GarciaDevice tree bindings for MVEBU Device Bus controllers
23edad321SEzequiel Garcia
33edad321SEzequiel GarciaThe Device Bus controller available in some Marvell's SoC allows to control
43edad321SEzequiel Garciadifferent types of standard memory and I/O devices such as NOR, NAND, and FPGA.
53edad321SEzequiel GarciaThe actual devices are instantiated from the child nodes of a Device Bus node.
63edad321SEzequiel Garcia
73edad321SEzequiel GarciaRequired properties:
83edad321SEzequiel Garcia
9c4ec7430SThomas Petazzoni - compatible:          Armada 370/XP SoC are supported using the
10c4ec7430SThomas Petazzoni                        "marvell,mvebu-devbus" compatible string.
113edad321SEzequiel Garcia
12c4ec7430SThomas Petazzoni                        Orion5x SoC are supported using the
13c4ec7430SThomas Petazzoni                        "marvell,orion-devbus" compatible string.
143edad321SEzequiel Garcia
153edad321SEzequiel Garcia - reg:                 A resource specifier for the register space.
163edad321SEzequiel Garcia                        This is the base address of a chip select within
173edad321SEzequiel Garcia			the controller's register space.
183edad321SEzequiel Garcia                        (see the example below)
193edad321SEzequiel Garcia
203edad321SEzequiel Garcia - #address-cells:      Must be set to 1
213edad321SEzequiel Garcia - #size-cells:         Must be set to 1
223edad321SEzequiel Garcia - ranges:              Must be set up to reflect the memory layout with four
233edad321SEzequiel Garcia                        integer values for each chip-select line in use:
243edad321SEzequiel Garcia                        0 <physical address of mapping> <size>
253edad321SEzequiel Garcia
260456d330SThomas PetazzoniOptional properties:
270456d330SThomas Petazzoni
280456d330SThomas Petazzoni - devbus,keep-config   This property can optionally be used to keep
290456d330SThomas Petazzoni                        using the timing parameters set by the
300456d330SThomas Petazzoni                        bootloader. It makes all the timing properties
310456d330SThomas Petazzoni                        described below unused.
320456d330SThomas Petazzoni
33c4ec7430SThomas PetazzoniTiming properties for child nodes:
343edad321SEzequiel Garcia
353edad321SEzequiel GarciaRead parameters:
363edad321SEzequiel Garcia
373edad321SEzequiel Garcia - devbus,turn-off-ps:  Defines the time during which the controller does not
383edad321SEzequiel Garcia                        drive the AD bus after the completion of a device read.
393edad321SEzequiel Garcia                        This prevents contentions on the Device Bus after a read
403edad321SEzequiel Garcia                        cycle from a slow device.
410456d330SThomas Petazzoni                        Mandatory, except if devbus,keep-config is used.
423edad321SEzequiel Garcia
43c4ec7430SThomas Petazzoni - devbus,bus-width:    Defines the bus width, in bits (e.g. <16>).
440456d330SThomas Petazzoni                        Mandatory, except if devbus,keep-config is used.
453edad321SEzequiel Garcia
463edad321SEzequiel Garcia - devbus,badr-skew-ps: Defines the time delay from from A[2:0] toggle,
473edad321SEzequiel Garcia                        to read data sample. This parameter is useful for
483edad321SEzequiel Garcia                        synchronous pipelined devices, where the address
493edad321SEzequiel Garcia                        precedes the read data by one or two cycles.
500456d330SThomas Petazzoni                        Mandatory, except if devbus,keep-config is used.
513edad321SEzequiel Garcia
523edad321SEzequiel Garcia - devbus,acc-first-ps: Defines the time delay from the negation of
533edad321SEzequiel Garcia                        ALE[0] to the cycle that the first read data is sampled
543edad321SEzequiel Garcia                        by the controller.
550456d330SThomas Petazzoni                        Mandatory, except if devbus,keep-config is used.
563edad321SEzequiel Garcia
573edad321SEzequiel Garcia - devbus,acc-next-ps:  Defines the time delay between the cycle that
583edad321SEzequiel Garcia                        samples data N and the cycle that samples data N+1
593edad321SEzequiel Garcia                        (in burst accesses).
600456d330SThomas Petazzoni                        Mandatory, except if devbus,keep-config is used.
613edad321SEzequiel Garcia
623edad321SEzequiel Garcia - devbus,rd-setup-ps:  Defines the time delay between DEV_CSn assertion to
633edad321SEzequiel Garcia			DEV_OEn assertion. If set to 0 (default),
643edad321SEzequiel Garcia                        DEV_OEn and DEV_CSn are asserted at the same cycle.
653edad321SEzequiel Garcia                        This parameter has no affect on <acc-first-ps> parameter
663edad321SEzequiel Garcia                        (no affect on first data sample). Set <rd-setup-ps>
673edad321SEzequiel Garcia                        to a value smaller than <acc-first-ps>.
680456d330SThomas Petazzoni                        Mandatory for "marvell,mvebu-devbus" compatible string,
690456d330SThomas Petazzoni                        except if devbus,keep-config is used.
703edad321SEzequiel Garcia
713edad321SEzequiel Garcia - devbus,rd-hold-ps:   Defines the time between the last data sample to the
723edad321SEzequiel Garcia			de-assertion of DEV_CSn. If set to 0 (default),
733edad321SEzequiel Garcia			DEV_OEn and DEV_CSn are de-asserted at the same cycle
743edad321SEzequiel Garcia			(the cycle of the last data sample).
753edad321SEzequiel Garcia                        This parameter has no affect on DEV_OEn de-assertion.
763edad321SEzequiel Garcia                        DEV_OEn is always de-asserted the next cycle after
773edad321SEzequiel Garcia                        last data sampled. Also this parameter has no
783edad321SEzequiel Garcia                        affect on <turn-off-ps> parameter.
793edad321SEzequiel Garcia                        Set <rd-hold-ps> to a value smaller than <turn-off-ps>.
800456d330SThomas Petazzoni                        Mandatory for "marvell,mvebu-devbus" compatible string,
810456d330SThomas Petazzoni                        except if devbus,keep-config is used.
823edad321SEzequiel Garcia
833edad321SEzequiel GarciaWrite parameters:
843edad321SEzequiel Garcia
853edad321SEzequiel Garcia - devbus,ale-wr-ps:    Defines the time delay from the ALE[0] negation cycle
863edad321SEzequiel Garcia			to the DEV_WEn assertion.
87c4ec7430SThomas Petazzoni                        Mandatory.
883edad321SEzequiel Garcia
893edad321SEzequiel Garcia - devbus,wr-low-ps:    Defines the time during which DEV_WEn is active.
903edad321SEzequiel Garcia                        A[2:0] and Data are kept valid as long as DEV_WEn
913edad321SEzequiel Garcia                        is active. This parameter defines the setup time of
923edad321SEzequiel Garcia                        address and data to DEV_WEn rise.
93c4ec7430SThomas Petazzoni                        Mandatory.
943edad321SEzequiel Garcia
953edad321SEzequiel Garcia - devbus,wr-high-ps:   Defines the time during which DEV_WEn is kept
963edad321SEzequiel Garcia                        inactive (high) between data beats of a burst write.
973edad321SEzequiel Garcia                        DEV_A[2:0] and Data are kept valid (do not toggle) for
983edad321SEzequiel Garcia                        <wr-high-ps> - <tick> ps.
993edad321SEzequiel Garcia			This parameter defines the hold time of address and
1003edad321SEzequiel Garcia			data after DEV_WEn rise.
101c4ec7430SThomas Petazzoni                        Mandatory.
1023edad321SEzequiel Garcia
1033edad321SEzequiel Garcia - devbus,sync-enable: Synchronous device enable.
1043edad321SEzequiel Garcia                       1: True
1053edad321SEzequiel Garcia                       0: False
1060456d330SThomas Petazzoni                       Mandatory for "marvell,mvebu-devbus" compatible string,
1070456d330SThomas Petazzoni                       except if devbus,keep-config is used.
1083edad321SEzequiel Garcia
1093edad321SEzequiel GarciaAn example for an Armada XP GP board, with a 16 MiB NOR device as child
1103edad321SEzequiel Garciais showed below. Note that the Device Bus driver is in charge of allocating
1113edad321SEzequiel Garciathe mbus address decoding window for each of its child devices.
1123edad321SEzequiel GarciaThe window is created using the chip select specified in the child
1133edad321SEzequiel Garciadevice node together with the base address and size specified in the ranges
1143edad321SEzequiel Garciaproperty. For instance, in the example below the allocated decoding window
1153edad321SEzequiel Garciawill start at base address 0xf0000000, with a size 0x1000000 (16 MiB)
1163edad321SEzequiel Garciafor chip select 0 (a.k.a DEV_BOOTCS).
1173edad321SEzequiel Garcia
1183edad321SEzequiel GarciaThis address window handling is done in this mvebu-devbus only as a temporary
1193edad321SEzequiel Garciasolution. It will be removed when the support for mbus device tree binding is
1203edad321SEzequiel Garciaadded.
1213edad321SEzequiel Garcia
1223edad321SEzequiel GarciaThe reg property implicitly specifies the chip select as this:
1233edad321SEzequiel Garcia
1243edad321SEzequiel Garcia  0x10400: DEV_BOOTCS
1253edad321SEzequiel Garcia  0x10408: DEV_CS0
1263edad321SEzequiel Garcia  0x10410: DEV_CS1
1273edad321SEzequiel Garcia  0x10418: DEV_CS2
1283edad321SEzequiel Garcia  0x10420: DEV_CS3
1293edad321SEzequiel Garcia
1303edad321SEzequiel GarciaExample:
1313edad321SEzequiel Garcia
1323edad321SEzequiel Garcia	devbus-bootcs@d0010400 {
1333edad321SEzequiel Garcia		ranges = <0 0xf0000000 0x1000000>; /* @addr 0xf0000000, size 0x1000000 */
1343edad321SEzequiel Garcia		#address-cells = <1>;
1353edad321SEzequiel Garcia		#size-cells = <1>;
1363edad321SEzequiel Garcia
1373edad321SEzequiel Garcia		/* Device Bus parameters are required */
1383edad321SEzequiel Garcia
1393edad321SEzequiel Garcia		/* Read parameters */
1403edad321SEzequiel Garcia		devbus,bus-width    = <8>;
1413edad321SEzequiel Garcia		devbus,turn-off-ps  = <60000>;
1423edad321SEzequiel Garcia		devbus,badr-skew-ps = <0>;
1433edad321SEzequiel Garcia		devbus,acc-first-ps = <124000>;
1443edad321SEzequiel Garcia		devbus,acc-next-ps  = <248000>;
1453edad321SEzequiel Garcia		devbus,rd-setup-ps  = <0>;
1463edad321SEzequiel Garcia		devbus,rd-hold-ps   = <0>;
1473edad321SEzequiel Garcia
1483edad321SEzequiel Garcia		/* Write parameters */
1493edad321SEzequiel Garcia		devbus,sync-enable = <0>;
1503edad321SEzequiel Garcia		devbus,wr-high-ps  = <60000>;
1513edad321SEzequiel Garcia		devbus,wr-low-ps   = <60000>;
1523edad321SEzequiel Garcia		devbus,ale-wr-ps   = <60000>;
1533edad321SEzequiel Garcia
1543edad321SEzequiel Garcia		flash@0 {
1553edad321SEzequiel Garcia			compatible = "cfi-flash";
1563edad321SEzequiel Garcia
1573edad321SEzequiel Garcia			/* 16 MiB */
1583edad321SEzequiel Garcia			reg = <0 0x1000000>;
1593edad321SEzequiel Garcia			bank-width = <2>;
1603edad321SEzequiel Garcia			#address-cells = <1>;
1613edad321SEzequiel Garcia			#size-cells = <1>;
1623edad321SEzequiel Garcia
1633edad321SEzequiel Garcia			/*
1643edad321SEzequiel Garcia			 * We split the 16 MiB in two partitions,
1653edad321SEzequiel Garcia			 * just as an example.
1663edad321SEzequiel Garcia			 */
1673edad321SEzequiel Garcia			partition@0 {
1683edad321SEzequiel Garcia				label = "First";
1693edad321SEzequiel Garcia				reg = <0 0x800000>;
1703edad321SEzequiel Garcia			};
1713edad321SEzequiel Garcia
1723edad321SEzequiel Garcia			partition@800000 {
1733edad321SEzequiel Garcia				label = "Second";
1743edad321SEzequiel Garcia				reg = <0x800000 0x800000>;
1753edad321SEzequiel Garcia			};
1763edad321SEzequiel Garcia		};
1773edad321SEzequiel Garcia	};
178