drivers: memory: Introduce Marvell EBU Device Bus driver
Subsystems (2)
PATCH 1/1 drivers: memory: Introduce Marvell EBU Device Bus driver
From: Ezequiel Garcia <[email protected]>
Marvell EBU SoCs such as Armada 370/XP, Orion5x (88f5xxx) and Discovery (mv78xx0) supports a Device Bus controller to access several kinds of memories and I/O devices (NOR, NAND, SRAM, FPGA).
This commit adds a driver to handle this controller. So far only Armada 370, Armada XP and Discovery SoCs are supported.
The driver must be registered through a device tree node; as explained in the binding document.
For each child node in the device tree, this driver will:
* set timing parameters
* register a child device
* setup an address decoding window, using the mbus driver
Keep in mind the address decoding window setup is only a temporary hack. This code will be removed from this devbus driver as soon as a proper device tree binding for the mbus driver is added.
---
Hi Greg,
This patch Applies on today linux-next.
I don't know if we are still in time for you to take this and merge it into v3.10.
All of the DT related changes are in linux-next through arm-soc, but this driver was left out and, unless you take it, will get queued for v3.11. So it's up to you.
.../bindings/memory-controllers/mvebu-devbus.txt | 156 ++++++++++ drivers/memory/Kconfig | 10 + drivers/memory/Makefile | 1 + drivers/memory/mvebu-devbus.c | 340 +++++++++++++++++++++ 4 files changed, 507 insertions(+) create mode 100644 Documentation/devicetree/bindings/memory-controllers/mvebu-devbus.txt create mode 100644 drivers/memory/mvebu-devbus.c
Documentation/devicetree/bindings/memory-controllers/mvebu-devbus.txt new file +156 -0
@@ -0,0 +1,156 @@ +Device tree bindings for MVEBU Device Bus controllers + +The Device Bus controller available in some Marvell's SoC allows to control +different types of standard memory and I/O devices such as NOR, NAND, and FPGA. +The actual devices are instantiated from the child nodes of a Device Bus node. + +Required properties: + + - compatible: Currently only Armada 370/XP SoC are supported, + with this compatible string: + + marvell,mvebu-devbus + + - reg: A resource specifier for the register space. + This is the base address of a chip select within + the controller's register space. + (see the example below) + + - #address-cells: Must be set to 1 + - #size-cells: Must be set to 1 + - ranges: Must be set up to reflect the memory layout with four + integer values for each chip-select line in use: + 0 <physical address of mapping> <size> + +Mandatory timing properties for child nodes: + +Read parameters: + + - devbus,turn-off-ps: Defines the time during which the controller does not + drive the AD bus after the completion of a device read. + This prevents contentions on the Device Bus after a read + cycle from a slow device. + + - devbus,bus-width: Defines the bus width (e.g. <16>) + + - devbus,badr-skew-ps: Defines the time delay from from A[2:0] toggle, + to read data sample. This parameter is useful for + synchronous pipelined devices, where the address + precedes the read data by one or two cycles. + + - devbus,acc-first-ps: Defines the time delay from the negation of + ALE[0] to the cycle that the first read data is sampled + by the controller. + + - devbus,acc-next-ps: Defines the time delay between the cycle that + samples data N and the cycle that samples data N+1 + (in burst accesses). + + - devbus,rd-setup-ps: Defines the time delay between DEV_CSn assertion to + DEV_OEn assertion. If set to 0 (default), + DEV_OEn and DEV_CSn are asserted at the same cycle. + This parameter has no affect on <acc-first-ps> parameter + (no affect on first data sample). Set <rd-setup-ps> + to a value smaller than <acc-first-ps>. + + - devbus,rd-hold-ps: Defines the time between the last data sample to the + de-assertion of DEV_CSn. If set to 0 (default), + DEV_OEn and DEV_CSn are de-asserted at the same cycle + (the cycle of the last data sample). + This parameter has no affect on DEV_OEn de-assertion. + DEV_OEn is always de-asserted the next cycle after + last data sampled. Also this parameter has no + affect on <turn-off-ps> parameter. + Set <rd-hold-ps> to a value smaller than <turn-off-ps>. + +Write parameters: + + - devbus,ale-wr-ps: Defines the time delay from the ALE[0] negation cycle + to the DEV_WEn assertion. + + - devbus,wr-low-ps: Defines the time during which DEV_WEn is active. + A[2:0] and Data are kept valid as long as DEV_WEn + is active. This parameter defines the setup time of + address and data to DEV_WEn rise. + + - devbus,wr-high-ps: Defines the time during which DEV_WEn is kept + inactive (high) between data beats of a burst write. + DEV_A[2:0] and Data are kept valid (do not toggle) for + <wr-high-ps> - <tick> ps. + This parameter defines the hold time of address and + data after DEV_WEn rise. + + - devbus,sync-enable: Synchronous device enable. + 1: True + 0: False + +An example for an Armada XP GP board, with a 16 MiB NOR device as child +is showed below. Note that the Device Bus driver is in charge of allocating +the mbus address decoding window for each of its child devices. +The window is created using the chip select specified in the child +device node together with the base address and size specified in the ranges +property. For instance, in the example below the allocated decoding window +will start at base address 0xf0000000, with a size 0x1000000 (16 MiB) +for chip select 0 (a.k.a DEV_BOOTCS). + +This address window handling is done in this mvebu-devbus only as a temporary +solution. It will be removed when the support for mbus device tree binding is +added. + +The reg property implicitly specifies the chip select as this: + + 0x10400: DEV_BOOTCS + 0x10408: DEV_CS0 + 0x10410: DEV_CS1 + 0x10418: DEV_CS2 + 0x10420: DEV_CS3 + +Example: + + devbus-bootcs at d0010400 { + status = "okay"; + ranges = <0 0xf0000000 0x1000000>; /* @addr 0xf0000000, size 0x1000000 */ + #address-cells = <1>; + #size-cells = <1>; + + /* Device Bus parameters are required */ + + /* Read parameters */ + devbus,bus-width = <8>; + devbus,turn-off-ps = <60000>; + devbus,badr-skew-ps = <0>; + devbus,acc-first-ps = <124000>; + devbus,acc-next-ps = <248000>; + devbus,rd-setup-ps = <0>; + devbus,rd-hold-ps = <0>; + + /* Write parameters */ + devbus,sync-enable = <0>; + devbus,wr-high-ps = <60000>; + devbus,wr-low-ps = <60000>; + devbus,ale-wr-ps = <60000>; + + flash at 0 { + compatible = "cfi-flash"; + + /* 16 MiB */ + reg = <0 0x1000000>; + bank-width = <2>; + #address-cells = <1>; + #size-cells = <1>; + + /* + * We split the 16 MiB in two partitions, + * just as an example. + */ + partition at 0 { + label = "First"; + reg = <0 0x800000>; + }; + + partition at 800000 { + label = "Second"; + reg = <0x800000 0x800000>; + }; + }; + };
drivers/memory/Kconfig +10 -0
@@ -20,6 +20,16 @@ config TI_EMIF parameters and other settings during frequency, voltage and temperature changes +config MVEBU_DEVBUS + bool "Marvell EBU Device Bus Controller" + default y + depends on PLAT_ORION && OF + help + This driver is for the Device Bus controller available in some + Marvell EBU SoCs such as Discovery (mv78xx0), Orion (88f5xxx) and + Armada 370 and Armada XP. This controller allows to handle flash + devices such as NOR, NAND, SRAM, and FPGA. + config TEGRA20_MC bool "Tegra20 Memory Controller(MC) driver" default y
drivers/memory/Makefile +1 -0
@@ -6,5 +6,6 @@ ifeq ($(CONFIG_DDR),y) obj-$(CONFIG_OF) += of_memory.o endif obj-$(CONFIG_TI_EMIF) += emif.o +obj-$(CONFIG_MVEBU_DEVBUS) += mvebu-devbus.o obj-$(CONFIG_TEGRA20_MC) += tegra20-mc.o obj-$(CONFIG_TEGRA30_MC) += tegra30-mc.o
drivers/memory/mvebu-devbus.c new file +340 -0
340 lines not on this page · raw message
Signature · 1 line
1.8.1.5
Quoted 26 lines · Ezequiel Garcia
From: Ezequiel Garcia <[email protected]>
Marvell EBU SoCs such as Armada 370/XP, Orion5x (88f5xxx) and Discovery (mv78xx0) supports a Device Bus controller to access several kinds of memories and I/O devices (NOR, NAND, SRAM, FPGA).
This commit adds a driver to handle this controller. So far only Armada 370, Armada XP and Discovery SoCs are supported.
The driver must be registered through a device tree node; as explained in the binding document.
For each child node in the device tree, this driver will:
* set timing parameters
* register a child device
* setup an address decoding window, using the mbus driverKeep in mind the address decoding window setup is only a temporary hack. This code will be removed from this devbus driver as soon as a proper device tree binding for the mbus driver is added.
Signed-off-by Ezequiel Garcia <[email protected]>Acked-by Arnd Bergmann <[email protected]>---
Hi Greg,
Quoted 7 lines
This patch Applies on today linux-next.
I don't know if we are still in time for you to take this and merge it into v3.10.All of the DT related changes are in linux-next through arm-soc, but this driver was left out and, unless you take it, will get queued for v3.11. So it's up to you.
It's way too late for new drivers for 3.10, sorry. I'll hold on to this and merge it to my trees after 3.10-rc1 is out for inclusion in 3.11.
thanks,
greg k-h
Quoted 31 lines · Greg KH
Quoted 30 lines · Ezequiel Garcia
From: Ezequiel Garcia <[email protected]>
Marvell EBU SoCs such as Armada 370/XP, Orion5x (88f5xxx) and Discovery (mv78xx0) supports a Device Bus controller to access several kinds of memories and I/O devices (NOR, NAND, SRAM, FPGA).
This commit adds a driver to handle this controller. So far only Armada 370, Armada XP and Discovery SoCs are supported.
The driver must be registered through a device tree node; as explained in the binding document.
For each child node in the device tree, this driver will:
* set timing parameters
* register a child device
* setup an address decoding window, using the mbus driverKeep in mind the address decoding window setup is only a temporary hack. This code will be removed from this devbus driver as soon as a proper device tree binding for the mbus driver is added.
Signed-off-by Ezequiel Garcia <[email protected]>Acked-by Arnd Bergmann <[email protected]>---
Hi Greg,This patch Applies on today linux-next.
I don't know if we are still in time for you to take this and merge it into v3.10.
Quoted 7 lines
Quoted 3 lines
All of the DT related changes are in linux-next through arm-soc, but this driver was left out and, unless you take it, will get queued for v3.11. So it's up to you.
It's way too late for new drivers for 3.10, sorry. I'll hold on to this and merge it to my trees after 3.10-rc1 is out for inclusion in 3.11.
That's fine, no problem.
Signature · 3 lines
Ezequiel García, Free Electrons Embedded Linux, Kernel and Android Engineering http://free-electrons.com
Quoted 36 lines · Ezequiel Garcia
Quoted 35 lines · Greg KH
Quoted 33 lines · Ezequiel Garcia
From: Ezequiel Garcia <[email protected]>
Marvell EBU SoCs such as Armada 370/XP, Orion5x (88f5xxx) and Discovery (mv78xx0) supports a Device Bus controller to access several kinds of memories and I/O devices (NOR, NAND, SRAM, FPGA).
This commit adds a driver to handle this controller. So far only Armada 370, Armada XP and Discovery SoCs are supported.
The driver must be registered through a device tree node; as explained in the binding document.
For each child node in the device tree, this driver will:
* set timing parameters
* register a child device
* setup an address decoding window, using the mbus driverKeep in mind the address decoding window setup is only a temporary hack. This code will be removed from this devbus driver as soon as a proper device tree binding for the mbus driver is added.
Signed-off-by Ezequiel Garcia <[email protected]>Acked-by Arnd Bergmann <[email protected]>---
Hi Greg,This patch Applies on today linux-next.
I don't know if we are still in time for you to take this and merge it into v3.10.All of the DT related changes are in linux-next through arm-soc, but this driver was left out and, unless you take it, will get queued for v3.11. So it's up to you.
Quoted 5 lines
Quoted 3 lines
It's way too late for new drivers for 3.10, sorry. I'll hold on to this and merge it to my trees after 3.10-rc1 is out for inclusion in 3.11.
That's fine, no problem.
Ezequiel,
I'm dropping this from my tree as Greg has said he would take it.
thx,
Jason.
Hi Greg,
Quoted 3 lines · Jason Cooper
Quoted 2 lines · Ezequiel Garcia
Quoted 1 line · Greg KH
On Tue, Apr 23, 2013 at 04:21:26PM -0300, Ezequiel Garcia wrote:
[...]
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
It's way too late for new drivers for 3.10, sorry. I'll hold on to this and merge it to my trees after 3.10-rc1 is out for inclusion in 3.11.
That's fine, no problem.
I'm dropping this from my tree as Greg has said he would take it.
Do you plan to take this through your trees? Which tree should I be monitoring? If at all possible, I'd love to see this in linux-next somewhat soon, to avoid future problems.
Thanks!
Signature · 3 lines
Ezequiel Garc?a, Free Electrons Embedded Linux, Kernel and Android Engineering http://free-electrons.com