]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mtd: rawnand: davinci: make platform_data private
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 14 Aug 2024 12:21:18 +0000 (14:21 +0200)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Fri, 23 Aug 2024 17:29:20 +0000 (19:29 +0200)
There are no longer any users of the platform data for davinci rawnand
in board files. We can remove the public pdata headers and move the
structures that are still used into the driver compilation unit while
removing the rest.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20240814122120.13975-1-brgl@bgdev.pl
drivers/mtd/nand/raw/davinci_nand.c
include/linux/platform_data/mtd-davinci-aemif.h [deleted file]
include/linux/platform_data/mtd-davinci.h [deleted file]

index 051deea768dbb7150ffa311e338d9822c145782a..392678143a36b20b42c1827eee8203dc2e41889a 100644 (file)
 #include <linux/slab.h>
 #include <linux/of.h>
 
-#include <linux/platform_data/mtd-davinci.h>
-#include <linux/platform_data/mtd-davinci-aemif.h>
+#define NRCSR_OFFSET           0x00
+#define NANDFCR_OFFSET         0x60
+#define NANDFSR_OFFSET         0x64
+#define NANDF1ECC_OFFSET       0x70
+
+/* 4-bit ECC syndrome registers */
+#define NAND_4BIT_ECC_LOAD_OFFSET      0xbc
+#define NAND_4BIT_ECC1_OFFSET          0xc0
+#define NAND_4BIT_ECC2_OFFSET          0xc4
+#define NAND_4BIT_ECC3_OFFSET          0xc8
+#define NAND_4BIT_ECC4_OFFSET          0xcc
+#define NAND_ERR_ADD1_OFFSET           0xd0
+#define NAND_ERR_ADD2_OFFSET           0xd4
+#define NAND_ERR_ERRVAL1_OFFSET                0xd8
+#define NAND_ERR_ERRVAL2_OFFSET                0xdc
+
+/* NOTE:  boards don't need to use these address bits
+ * for ALE/CLE unless they support booting from NAND.
+ * They're used unless platform data overrides them.
+ */
+#define        MASK_ALE                0x08
+#define        MASK_CLE                0x10
+
+struct davinci_nand_pdata {
+       uint32_t                mask_ale;
+       uint32_t                mask_cle;
+
+       /*
+        * 0-indexed chip-select number of the asynchronous
+        * interface to which the NAND device has been connected.
+        *
+        * So, if you have NAND connected to CS3 of DA850, you
+        * will pass '1' here. Since the asynchronous interface
+        * on DA850 starts from CS2.
+        */
+       uint32_t                core_chipsel;
+
+       /* for packages using two chipselects */
+       uint32_t                mask_chipsel;
+
+       /* board's default static partition info */
+       struct mtd_partition    *parts;
+       unsigned int            nr_parts;
+
+       /* none  == NAND_ECC_ENGINE_TYPE_NONE (strongly *not* advised!!)
+        * soft  == NAND_ECC_ENGINE_TYPE_SOFT
+        * else  == NAND_ECC_ENGINE_TYPE_ON_HOST, according to ecc_bits
+        *
+        * All DaVinci-family chips support 1-bit hardware ECC.
+        * Newer ones also support 4-bit ECC, but are awkward
+        * using it with large page chips.
+        */
+       enum nand_ecc_engine_type engine_type;
+       enum nand_ecc_placement ecc_placement;
+       u8                      ecc_bits;
+
+       /* e.g. NAND_BUSWIDTH_16 */
+       unsigned int            options;
+       /* e.g. NAND_BBT_USE_FLASH */
+       unsigned int            bbt_options;
+
+       /* Main and mirror bbt descriptor overrides */
+       struct nand_bbt_descr   *bbt_td;
+       struct nand_bbt_descr   *bbt_md;
+};
 
 /*
  * This is a device driver for the NAND flash controller found on the
@@ -54,8 +117,6 @@ struct davinci_nand_info {
        uint32_t                mask_cle;
 
        uint32_t                core_chipsel;
-
-       struct davinci_aemif_timing     *timing;
 };
 
 static DEFINE_SPINLOCK(davinci_nand_lock);
@@ -775,7 +836,6 @@ static int nand_davinci_probe(struct platform_device *pdev)
        info->chip.options      = pdata->options;
        info->chip.bbt_td       = pdata->bbt_td;
        info->chip.bbt_md       = pdata->bbt_md;
-       info->timing            = pdata->timing;
 
        info->current_cs        = info->vaddr;
        info->core_chipsel      = pdata->core_chipsel;
diff --git a/include/linux/platform_data/mtd-davinci-aemif.h b/include/linux/platform_data/mtd-davinci-aemif.h
deleted file mode 100644 (file)
index a498262..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * TI DaVinci AEMIF support
- *
- * Copyright 2010 (C) Texas Instruments, Inc. https://www.ti.com/
- *
- * This file is licensed under the terms of the GNU General Public License
- * version 2. This program is licensed "as is" without any warranty of any
- * kind, whether express or implied.
- */
-#ifndef _MACH_DAVINCI_AEMIF_H
-#define _MACH_DAVINCI_AEMIF_H
-
-#include <linux/platform_device.h>
-
-#define NRCSR_OFFSET           0x00
-#define AWCCR_OFFSET           0x04
-#define A1CR_OFFSET            0x10
-
-#define ACR_ASIZE_MASK         0x3
-#define ACR_EW_MASK            BIT(30)
-#define ACR_SS_MASK            BIT(31)
-
-/* All timings in nanoseconds */
-struct davinci_aemif_timing {
-       u8      wsetup;
-       u8      wstrobe;
-       u8      whold;
-
-       u8      rsetup;
-       u8      rstrobe;
-       u8      rhold;
-
-       u8      ta;
-};
-
-#endif
diff --git a/include/linux/platform_data/mtd-davinci.h b/include/linux/platform_data/mtd-davinci.h
deleted file mode 100644 (file)
index dd474dd..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/*
- * mach-davinci/nand.h
- *
- * Copyright © 2006 Texas Instruments.
- *
- * Ported to 2.6.23 Copyright © 2008 by
- *   Sander Huijsen <Shuijsen@optelecom-nkf.com>
- *   Troy Kisky <troy.kisky@boundarydevices.com>
- *   Dirk Behme <Dirk.Behme@gmail.com>
- *
- * --------------------------------------------------------------------------
- */
-
-#ifndef __ARCH_ARM_DAVINCI_NAND_H
-#define __ARCH_ARM_DAVINCI_NAND_H
-
-#include <linux/mtd/rawnand.h>
-
-#define NANDFCR_OFFSET         0x60
-#define NANDFSR_OFFSET         0x64
-#define NANDF1ECC_OFFSET       0x70
-
-/* 4-bit ECC syndrome registers */
-#define NAND_4BIT_ECC_LOAD_OFFSET      0xbc
-#define NAND_4BIT_ECC1_OFFSET          0xc0
-#define NAND_4BIT_ECC2_OFFSET          0xc4
-#define NAND_4BIT_ECC3_OFFSET          0xc8
-#define NAND_4BIT_ECC4_OFFSET          0xcc
-#define NAND_ERR_ADD1_OFFSET           0xd0
-#define NAND_ERR_ADD2_OFFSET           0xd4
-#define NAND_ERR_ERRVAL1_OFFSET                0xd8
-#define NAND_ERR_ERRVAL2_OFFSET                0xdc
-
-/* NOTE:  boards don't need to use these address bits
- * for ALE/CLE unless they support booting from NAND.
- * They're used unless platform data overrides them.
- */
-#define        MASK_ALE                0x08
-#define        MASK_CLE                0x10
-
-struct davinci_nand_pdata {            /* platform_data */
-       uint32_t                mask_ale;
-       uint32_t                mask_cle;
-
-       /*
-        * 0-indexed chip-select number of the asynchronous
-        * interface to which the NAND device has been connected.
-        *
-        * So, if you have NAND connected to CS3 of DA850, you
-        * will pass '1' here. Since the asynchronous interface
-        * on DA850 starts from CS2.
-        */
-       uint32_t                core_chipsel;
-
-       /* for packages using two chipselects */
-       uint32_t                mask_chipsel;
-
-       /* board's default static partition info */
-       struct mtd_partition    *parts;
-       unsigned                nr_parts;
-
-       /* none  == NAND_ECC_ENGINE_TYPE_NONE (strongly *not* advised!!)
-        * soft  == NAND_ECC_ENGINE_TYPE_SOFT
-        * else  == NAND_ECC_ENGINE_TYPE_ON_HOST, according to ecc_bits
-        *
-        * All DaVinci-family chips support 1-bit hardware ECC.
-        * Newer ones also support 4-bit ECC, but are awkward
-        * using it with large page chips.
-        */
-       enum nand_ecc_engine_type engine_type;
-       enum nand_ecc_placement ecc_placement;
-       u8                      ecc_bits;
-
-       /* e.g. NAND_BUSWIDTH_16 */
-       unsigned                options;
-       /* e.g. NAND_BBT_USE_FLASH */
-       unsigned                bbt_options;
-
-       /* Main and mirror bbt descriptor overrides */
-       struct nand_bbt_descr   *bbt_td;
-       struct nand_bbt_descr   *bbt_md;
-
-       /* Access timings */
-       struct davinci_aemif_timing     *timing;
-};
-
-#endif /* __ARCH_ARM_DAVINCI_NAND_H */