162306a36Sopenharmony_ciMarvell Orion SPI device 262306a36Sopenharmony_ci 362306a36Sopenharmony_ciRequired properties: 462306a36Sopenharmony_ci- compatible : should be on of the following: 562306a36Sopenharmony_ci - "marvell,orion-spi" for the Orion, mv78x00, Kirkwood and Dove SoCs 662306a36Sopenharmony_ci - "marvell,armada-370-spi", for the Armada 370 SoCs 762306a36Sopenharmony_ci - "marvell,armada-375-spi", for the Armada 375 SoCs 862306a36Sopenharmony_ci - "marvell,armada-380-spi", for the Armada 38x SoCs 962306a36Sopenharmony_ci - "marvell,armada-390-spi", for the Armada 39x SoCs 1062306a36Sopenharmony_ci - "marvell,armada-xp-spi", for the Armada XP SoCs 1162306a36Sopenharmony_ci- reg : offset and length of the register set for the device. 1262306a36Sopenharmony_ci This property can optionally have additional entries to configure 1362306a36Sopenharmony_ci the SPI direct access mode that some of the Marvell SoCs support 1462306a36Sopenharmony_ci additionally to the normal indirect access (PIO) mode. The values 1562306a36Sopenharmony_ci for the MBus "target" and "attribute" are defined in the Marvell 1662306a36Sopenharmony_ci SoC "Functional Specifications" Manual in the chapter "Marvell 1762306a36Sopenharmony_ci Core Processor Address Decoding". 1862306a36Sopenharmony_ci The eight register sets following the control registers refer to 1962306a36Sopenharmony_ci chip-select lines 0 through 7 respectively. 2062306a36Sopenharmony_ci- cell-index : Which of multiple SPI controllers is this. 2162306a36Sopenharmony_ci- clocks : pointers to the reference clocks for this device, the first 2262306a36Sopenharmony_ci one is the one used for the clock on the spi bus, the 2362306a36Sopenharmony_ci second one is optional and is the clock used for the 2462306a36Sopenharmony_ci functional part of the controller 2562306a36Sopenharmony_ci 2662306a36Sopenharmony_ciOptional properties: 2762306a36Sopenharmony_ci- interrupts : Is currently not used. 2862306a36Sopenharmony_ci- clock-names : names of used clocks, mandatory if the second clock is 2962306a36Sopenharmony_ci used, the name must be "core", and "axi" (the latter 3062306a36Sopenharmony_ci is only for Armada 7K/8K). 3162306a36Sopenharmony_ci 3262306a36Sopenharmony_ci 3362306a36Sopenharmony_ciExample: 3462306a36Sopenharmony_ci spi@10600 { 3562306a36Sopenharmony_ci compatible = "marvell,orion-spi"; 3662306a36Sopenharmony_ci #address-cells = <1>; 3762306a36Sopenharmony_ci #size-cells = <0>; 3862306a36Sopenharmony_ci cell-index = <0>; 3962306a36Sopenharmony_ci reg = <0x10600 0x28>; 4062306a36Sopenharmony_ci interrupts = <23>; 4162306a36Sopenharmony_ci }; 4262306a36Sopenharmony_ci 4362306a36Sopenharmony_ciExample with SPI direct mode support (optionally): 4462306a36Sopenharmony_ci spi0: spi@10600 { 4562306a36Sopenharmony_ci compatible = "marvell,orion-spi"; 4662306a36Sopenharmony_ci #address-cells = <1>; 4762306a36Sopenharmony_ci #size-cells = <0>; 4862306a36Sopenharmony_ci cell-index = <0>; 4962306a36Sopenharmony_ci reg = <MBUS_ID(0xf0, 0x01) 0x10600 0x28>, /* control */ 5062306a36Sopenharmony_ci <MBUS_ID(0x01, 0x1e) 0 0xffffffff>, /* CS0 */ 5162306a36Sopenharmony_ci <MBUS_ID(0x01, 0x5e) 0 0xffffffff>, /* CS1 */ 5262306a36Sopenharmony_ci <MBUS_ID(0x01, 0x9e) 0 0xffffffff>, /* CS2 */ 5362306a36Sopenharmony_ci <MBUS_ID(0x01, 0xde) 0 0xffffffff>, /* CS3 */ 5462306a36Sopenharmony_ci <MBUS_ID(0x01, 0x1f) 0 0xffffffff>, /* CS4 */ 5562306a36Sopenharmony_ci <MBUS_ID(0x01, 0x5f) 0 0xffffffff>, /* CS5 */ 5662306a36Sopenharmony_ci <MBUS_ID(0x01, 0x9f) 0 0xffffffff>, /* CS6 */ 5762306a36Sopenharmony_ci <MBUS_ID(0x01, 0xdf) 0 0xffffffff>; /* CS7 */ 5862306a36Sopenharmony_ci interrupts = <23>; 5962306a36Sopenharmony_ci }; 6062306a36Sopenharmony_ci 6162306a36Sopenharmony_ciTo enable the direct mode, the board specific 'ranges' property in the 6262306a36Sopenharmony_ci'soc' node needs to add the entries for the desired SPI controllers 6362306a36Sopenharmony_ciand its chip-selects that are used in the direct mode instead of PIO 6462306a36Sopenharmony_cimode. Here an example for this (SPI controller 0, device 1 and SPI 6562306a36Sopenharmony_cicontroller 1, device 2 are used in direct mode. All other SPI device 6662306a36Sopenharmony_ciare used in the default indirect (PIO) mode): 6762306a36Sopenharmony_ci soc { 6862306a36Sopenharmony_ci /* 6962306a36Sopenharmony_ci * Enable the SPI direct access by configuring an entry 7062306a36Sopenharmony_ci * here in the board-specific ranges property 7162306a36Sopenharmony_ci */ 7262306a36Sopenharmony_ci ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xf1000000 0x100000>, /* internal regs */ 7362306a36Sopenharmony_ci <MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000>, /* BootROM */ 7462306a36Sopenharmony_ci <MBUS_ID(0x01, 0x5e) 0 0 0xf1100000 0x10000>, /* SPI0-DEV1 */ 7562306a36Sopenharmony_ci <MBUS_ID(0x01, 0x9a) 0 0 0xf1110000 0x10000>; /* SPI1-DEV2 */ 7662306a36Sopenharmony_ci 7762306a36Sopenharmony_ciFor further information on the MBus bindings, please see the MBus 7862306a36Sopenharmony_ciDT documentation: 7962306a36Sopenharmony_ciDocumentation/devicetree/bindings/bus/mvebu-mbus.txt 80