18c2ecf20Sopenharmony_ciDevice tree bindings for MVEBU Device Bus controllers
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ciThe Device Bus controller available in some Marvell's SoC allows to control
48c2ecf20Sopenharmony_cidifferent types of standard memory and I/O devices such as NOR, NAND, and FPGA.
58c2ecf20Sopenharmony_ciThe actual devices are instantiated from the child nodes of a Device Bus node.
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ciRequired properties:
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci - compatible:          Armada 370/XP SoC are supported using the
108c2ecf20Sopenharmony_ci                        "marvell,mvebu-devbus" compatible string.
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci                        Orion5x SoC are supported using the
138c2ecf20Sopenharmony_ci                        "marvell,orion-devbus" compatible string.
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci - reg:                 A resource specifier for the register space.
168c2ecf20Sopenharmony_ci                        This is the base address of a chip select within
178c2ecf20Sopenharmony_ci			the controller's register space.
188c2ecf20Sopenharmony_ci                        (see the example below)
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci - #address-cells:      Must be set to 1
218c2ecf20Sopenharmony_ci - #size-cells:         Must be set to 1
228c2ecf20Sopenharmony_ci - ranges:              Must be set up to reflect the memory layout with four
238c2ecf20Sopenharmony_ci                        integer values for each chip-select line in use:
248c2ecf20Sopenharmony_ci                        0 <physical address of mapping> <size>
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ciOptional properties:
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci - devbus,keep-config   This property can optionally be used to keep
298c2ecf20Sopenharmony_ci                        using the timing parameters set by the
308c2ecf20Sopenharmony_ci                        bootloader. It makes all the timing properties
318c2ecf20Sopenharmony_ci                        described below unused.
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ciTiming properties for child nodes:
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ciRead parameters:
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci - devbus,turn-off-ps:  Defines the time during which the controller does not
388c2ecf20Sopenharmony_ci                        drive the AD bus after the completion of a device read.
398c2ecf20Sopenharmony_ci                        This prevents contentions on the Device Bus after a read
408c2ecf20Sopenharmony_ci                        cycle from a slow device.
418c2ecf20Sopenharmony_ci                        Mandatory, except if devbus,keep-config is used.
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci - devbus,bus-width:    Defines the bus width, in bits (e.g. <16>).
448c2ecf20Sopenharmony_ci                        Mandatory, except if devbus,keep-config is used.
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci - devbus,badr-skew-ps: Defines the time delay from from A[2:0] toggle,
478c2ecf20Sopenharmony_ci                        to read data sample. This parameter is useful for
488c2ecf20Sopenharmony_ci                        synchronous pipelined devices, where the address
498c2ecf20Sopenharmony_ci                        precedes the read data by one or two cycles.
508c2ecf20Sopenharmony_ci                        Mandatory, except if devbus,keep-config is used.
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci - devbus,acc-first-ps: Defines the time delay from the negation of
538c2ecf20Sopenharmony_ci                        ALE[0] to the cycle that the first read data is sampled
548c2ecf20Sopenharmony_ci                        by the controller.
558c2ecf20Sopenharmony_ci                        Mandatory, except if devbus,keep-config is used.
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_ci - devbus,acc-next-ps:  Defines the time delay between the cycle that
588c2ecf20Sopenharmony_ci                        samples data N and the cycle that samples data N+1
598c2ecf20Sopenharmony_ci                        (in burst accesses).
608c2ecf20Sopenharmony_ci                        Mandatory, except if devbus,keep-config is used.
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ci - devbus,rd-setup-ps:  Defines the time delay between DEV_CSn assertion to
638c2ecf20Sopenharmony_ci			DEV_OEn assertion. If set to 0 (default),
648c2ecf20Sopenharmony_ci                        DEV_OEn and DEV_CSn are asserted at the same cycle.
658c2ecf20Sopenharmony_ci                        This parameter has no affect on <acc-first-ps> parameter
668c2ecf20Sopenharmony_ci                        (no affect on first data sample). Set <rd-setup-ps>
678c2ecf20Sopenharmony_ci                        to a value smaller than <acc-first-ps>.
688c2ecf20Sopenharmony_ci                        Mandatory for "marvell,mvebu-devbus" compatible string,
698c2ecf20Sopenharmony_ci                        except if devbus,keep-config is used.
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ci - devbus,rd-hold-ps:   Defines the time between the last data sample to the
728c2ecf20Sopenharmony_ci			de-assertion of DEV_CSn. If set to 0 (default),
738c2ecf20Sopenharmony_ci			DEV_OEn and DEV_CSn are de-asserted at the same cycle
748c2ecf20Sopenharmony_ci			(the cycle of the last data sample).
758c2ecf20Sopenharmony_ci                        This parameter has no affect on DEV_OEn de-assertion.
768c2ecf20Sopenharmony_ci                        DEV_OEn is always de-asserted the next cycle after
778c2ecf20Sopenharmony_ci                        last data sampled. Also this parameter has no
788c2ecf20Sopenharmony_ci                        affect on <turn-off-ps> parameter.
798c2ecf20Sopenharmony_ci                        Set <rd-hold-ps> to a value smaller than <turn-off-ps>.
808c2ecf20Sopenharmony_ci                        Mandatory for "marvell,mvebu-devbus" compatible string,
818c2ecf20Sopenharmony_ci                        except if devbus,keep-config is used.
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ciWrite parameters:
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ci - devbus,ale-wr-ps:    Defines the time delay from the ALE[0] negation cycle
868c2ecf20Sopenharmony_ci			to the DEV_WEn assertion.
878c2ecf20Sopenharmony_ci                        Mandatory.
888c2ecf20Sopenharmony_ci
898c2ecf20Sopenharmony_ci - devbus,wr-low-ps:    Defines the time during which DEV_WEn is active.
908c2ecf20Sopenharmony_ci                        A[2:0] and Data are kept valid as long as DEV_WEn
918c2ecf20Sopenharmony_ci                        is active. This parameter defines the setup time of
928c2ecf20Sopenharmony_ci                        address and data to DEV_WEn rise.
938c2ecf20Sopenharmony_ci                        Mandatory.
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_ci - devbus,wr-high-ps:   Defines the time during which DEV_WEn is kept
968c2ecf20Sopenharmony_ci                        inactive (high) between data beats of a burst write.
978c2ecf20Sopenharmony_ci                        DEV_A[2:0] and Data are kept valid (do not toggle) for
988c2ecf20Sopenharmony_ci                        <wr-high-ps> - <tick> ps.
998c2ecf20Sopenharmony_ci			This parameter defines the hold time of address and
1008c2ecf20Sopenharmony_ci			data after DEV_WEn rise.
1018c2ecf20Sopenharmony_ci                        Mandatory.
1028c2ecf20Sopenharmony_ci
1038c2ecf20Sopenharmony_ci - devbus,sync-enable: Synchronous device enable.
1048c2ecf20Sopenharmony_ci                       1: True
1058c2ecf20Sopenharmony_ci                       0: False
1068c2ecf20Sopenharmony_ci                       Mandatory for "marvell,mvebu-devbus" compatible string,
1078c2ecf20Sopenharmony_ci                       except if devbus,keep-config is used.
1088c2ecf20Sopenharmony_ci
1098c2ecf20Sopenharmony_ciAn example for an Armada XP GP board, with a 16 MiB NOR device as child
1108c2ecf20Sopenharmony_ciis showed below. Note that the Device Bus driver is in charge of allocating
1118c2ecf20Sopenharmony_cithe mbus address decoding window for each of its child devices.
1128c2ecf20Sopenharmony_ciThe window is created using the chip select specified in the child
1138c2ecf20Sopenharmony_cidevice node together with the base address and size specified in the ranges
1148c2ecf20Sopenharmony_ciproperty. For instance, in the example below the allocated decoding window
1158c2ecf20Sopenharmony_ciwill start at base address 0xf0000000, with a size 0x1000000 (16 MiB)
1168c2ecf20Sopenharmony_cifor chip select 0 (a.k.a DEV_BOOTCS).
1178c2ecf20Sopenharmony_ci
1188c2ecf20Sopenharmony_ciThis address window handling is done in this mvebu-devbus only as a temporary
1198c2ecf20Sopenharmony_cisolution. It will be removed when the support for mbus device tree binding is
1208c2ecf20Sopenharmony_ciadded.
1218c2ecf20Sopenharmony_ci
1228c2ecf20Sopenharmony_ciThe reg property implicitly specifies the chip select as this:
1238c2ecf20Sopenharmony_ci
1248c2ecf20Sopenharmony_ci  0x10400: DEV_BOOTCS
1258c2ecf20Sopenharmony_ci  0x10408: DEV_CS0
1268c2ecf20Sopenharmony_ci  0x10410: DEV_CS1
1278c2ecf20Sopenharmony_ci  0x10418: DEV_CS2
1288c2ecf20Sopenharmony_ci  0x10420: DEV_CS3
1298c2ecf20Sopenharmony_ci
1308c2ecf20Sopenharmony_ciExample:
1318c2ecf20Sopenharmony_ci
1328c2ecf20Sopenharmony_ci	devbus-bootcs@d0010400 {
1338c2ecf20Sopenharmony_ci		ranges = <0 0xf0000000 0x1000000>; /* @addr 0xf0000000, size 0x1000000 */
1348c2ecf20Sopenharmony_ci		#address-cells = <1>;
1358c2ecf20Sopenharmony_ci		#size-cells = <1>;
1368c2ecf20Sopenharmony_ci
1378c2ecf20Sopenharmony_ci		/* Device Bus parameters are required */
1388c2ecf20Sopenharmony_ci
1398c2ecf20Sopenharmony_ci		/* Read parameters */
1408c2ecf20Sopenharmony_ci		devbus,bus-width    = <8>;
1418c2ecf20Sopenharmony_ci		devbus,turn-off-ps  = <60000>;
1428c2ecf20Sopenharmony_ci		devbus,badr-skew-ps = <0>;
1438c2ecf20Sopenharmony_ci		devbus,acc-first-ps = <124000>;
1448c2ecf20Sopenharmony_ci		devbus,acc-next-ps  = <248000>;
1458c2ecf20Sopenharmony_ci		devbus,rd-setup-ps  = <0>;
1468c2ecf20Sopenharmony_ci		devbus,rd-hold-ps   = <0>;
1478c2ecf20Sopenharmony_ci
1488c2ecf20Sopenharmony_ci		/* Write parameters */
1498c2ecf20Sopenharmony_ci		devbus,sync-enable = <0>;
1508c2ecf20Sopenharmony_ci		devbus,wr-high-ps  = <60000>;
1518c2ecf20Sopenharmony_ci		devbus,wr-low-ps   = <60000>;
1528c2ecf20Sopenharmony_ci		devbus,ale-wr-ps   = <60000>;
1538c2ecf20Sopenharmony_ci
1548c2ecf20Sopenharmony_ci		flash@0 {
1558c2ecf20Sopenharmony_ci			compatible = "cfi-flash";
1568c2ecf20Sopenharmony_ci
1578c2ecf20Sopenharmony_ci			/* 16 MiB */
1588c2ecf20Sopenharmony_ci			reg = <0 0x1000000>;
1598c2ecf20Sopenharmony_ci			bank-width = <2>;
1608c2ecf20Sopenharmony_ci			#address-cells = <1>;
1618c2ecf20Sopenharmony_ci			#size-cells = <1>;
1628c2ecf20Sopenharmony_ci
1638c2ecf20Sopenharmony_ci			/*
1648c2ecf20Sopenharmony_ci			 * We split the 16 MiB in two partitions,
1658c2ecf20Sopenharmony_ci			 * just as an example.
1668c2ecf20Sopenharmony_ci			 */
1678c2ecf20Sopenharmony_ci			partition@0 {
1688c2ecf20Sopenharmony_ci				label = "First";
1698c2ecf20Sopenharmony_ci				reg = <0 0x800000>;
1708c2ecf20Sopenharmony_ci			};
1718c2ecf20Sopenharmony_ci
1728c2ecf20Sopenharmony_ci			partition@800000 {
1738c2ecf20Sopenharmony_ci				label = "Second";
1748c2ecf20Sopenharmony_ci				reg = <0x800000 0x800000>;
1758c2ecf20Sopenharmony_ci			};
1768c2ecf20Sopenharmony_ci		};
1778c2ecf20Sopenharmony_ci	};
178