]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
mtd: nand: remove useless fields from pxa3xx NAND platform data
authorMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 19 Feb 2018 22:35:54 +0000 (23:35 +0100)
committerBoris Brezillon <boris.brezillon@bootlin.com>
Fri, 2 Mar 2018 20:51:41 +0000 (21:51 +0100)
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>
arch/arm/mach-mmp/aspenite.c
arch/arm/mach-mmp/ttc_dkb.c
arch/arm/mach-pxa/cm-x300.c
arch/arm/mach-pxa/colibri-pxa3xx.c
arch/arm/mach-pxa/littleton.c
arch/arm/mach-pxa/mxm8x10.c
arch/arm/mach-pxa/raumfeld.c
arch/arm/mach-pxa/zylonite.c
drivers/mtd/nand/marvell_nand.c
include/linux/platform_data/mtd-nand-pxa3xx.h

index d2283009a5ff1a0b09a9b200ecb2ed1d490ed1be..6c2ebf01893afeb9e5ab76a2e7a57026db684b4f 100644 (file)
@@ -172,10 +172,8 @@ static struct mtd_partition aspenite_nand_partitions[] = {
 };
 
 static struct pxa3xx_nand_platform_data aspenite_nand_info = {
-       .enable_arbiter = 1,
-       .num_cs = 1,
-       .parts[0]       = aspenite_nand_partitions,
-       .nr_parts[0]    = ARRAY_SIZE(aspenite_nand_partitions),
+       .parts          = aspenite_nand_partitions,
+       .nr_parts       = ARRAY_SIZE(aspenite_nand_partitions),
 };
 
 static struct i2c_board_info aspenite_i2c_info[] __initdata = {
index e0b6073c61a78339ce7e705b1bb19cb15070f94d..c7897fb2b6dadd82c20536ccc5147cee20431597 100644 (file)
@@ -179,10 +179,7 @@ static struct mv_usb_platform_data ttc_usb_pdata = {
 #endif
 
 #if IS_ENABLED(CONFIG_MTD_NAND_MARVELL)
-static struct pxa3xx_nand_platform_data dkb_nand_info = {
-       .enable_arbiter = 1,
-       .num_cs = 1,
-};
+static struct pxa3xx_nand_platform_data dkb_nand_info = {};
 #endif
 
 #if IS_ENABLED(CONFIG_MMP_DISP)
index de1f8c9950761a4e11f0d85bd7062ee47b492509..0e71799cab258a793393a92781b667aadefe1c6e 100644 (file)
@@ -429,11 +429,9 @@ static struct mtd_partition cm_x300_nand_partitions[] = {
 };
 
 static struct pxa3xx_nand_platform_data cm_x300_nand_info = {
-       .enable_arbiter = 1,
        .keep_config    = 1,
-       .num_cs         = 1,
-       .parts[0]       = cm_x300_nand_partitions,
-       .nr_parts[0]    = ARRAY_SIZE(cm_x300_nand_partitions),
+       .parts          = cm_x300_nand_partitions,
+       .nr_parts       = ARRAY_SIZE(cm_x300_nand_partitions),
 };
 
 static void __init cm_x300_init_nand(void)
index 3018eafd723ea72e246074336c12ed0825ca88c3..e31a591e949f3914bea2205fed5a7b9cde05539d 100644 (file)
@@ -138,11 +138,9 @@ static struct mtd_partition colibri_nand_partitions[] = {
 };
 
 static struct pxa3xx_nand_platform_data colibri_nand_info = {
-       .enable_arbiter = 1,
        .keep_config    = 1,
-       .num_cs         = 1,
-       .parts[0]       = colibri_nand_partitions,
-       .nr_parts[0]    = ARRAY_SIZE(colibri_nand_partitions),
+       .parts          = colibri_nand_partitions,
+       .nr_parts       = ARRAY_SIZE(colibri_nand_partitions),
 };
 
 void __init colibri_pxa3xx_init_nand(void)
index 193dccca1086f6a0570873da47dc47ba1b2cc191..9e132b3e48c68ef767ef7055b8d37cddc9d6453c 100644 (file)
@@ -329,10 +329,8 @@ static struct mtd_partition littleton_nand_partitions[] = {
 };
 
 static struct pxa3xx_nand_platform_data littleton_nand_info = {
-       .enable_arbiter = 1,
-       .num_cs         = 1,
-       .parts[0]       = littleton_nand_partitions,
-       .nr_parts[0]    = ARRAY_SIZE(littleton_nand_partitions),
+       .parts          = littleton_nand_partitions,
+       .nr_parts       = ARRAY_SIZE(littleton_nand_partitions),
 };
 
 static void __init littleton_init_nand(void)
index 5cc379c0626c252c9f907351318b1c3e1feb2a98..616b22397d7351a74e814f9e00f2d9853bc5839d 100644 (file)
@@ -389,11 +389,9 @@ static struct mtd_partition mxm_8x10_nand_partitions[] = {
 };
 
 static struct pxa3xx_nand_platform_data mxm_8x10_nand_info = {
-       .enable_arbiter = 1,
        .keep_config    = 1,
-       .num_cs         = 1,
-       .parts[0]       = mxm_8x10_nand_partitions,
-       .nr_parts[0]    = ARRAY_SIZE(mxm_8x10_nand_partitions)
+       .parts          = mxm_8x10_nand_partitions,
+       .nr_parts       = ARRAY_SIZE(mxm_8x10_nand_partitions)
 };
 
 static void __init mxm_8x10_nand_init(void)
index 4d5d05cf87d69b513b337632ed6c3127a5ead6cf..8c95ae58312abeaa68517cf5dd392a2d2fe5dfbf 100644 (file)
@@ -346,11 +346,9 @@ static struct mtd_partition raumfeld_nand_partitions[] = {
 };
 
 static struct pxa3xx_nand_platform_data raumfeld_nand_info = {
-       .enable_arbiter = 1,
        .keep_config    = 1,
-       .num_cs         = 1,
-       .parts[0]       = raumfeld_nand_partitions,
-       .nr_parts[0]    = ARRAY_SIZE(raumfeld_nand_partitions),
+       .parts          = raumfeld_nand_partitions,
+       .nr_parts       = ARRAY_SIZE(raumfeld_nand_partitions),
 };
 
 /**
index 3a99fc054e96e65d9f8a12b28f0e719e9c82cd8c..d69de312d8d91a432d5652428cdfc3808ff760e6 100644 (file)
@@ -376,10 +376,8 @@ static struct mtd_partition zylonite_nand_partitions[] = {
 };
 
 static struct pxa3xx_nand_platform_data zylonite_nand_info = {
-       .enable_arbiter = 1,
-       .num_cs         = 1,
-       .parts[0]       = zylonite_nand_partitions,
-       .nr_parts[0]    = ARRAY_SIZE(zylonite_nand_partitions),
+       .parts          = zylonite_nand_partitions,
+       .nr_parts       = ARRAY_SIZE(zylonite_nand_partitions),
 };
 
 static void __init zylonite_init_nand(void)
index 2196f2a233d6bc935d31fc3f794ea5f5aa76d621..03805f9669dac4bd23b0430dfa1f7177fbb92bed 100644 (file)
@@ -2520,8 +2520,7 @@ static int marvell_nand_chip_init(struct device *dev, struct marvell_nfc *nfc,
 
        if (pdata)
                /* Legacy bindings support only one chip */
-               ret = mtd_device_register(mtd, pdata->parts[0],
-                                         pdata->nr_parts[0]);
+               ret = mtd_device_register(mtd, pdata->parts, pdata->nr_parts);
        else
                ret = mtd_device_register(mtd, NULL, 0);
        if (ret) {
index b42ad83cbc20c4221ce0790ed6251c6b0ec06769..4fd0f592a2d26c65be6802ff05b25e04a4167490 100644 (file)
@@ -6,41 +6,22 @@
 #include <linux/mtd/partitions.h>
 
 /*
- * Current pxa3xx_nand controller has two chip select which
- * both be workable.
- *
- * Notice should be taken that:
- * When you want to use this feature, you should not enable the
- * keep configuration feature, for two chip select could be
- * attached with different nand chip. The different page size
- * and timing requirement make the keep configuration impossible.
+ * Current pxa3xx_nand controller has two chip select which both be workable but
+ * historically all platforms remaining on platform data used only one. Switch
+ * to device tree if you need more.
  */
-
-/* The max num of chip select current support */
-#define NUM_CHIP_SELECT                (2)
 struct pxa3xx_nand_platform_data {
-
-       /* the data flash bus is shared between the Static Memory
-        * Controller and the Data Flash Controller,  the arbiter
-        * controls the ownership of the bus
-        */
-       int     enable_arbiter;
-
-       /* allow platform code to keep OBM/bootloader defined NFC config */
-       int     keep_config;
-
-       /* indicate how many chip selects will be used */
-       int     num_cs;
-
-       /* use an flash-based bad block table */
-       bool    flash_bbt;
-
-       /* requested ECC strength and ECC step size */
+       /* Keep OBM/bootloader NFC timing configuration */
+       bool keep_config;
+       /* Use a flash-based bad block table */
+       bool flash_bbt;
+       /* Requested ECC strength and ECC step size */
        int ecc_strength, ecc_step_size;
-
-       const struct mtd_partition              *parts[NUM_CHIP_SELECT];
-       unsigned int                            nr_parts[NUM_CHIP_SELECT];
+       /* Partitions */
+       const struct mtd_partition *parts;
+       unsigned int nr_parts;
 };
 
 extern void pxa3xx_set_nand_info(struct pxa3xx_nand_platform_data *info);
+
 #endif /* __ASM_ARCH_PXA3XX_NAND_H */