Re: [PATCH 12/16] mtd: rawnand: remove w90x900 driver

2019-08-26 Thread Miquel Raynal
On Fri, 2019-08-09 at 20:27:40 UTC, Arnd Bergmann wrote:
> The ARM w90x900 platform is getting removed, so this driver is obsolete.
> 
> Signed-off-by: Arnd Bergmann 
> Reviewed-by: Boris Brezillon 

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git 
nand/next, thanks.

Miquel


Re: [PATCH 12/16] mtd: rawnand: remove w90x900 driver

2019-08-10 Thread Boris Brezillon
On Fri,  9 Aug 2019 22:27:40 +0200
Arnd Bergmann  wrote:

> The ARM w90x900 platform is getting removed, so this driver is obsolete.
> 
> Signed-off-by: Arnd Bergmann 

One less driver to convert to ->exec_op(), Yay! 

Reviewed-by: Boris Brezillon 

> ---
>  drivers/mtd/nand/raw/Kconfig   |   8 -
>  drivers/mtd/nand/raw/Makefile  |   1 -
>  drivers/mtd/nand/raw/nuc900_nand.c | 304 -
>  3 files changed, 313 deletions(-)
>  delete mode 100644 drivers/mtd/nand/raw/nuc900_nand.c
> 
> diff --git a/drivers/mtd/nand/raw/Kconfig b/drivers/mtd/nand/raw/Kconfig
> index 5a711d8beaca..0e5c5e02ee6f 100644
> --- a/drivers/mtd/nand/raw/Kconfig
> +++ b/drivers/mtd/nand/raw/Kconfig
> @@ -351,14 +351,6 @@ config MTD_NAND_SOCRATES
>   help
> Enables support for NAND Flash chips wired onto Socrates board.
>  
> -config MTD_NAND_NUC900
> - tristate "Nuvoton NUC9xx/w90p910 NAND controller"
> - depends on ARCH_W90X900 || COMPILE_TEST
> - depends on HAS_IOMEM
> - help
> -   This enables the driver for the NAND Flash on evaluation board based
> -   on w90p910 / NUC9xx.
> -
>  source "drivers/mtd/nand/raw/ingenic/Kconfig"
>  
>  config MTD_NAND_FSMC
> diff --git a/drivers/mtd/nand/raw/Makefile b/drivers/mtd/nand/raw/Makefile
> index efaf5cd25edc..d7f6c237e37c 100644
> --- a/drivers/mtd/nand/raw/Makefile
> +++ b/drivers/mtd/nand/raw/Makefile
> @@ -41,7 +41,6 @@ obj-$(CONFIG_MTD_NAND_SH_FLCTL) += sh_flctl.o
>  obj-$(CONFIG_MTD_NAND_MXC)   += mxc_nand.o
>  obj-$(CONFIG_MTD_NAND_SOCRATES)  += socrates_nand.o
>  obj-$(CONFIG_MTD_NAND_TXX9NDFMC) += txx9ndfmc.o
> -obj-$(CONFIG_MTD_NAND_NUC900)+= nuc900_nand.o
>  obj-$(CONFIG_MTD_NAND_MPC5121_NFC)   += mpc5121_nfc.o
>  obj-$(CONFIG_MTD_NAND_VF610_NFC) += vf610_nfc.o
>  obj-$(CONFIG_MTD_NAND_RICOH) += r852.o
> diff --git a/drivers/mtd/nand/raw/nuc900_nand.c 
> b/drivers/mtd/nand/raw/nuc900_nand.c
> deleted file mode 100644
> index 13bf7b2894d3..
> --- a/drivers/mtd/nand/raw/nuc900_nand.c
> +++ /dev/null
> @@ -1,304 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0-only
> -/*
> - * Copyright © 2009 Nuvoton technology corporation.
> - *
> - * Wan ZongShun 
> - */
> -
> -#include 
> -#include 
> -#include 
> -#include 
> -#include 
> -#include 
> -#include 
> -#include 
> -
> -#include 
> -#include 
> -#include 
> -
> -#define REG_FMICSR   0x00
> -#define REG_SMCSR0xa0
> -#define REG_SMISR0xac
> -#define REG_SMCMD0xb0
> -#define REG_SMADDR   0xb4
> -#define REG_SMDATA   0xb8
> -
> -#define RESET_FMI0x01
> -#define NAND_EN  0x08
> -#define READYBUSY(0x01 << 18)
> -
> -#define SWRST0x01
> -#define PSIZE(0x01 << 3)
> -#define DMARWEN  (0x03 << 1)
> -#define BUSWID   (0x01 << 4)
> -#define ECC4EN   (0x01 << 5)
> -#define WP   (0x01 << 24)
> -#define NANDCS   (0x01 << 25)
> -#define ENDADDR  (0x01 << 31)
> -
> -#define read_data_reg(dev)   \
> - __raw_readl((dev)->reg + REG_SMDATA)
> -
> -#define write_data_reg(dev, val) \
> - __raw_writel((val), (dev)->reg + REG_SMDATA)
> -
> -#define write_cmd_reg(dev, val)  \
> - __raw_writel((val), (dev)->reg + REG_SMCMD)
> -
> -#define write_addr_reg(dev, val) \
> - __raw_writel((val), (dev)->reg + REG_SMADDR)
> -
> -struct nuc900_nand {
> - struct nand_chip chip;
> - void __iomem *reg;
> - struct clk *clk;
> - spinlock_t lock;
> -};
> -
> -static inline struct nuc900_nand *mtd_to_nuc900(struct mtd_info *mtd)
> -{
> - return container_of(mtd_to_nand(mtd), struct nuc900_nand, chip);
> -}
> -
> -static const struct mtd_partition partitions[] = {
> - {
> -  .name = "NAND FS 0",
> -  .offset = 0,
> -  .size = 8 * 1024 * 1024
> - },
> - {
> -  .name = "NAND FS 1",
> -  .offset = MTDPART_OFS_APPEND,
> -  .size = MTDPART_SIZ_FULL
> - }
> -};
> -
> -static unsigned char nuc900_nand_read_byte(struct nand_chip *chip)
> -{
> - unsigned char ret;
> - struct nuc900_nand *nand = mtd_to_nuc900(nand_to_mtd(chip));
> -
> - ret = (unsigned char)read_data_reg(nand);
> -
> - return ret;
> -}
> -
> -static void nuc900_nand_read_buf(struct nand_chip *chip,
> -  unsigned char *buf, int len)
> -{
> - int i;
> - struct nuc900_nand *nand = mtd_to_nuc900(nand_to_mtd(chip));
> -
> - for (i = 0; i < len; i++)
> - buf[i] = (unsigned char)read_data_reg(nand);
> -}
> -
> -static void nuc900_nand_write_buf(struct nand_chip *chip,
> -   const unsigned char *buf, int len)
> -{
> - int i;
> - struct nuc900_nand *nand = mtd_to_nuc900(nand_to_mtd(chip));
> -
> - for (i = 0; i < len; i++)
> - write_data_reg(nand, buf[i]);
> -}
> -
> -static int nuc900_check_rb

[PATCH 12/16] mtd: rawnand: remove w90x900 driver

2019-08-09 Thread Arnd Bergmann
The ARM w90x900 platform is getting removed, so this driver is obsolete.

Signed-off-by: Arnd Bergmann 
---
 drivers/mtd/nand/raw/Kconfig   |   8 -
 drivers/mtd/nand/raw/Makefile  |   1 -
 drivers/mtd/nand/raw/nuc900_nand.c | 304 -
 3 files changed, 313 deletions(-)
 delete mode 100644 drivers/mtd/nand/raw/nuc900_nand.c

diff --git a/drivers/mtd/nand/raw/Kconfig b/drivers/mtd/nand/raw/Kconfig
index 5a711d8beaca..0e5c5e02ee6f 100644
--- a/drivers/mtd/nand/raw/Kconfig
+++ b/drivers/mtd/nand/raw/Kconfig
@@ -351,14 +351,6 @@ config MTD_NAND_SOCRATES
help
  Enables support for NAND Flash chips wired onto Socrates board.
 
-config MTD_NAND_NUC900
-   tristate "Nuvoton NUC9xx/w90p910 NAND controller"
-   depends on ARCH_W90X900 || COMPILE_TEST
-   depends on HAS_IOMEM
-   help
- This enables the driver for the NAND Flash on evaluation board based
- on w90p910 / NUC9xx.
-
 source "drivers/mtd/nand/raw/ingenic/Kconfig"
 
 config MTD_NAND_FSMC
diff --git a/drivers/mtd/nand/raw/Makefile b/drivers/mtd/nand/raw/Makefile
index efaf5cd25edc..d7f6c237e37c 100644
--- a/drivers/mtd/nand/raw/Makefile
+++ b/drivers/mtd/nand/raw/Makefile
@@ -41,7 +41,6 @@ obj-$(CONFIG_MTD_NAND_SH_FLCTL)   += sh_flctl.o
 obj-$(CONFIG_MTD_NAND_MXC) += mxc_nand.o
 obj-$(CONFIG_MTD_NAND_SOCRATES)+= socrates_nand.o
 obj-$(CONFIG_MTD_NAND_TXX9NDFMC)   += txx9ndfmc.o
-obj-$(CONFIG_MTD_NAND_NUC900)  += nuc900_nand.o
 obj-$(CONFIG_MTD_NAND_MPC5121_NFC) += mpc5121_nfc.o
 obj-$(CONFIG_MTD_NAND_VF610_NFC)   += vf610_nfc.o
 obj-$(CONFIG_MTD_NAND_RICOH)   += r852.o
diff --git a/drivers/mtd/nand/raw/nuc900_nand.c 
b/drivers/mtd/nand/raw/nuc900_nand.c
deleted file mode 100644
index 13bf7b2894d3..
--- a/drivers/mtd/nand/raw/nuc900_nand.c
+++ /dev/null
@@ -1,304 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * Copyright © 2009 Nuvoton technology corporation.
- *
- * Wan ZongShun 
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include 
-#include 
-#include 
-
-#define REG_FMICSR 0x00
-#define REG_SMCSR  0xa0
-#define REG_SMISR  0xac
-#define REG_SMCMD  0xb0
-#define REG_SMADDR 0xb4
-#define REG_SMDATA 0xb8
-
-#define RESET_FMI  0x01
-#define NAND_EN0x08
-#define READYBUSY  (0x01 << 18)
-
-#define SWRST  0x01
-#define PSIZE  (0x01 << 3)
-#define DMARWEN(0x03 << 1)
-#define BUSWID (0x01 << 4)
-#define ECC4EN (0x01 << 5)
-#define WP (0x01 << 24)
-#define NANDCS (0x01 << 25)
-#define ENDADDR(0x01 << 31)
-
-#define read_data_reg(dev) \
-   __raw_readl((dev)->reg + REG_SMDATA)
-
-#define write_data_reg(dev, val)   \
-   __raw_writel((val), (dev)->reg + REG_SMDATA)
-
-#define write_cmd_reg(dev, val)\
-   __raw_writel((val), (dev)->reg + REG_SMCMD)
-
-#define write_addr_reg(dev, val)   \
-   __raw_writel((val), (dev)->reg + REG_SMADDR)
-
-struct nuc900_nand {
-   struct nand_chip chip;
-   void __iomem *reg;
-   struct clk *clk;
-   spinlock_t lock;
-};
-
-static inline struct nuc900_nand *mtd_to_nuc900(struct mtd_info *mtd)
-{
-   return container_of(mtd_to_nand(mtd), struct nuc900_nand, chip);
-}
-
-static const struct mtd_partition partitions[] = {
-   {
-.name = "NAND FS 0",
-.offset = 0,
-.size = 8 * 1024 * 1024
-   },
-   {
-.name = "NAND FS 1",
-.offset = MTDPART_OFS_APPEND,
-.size = MTDPART_SIZ_FULL
-   }
-};
-
-static unsigned char nuc900_nand_read_byte(struct nand_chip *chip)
-{
-   unsigned char ret;
-   struct nuc900_nand *nand = mtd_to_nuc900(nand_to_mtd(chip));
-
-   ret = (unsigned char)read_data_reg(nand);
-
-   return ret;
-}
-
-static void nuc900_nand_read_buf(struct nand_chip *chip,
-unsigned char *buf, int len)
-{
-   int i;
-   struct nuc900_nand *nand = mtd_to_nuc900(nand_to_mtd(chip));
-
-   for (i = 0; i < len; i++)
-   buf[i] = (unsigned char)read_data_reg(nand);
-}
-
-static void nuc900_nand_write_buf(struct nand_chip *chip,
- const unsigned char *buf, int len)
-{
-   int i;
-   struct nuc900_nand *nand = mtd_to_nuc900(nand_to_mtd(chip));
-
-   for (i = 0; i < len; i++)
-   write_data_reg(nand, buf[i]);
-}
-
-static int nuc900_check_rb(struct nuc900_nand *nand)
-{
-   unsigned int val;
-   spin_lock(&nand->lock);
-   val = __raw_readl(nand->reg + REG_SMISR);
-   val &= READYBUSY;
-   spin_unlock(&nand->lock);
-
-   return val;
-}
-
-static int nuc900_nand_devready(struct nand_chip *chip)
-{
-   struct nuc900_nand *nand = mtd_to_nuc900(nand_to_mtd(chip));
-   int ready;
-
-   ready = (nuc900_check_rb(