aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/devicetree/bindings/mtd/fsmc-nand.txt12
-rw-r--r--arch/arm/boot/dts/spear13xx.dtsi10
-rw-r--r--arch/arm/boot/dts/spear300.dtsi8
-rw-r--r--arch/arm/boot/dts/spear310.dtsi8
-rw-r--r--arch/arm/boot/dts/spear320.dtsi8
-rw-r--r--arch/arm/boot/dts/spear600.dtsi8
-rw-r--r--arch/arm/mach-u300/core.c14
-rw-r--r--drivers/mtd/nand/fsmc_nand.c44
-rw-r--r--include/linux/mtd/fsmc.h3
9 files changed, 49 insertions, 66 deletions
diff --git a/Documentation/devicetree/bindings/mtd/fsmc-nand.txt b/Documentation/devicetree/bindings/mtd/fsmc-nand.txt
index e2c663b354d2..e3ea32e7de3e 100644
--- a/Documentation/devicetree/bindings/mtd/fsmc-nand.txt
+++ b/Documentation/devicetree/bindings/mtd/fsmc-nand.txt
@@ -3,9 +3,7 @@
3Required properties: 3Required properties:
4- compatible : "st,spear600-fsmc-nand" 4- compatible : "st,spear600-fsmc-nand"
5- reg : Address range of the mtd chip 5- reg : Address range of the mtd chip
6- reg-names: Should contain the reg names "fsmc_regs" and "nand_data" 6- reg-names: Should contain the reg names "fsmc_regs", "nand_data", "nand_addr" and "nand_cmd"
7- st,ale-off : Chip specific offset to ALE
8- st,cle-off : Chip specific offset to CLE
9 7
10Optional properties: 8Optional properties:
11- bank-width : Width (in bytes) of the device. If not present, the width 9- bank-width : Width (in bytes) of the device. If not present, the width
@@ -19,10 +17,10 @@ Example:
19 #address-cells = <1>; 17 #address-cells = <1>;
20 #size-cells = <1>; 18 #size-cells = <1>;
21 reg = <0xd1800000 0x1000 /* FSMC Register */ 19 reg = <0xd1800000 0x1000 /* FSMC Register */
22 0xd2000000 0x4000>; /* NAND Base */ 20 0xd2000000 0x0010 /* NAND Base DATA */
23 reg-names = "fsmc_regs", "nand_data"; 21 0xd2020000 0x0010 /* NAND Base ADDR */
24 st,ale-off = <0x20000>; 22 0xd2010000 0x0010>; /* NAND Base CMD */
25 st,cle-off = <0x10000>; 23 reg-names = "fsmc_regs", "nand_data", "nand_addr", "nand_cmd";
26 24
27 bank-width = <1>; 25 bank-width = <1>;
28 nand-skip-bbtscan; 26 nand-skip-bbtscan;
diff --git a/arch/arm/boot/dts/spear13xx.dtsi b/arch/arm/boot/dts/spear13xx.dtsi
index f7b84aced654..14a6d15c2a81 100644
--- a/arch/arm/boot/dts/spear13xx.dtsi
+++ b/arch/arm/boot/dts/spear13xx.dtsi
@@ -104,15 +104,15 @@
104 compatible = "st,spear600-fsmc-nand"; 104 compatible = "st,spear600-fsmc-nand";
105 #address-cells = <1>; 105 #address-cells = <1>;
106 #size-cells = <1>; 106 #size-cells = <1>;
107 reg = <0xb0000000 0x1000 /* FSMC Register */ 107 reg = <0xb0000000 0x1000 /* FSMC Register*/
108 0xb0800000 0x0010>; /* NAND Base */ 108 0xb0800000 0x0010 /* NAND Base DATA */
109 reg-names = "fsmc_regs", "nand_data"; 109 0xb0820000 0x0010 /* NAND Base ADDR */
110 0xb0810000 0x0010>; /* NAND Base CMD */
111 reg-names = "fsmc_regs", "nand_data", "nand_addr", "nand_cmd";
110 interrupts = <0 20 0x4 112 interrupts = <0 20 0x4
111 0 21 0x4 113 0 21 0x4
112 0 22 0x4 114 0 22 0x4
113 0 23 0x4>; 115 0 23 0x4>;
114 st,ale-off = <0x20000>;
115 st,cle-off = <0x10000>;
116 status = "disabled"; 116 status = "disabled";
117 }; 117 };
118 118
diff --git a/arch/arm/boot/dts/spear300.dtsi b/arch/arm/boot/dts/spear300.dtsi
index ed3627c116cc..bc436387d7f9 100644
--- a/arch/arm/boot/dts/spear300.dtsi
+++ b/arch/arm/boot/dts/spear300.dtsi
@@ -38,10 +38,10 @@
38 #address-cells = <1>; 38 #address-cells = <1>;
39 #size-cells = <1>; 39 #size-cells = <1>;
40 reg = <0x94000000 0x1000 /* FSMC Register */ 40 reg = <0x94000000 0x1000 /* FSMC Register */
41 0x80000000 0x0010>; /* NAND Base */ 41 0x80000000 0x0010 /* NAND Base DATA */
42 reg-names = "fsmc_regs", "nand_data"; 42 0x80020000 0x0010 /* NAND Base ADDR */
43 st,ale-off = <0x20000>; 43 0x80010000 0x0010>; /* NAND Base CMD */
44 st,cle-off = <0x10000>; 44 reg-names = "fsmc_regs", "nand_data", "nand_addr", "nand_cmd";
45 status = "disabled"; 45 status = "disabled";
46 }; 46 };
47 47
diff --git a/arch/arm/boot/dts/spear310.dtsi b/arch/arm/boot/dts/spear310.dtsi
index 62fc4fb3e5f9..7840e529aba2 100644
--- a/arch/arm/boot/dts/spear310.dtsi
+++ b/arch/arm/boot/dts/spear310.dtsi
@@ -32,10 +32,10 @@
32 #address-cells = <1>; 32 #address-cells = <1>;
33 #size-cells = <1>; 33 #size-cells = <1>;
34 reg = <0x44000000 0x1000 /* FSMC Register */ 34 reg = <0x44000000 0x1000 /* FSMC Register */
35 0x40000000 0x0010>; /* NAND Base */ 35 0x40000000 0x0010 /* NAND Base DATA */
36 reg-names = "fsmc_regs", "nand_data"; 36 0x40020000 0x0010 /* NAND Base ADDR */
37 st,ale-off = <0x10000>; 37 0x40010000 0x0010>; /* NAND Base CMD */
38 st,cle-off = <0x20000>; 38 reg-names = "fsmc_regs", "nand_data", "nand_addr", "nand_cmd";
39 status = "disabled"; 39 status = "disabled";
40 }; 40 };
41 41
diff --git a/arch/arm/boot/dts/spear320.dtsi b/arch/arm/boot/dts/spear320.dtsi
index 1f49d69595a0..5ad820641ac0 100644
--- a/arch/arm/boot/dts/spear320.dtsi
+++ b/arch/arm/boot/dts/spear320.dtsi
@@ -38,10 +38,10 @@
38 #address-cells = <1>; 38 #address-cells = <1>;
39 #size-cells = <1>; 39 #size-cells = <1>;
40 reg = <0x4c000000 0x1000 /* FSMC Register */ 40 reg = <0x4c000000 0x1000 /* FSMC Register */
41 0x50000000 0x0010>; /* NAND Base */ 41 0x50000000 0x0010 /* NAND Base DATA */
42 reg-names = "fsmc_regs", "nand_data"; 42 0x50020000 0x0010 /* NAND Base ADDR */
43 st,ale-off = <0x20000>; 43 0x50010000 0x0010>; /* NAND Base CMD */
44 st,cle-off = <0x10000>; 44 reg-names = "fsmc_regs", "nand_data", "nand_addr", "nand_cmd";
45 status = "disabled"; 45 status = "disabled";
46 }; 46 };
47 47
diff --git a/arch/arm/boot/dts/spear600.dtsi b/arch/arm/boot/dts/spear600.dtsi
index a3c36e47d7ef..4ecc66f5ac88 100644
--- a/arch/arm/boot/dts/spear600.dtsi
+++ b/arch/arm/boot/dts/spear600.dtsi
@@ -67,10 +67,10 @@
67 #address-cells = <1>; 67 #address-cells = <1>;
68 #size-cells = <1>; 68 #size-cells = <1>;
69 reg = <0xd1800000 0x1000 /* FSMC Register */ 69 reg = <0xd1800000 0x1000 /* FSMC Register */
70 0xd2000000 0x4000>; /* NAND Base */ 70 0xd2000000 0x0010 /* NAND Base DATA */
71 reg-names = "fsmc_regs", "nand_data"; 71 0xd2020000 0x0010 /* NAND Base ADDR */
72 st,ale-off = <0x20000>; 72 0xd2010000 0x0010>; /* NAND Base CMD */
73 st,cle-off = <0x10000>; 73 reg-names = "fsmc_regs", "nand_data", "nand_addr", "nand_cmd";
74 status = "disabled"; 74 status = "disabled";
75 }; 75 };
76 76
diff --git a/arch/arm/mach-u300/core.c b/arch/arm/mach-u300/core.c
index b8efac4daed8..f642a1552346 100644
--- a/arch/arm/mach-u300/core.c
+++ b/arch/arm/mach-u300/core.c
@@ -252,6 +252,18 @@ static struct resource rtc_resources[] = {
252 */ 252 */
253static struct resource fsmc_resources[] = { 253static struct resource fsmc_resources[] = {
254 { 254 {
255 .name = "nand_addr",
256 .start = U300_NAND_CS0_PHYS_BASE + PLAT_NAND_ALE,
257 .end = U300_NAND_CS0_PHYS_BASE + PLAT_NAND_ALE + SZ_16K - 1,
258 .flags = IORESOURCE_MEM,
259 },
260 {
261 .name = "nand_cmd",
262 .start = U300_NAND_CS0_PHYS_BASE + PLAT_NAND_CLE,
263 .end = U300_NAND_CS0_PHYS_BASE + PLAT_NAND_CLE + SZ_16K - 1,
264 .flags = IORESOURCE_MEM,
265 },
266 {
255 .name = "nand_data", 267 .name = "nand_data",
256 .start = U300_NAND_CS0_PHYS_BASE, 268 .start = U300_NAND_CS0_PHYS_BASE,
257 .end = U300_NAND_CS0_PHYS_BASE + SZ_16K - 1, 269 .end = U300_NAND_CS0_PHYS_BASE + SZ_16K - 1,
@@ -1496,8 +1508,6 @@ static struct fsmc_nand_platform_data nand_platform_data = {
1496 .nr_partitions = ARRAY_SIZE(u300_partitions), 1508 .nr_partitions = ARRAY_SIZE(u300_partitions),
1497 .options = NAND_SKIP_BBTSCAN, 1509 .options = NAND_SKIP_BBTSCAN,
1498 .width = FSMC_NAND_BW8, 1510 .width = FSMC_NAND_BW8,
1499 .ale_off = PLAT_NAND_ALE,
1500 .cle_off = PLAT_NAND_CLE,
1501}; 1511};
1502 1512
1503static struct platform_device nand_device = { 1513static struct platform_device nand_device = {
diff --git a/drivers/mtd/nand/fsmc_nand.c b/drivers/mtd/nand/fsmc_nand.c
index 38d26240d8b1..cb8645087151 100644
--- a/drivers/mtd/nand/fsmc_nand.c
+++ b/drivers/mtd/nand/fsmc_nand.c
@@ -876,8 +876,6 @@ static int __devinit fsmc_nand_probe_config_dt(struct platform_device *pdev,
876 return -EINVAL; 876 return -EINVAL;
877 } 877 }
878 } 878 }
879 of_property_read_u32(np, "st,ale-off", &pdata->ale_off);
880 of_property_read_u32(np, "st,cle-off", &pdata->cle_off);
881 if (of_get_property(np, "nand-skip-bbtscan", NULL)) 879 if (of_get_property(np, "nand-skip-bbtscan", NULL))
882 pdata->options = NAND_SKIP_BBTSCAN; 880 pdata->options = NAND_SKIP_BBTSCAN;
883 881
@@ -935,41 +933,28 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
935 if (!res) 933 if (!res)
936 return -EINVAL; 934 return -EINVAL;
937 935
938 if (!devm_request_mem_region(&pdev->dev, res->start, resource_size(res), 936 host->data_va = devm_request_and_ioremap(&pdev->dev, res);
939 pdev->name)) {
940 dev_err(&pdev->dev, "Failed to get memory data resourse\n");
941 return -ENOENT;
942 }
943
944 host->data_pa = (dma_addr_t)res->start;
945 host->data_va = devm_ioremap(&pdev->dev, res->start,
946 resource_size(res));
947 if (!host->data_va) { 937 if (!host->data_va) {
948 dev_err(&pdev->dev, "data ioremap failed\n"); 938 dev_err(&pdev->dev, "data ioremap failed\n");
949 return -ENOMEM; 939 return -ENOMEM;
950 } 940 }
941 host->data_pa = (dma_addr_t)res->start;
951 942
952 if (!devm_request_mem_region(&pdev->dev, res->start + pdata->ale_off, 943 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "nand_addr");
953 resource_size(res), pdev->name)) { 944 if (!res)
954 dev_err(&pdev->dev, "Failed to get memory ale resourse\n"); 945 return -EINVAL;
955 return -ENOENT;
956 }
957 946
958 host->addr_va = devm_ioremap(&pdev->dev, res->start + pdata->ale_off, 947 host->addr_va = devm_request_and_ioremap(&pdev->dev, res);
959 resource_size(res));
960 if (!host->addr_va) { 948 if (!host->addr_va) {
961 dev_err(&pdev->dev, "ale ioremap failed\n"); 949 dev_err(&pdev->dev, "ale ioremap failed\n");
962 return -ENOMEM; 950 return -ENOMEM;
963 } 951 }
964 952
965 if (!devm_request_mem_region(&pdev->dev, res->start + pdata->cle_off, 953 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "nand_cmd");
966 resource_size(res), pdev->name)) { 954 if (!res)
967 dev_err(&pdev->dev, "Failed to get memory cle resourse\n"); 955 return -EINVAL;
968 return -ENOENT;
969 }
970 956
971 host->cmd_va = devm_ioremap(&pdev->dev, res->start + pdata->cle_off, 957 host->cmd_va = devm_request_and_ioremap(&pdev->dev, res);
972 resource_size(res));
973 if (!host->cmd_va) { 958 if (!host->cmd_va) {
974 dev_err(&pdev->dev, "ale ioremap failed\n"); 959 dev_err(&pdev->dev, "ale ioremap failed\n");
975 return -ENOMEM; 960 return -ENOMEM;
@@ -979,14 +964,7 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
979 if (!res) 964 if (!res)
980 return -EINVAL; 965 return -EINVAL;
981 966
982 if (!devm_request_mem_region(&pdev->dev, res->start, resource_size(res), 967 host->regs_va = devm_request_and_ioremap(&pdev->dev, res);
983 pdev->name)) {
984 dev_err(&pdev->dev, "Failed to get memory regs resourse\n");
985 return -ENOENT;
986 }
987
988 host->regs_va = devm_ioremap(&pdev->dev, res->start,
989 resource_size(res));
990 if (!host->regs_va) { 968 if (!host->regs_va) {
991 dev_err(&pdev->dev, "regs ioremap failed\n"); 969 dev_err(&pdev->dev, "regs ioremap failed\n");
992 return -ENOMEM; 970 return -ENOMEM;
diff --git a/include/linux/mtd/fsmc.h b/include/linux/mtd/fsmc.h
index b20029221fb1..d6ed61ef451d 100644
--- a/include/linux/mtd/fsmc.h
+++ b/include/linux/mtd/fsmc.h
@@ -155,9 +155,6 @@ struct fsmc_nand_platform_data {
155 unsigned int width; 155 unsigned int width;
156 unsigned int bank; 156 unsigned int bank;
157 157
158 /* CLE, ALE offsets */
159 unsigned int cle_off;
160 unsigned int ale_off;
161 enum access_mode mode; 158 enum access_mode mode;
162 159
163 void (*select_bank)(uint32_t bank, uint32_t busw); 160 void (*select_bank)(uint32_t bank, uint32_t busw);