aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2018-02-19 17:35:54 -0500
committerBoris Brezillon <boris.brezillon@bootlin.com>2018-03-02 15:51:41 -0500
commit7576594c8e69f5a9e08c5b952d5139bb43574bbc (patch)
tree4f4c96fa0e3d17908f268e43e8bdb529bbc1681d
parentcc396436c24de8ae28b3c0bee795a19bffea815b (diff)
mtd: nand: remove useless fields from pxa3xx NAND platform data
The "enable arbiter" bit is available only for pxa3xx based platforms but it was experimentally shown that even if this bit is reserved, some Marvell platforms (64-bit) actually need it to be set. The driver always set this bit regardless of this property, which is harmless. Then this property is not needed. The "num_cs" field is always 1 and for a good reason, the old driver (pxa3xx_nand.c) could only handle one. The new driver that replaces it (marvell_nand.c) can handle more, but better use device tree for such description. As there is only one available chip select, there is no need for an array of partitions neither an array of partition numbers. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
-rw-r--r--arch/arm/mach-mmp/aspenite.c6
-rw-r--r--arch/arm/mach-mmp/ttc_dkb.c5
-rw-r--r--arch/arm/mach-pxa/cm-x300.c6
-rw-r--r--arch/arm/mach-pxa/colibri-pxa3xx.c6
-rw-r--r--arch/arm/mach-pxa/littleton.c6
-rw-r--r--arch/arm/mach-pxa/mxm8x10.c6
-rw-r--r--arch/arm/mach-pxa/raumfeld.c6
-rw-r--r--arch/arm/mach-pxa/zylonite.c6
-rw-r--r--drivers/mtd/nand/marvell_nand.c3
-rw-r--r--include/linux/platform_data/mtd-nand-pxa3xx.h43
10 files changed, 28 insertions, 65 deletions
diff --git a/arch/arm/mach-mmp/aspenite.c b/arch/arm/mach-mmp/aspenite.c
index d2283009a5ff..6c2ebf01893a 100644
--- a/arch/arm/mach-mmp/aspenite.c
+++ b/arch/arm/mach-mmp/aspenite.c
@@ -172,10 +172,8 @@ static struct mtd_partition aspenite_nand_partitions[] = {
172}; 172};
173 173
174static struct pxa3xx_nand_platform_data aspenite_nand_info = { 174static struct pxa3xx_nand_platform_data aspenite_nand_info = {
175 .enable_arbiter = 1, 175 .parts = aspenite_nand_partitions,
176 .num_cs = 1, 176 .nr_parts = ARRAY_SIZE(aspenite_nand_partitions),
177 .parts[0] = aspenite_nand_partitions,
178 .nr_parts[0] = ARRAY_SIZE(aspenite_nand_partitions),
179}; 177};
180 178
181static struct i2c_board_info aspenite_i2c_info[] __initdata = { 179static struct i2c_board_info aspenite_i2c_info[] __initdata = {
diff --git a/arch/arm/mach-mmp/ttc_dkb.c b/arch/arm/mach-mmp/ttc_dkb.c
index e0b6073c61a7..c7897fb2b6da 100644
--- a/arch/arm/mach-mmp/ttc_dkb.c
+++ b/arch/arm/mach-mmp/ttc_dkb.c
@@ -179,10 +179,7 @@ static struct mv_usb_platform_data ttc_usb_pdata = {
179#endif 179#endif
180 180
181#if IS_ENABLED(CONFIG_MTD_NAND_MARVELL) 181#if IS_ENABLED(CONFIG_MTD_NAND_MARVELL)
182static struct pxa3xx_nand_platform_data dkb_nand_info = { 182static struct pxa3xx_nand_platform_data dkb_nand_info = {};
183 .enable_arbiter = 1,
184 .num_cs = 1,
185};
186#endif 183#endif
187 184
188#if IS_ENABLED(CONFIG_MMP_DISP) 185#if IS_ENABLED(CONFIG_MMP_DISP)
diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c
index de1f8c995076..0e71799cab25 100644
--- a/arch/arm/mach-pxa/cm-x300.c
+++ b/arch/arm/mach-pxa/cm-x300.c
@@ -429,11 +429,9 @@ static struct mtd_partition cm_x300_nand_partitions[] = {
429}; 429};
430 430
431static struct pxa3xx_nand_platform_data cm_x300_nand_info = { 431static struct pxa3xx_nand_platform_data cm_x300_nand_info = {
432 .enable_arbiter = 1,
433 .keep_config = 1, 432 .keep_config = 1,
434 .num_cs = 1, 433 .parts = cm_x300_nand_partitions,
435 .parts[0] = cm_x300_nand_partitions, 434 .nr_parts = ARRAY_SIZE(cm_x300_nand_partitions),
436 .nr_parts[0] = ARRAY_SIZE(cm_x300_nand_partitions),
437}; 435};
438 436
439static void __init cm_x300_init_nand(void) 437static void __init cm_x300_init_nand(void)
diff --git a/arch/arm/mach-pxa/colibri-pxa3xx.c b/arch/arm/mach-pxa/colibri-pxa3xx.c
index 3018eafd723e..e31a591e949f 100644
--- a/arch/arm/mach-pxa/colibri-pxa3xx.c
+++ b/arch/arm/mach-pxa/colibri-pxa3xx.c
@@ -138,11 +138,9 @@ static struct mtd_partition colibri_nand_partitions[] = {
138}; 138};
139 139
140static struct pxa3xx_nand_platform_data colibri_nand_info = { 140static struct pxa3xx_nand_platform_data colibri_nand_info = {
141 .enable_arbiter = 1,
142 .keep_config = 1, 141 .keep_config = 1,
143 .num_cs = 1, 142 .parts = colibri_nand_partitions,
144 .parts[0] = colibri_nand_partitions, 143 .nr_parts = ARRAY_SIZE(colibri_nand_partitions),
145 .nr_parts[0] = ARRAY_SIZE(colibri_nand_partitions),
146}; 144};
147 145
148void __init colibri_pxa3xx_init_nand(void) 146void __init colibri_pxa3xx_init_nand(void)
diff --git a/arch/arm/mach-pxa/littleton.c b/arch/arm/mach-pxa/littleton.c
index 193dccca1086..9e132b3e48c6 100644
--- a/arch/arm/mach-pxa/littleton.c
+++ b/arch/arm/mach-pxa/littleton.c
@@ -329,10 +329,8 @@ static struct mtd_partition littleton_nand_partitions[] = {
329}; 329};
330 330
331static struct pxa3xx_nand_platform_data littleton_nand_info = { 331static struct pxa3xx_nand_platform_data littleton_nand_info = {
332 .enable_arbiter = 1, 332 .parts = littleton_nand_partitions,
333 .num_cs = 1, 333 .nr_parts = ARRAY_SIZE(littleton_nand_partitions),
334 .parts[0] = littleton_nand_partitions,
335 .nr_parts[0] = ARRAY_SIZE(littleton_nand_partitions),
336}; 334};
337 335
338static void __init littleton_init_nand(void) 336static void __init littleton_init_nand(void)
diff --git a/arch/arm/mach-pxa/mxm8x10.c b/arch/arm/mach-pxa/mxm8x10.c
index 5cc379c0626c..616b22397d73 100644
--- a/arch/arm/mach-pxa/mxm8x10.c
+++ b/arch/arm/mach-pxa/mxm8x10.c
@@ -389,11 +389,9 @@ static struct mtd_partition mxm_8x10_nand_partitions[] = {
389}; 389};
390 390
391static struct pxa3xx_nand_platform_data mxm_8x10_nand_info = { 391static struct pxa3xx_nand_platform_data mxm_8x10_nand_info = {
392 .enable_arbiter = 1,
393 .keep_config = 1, 392 .keep_config = 1,
394 .num_cs = 1, 393 .parts = mxm_8x10_nand_partitions,
395 .parts[0] = mxm_8x10_nand_partitions, 394 .nr_parts = ARRAY_SIZE(mxm_8x10_nand_partitions)
396 .nr_parts[0] = ARRAY_SIZE(mxm_8x10_nand_partitions)
397}; 395};
398 396
399static void __init mxm_8x10_nand_init(void) 397static void __init mxm_8x10_nand_init(void)
diff --git a/arch/arm/mach-pxa/raumfeld.c b/arch/arm/mach-pxa/raumfeld.c
index 4d5d05cf87d6..8c95ae58312a 100644
--- a/arch/arm/mach-pxa/raumfeld.c
+++ b/arch/arm/mach-pxa/raumfeld.c
@@ -346,11 +346,9 @@ static struct mtd_partition raumfeld_nand_partitions[] = {
346}; 346};
347 347
348static struct pxa3xx_nand_platform_data raumfeld_nand_info = { 348static struct pxa3xx_nand_platform_data raumfeld_nand_info = {
349 .enable_arbiter = 1,
350 .keep_config = 1, 349 .keep_config = 1,
351 .num_cs = 1, 350 .parts = raumfeld_nand_partitions,
352 .parts[0] = raumfeld_nand_partitions, 351 .nr_parts = ARRAY_SIZE(raumfeld_nand_partitions),
353 .nr_parts[0] = ARRAY_SIZE(raumfeld_nand_partitions),
354}; 352};
355 353
356/** 354/**
diff --git a/arch/arm/mach-pxa/zylonite.c b/arch/arm/mach-pxa/zylonite.c
index 3a99fc054e96..d69de312d8d9 100644
--- a/arch/arm/mach-pxa/zylonite.c
+++ b/arch/arm/mach-pxa/zylonite.c
@@ -376,10 +376,8 @@ static struct mtd_partition zylonite_nand_partitions[] = {
376}; 376};
377 377
378static struct pxa3xx_nand_platform_data zylonite_nand_info = { 378static struct pxa3xx_nand_platform_data zylonite_nand_info = {
379 .enable_arbiter = 1, 379 .parts = zylonite_nand_partitions,
380 .num_cs = 1, 380 .nr_parts = ARRAY_SIZE(zylonite_nand_partitions),
381 .parts[0] = zylonite_nand_partitions,
382 .nr_parts[0] = ARRAY_SIZE(zylonite_nand_partitions),
383}; 381};
384 382
385static void __init zylonite_init_nand(void) 383static void __init zylonite_init_nand(void)
diff --git a/drivers/mtd/nand/marvell_nand.c b/drivers/mtd/nand/marvell_nand.c
index 2196f2a233d6..03805f9669da 100644
--- a/drivers/mtd/nand/marvell_nand.c
+++ b/drivers/mtd/nand/marvell_nand.c
@@ -2520,8 +2520,7 @@ static int marvell_nand_chip_init(struct device *dev, struct marvell_nfc *nfc,
2520 2520
2521 if (pdata) 2521 if (pdata)
2522 /* Legacy bindings support only one chip */ 2522 /* Legacy bindings support only one chip */
2523 ret = mtd_device_register(mtd, pdata->parts[0], 2523 ret = mtd_device_register(mtd, pdata->parts, pdata->nr_parts);
2524 pdata->nr_parts[0]);
2525 else 2524 else
2526 ret = mtd_device_register(mtd, NULL, 0); 2525 ret = mtd_device_register(mtd, NULL, 0);
2527 if (ret) { 2526 if (ret) {
diff --git a/include/linux/platform_data/mtd-nand-pxa3xx.h b/include/linux/platform_data/mtd-nand-pxa3xx.h
index b42ad83cbc20..4fd0f592a2d2 100644
--- a/include/linux/platform_data/mtd-nand-pxa3xx.h
+++ b/include/linux/platform_data/mtd-nand-pxa3xx.h
@@ -6,41 +6,22 @@
6#include <linux/mtd/partitions.h> 6#include <linux/mtd/partitions.h>
7 7
8/* 8/*
9 * Current pxa3xx_nand controller has two chip select which 9 * Current pxa3xx_nand controller has two chip select which both be workable but
10 * both be workable. 10 * historically all platforms remaining on platform data used only one. Switch
11 * 11 * to device tree if you need more.
12 * Notice should be taken that:
13 * When you want to use this feature, you should not enable the
14 * keep configuration feature, for two chip select could be
15 * attached with different nand chip. The different page size
16 * and timing requirement make the keep configuration impossible.
17 */ 12 */
18
19/* The max num of chip select current support */
20#define NUM_CHIP_SELECT (2)
21struct pxa3xx_nand_platform_data { 13struct pxa3xx_nand_platform_data {
22 14 /* Keep OBM/bootloader NFC timing configuration */
23 /* the data flash bus is shared between the Static Memory 15 bool keep_config;
24 * Controller and the Data Flash Controller, the arbiter 16 /* Use a flash-based bad block table */
25 * controls the ownership of the bus 17 bool flash_bbt;
26 */ 18 /* Requested ECC strength and ECC step size */
27 int enable_arbiter;
28
29 /* all