MTD: Add device-tree support to fsmc_nand
Subsystems (3)
PATCH 1/1 MTD: Add device-tree support to fsmc_nand
This patch adds support to configure the FSMC NAND driver (used amongst others on SPEAr platforms) via device-tree instead of platform_data.
Signed-off-by Stefan Roese <[email protected]>
Cc Viresh Kumar <[email protected]>
--- .../devicetree/bindings/mtd/fsmc-nand.txt | 33 ++++++++++++ drivers/mtd/nand/fsmc_nand.c | 57 +++++++++++++++++++- include/linux/mtd/fsmc.h | 4 +- 3 files changed, 91 insertions(+), 3 deletions(-) create mode 100644 Documentation/devicetree/bindings/mtd/fsmc-nand.txt
Documentation/devicetree/bindings/mtd/fsmc-nand.txt new file +33 -0
@@ -0,0 +1,33 @@ +* FSMC NAND + +Required properties: +- compatible : "st,spear600-fsmc-nand" +- reg : Address range of the mtd chip +- reg-names: Should contain the reg names "fsmc_regs" and "nand_data" +- st,ale-off : Chip specific offset to ALE +- st,cle-off : Chip specific offset to CLE + +Optional properties: +- bank-width : Width (in bytes) of the device. If not present, the width + defaults to 1 byte +- nand-skip-bbtscan: Indicates the the BBT scanning should be skipped + +Example: + + fsmc: flash@d1800000 { + compatible = "st,spear600-fsmc-nand"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0xd1800000 0x1000 /* FSMC Register */ + 0xd2000000 0x4000>; /* NAND Base */ + reg-names = "fsmc_regs", "nand_data"; + st,ale-off = <0x20000>; + st,cle-off = <0x10000>; + + bank-width = <1>; + nand-skip-bbtscan; + + partition@0 { + ... + }; + };
drivers/mtd/nand/fsmc_nand.c +56 -1
98 lines not on this page · raw message
include/linux/mtd/fsmc.h +2 -2
@@ -156,8 +156,8 @@ struct fsmc_nand_platform_data {unsigned int bank;/* CLE, ALE offsets */ -unsigned long cle_off; -unsigned long ale_off; +unsigned int cle_off; +unsigned int ale_off;enum access_mode mode;void (*select_bank)(uint32_t bank,uint32_t busw);
Signature · 1 line
1.7.9.2
Artem Bityutskiy
AppliedQuoted 4 lines · Stefan Roese
This patch adds support to configure the FSMC NAND driver (used amongst others on SPEAr platforms) via device-tree instead of
platform_data.Signed-off-by Stefan Roese <[email protected]>
Pushed to l2-mtd.git, thanks!
Signature · 2 lines
Best Regards, Artem Bityutskiy