1*c66ec88fSEmmanuel VadotMarvell Orion SPI device 2*c66ec88fSEmmanuel Vadot 3*c66ec88fSEmmanuel VadotRequired properties: 4*c66ec88fSEmmanuel Vadot- compatible : should be on of the following: 5*c66ec88fSEmmanuel Vadot - "marvell,orion-spi" for the Orion, mv78x00, Kirkwood and Dove SoCs 6*c66ec88fSEmmanuel Vadot - "marvell,armada-370-spi", for the Armada 370 SoCs 7*c66ec88fSEmmanuel Vadot - "marvell,armada-375-spi", for the Armada 375 SoCs 8*c66ec88fSEmmanuel Vadot - "marvell,armada-380-spi", for the Armada 38x SoCs 9*c66ec88fSEmmanuel Vadot - "marvell,armada-390-spi", for the Armada 39x SoCs 10*c66ec88fSEmmanuel Vadot - "marvell,armada-xp-spi", for the Armada XP SoCs 11*c66ec88fSEmmanuel Vadot- reg : offset and length of the register set for the device. 12*c66ec88fSEmmanuel Vadot This property can optionally have additional entries to configure 13*c66ec88fSEmmanuel Vadot the SPI direct access mode that some of the Marvell SoCs support 14*c66ec88fSEmmanuel Vadot additionally to the normal indirect access (PIO) mode. The values 15*c66ec88fSEmmanuel Vadot for the MBus "target" and "attribute" are defined in the Marvell 16*c66ec88fSEmmanuel Vadot SoC "Functional Specifications" Manual in the chapter "Marvell 17*c66ec88fSEmmanuel Vadot Core Processor Address Decoding". 18*c66ec88fSEmmanuel Vadot The eight register sets following the control registers refer to 19*c66ec88fSEmmanuel Vadot chip-select lines 0 through 7 respectively. 20*c66ec88fSEmmanuel Vadot- cell-index : Which of multiple SPI controllers is this. 21*c66ec88fSEmmanuel Vadot- clocks : pointers to the reference clocks for this device, the first 22*c66ec88fSEmmanuel Vadot one is the one used for the clock on the spi bus, the 23*c66ec88fSEmmanuel Vadot second one is optional and is the clock used for the 24*c66ec88fSEmmanuel Vadot functional part of the controller 25*c66ec88fSEmmanuel Vadot 26*c66ec88fSEmmanuel VadotOptional properties: 27*c66ec88fSEmmanuel Vadot- interrupts : Is currently not used. 28*c66ec88fSEmmanuel Vadot- clock-names : names of used clocks, mandatory if the second clock is 29*c66ec88fSEmmanuel Vadot used, the name must be "core", and "axi" (the latter 30*c66ec88fSEmmanuel Vadot is only for Armada 7K/8K). 31*c66ec88fSEmmanuel Vadot 32*c66ec88fSEmmanuel Vadot 33*c66ec88fSEmmanuel VadotExample: 34*c66ec88fSEmmanuel Vadot spi@10600 { 35*c66ec88fSEmmanuel Vadot compatible = "marvell,orion-spi"; 36*c66ec88fSEmmanuel Vadot #address-cells = <1>; 37*c66ec88fSEmmanuel Vadot #size-cells = <0>; 38*c66ec88fSEmmanuel Vadot cell-index = <0>; 39*c66ec88fSEmmanuel Vadot reg = <0x10600 0x28>; 40*c66ec88fSEmmanuel Vadot interrupts = <23>; 41*c66ec88fSEmmanuel Vadot }; 42*c66ec88fSEmmanuel Vadot 43*c66ec88fSEmmanuel VadotExample with SPI direct mode support (optionally): 44*c66ec88fSEmmanuel Vadot spi0: spi@10600 { 45*c66ec88fSEmmanuel Vadot compatible = "marvell,orion-spi"; 46*c66ec88fSEmmanuel Vadot #address-cells = <1>; 47*c66ec88fSEmmanuel Vadot #size-cells = <0>; 48*c66ec88fSEmmanuel Vadot cell-index = <0>; 49*c66ec88fSEmmanuel Vadot reg = <MBUS_ID(0xf0, 0x01) 0x10600 0x28>, /* control */ 50*c66ec88fSEmmanuel Vadot <MBUS_ID(0x01, 0x1e) 0 0xffffffff>, /* CS0 */ 51*c66ec88fSEmmanuel Vadot <MBUS_ID(0x01, 0x5e) 0 0xffffffff>, /* CS1 */ 52*c66ec88fSEmmanuel Vadot <MBUS_ID(0x01, 0x9e) 0 0xffffffff>, /* CS2 */ 53*c66ec88fSEmmanuel Vadot <MBUS_ID(0x01, 0xde) 0 0xffffffff>, /* CS3 */ 54*c66ec88fSEmmanuel Vadot <MBUS_ID(0x01, 0x1f) 0 0xffffffff>, /* CS4 */ 55*c66ec88fSEmmanuel Vadot <MBUS_ID(0x01, 0x5f) 0 0xffffffff>, /* CS5 */ 56*c66ec88fSEmmanuel Vadot <MBUS_ID(0x01, 0x9f) 0 0xffffffff>, /* CS6 */ 57*c66ec88fSEmmanuel Vadot <MBUS_ID(0x01, 0xdf) 0 0xffffffff>; /* CS7 */ 58*c66ec88fSEmmanuel Vadot interrupts = <23>; 59*c66ec88fSEmmanuel Vadot }; 60*c66ec88fSEmmanuel Vadot 61*c66ec88fSEmmanuel VadotTo enable the direct mode, the board specific 'ranges' property in the 62*c66ec88fSEmmanuel Vadot'soc' node needs to add the entries for the desired SPI controllers 63*c66ec88fSEmmanuel Vadotand its chip-selects that are used in the direct mode instead of PIO 64*c66ec88fSEmmanuel Vadotmode. Here an example for this (SPI controller 0, device 1 and SPI 65*c66ec88fSEmmanuel Vadotcontroller 1, device 2 are used in direct mode. All other SPI device 66*c66ec88fSEmmanuel Vadotare used in the default indirect (PIO) mode): 67*c66ec88fSEmmanuel Vadot soc { 68*c66ec88fSEmmanuel Vadot /* 69*c66ec88fSEmmanuel Vadot * Enable the SPI direct access by configuring an entry 70*c66ec88fSEmmanuel Vadot * here in the board-specific ranges property 71*c66ec88fSEmmanuel Vadot */ 72*c66ec88fSEmmanuel Vadot ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xf1000000 0x100000>, /* internal regs */ 73*c66ec88fSEmmanuel Vadot <MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000>, /* BootROM */ 74*c66ec88fSEmmanuel Vadot <MBUS_ID(0x01, 0x5e) 0 0 0xf1100000 0x10000>, /* SPI0-DEV1 */ 75*c66ec88fSEmmanuel Vadot <MBUS_ID(0x01, 0x9a) 0 0 0xf1110000 0x10000>; /* SPI1-DEV2 */ 76*c66ec88fSEmmanuel Vadot 77*c66ec88fSEmmanuel VadotFor further information on the MBus bindings, please see the MBus 78*c66ec88fSEmmanuel VadotDT documentation: 79*c66ec88fSEmmanuel VadotDocumentation/devicetree/bindings/bus/mvebu-mbus.txt 80