mtd: rawnand: API cleanup (2nd batch)
Subsystems (27)
cover mtd: rawnand: API cleanup (2nd batch)
Hello,
This is the 2nd batch of API cleanup patches. This time we move deprecated hooks/fields to the nand_legacy struct, and then move some of the code found in nand_base.c into separate source/header files.
With this new organization, new comers should more easily identify the bits they can use in their NAND controller drivers and those that are only meant for core code. It also shrink a bit nand_base.c which was over 6000 lines of code.
Note that existing coding style issues (reported by checkpatch) in arch or driver code are intentionally not fixed to keep the series focused on the API/core cleanup.
Regards,
Boris
Boris Brezillon (19):
mtd: rawnand: Leave chip->IO_ADDR_{R,W} to NULL when unused
mtd: rawnand: Create a legacy struct and move ->IO_ADDR_{R,W} there
mtd: rawnand: Deprecate ->{read,write}_{byte,buf}() hooks
mtd: rawnand: Deprecate ->cmd_ctrl() and ->cmdfunc()
mtd: rawnand: Deprecate ->dev_ready() and ->waitfunc()
mtd: rawnand: Deprecate ->block_{bad,markbad}() hooks
mtd: rawnand: Deprecate ->erase()
mtd: rawnand: Deprecate ->{set,get}_features() hooks
mtd: rawnand: Deprecate ->chip_delay
mtd: rawnand: Move function prototypes after struct declarations
mtd: rawnand: Get rid of nand_flash_dev forward declation
mtd: rawnand: Get rid of the duplicate nand_chip forward declaration
mtd: rawnand: Get rid of a few unused definitions
mtd: rawnand: Move platform_nand_xxx definitions out of rawnand.h
mtd: rawnand: Inline onfi_get_async_timing_mode()
mtd: rawnand: Keep all internal stuff private
mtd: rawnand: Move legacy code to nand_legacy.c
mtd: rawnand: Move ONFI code to nand_onfi.c
mtd: rawnand: Move JEDEC code to nand_jedec.c
Documentation/driver-api/mtdnand.rst | 30 +- arch/arm/mach-ep93xx/snappercl15.c | 8 +- arch/arm/mach-ep93xx/ts72xx.c | 9 +- arch/arm/mach-imx/mach-qong.c | 6 +- arch/arm/mach-ixp4xx/ixdp425-setup.c | 2 +- arch/arm/mach-omap1/board-fsample.c | 3 +- arch/arm/mach-omap1/board-h2.c | 3 +- arch/arm/mach-omap1/board-h3.c | 2 +- arch/arm/mach-omap1/board-nand.c | 2 +- arch/arm/mach-omap1/board-perseus2.c | 3 +- arch/arm/mach-orion5x/ts78xx-setup.c | 9 +- arch/arm/mach-pxa/balloon3.c | 5 +- arch/arm/mach-pxa/em-x270.c | 9 +- arch/arm/mach-pxa/palmtx.c | 5 +- arch/mips/alchemy/devboards/db1200.c | 9 +- arch/mips/alchemy/devboards/db1300.c | 9 +- arch/mips/alchemy/devboards/db1550.c | 9 +- arch/mips/netlogic/xlr/platform-flash.c | 3 +- arch/mips/pnx833x/common/platform.c | 5 +- arch/mips/rb532/devices.c | 5 +- arch/sh/boards/mach-migor/setup.c | 8 +- drivers/mtd/nand/raw/Makefile | 4 +- drivers/mtd/nand/raw/ams-delta.c | 22 +- drivers/mtd/nand/raw/atmel/nand-controller.c | 22 +- drivers/mtd/nand/raw/au1550nd.c | 43 +- drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c | 22 +- drivers/mtd/nand/raw/brcmnand/brcmnand.c | 15 +- drivers/mtd/nand/raw/cafe_nand.c | 22 +- drivers/mtd/nand/raw/cmx270_nand.c | 28 +- drivers/mtd/nand/raw/cs553x_nand.c | 42 +- drivers/mtd/nand/raw/davinci_nand.c | 34 +- drivers/mtd/nand/raw/denali.c | 23 +- drivers/mtd/nand/raw/diskonchip.c | 50 +- drivers/mtd/nand/raw/fsl_elbc_nand.c | 18 +- drivers/mtd/nand/raw/fsl_ifc_nand.c | 24 +- drivers/mtd/nand/raw/fsl_upm.c | 30 +- drivers/mtd/nand/raw/fsmc_nand.c | 1 - drivers/mtd/nand/raw/gpio.c | 16 +- drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 22 +- drivers/mtd/nand/raw/hisi504_nand.c | 18 +- drivers/mtd/nand/raw/internals.h | 114 ++ drivers/mtd/nand/raw/jz4740_nand.c | 14 +- drivers/mtd/nand/raw/jz4780_nand.c | 10 +- drivers/mtd/nand/raw/lpc32xx_mlc.c | 12 +- drivers/mtd/nand/raw/lpc32xx_slc.c | 26 +- drivers/mtd/nand/raw/mpc5121_nfc.c | 14 +- drivers/mtd/nand/raw/mtk_nand.c | 12 +- drivers/mtd/nand/raw/mxc_nand.c | 20 +- drivers/mtd/nand/raw/nand_amd.c | 2 +- drivers/mtd/nand/raw/nand_base.c | 1260 +++------------------- drivers/mtd/nand/raw/nand_bbt.c | 5 +- drivers/mtd/nand/raw/nand_hynix.c | 9 +- drivers/mtd/nand/raw/nand_ids.c | 4 +- drivers/mtd/nand/raw/nand_jedec.c | 113 ++ drivers/mtd/nand/raw/nand_legacy.c | 642 +++++++++++ drivers/mtd/nand/raw/nand_macronix.c | 2 +- drivers/mtd/nand/raw/nand_micron.c | 3 +- drivers/mtd/nand/raw/nand_onfi.c | 305 ++++++ drivers/mtd/nand/raw/nand_samsung.c | 2 +- drivers/mtd/nand/raw/nand_timings.c | 18 +- drivers/mtd/nand/raw/nand_toshiba.c | 2 +- drivers/mtd/nand/raw/nandsim.c | 14 +- drivers/mtd/nand/raw/ndfc.c | 14 +- drivers/mtd/nand/raw/nuc900_nand.c | 22 +- drivers/mtd/nand/raw/omap2.c | 62 +- drivers/mtd/nand/raw/orion_nand.c | 12 +- drivers/mtd/nand/raw/oxnas_nand.c | 10 +- drivers/mtd/nand/raw/pasemi_nand.c | 32 +- drivers/mtd/nand/raw/plat_nand.c | 17 +- drivers/mtd/nand/raw/qcom_nandc.c | 39 +- drivers/mtd/nand/raw/r852.c | 14 +- drivers/mtd/nand/raw/s3c2410.c | 34 +- drivers/mtd/nand/raw/sh_flctl.c | 18 +- drivers/mtd/nand/raw/sharpsl.c | 12 +- drivers/mtd/nand/raw/sm_common.c | 2 +- drivers/mtd/nand/raw/socrates_nand.c | 16 +- drivers/mtd/nand/raw/sunxi_nand.c | 14 +- drivers/mtd/nand/raw/tango_nand.c | 12 +- drivers/mtd/nand/raw/tmio_nand.c | 20 +- drivers/mtd/nand/raw/txx9ndfmc.c | 12 +- drivers/mtd/nand/raw/xway_nand.c | 12 +- drivers/staging/mt29f_spinand/mt29f_spinand.c | 16 +- include/linux/mtd/jedec.h | 91 ++ include/linux/mtd/onfi.h | 178 +++ include/linux/mtd/platnand.h | 74 ++ include/linux/mtd/rawnand.h | 555 ++-------- 86 files changed, 2300 insertions(+), 2191 deletions(-) create mode 100644 drivers/mtd/nand/raw/internals.h create mode 100644 drivers/mtd/nand/raw/nand_jedec.c create mode 100644 drivers/mtd/nand/raw/nand_legacy.c create mode 100644 drivers/mtd/nand/raw/nand_onfi.c create mode 100644 include/linux/mtd/jedec.h create mode 100644 include/linux/mtd/onfi.h create mode 100644 include/linux/mtd/platnand.h
Signature · 1 line
2.14.1
PATCH 1/19 mtd: rawnand: Leave chip->IO_ADDR_{R,W} to NULL when unused
There's no point in poisoning the ->IO_ADDR_{R,W}, a NULL pointer is just as good to detect unexpected ->IO_ADDR_{R,W} usage.
--- drivers/mtd/nand/raw/brcmnand/brcmnand.c | 3 --- drivers/mtd/nand/raw/socrates_nand.c | 4 ---- 2 files changed, 7 deletions(-)
drivers/mtd/nand/raw/brcmnand/brcmnand.c +0 -3
@@ -2270,9 +2270,6 @@ static int brcmnand_init_cs(struct brcmnand_host *host, struct device_node *dn) mtd->owner =THIS_MODULE ; mtd->dev.parent = &pdev->dev; - chip->IO_ADDR_R = (void __iomem *)0xdeadbeef ; - chip->IO_ADDR_W = (void __iomem *)0xdeadbeef ; - chip->cmd_ctrl = brcmnand_cmd_ctrl; chip->cmdfunc = brcmnand_cmdfunc; chip->waitfunc = brcmnand_waitfunc;
drivers/mtd/nand/raw/socrates_nand.c +0 -4
@@ -152,10 +152,6 @@ static int socrates_nand_probe(struct platform_device *ofdev) mtd->name ="socrates_nand" ; mtd->dev.parent = &ofdev->dev; -/*should never be accessed directly */ - nand_chip->IO_ADDR_R = (void *)0xdeadbeef ; - nand_chip->IO_ADDR_W = (void *)0xdeadbeef ; - nand_chip->cmd_ctrl = socrates_nand_cmd_ctrl; nand_chip->read_byte = socrates_nand_read_byte; nand_chip->write_buf = socrates_nand_write_buf;
Signature · 1 line
2.14.1
PATCH 2/19 mtd: rawnand: Create a legacy struct and move ->IO_ADDR_{R,W} there
In reply to Boris BrezillonWe regularly have new NAND controller drivers that are making use of fields/hooks that we want to get rid of but can't because of all the legacy drivers that we might break if we do.
So, instead of removing those fields/hooks, let's move them to a sub-struct which is clearly documented as deprecated.
We start with the ->IO_ADDR_{R,W] fields.
--- Documentation/driver-api/mtdnand.rst | 24 ++++++++++++------------ arch/arm/mach-ep93xx/snappercl15.c | 5 +++-- arch/arm/mach-ep93xx/ts72xx.c | 6 +++--- arch/arm/mach-imx/mach-qong.c | 4 ++-- arch/arm/mach-ixp4xx/ixdp425-setup.c | 2 +- arch/arm/mach-omap1/board-nand.c | 2 +- arch/arm/mach-orion5x/ts78xx-setup.c | 6 +++--- arch/arm/mach-pxa/balloon3.c | 2 +- arch/arm/mach-pxa/em-x270.c | 6 +++--- arch/arm/mach-pxa/palmtx.c | 2 +- arch/mips/alchemy/devboards/db1200.c | 6 +++--- arch/mips/alchemy/devboards/db1300.c | 6 +++--- arch/mips/alchemy/devboards/db1550.c | 6 +++--- arch/mips/pnx833x/common/platform.c | 2 +- arch/mips/rb532/devices.c | 2 +- arch/sh/boards/mach-migor/setup.c | 6 +++--- drivers/mtd/nand/raw/ams-delta.c | 8 ++++---- drivers/mtd/nand/raw/au1550nd.c | 26 +++++++++++++------------- drivers/mtd/nand/raw/cmx270_nand.c | 16 ++++++++-------- drivers/mtd/nand/raw/cs553x_nand.c | 30 +++++++++++++++--------------- drivers/mtd/nand/raw/davinci_nand.c | 24 ++++++++++++------------ drivers/mtd/nand/raw/fsl_upm.c | 16 ++++++++-------- drivers/mtd/nand/raw/gpio.c | 10 +++++----- drivers/mtd/nand/raw/jz4740_nand.c | 8 ++++---- drivers/mtd/nand/raw/jz4780_nand.c | 4 ++-- drivers/mtd/nand/raw/lpc32xx_mlc.c | 4 ++-- drivers/mtd/nand/raw/lpc32xx_slc.c | 4 ++-- drivers/mtd/nand/raw/nand_base.c | 12 ++++++------ drivers/mtd/nand/raw/ndfc.c | 4 ++-- drivers/mtd/nand/raw/omap2.c | 30 +++++++++++++++--------------- drivers/mtd/nand/raw/orion_nand.c | 6 +++--- drivers/mtd/nand/raw/pasemi_nand.c | 22 +++++++++++----------- drivers/mtd/nand/raw/plat_nand.c | 4 ++-- drivers/mtd/nand/raw/s3c2410.c | 12 ++++++------ drivers/mtd/nand/raw/sharpsl.c | 6 +++--- drivers/mtd/nand/raw/tmio_nand.c | 6 +++--- include/linux/mtd/rawnand.h | 26 ++++++++++++++++++++------ 37 files changed, 190 insertions(+), 175 deletions(-)
Documentation/driver-api/mtdnand.rst +12 -12
@@ -180,10 +180,10 @@ by a chip select decoder. { struct nand_chip *this = mtd_to_nand(mtd); switch(cmd){ - case NAND_CTL_SETCLE: this->IO_ADDR_W |= CLE_ADRR_BIT; break; - case NAND_CTL_CLRCLE: this->IO_ADDR_W &= ~CLE_ADRR_BIT; break; - case NAND_CTL_SETALE: this->IO_ADDR_W |= ALE_ADRR_BIT; break; - case NAND_CTL_CLRALE: this->IO_ADDR_W &= ~ALE_ADRR_BIT; break; + case NAND_CTL_SETCLE: this->legacy.IO_ADDR_W |= CLE_ADRR_BIT; break; + case NAND_CTL_CLRCLE: this->legacy.IO_ADDR_W &= ~CLE_ADRR_BIT; break; + case NAND_CTL_SETALE: this->legacy.IO_ADDR_W |= ALE_ADRR_BIT; break; + case NAND_CTL_CLRALE: this->legacy.IO_ADDR_W &= ~ALE_ADRR_BIT; break; } }
@@ -235,8 +235,8 @@ necessary information about the device. } /* Set address of NAND IO lines */ - this->IO_ADDR_R = baseaddr; - this->IO_ADDR_W = baseaddr; + this->legacy.IO_ADDR_R = baseaddr; + this->legacy.IO_ADDR_W = baseaddr; /* Reference hardware control function */ this->hwcontrol = board_hwcontrol; /* Set command delay time, see datasheet for correct value */
@@ -336,17 +336,17 @@ connected to an address decoder. struct nand_chip *this = mtd_to_nand(mtd); /* Deselect all chips */ - this->IO_ADDR_R &= ~BOARD_NAND_ADDR_MASK; - this->IO_ADDR_W &= ~BOARD_NAND_ADDR_MASK; + this->legacy.IO_ADDR_R &= ~BOARD_NAND_ADDR_MASK; + this->legacy.IO_ADDR_W &= ~BOARD_NAND_ADDR_MASK; switch (chip) { case 0: - this->IO_ADDR_R |= BOARD_NAND_ADDR_CHIP0; - this->IO_ADDR_W |= BOARD_NAND_ADDR_CHIP0; + this->legacy.IO_ADDR_R |= BOARD_NAND_ADDR_CHIP0; + this->legacy.IO_ADDR_W |= BOARD_NAND_ADDR_CHIP0; break; .... case n: - this->IO_ADDR_R |= BOARD_NAND_ADDR_CHIPn; - this->IO_ADDR_W |= BOARD_NAND_ADDR_CHIPn; + this->legacy.IO_ADDR_R |= BOARD_NAND_ADDR_CHIPn; + this->legacy.IO_ADDR_W |= BOARD_NAND_ADDR_CHIPn; break; } }
arch/arm/mach-ep93xx/snappercl15.c +3 -2
@@ -43,7 +43,7 @@#define SNAPPERCL15_NAND_CEN (1 << 11)/* Chip enable (active low) */ #define SNAPPERCL15_NAND_RDY (1 << 14)/* Device ready */ -#define NAND_CTRL_ADDR (chip) (chip->IO_ADDR_W + 0x40) +#define NAND_CTRL_ADDR (chip) (chip->legacy.IO_ADDR_W + 0x40)static void snappercl15_nand_cmd_ctrl (struct nand_chip *chip,int cmd,unsigned int ctrl)
@@ -69,7 +69,8 @@ static void snappercl15_nand_cmd_ctrl(struct nand_chip *chip, int cmd, }if (cmd !=NAND_CMD_NONE ) -__raw_writew ((cmd &0xff ) | nand_state, chip->IO_ADDR_W); +__raw_writew ((cmd &0xff ) | nand_state, + chip->legacy.IO_ADDR_W); }static int snappercl15_nand_dev_ready (struct nand_chip *chip)
arch/arm/mach-ep93xx/ts72xx.c +3 -3
@@ -80,7 +80,7 @@ static void ts72xx_nand_hwcontrol(struct nand_chip *chip, int cmd, unsigned int ctrl) {if (ctrl &NAND_CTRL_CHANGE ) { -void __iomem *addr = chip->IO_ADDR_R; +void __iomem *addr = chip->legacy.IO_ADDR_R;unsigned char bits; addr += (1 <<TS72XX_NAND_CONTROL_ADDR_LINE );
@@ -94,12 +94,12 @@ static void ts72xx_nand_hwcontrol(struct nand_chip *chip, }if (cmd !=NAND_CMD_NONE ) -__raw_writeb (cmd, chip->IO_ADDR_W); +__raw_writeb (cmd, chip->legacy.IO_ADDR_W); }static int ts72xx_nand_device_ready (struct nand_chip *chip) { -void __iomem *addr = chip->IO_ADDR_R; +void __iomem *addr = chip->legacy.IO_ADDR_R; addr += (1 <<TS72XX_NAND_BUSY_ADDR_LINE );
arch/arm/mach-imx/mach-qong.c +2 -2
@@ -136,9 +136,9 @@ static void qong_nand_cmd_ctrl(struct nand_chip *nand_chip, int cmd,return ;if (ctrl &NAND_CLE ) -writeb (cmd, nand_chip->IO_ADDR_W + (1 <<24 )); +writeb (cmd, nand_chip->legacy.IO_ADDR_W + (1 <<24 ));else -writeb (cmd, nand_chip->IO_ADDR_W + (1 <<23 )); +writeb (cmd, nand_chip->legacy.IO_ADDR_W + (1 <<23 )); }/*
arch/arm/mach-ixp4xx/ixdp425-setup.c +1 -1
@@ -92,7 +92,7 @@ ixdp425_flash_nand_cmd_ctrl(struct nand_chip *this, int cmd, unsigned int ctrl) }if (cmd !=NAND_CMD_NONE ) -writeb (cmd, this->IO_ADDR_W + offset); +writeb (cmd, this->legacy.IO_ADDR_W + offset); }static struct platform_nand_data ixdp425_flash_nand_data = {
arch/arm/mach-omap1/board-nand.c +1 -1
@@ -31,6 +31,6 @@ void omap1_nand_cmd_ctl(struct nand_chip *this, int cmd, unsigned int ctrl)if (ctrl &NAND_ALE ) mask |=0x04 ; -writeb (cmd, this->IO_ADDR_W + mask); +writeb (cmd, this->legacy.IO_ADDR_W + mask); }
arch/arm/mach-orion5x/ts78xx-setup.c +3 -3
@@ -145,7 +145,7 @@ static void ts78xx_ts_nand_cmd_ctrl(struct nand_chip *this, int cmd, }if (cmd !=NAND_CMD_NONE ) -writeb (cmd, this->IO_ADDR_W); +writeb (cmd, this->legacy.IO_ADDR_W); }static int ts78xx_ts_nand_dev_ready (struct nand_chip *chip)
@@ -156,7 +156,7 @@ static int ts78xx_ts_nand_dev_ready(struct nand_chip *chip)static void ts78xx_ts_nand_write_buf (struct nand_chip *chip,const uint8_t *buf,int len) { -void __iomem *io_base = chip->IO_ADDR_W; +void __iomem *io_base = chip->legacy.IO_ADDR_W;unsigned long off = ((unsigned long )buf &3 );int sz;
@@ -182,7 +182,7 @@ static void ts78xx_ts_nand_write_buf(struct nand_chip *chip,static void ts78xx_ts_nand_read_buf (struct nand_chip *chip,uint8_t *buf,int len) { -void __iomem *io_base = chip->IO_ADDR_R; +void __iomem *io_base = chip->legacy.IO_ADDR_R;unsigned long off = ((unsigned long )buf &3 );int sz;
arch/arm/mach-pxa/balloon3.c +1 -1
@@ -597,7 +597,7 @@ static void balloon3_nand_cmd_ctl(struct nand_chip *this, int cmd, }if (cmd !=NAND_CMD_NONE ) -writeb (cmd, this->IO_ADDR_W); +writeb (cmd, this->legacy.IO_ADDR_W); }static void balloon3_nand_select_chip (struct nand_chip *this,int chip)
arch/arm/mach-pxa/em-x270.c +3 -3
@@ -288,7 +288,7 @@ static void nand_cs_off(void)static void em_x270_nand_cmd_ctl (struct nand_chip *this,int dat,unsigned int ctrl) { -unsigned long nandaddr = (unsigned long )this->IO_ADDR_W; +unsigned long nandaddr = (unsigned long )this->legacy.IO_ADDR_W;dsb ();
@@ -308,9 +308,9 @@ static void em_x270_nand_cmd_ctl(struct nand_chip *this, int dat, }dsb (); - this->IO_ADDR_W = (void __iomem *)nandaddr; + this->legacy.IO_ADDR_W = (void __iomem *)nandaddr;if (dat !=NAND_CMD_NONE ) -writel (dat, this->IO_ADDR_W); +writel (dat, this->legacy.IO_ADDR_W);dsb (); }
arch/arm/mach-pxa/palmtx.c +1 -1
@@ -250,7 +250,7 @@ static inline void palmtx_keys_init(void) {}static void palmtx_nand_cmd_ctl (struct nand_chip *this,int cmd,unsigned int ctrl) { -char __iomem *nandaddr = this->IO_ADDR_W; +char __iomem *nandaddr = this->legacy.IO_ADDR_W;if (cmd ==NAND_CMD_NONE )return ;
arch/mips/alchemy/devboards/db1200.c +3 -3
@@ -200,7 +200,7 @@ static struct i2c_board_info db1200_i2c_devs[] __initdata = {static void au1200_nand_cmd_ctrl (struct nand_chip *this,int cmd,unsigned int ctrl) { -unsigned long ioaddr = (unsigned long )this->IO_ADDR_W; +unsigned long ioaddr = (unsigned long )this->legacy.IO_ADDR_W; ioaddr &=0xffffff00 ;
@@ -212,9 +212,9 @@ static void au1200_nand_cmd_ctrl(struct nand_chip *this, int cmd,/* assume we want to r/w real data by default */ ioaddr +=MEM_STNAND_DATA ; } - this->IO_ADDR_R = this->IO_ADDR_W = (void __iomem *)ioaddr; + this->legacy.IO_ADDR_R = this->legacy.IO_ADDR_W = (void __iomem *)ioaddr;if (cmd !=NAND_CMD_NONE ) { -__raw_writeb (cmd, this->IO_ADDR_W); +__raw_writeb (cmd, this->legacy.IO_ADDR_W);wmb (); } }
arch/mips/alchemy/devboards/db1300.c +3 -3
@@ -152,7 +152,7 @@ static void __init db1300_gpio_config(void)static void au1300_nand_cmd_ctrl (struct nand_chip *this,int cmd,unsigned int ctrl) { -unsigned long ioaddr = (unsigned long )this->IO_ADDR_W; +unsigned long ioaddr = (unsigned long )this->legacy.IO_ADDR_W; ioaddr &=0xffffff00 ;
@@ -164,9 +164,9 @@ static void au1300_nand_cmd_ctrl(struct nand_chip *this, int cmd,/* assume we want to r/w real data by default */ ioaddr +=MEM_STNAND_DATA ; } - this->IO_ADDR_R = this->IO_ADDR_W = (void __iomem *)ioaddr; + this->legacy.IO_ADDR_R = this->legacy.IO_ADDR_W = (void __iomem *)ioaddr;if (cmd !=NAND_CMD_NONE ) { -__raw_writeb (cmd, this->IO_ADDR_W); +__raw_writeb (cmd, this->legacy.IO_ADDR_W);wmb (); } }
arch/mips/alchemy/devboards/db1550.c +3 -3
@@ -129,7 +129,7 @@ static struct i2c_board_info db1550_i2c_devs[] __initdata = {static void au1550_nand_cmd_ctrl (struct nand_chip *this,int cmd,unsigned int ctrl) { -unsigned long ioaddr = (unsigned long )this->IO_ADDR_W; +unsigned long ioaddr = (unsigned long )this->legacy.IO_ADDR_W; ioaddr &=0xffffff00 ;
@@ -141,9 +141,9 @@ static void au1550_nand_cmd_ctrl(struct nand_chip *this, int cmd,/* assume we want to r/w real data by default */ ioaddr +=MEM_STNAND_DATA ; } - this->IO_ADDR_R = this->IO_ADDR_W = (void __iomem *)ioaddr; + this->legacy.IO_ADDR_R = this->legacy.IO_ADDR_W = (void __iomem *)ioaddr;if (cmd !=NAND_CMD_NONE ) { -__raw_writeb (cmd, this->IO_ADDR_W); +__raw_writeb (cmd, this->legacy.IO_ADDR_W);wmb (); } }
arch/mips/pnx833x/common/platform.c +1 -1
@@ -180,7 +180,7 @@ static struct platform_device pnx833x_sata_device = {static void pnx833x_flash_nand_cmd_ctrl (struct nand_chip *this,int cmd,unsigned int ctrl) { -unsigned long nandaddr = (unsigned long )this->IO_ADDR_W; +unsigned long nandaddr = (unsigned long )this->legacy.IO_ADDR_W;if (cmd ==NAND_CMD_NONE )return ;
arch/mips/rb532/devices.c +1 -1
@@ -160,7 +160,7 @@ static void rb532_cmd_ctrl(struct nand_chip *chip, int cmd, unsigned int ctrl)set_latch_u5 (orbits, nandbits); }if (cmd !=NAND_CMD_NONE ) -writeb (cmd, chip->IO_ADDR_W); +writeb (cmd, chip->legacy.IO_ADDR_W); }static struct resource nand_slot0_res[] = {
arch/sh/boards/mach-migor/setup.c +3 -3
@@ -172,11 +172,11 @@ static void migor_nand_flash_cmd_ctl(struct nand_chip *chip, int cmd,return ;if (ctrl &NAND_CLE ) -writeb (cmd, chip->IO_ADDR_W +0x00400000 ); +writeb (cmd, chip->legacy.IO_ADDR_W +0x00400000 );else if (ctrl &NAND_ALE ) -writeb (cmd, chip->IO_ADDR_W +0x00800000 ); +writeb (cmd, chip->legacy.IO_ADDR_W +0x00800000 );else -writeb (cmd, chip->IO_ADDR_W); +writeb (cmd, chip->legacy.IO_ADDR_W); }static int migor_nand_flash_ready (struct nand_chip *chip)
drivers/mtd/nand/raw/ams-delta.c +4 -4
@@ -68,7 +68,7 @@ static void ams_delta_write_byte(struct nand_chip *this, u_char byte)void __iomem *io_base = (void __iomem *)nand_get_controller_data (this);writew (0 , io_base +OMAP_MPUIO_IO_CNTL ); -writew (byte, this->IO_ADDR_W); +writew (byte, this->legacy.IO_ADDR_W);gpio_set_value (AMS_DELTA_GPIO_PIN_NAND_NWE ,0 );ndelay (40 );gpio_set_value (AMS_DELTA_GPIO_PIN_NAND_NWE ,1 );
@@ -82,7 +82,7 @@ static u_char ams_delta_read_byte(struct nand_chip *this)gpio_set_value (AMS_DELTA_GPIO_PIN_NAND_NRE ,0 );ndelay (40 );writew (~0 , io_base +OMAP_MPUIO_IO_CNTL ); - res =readw (this->IO_ADDR_R); + res =readw (this->legacy.IO_ADDR_R);gpio_set_value (AMS_DELTA_GPIO_PIN_NAND_NRE ,1 );return res;
@@ -208,8 +208,8 @@ static int ams_delta_init(struct platform_device *pdev)nand_set_controller_data (this, (void *)io_base);/* Set address of NAND IO lines */ - this->IO_ADDR_R = io_base +OMAP_MPUIO_INPUT_LATCH ; - this->IO_ADDR_W = io_base +OMAP_MPUIO_OUTPUT ; + this->legacy.IO_ADDR_R = io_base +OMAP_MPUIO_INPUT_LATCH ; + this->legacy.IO_ADDR_W = io_base +OMAP_MPUIO_OUTPUT ; this->read_byte = ams_delta_read_byte; this->write_buf = ams_delta_write_buf; this->read_buf = ams_delta_read_buf;
drivers/mtd/nand/raw/au1550nd.c +13 -13
@@ -35,7 +35,7 @@ struct au1550nd_ctx {*/ static u_char au_read_byte (struct nand_chip *this) { -u_char ret =readb (this->IO_ADDR_R); +u_char ret =readb (this->legacy.IO_ADDR_R);wmb ();/* drain writebuffer */ return ret; }
@@ -49,7 +49,7 @@ static u_char au_read_byte(struct nand_chip *this)*/ static void au_write_byte (struct nand_chip *this,u_char byte) { -writeb (byte, this->IO_ADDR_W); +writeb (byte, this->legacy.IO_ADDR_W);wmb ();/* drain writebuffer */ }
@@ -61,7 +61,7 @@ static void au_write_byte(struct nand_chip *this, u_char byte)*/ static u_char au_read_byte16 (struct nand_chip *this) { -u_char ret = (u_char )cpu_to_le16 (readw (this->IO_ADDR_R)); +u_char ret = (u_char )cpu_to_le16 (readw (this->legacy.IO_ADDR_R));wmb ();/* drain writebuffer */ return ret; }
@@ -75,7 +75,7 @@ static u_char au_read_byte16(struct nand_chip *this)*/ static void au_write_byte16 (struct nand_chip *this,u_char byte) { -writew (le16_to_cpu ((u16 ) byte), this->IO_ADDR_W); +writew (le16_to_cpu ((u16 ) byte), this->legacy.IO_ADDR_W);wmb ();/* drain writebuffer */ }
@@ -92,7 +92,7 @@ static void au_write_buf(struct nand_chip *this, const u_char *buf, int len)int i;for (i =0 ; i < len; i++) { -writeb (buf[i], this->IO_ADDR_W); +writeb (buf[i], this->legacy.IO_ADDR_W);wmb ();/* drain writebuffer */ } }
@@ -110,7 +110,7 @@ static void au_read_buf(struct nand_chip *this, u_char *buf, int len)int i;for (i =0 ; i < len; i++) { - buf[i] =readb (this->IO_ADDR_R); + buf[i] =readb (this->legacy.IO_ADDR_R);wmb ();/* drain writebuffer */ } }
@@ -130,7 +130,7 @@ static void au_write_buf16(struct nand_chip *this, const u_char *buf, int len) len >>=1 ;for (i =0 ; i < len; i++) { -writew (p[i], this->IO_ADDR_W); +writew (p[i], this->legacy.IO_ADDR_W);wmb ();/* drain writebuffer */ }
@@ -152,7 +152,7 @@ static void au_read_buf16(struct mtd_info *mtd, u_char *buf, int len) len >>=1 ;for (i =0 ; i < len; i++) { - p[i] =readw (this->IO_ADDR_R); + p[i] =readw (this->legacy.IO_ADDR_R);wmb ();/* drain writebuffer */ } }
@@ -179,19 +179,19 @@ static void au1550_hwcontrol(struct mtd_info *mtd, int cmd)switch (cmd) {case NAND_CTL_SETCLE : - this->IO_ADDR_W = ctx->base +MEM_STNAND_CMD ; + this->legacy.IO_ADDR_W = ctx->base +MEM_STNAND_CMD ;break ;case NAND_CTL_CLRCLE : - this->IO_ADDR_W = ctx->base +MEM_STNAND_DATA ; + this->legacy.IO_ADDR_W = ctx->base +MEM_STNAND_DATA ;break ;case NAND_CTL_SETALE : - this->IO_ADDR_W = ctx->base +MEM_STNAND_ADDR ; + this->legacy.IO_ADDR_W = ctx->base +MEM_STNAND_ADDR ;break ;case NAND_CTL_CLRALE : - this->IO_ADDR_W = ctx->base +MEM_STNAND_DATA ; + this->legacy.IO_ADDR_W = ctx->base +MEM_STNAND_DATA ;/* FIXME: Nobody knows why this is necessary, * but it works only that way */ udelay (1 );
@@ -208,7 +208,7 @@ static void au1550_hwcontrol(struct mtd_info *mtd, int cmd)break ; } - this->IO_ADDR_R = this->IO_ADDR_W; + this->legacy.IO_ADDR_R = this->legacy.IO_ADDR_W;wmb ();/* Drain the writebuffer */ }
drivers/mtd/nand/raw/cmx270_nand.c +8 -8
@@ -51,7 +51,7 @@ static const struct mtd_partition partition_info[] = {static u_char cmx270_read_byte (struct nand_chip *this) { -return (readl (this->IO_ADDR_R) >>16 ); +return (readl (this->legacy.IO_ADDR_R) >>16 ); } static void cmx270_write_buf(struct nand_chip *this, const u_char *buf,
@@ -60,7 +60,7 @@ static void cmx270_write_buf(struct nand_chip *this, const u_char *buf,int i;for (i=0 ; i<len; i++) -writel ((*buf++ <<16 ), this->IO_ADDR_W); +writel ((*buf++ <<16 ), this->legacy.IO_ADDR_W); }static void cmx270_read_buf (struct nand_chip *this,u_char *buf,int len)
@@ -68,7 +68,7 @@ static void cmx270_read_buf(struct nand_chip *this, u_char *buf, int len)int i;for (i=0 ; i<len; i++) - *buf++ =readl (this->IO_ADDR_R) >>16 ; + *buf++ =readl (this->legacy.IO_ADDR_R) >>16 ; }static inline void nand_cs_on (void )
@@ -89,7 +89,7 @@ static void nand_cs_off(void)static void cmx270_hwcontrol (struct nand_chip *this,int dat,unsigned int ctrl) { -unsigned int nandaddr = (unsigned int )this->IO_ADDR_W; +unsigned int nandaddr = (unsigned int )this->legacy.IO_ADDR_W;dsb ();
@@ -109,9 +109,9 @@ static void cmx270_hwcontrol(struct nand_chip *this, int dat, }dsb (); - this->IO_ADDR_W = (void __iomem *)nandaddr; + this->legacy.IO_ADDR_W = (void __iomem *)nandaddr;if (dat !=NAND_CMD_NONE ) -writel ((dat <<16 ), this->IO_ADDR_W); +writel ((dat <<16 ), this->legacy.IO_ADDR_W);dsb (); }
@@ -173,8 +173,8 @@ static int __init cmx270_init(void) cmx270_nand_mtd->owner =THIS_MODULE ;/* insert callbacks */ - this->IO_ADDR_R = cmx270_nand_io; - this->IO_ADDR_W = cmx270_nand_io; + this->legacy.IO_ADDR_R = cmx270_nand_io; + this->legacy.IO_ADDR_W = cmx270_nand_io; this->cmd_ctrl = cmx270_hwcontrol; this->dev_ready = cmx270_device_ready;
drivers/mtd/nand/raw/cs553x_nand.c +15 -15
@@ -96,43 +96,43 @@static void cs553x_read_buf (struct nand_chip *this,u_char *buf,int len) {while (unlikely (len >0x800 )) { -memcpy_fromio (buf, this->IO_ADDR_R,0x800 ); +memcpy_fromio (buf, this->legacy.IO_ADDR_R,0x800 ); buf +=0x800 ; len -=0x800 ; } -memcpy_fromio (buf, this->IO_ADDR_R, len); +memcpy_fromio (buf, this->legacy.IO_ADDR_R, len); }static void cs553x_write_buf (struct nand_chip *this,const u_char *buf,int len) {while (unlikely (len >0x800 )) { -memcpy_toio (this->IO_ADDR_R, buf,0x800 ); +memcpy_toio (this->legacy.IO_ADDR_R, buf,0x800 ); buf +=0x800 ; len -=0x800 ; } -memcpy_toio (this->IO_ADDR_R, buf, len); +memcpy_toio (this->legacy.IO_ADDR_R, buf, len); }static unsigned char cs553x_read_byte (struct nand_chip *this) { -return readb (this->IO_ADDR_R); +return readb (this->legacy.IO_ADDR_R); }static void cs553x_write_byte (struct nand_chip *this,u_char byte) {int i =100000 ; -while (i &&readb (this->IO_ADDR_R +MM_NAND_STS ) &CS_NAND_CTLR_BUSY ) { +while (i &&readb (this->legacy.IO_ADDR_R +MM_NAND_STS ) &CS_NAND_CTLR_BUSY ) {udelay (1 ); i--; } -writeb (byte, this->IO_ADDR_W +0x801 ); +writeb (byte, this->legacy.IO_ADDR_W +0x801 ); }static void cs553x_hwcontrol (struct nand_chip *this,int cmd,unsigned int ctrl) { -void __iomem *mmio_base = this->IO_ADDR_R; +void __iomem *mmio_base = this->legacy.IO_ADDR_R;if (ctrl &NAND_CTRL_CHANGE ) {unsigned char ctl = (ctrl & ~NAND_CTRL_CHANGE ) ^0x01 ;writeb (ctl, mmio_base +MM_NAND_CTL );
@@ -143,7 +143,7 @@ static void cs553x_hwcontrol(struct nand_chip *this, int cmd,static int cs553x_device_ready (struct nand_chip *this) { -void __iomem *mmio_base = this->IO_ADDR_R; +void __iomem *mmio_base = this->legacy.IO_ADDR_R;unsigned char foo =readb (mmio_base +MM_NAND_STS );return (foo &CS_NAND_STS_FLASH_RDY ) && !(foo &CS_NAND_CTLR_BUSY );
@@ -151,7 +151,7 @@ static int cs553x_device_ready(struct nand_chip *this)static void cs_enable_hwecc (struct nand_chip *this,int mode) { -void __iomem *mmio_base = this->IO_ADDR_R; +void __iomem *mmio_base = this->legacy.IO_ADDR_R;writeb (0x07 , mmio_base +MM_NAND_ECC_CTL ); }
@@ -160,7 +160,7 @@ static int cs_calculate_ecc(struct nand_chip *this, const u_char *dat, u_char *ecc_code) {uint32_t ecc; -void __iomem *mmio_base = this->IO_ADDR_R; +void __iomem *mmio_base = this->legacy.IO_ADDR_R; ecc =readl (mmio_base +MM_NAND_STS );
@@ -199,8 +199,8 @@ static int __init cs553x_init_one(int cs, int mmio, unsigned long adr) new_mtd->owner =THIS_MODULE ;/* map physical address */ - this->IO_ADDR_R = this->IO_ADDR_W =ioremap (adr,4096 ); -if (!this->IO_ADDR_R) { + this->legacy.IO_ADDR_R = this->legacy.IO_ADDR_W =ioremap (adr,4096 ); +if (!this->legacy.IO_ADDR_R) {pr_warn ("ioremap cs553x NAND @0x%08lx failed\n" , adr); err = -EIO ; goto out_mtd;
@@ -242,7 +242,7 @@ static int __init cs553x_init_one(int cs, int mmio, unsigned long adr) out_free:kfree (new_mtd->name); out_ior: -iounmap (this->IO_ADDR_R); +iounmap (this->legacy.IO_ADDR_R); out_mtd:kfree (this); out:
@@ -324,7 +324,7 @@ static void __exit cs553x_cleanup(void)continue ; this =mtd_to_nand (mtd); - mmio_base = this->IO_ADDR_R; + mmio_base = this->legacy.IO_ADDR_R;/* Release resources, unregister device */ nand_release (this);
drivers/mtd/nand/raw/davinci_nand.c +12 -12
@@ -110,11 +110,11 @@ static void nand_davinci_hwcontrol(struct nand_chip *nand, int cmd,else if ((ctrl &NAND_CTRL_ALE ) ==NAND_CTRL_ALE ) addr += info->mask_ale; - nand->IO_ADDR_W = addr; + nand->legacy.IO_ADDR_W = addr; }if (cmd !=NAND_CMD_NONE ) -iowrite8 (cmd, nand->IO_ADDR_W); +iowrite8 (cmd, nand->legacy.IO_ADDR_W); }static void nand_davinci_select_chip (struct nand_chip *nand,int chip)
@@ -127,8 +127,8 @@ static void nand_davinci_select_chip(struct nand_chip *nand, int chip)if (chip >0 ) info->current_cs += info->mask_chipsel; - info->chip.IO_ADDR_W = info->current_cs; - info->chip.IO_ADDR_R = info->chip.IO_ADDR_W; + info->chip.legacy.IO_ADDR_W = info->current_cs; + info->chip.legacy.IO_ADDR_R = info->chip.legacy.IO_ADDR_W; }/*----------------------------------------------------------------------*/
@@ -438,22 +438,22 @@ static void nand_davinci_read_buf(struct nand_chip *chip, uint8_t *buf, int len) {if ((0x03 & ((uintptr_t )buf)) ==0 && (0x03 & len) ==0 ) -ioread32_rep (chip->IO_ADDR_R, buf, len >>2 ); +ioread32_rep (chip->legacy.IO_ADDR_R, buf, len >>2 );else if ((0x01 & ((uintptr_t )buf)) ==0 && (0x01 & len) ==0 ) -ioread16_rep (chip->IO_ADDR_R, buf, len >>1 ); +ioread16_rep (chip->legacy.IO_ADDR_R, buf, len >>1 );else -ioread8_rep (chip->IO_ADDR_R, buf, len); +ioread8_rep (chip->legacy.IO_ADDR_R, buf, len); }static void nand_davinci_write_buf (struct nand_chip *chip,const uint8_t *buf,int len) {if ((0x03 & ((uintptr_t )buf)) ==0 && (0x03 & len) ==0 ) -iowrite32_rep (chip->IO_ADDR_R, buf, len >>2 ); +iowrite32_rep (chip->legacy.IO_ADDR_R, buf, len >>2 );else if ((0x01 & ((uintptr_t )buf)) ==0 && (0x01 & len) ==0 ) -iowrite16_rep (chip->IO_ADDR_R, buf, len >>1 ); +iowrite16_rep (chip->legacy.IO_ADDR_R, buf, len >>1 );else -iowrite8_rep (chip->IO_ADDR_R, buf, len); +iowrite8_rep (chip->legacy.IO_ADDR_R, buf, len); }/*
@@ -759,8 +759,8 @@ static int nand_davinci_probe(struct platform_device *pdev) mtd->dev.parent = &pdev->dev;nand_set_flash_node (&info->chip, pdev->dev.of_node); - info->chip.IO_ADDR_R = vaddr; - info->chip.IO_ADDR_W = vaddr; + info->chip.legacy.IO_ADDR_R = vaddr; + info->chip.legacy.IO_ADDR_W = vaddr; info->chip.chip_delay =0 ; info->chip.select_chip = nand_davinci_select_chip;
drivers/mtd/nand/raw/fsl_upm.c +8 -8
@@ -101,7 +101,7 @@ static void fun_cmd_ctrl(struct nand_chip *chip, int cmd, unsigned int ctrl) mar = (cmd << (32 - fun->upm.width)) | fun->mchip_offsets[fun->mchip_number]; -fsl_upm_run_pattern (&fun->upm, chip->IO_ADDR_R, mar); +fsl_upm_run_pattern (&fun->upm, chip->legacy.IO_ADDR_R, mar);if (fun->wait_flags &FSL_UPM_WAIT_RUN_PATTERN )fun_wait_rnb (fun);
@@ -115,8 +115,8 @@ static void fun_select_chip(struct nand_chip *chip, int mchip_nr) chip->cmd_ctrl (chip,NAND_CMD_NONE ,0 |NAND_CTRL_CHANGE ); }else if (mchip_nr >=0 && mchip_nr <NAND_MAX_CHIPS ) { fun->mchip_number = mchip_nr; - chip->IO_ADDR_R = fun->io_base + fun->mchip_offsets[mchip_nr]; - chip->IO_ADDR_W = chip->IO_ADDR_R; + chip->legacy.IO_ADDR_R = fun->io_base + fun->mchip_offsets[mchip_nr]; + chip->legacy.IO_ADDR_W = chip->legacy.IO_ADDR_R; }else {BUG (); }
@@ -126,7 +126,7 @@ static uint8_t fun_read_byte(struct nand_chip *chip) {struct fsl_upm_nand *fun =to_fsl_upm_nand (nand_to_mtd (chip)); -return in_8 (fun->chip.IO_ADDR_R); +return in_8 (fun->chip.legacy.IO_ADDR_R); }static void fun_read_buf (struct nand_chip *chip,uint8_t *buf,int len)
@@ -135,7 +135,7 @@ static void fun_read_buf(struct nand_chip *chip, uint8_t *buf, int len)int i;for (i =0 ; i < len; i++) - buf[i] =in_8 (fun->chip.IO_ADDR_R); + buf[i] =in_8 (fun->chip.legacy.IO_ADDR_R); }static void fun_write_buf (struct nand_chip *chip,const uint8_t *buf,int len)
@@ -144,7 +144,7 @@ static void fun_write_buf(struct nand_chip *chip, const uint8_t *buf, int len)int i;for (i =0 ; i < len; i++) { -out_8 (fun->chip.IO_ADDR_W, buf[i]); +out_8 (fun->chip.legacy.IO_ADDR_W, buf[i]);if (fun->wait_flags &FSL_UPM_WAIT_WRITE_BYTE )fun_wait_rnb (fun); }
@@ -160,8 +160,8 @@ static int fun_chip_init(struct fsl_upm_nand *fun,int ret;struct device_node *flash_np; - fun->chip.IO_ADDR_R = fun->io_base; - fun->chip.IO_ADDR_W = fun->io_base; + fun->chip.legacy.IO_ADDR_R = fun->io_base; + fun->chip.legacy.IO_ADDR_W = fun->io_base; fun->chip.cmd_ctrl = fun_cmd_ctrl; fun->chip.chip_delay = fun->chip_delay; fun->chip.read_byte = fun_read_byte;
drivers/mtd/nand/raw/gpio.c +5 -5
@@ -90,7 +90,7 @@ static void gpio_nand_cmd_ctrl(struct nand_chip *chip, int cmd,if (cmd ==NAND_CMD_NONE )return ; -writeb (cmd, gpiomtd->nand_chip.IO_ADDR_W); +writeb (cmd, gpiomtd->nand_chip.legacy.IO_ADDR_W);gpio_nand_dosync (gpiomtd); }
@@ -225,9 +225,9 @@ static int gpio_nand_probe(struct platform_device *pdev) chip = &gpiomtd->nand_chip; res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - chip->IO_ADDR_R =devm_ioremap_resource (dev, res); -if (IS_ERR (chip->IO_ADDR_R)) -return PTR_ERR (chip->IO_ADDR_R); + chip->legacy.IO_ADDR_R =devm_ioremap_resource (dev, res); +if (IS_ERR (chip->legacy.IO_ADDR_R)) +return PTR_ERR (chip->legacy.IO_ADDR_R); res =gpio_nand_get_io_sync (pdev);if (res) {
@@ -274,7 +274,7 @@ static int gpio_nand_probe(struct platform_device *pdev) chip->dev_ready = gpio_nand_devready;nand_set_flash_node (chip, pdev->dev.of_node); - chip->IO_ADDR_W = chip->IO_ADDR_R; + chip->legacy.IO_ADDR_W = chip->legacy.IO_ADDR_R; chip->ecc.mode =NAND_ECC_SOFT ; chip->ecc.algo =NAND_ECC_HAMMING ; chip->options = gpiomtd->plat.options;
drivers/mtd/nand/raw/jz4740_nand.c +4 -4
@@ -91,8 +91,8 @@ static void jz_nand_select_chip(struct nand_chip *chip, int chipnr) banknr =-1 ; }else { banknr = nand->banks[chipnr] -1 ; - chip->IO_ADDR_R = nand->bank_base[banknr]; - chip->IO_ADDR_W = nand->bank_base[banknr]; + chip->legacy.IO_ADDR_R = nand->bank_base[banknr]; + chip->legacy.IO_ADDR_W = nand->bank_base[banknr]; }writel (ctrl, nand->base +JZ_REG_NAND_CTRL );
@@ -114,7 +114,7 @@ static void jz_nand_cmd_ctrl(struct nand_chip *chip, int dat, bank_base +=JZ_NAND_MEM_ADDR_OFFSET ; else if (ctrl & NAND_CLE) bank_base += JZ_NAND_MEM_CMD_OFFSET; - chip->IO_ADDR_W = bank_base; + chip->legacy.IO_ADDR_W = bank_base; reg =readl (nand->base +JZ_REG_NAND_CTRL );if (ctrl &NAND_NCE )
@@ -124,7 +124,7 @@ static void jz_nand_cmd_ctrl(struct nand_chip *chip, int dat,writel (reg, nand->base +JZ_REG_NAND_CTRL ); }if (dat !=NAND_CMD_NONE ) -writeb (dat, chip->IO_ADDR_W); +writeb (dat, chip->legacy.IO_ADDR_W); }static int jz_nand_dev_ready (struct nand_chip *chip)
drivers/mtd/nand/raw/jz4780_nand.c +2 -2
@@ -275,8 +275,8 @@ static int jz4780_nand_init_chip(struct platform_device *pdev,return -ENOMEM ; mtd->dev.parent = dev; - chip->IO_ADDR_R = cs->base +OFFSET_DATA ; - chip->IO_ADDR_W = cs->base +OFFSET_DATA ; + chip->legacy.IO_ADDR_R = cs->base +OFFSET_DATA ; + chip->legacy.IO_ADDR_W = cs->base +OFFSET_DATA ; chip->chip_delay =RB_DELAY_US ; chip->options =NAND_NO_SUBPAGE_WRITE ; chip->select_chip = jz4780_nand_select_chip;
drivers/mtd/nand/raw/lpc32xx_mlc.c +2 -2
@@ -742,8 +742,8 @@ static int lpc32xx_nand_probe(struct platform_device *pdev) nand_chip->cmd_ctrl = lpc32xx_nand_cmd_ctrl; nand_chip->dev_ready = lpc32xx_nand_device_ready; nand_chip->chip_delay =25 ;/* us */ - nand_chip->IO_ADDR_R =MLC_DATA (host->io_base); - nand_chip->IO_ADDR_W =MLC_DATA (host->io_base); + nand_chip->legacy.IO_ADDR_R =MLC_DATA (host->io_base); + nand_chip->legacy.IO_ADDR_W =MLC_DATA (host->io_base);/* Init NAND controller */ lpc32xx_nand_setup (host);
drivers/mtd/nand/raw/lpc32xx_slc.c +2 -2
@@ -878,8 +878,8 @@ static int lpc32xx_nand_probe(struct platform_device *pdev) goto enable_wp;/* Set NAND IO addresses and command/ready functions */ - chip->IO_ADDR_R =SLC_DATA (host->io_base); - chip->IO_ADDR_W =SLC_DATA (host->io_base); + chip->legacy.IO_ADDR_R =SLC_DATA (host->io_base); + chip->legacy.IO_ADDR_W =SLC_DATA (host->io_base); chip->cmd_ctrl = lpc32xx_nand_cmd_ctrl; chip->dev_ready = lpc32xx_nand_device_ready; chip->chip_delay =20 ;/* 20us command delay time */
drivers/mtd/nand/raw/nand_base.c +6 -6
@@ -260,7 +260,7 @@ static void nand_release_device(struct mtd_info *mtd)*/ static uint8_t nand_read_byte (struct nand_chip *chip) { -return readb (chip->IO_ADDR_R); +return readb (chip->legacy.IO_ADDR_R); }/**
@@ -272,7 +272,7 @@ static uint8_t nand_read_byte(struct nand_chip *chip)*/ static uint8_t nand_read_byte16 (struct nand_chip *chip) { -return (uint8_t )cpu_to_le16 (readw (chip->IO_ADDR_R)); +return (uint8_t )cpu_to_le16 (readw (chip->legacy.IO_ADDR_R)); }/**
@@ -348,7 +348,7 @@ static void nand_write_byte16(struct nand_chip *chip, uint8_t byte)*/ static void nand_write_buf (struct nand_chip *chip,const uint8_t *buf,int len) { -iowrite8_rep (chip->IO_ADDR_W, buf, len); +iowrite8_rep (chip->legacy.IO_ADDR_W, buf, len); }/**
@@ -361,7 +361,7 @@ static void nand_write_buf(struct nand_chip *chip, const uint8_t *buf, int len)*/ static void nand_read_buf (struct nand_chip *chip,uint8_t *buf,int len) { -ioread8_rep (chip->IO_ADDR_R, buf, len); +ioread8_rep (chip->legacy.IO_ADDR_R, buf, len); }/**
@@ -377,7 +377,7 @@ static void nand_write_buf16(struct nand_chip *chip, const uint8_t *buf, {u16 *p = (u16 *) buf; -iowrite16_rep (chip->IO_ADDR_W, p, len >>1 ); +iowrite16_rep (chip->legacy.IO_ADDR_W, p, len >>1 ); }/**
@@ -392,7 +392,7 @@ static void nand_read_buf16(struct nand_chip *chip, uint8_t *buf, int len) {u16 *p = (u16 *) buf; -ioread16_rep (chip->IO_ADDR_R, p, len >>1 ); +ioread16_rep (chip->legacy.IO_ADDR_R, p, len >>1 ); }/**
drivers/mtd/nand/raw/ndfc.c +2 -2
@@ -142,8 +142,8 @@ static int ndfc_chip_init(struct ndfc_controller *ndfc,struct mtd_info *mtd =nand_to_mtd (chip);int ret; - chip->IO_ADDR_R = ndfc->ndfcbase +NDFC_DATA ; - chip->IO_ADDR_W = ndfc->ndfcbase +NDFC_DATA ; + chip->legacy.IO_ADDR_R = ndfc->ndfcbase +NDFC_DATA ; + chip->legacy.IO_ADDR_W = ndfc->ndfcbase +NDFC_DATA ; chip->cmd_ctrl = ndfc_hwcontrol; chip->dev_ready = ndfc_ready; chip->select_chip = ndfc_select_chip;
drivers/mtd/nand/raw/omap2.c +15 -15
@@ -275,7 +275,7 @@ static void omap_read_buf8(struct mtd_info *mtd, u_char *buf, int len) {struct nand_chip *nand =mtd_to_nand (mtd); -ioread8_rep (nand->IO_ADDR_R, buf, len); +ioread8_rep (nand->legacy.IO_ADDR_R, buf, len); }/**
@@ -291,7 +291,7 @@ static void omap_write_buf8(struct mtd_info *mtd, const u_char *buf, int len)bool status;while (len--) { -iowrite8 (*p++, info->nand.IO_ADDR_W); +iowrite8 (*p++, info->nand.legacy.IO_ADDR_W);/* wait until buffer is available for write */ do { status = info->ops->nand_writebuffer_empty();
@@ -309,7 +309,7 @@ static void omap_read_buf16(struct mtd_info *mtd, u_char *buf, int len) {struct nand_chip *nand =mtd_to_nand (mtd); -ioread16_rep (nand->IO_ADDR_R, buf, len /2 ); +ioread16_rep (nand->legacy.IO_ADDR_R, buf, len /2 ); }/**
@@ -327,7 +327,7 @@ static void omap_write_buf16(struct mtd_info *mtd, const u_char * buf, int len) len >>=1 ;while (len--) { -iowrite16 (*p++, info->nand.IO_ADDR_W); +iowrite16 (*p++, info->nand.legacy.IO_ADDR_W);/* wait until buffer is available for write */ do { status = info->ops->nand_writebuffer_empty();
@@ -373,7 +373,7 @@ static void omap_read_buf_pref(struct nand_chip *chip, u_char *buf, int len) r_count =readl (info->reg.gpmc_prefetch_status); r_count =PREFETCH_STATUS_FIFO_CNT (r_count); r_count = r_count >>2 ; -ioread32_rep (info->nand.IO_ADDR_R, p, r_count); +ioread32_rep (info->nand.legacy.IO_ADDR_R, p, r_count); p += r_count; len -= r_count <<2 ; }while (len);
@@ -401,7 +401,7 @@ static void omap_write_buf_pref(struct nand_chip *chip, const u_char *buf,/* take care of subpage writes */ if (len %2 !=0 ) { -writeb (*buf, info->nand.IO_ADDR_W); +writeb (*buf, info->nand.legacy.IO_ADDR_W); p = (u16 *)(buf +1 ); len--; }
@@ -421,7 +421,7 @@ static void omap_write_buf_pref(struct nand_chip *chip, const u_char *buf, w_count =PREFETCH_STATUS_FIFO_CNT (w_count); w_count = w_count >>1 ;for (i =0 ; (i < w_count) && len; i++, len -=2 ) -iowrite16 (*p++, info->nand.IO_ADDR_W); +iowrite16 (*p++, info->nand.legacy.IO_ADDR_W); }/* wait for data to flushed-out before reset the prefetch */ tim =0 ;
@@ -585,14 +585,14 @@ static irqreturn_t omap_nand_irq(int this_irq, void *dev) bytes = info->buf_len; else if (!info->buf_len) bytes =0 ; -iowrite32_rep (info->nand.IO_ADDR_W, - (u32 *)info->buf, bytes >>2 ); +iowrite32_rep (info->nand.legacy.IO_ADDR_W, (u32 *)info->buf, + bytes >>2 ); info->buf = info->buf + bytes; info->buf_len -= bytes; }else { -ioread32_rep (info->nand.IO_ADDR_R, - (u32 *)info->buf, bytes >>2 ); +ioread32_rep (info->nand.legacy.IO_ADDR_R, (u32 *)info->buf, + bytes >>2 ); info->buf = info->buf + bytes;if (this_irq == info->gpmc_irq_count)
@@ -2221,15 +2221,15 @@ static int omap_nand_probe(struct platform_device *pdev) } res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - nand_chip->IO_ADDR_R =devm_ioremap_resource (&pdev->dev, res); -if (IS_ERR (nand_chip->IO_ADDR_R)) -return PTR_ERR (nand_chip->IO_ADDR_R); + nand_chip->legacy.IO_ADDR_R =devm_ioremap_resource (&pdev->dev, res); +if (IS_ERR (nand_chip->legacy.IO_ADDR_R)) +return PTR_ERR (nand_chip->legacy.IO_ADDR_R); info->phys_base = res->start; nand_chip->controller = &omap_gpmc_controller; - nand_chip->IO_ADDR_W = nand_chip->IO_ADDR_R; + nand_chip->legacy.IO_ADDR_W = nand_chip->legacy.IO_ADDR_R; nand_chip->cmd_ctrl = omap_hwcontrol; info->ready_gpiod = devm_gpiod_get_optional(&pdev->dev, "rb",
drivers/mtd/nand/raw/orion_nand.c +3 -3
@@ -45,12 +45,12 @@ static void orion_nand_cmd_ctrl(struct nand_chip *nc, int cmd,if (nc->options &NAND_BUSWIDTH_16 ) offs <<=1 ; -writeb (cmd, nc->IO_ADDR_W + offs); +writeb (cmd, nc->legacy.IO_ADDR_W + offs); }static void orion_nand_read_buf (struct nand_chip *chip,uint8_t *buf,int len) { -void __iomem *io_base = chip->IO_ADDR_R; +void __iomem *io_base = chip->legacy.IO_ADDR_R;#if defined(__LINUX_ARM_ARCH__) && __LINUX_ARM_ARCH__ >=5 uint64_t *buf64;#endif
@@ -136,7 +136,7 @@ static int __init orion_nand_probe(struct platform_device *pdev)nand_set_controller_data (nc, board);nand_set_flash_node (nc, pdev->dev.of_node); - nc->IO_ADDR_R = nc->IO_ADDR_W = io_base; + nc->legacy.IO_ADDR_R = nc->legacy.IO_ADDR_W = io_base; nc->cmd_ctrl = orion_nand_cmd_ctrl; nc->read_buf = orion_nand_read_buf; nc->ecc.mode =NAND_ECC_SOFT ;
drivers/mtd/nand/raw/pasemi_nand.c +11 -11
@@ -46,22 +46,22 @@ static const char driver_name[] = "pasemi-nand";static void pasemi_read_buf (struct nand_chip *chip,u_char *buf,int len) {while (len >0x800 ) { -memcpy_fromio (buf, chip->IO_ADDR_R,0x800 ); +memcpy_fromio (buf, chip->legacy.IO_ADDR_R,0x800 ); buf +=0x800 ; len -=0x800 ; } -memcpy_fromio (buf, chip->IO_ADDR_R, len); +memcpy_fromio (buf, chip->legacy.IO_ADDR_R, len); }static void pasemi_write_buf (struct nand_chip *chip,const u_char *buf,int len) {while (len >0x800 ) { -memcpy_toio (chip->IO_ADDR_R, buf,0x800 ); +memcpy_toio (chip->legacy.IO_ADDR_R, buf,0x800 ); buf +=0x800 ; len -=0x800 ; } -memcpy_toio (chip->IO_ADDR_R, buf, len); +memcpy_toio (chip->legacy.IO_ADDR_R, buf, len); } static void pasemi_hwcontrol(struct nand_chip *chip, int cmd,
@@ -71,9 +71,9 @@ static void pasemi_hwcontrol(struct nand_chip *chip, int cmd,return ;if (ctrl &NAND_CLE ) -out_8 (chip->IO_ADDR_W + (1 <<CLE_PIN_CTL ), cmd); +out_8 (chip->legacy.IO_ADDR_W + (1 <<CLE_PIN_CTL ), cmd);else -out_8 (chip->IO_ADDR_W + (1 <<ALE_PIN_CTL ), cmd); +out_8 (chip->legacy.IO_ADDR_W + (1 <<ALE_PIN_CTL ), cmd);/* Push out posted writes */ eieio ();
@@ -117,10 +117,10 @@ static int pasemi_nand_probe(struct platform_device *ofdev)/* Link the private data with the MTD structure */ pasemi_nand_mtd->dev.parent = dev; - chip->IO_ADDR_R =of_iomap (np,0 ); - chip->IO_ADDR_W = chip->IO_ADDR_R; + chip->legacy.IO_ADDR_R =of_iomap (np,0 ); + chip->legacy.IO_ADDR_W = chip->legacy.IO_ADDR_R; -if (!chip->IO_ADDR_R) { +if (!chip->legacy.IO_ADDR_R) { err = -EIO ; goto out_mtd; }
@@ -169,7 +169,7 @@ static int pasemi_nand_probe(struct platform_device *ofdev) out_lpc:release_region (lpcctl,4 ); out_ior: -iounmap (chip->IO_ADDR_R); +iounmap (chip->legacy.IO_ADDR_R); out_mtd:kfree (chip); out:
@@ -190,7 +190,7 @@ static int pasemi_nand_remove(struct platform_device *ofdev)release_region (lpcctl,4 ); -iounmap (chip->IO_ADDR_R); +iounmap (chip->legacy.IO_ADDR_R);/* Free the MTD device structure */ kfree (chip);
drivers/mtd/nand/raw/plat_nand.c +2 -2
@@ -60,8 +60,8 @@ static int plat_nand_probe(struct platform_device *pdev) mtd =nand_to_mtd (&data->chip); mtd->dev.parent = &pdev->dev; - data->chip.IO_ADDR_R = data->io_base; - data->chip.IO_ADDR_W = data->io_base; + data->chip.legacy.IO_ADDR_R = data->io_base; + data->chip.legacy.IO_ADDR_W = data->io_base; data->chip.cmd_ctrl = pdata->ctrl.cmd_ctrl; data->chip.dev_ready = pdata->ctrl.dev_ready; data->chip.select_chip = pdata->ctrl.select_chip;
drivers/mtd/nand/raw/s3c2410.c +6 -6
@@ -681,7 +681,7 @@ static int s3c2440_nand_calculate_ecc(struct nand_chip *chip,static void s3c2410_nand_read_buf (struct nand_chip *this,u_char *buf,int len) { -readsb (this->IO_ADDR_R, buf, len); +readsb (this->legacy.IO_ADDR_R, buf, len); }static void s3c2440_nand_read_buf (struct nand_chip *this,u_char *buf,int len)
@@ -703,7 +703,7 @@ static void s3c2440_nand_read_buf(struct nand_chip *this, u_char *buf, int len)static void s3c2410_nand_write_buf (struct nand_chip *this,const u_char *buf,int len) { -writesb (this->IO_ADDR_W, buf, len); +writesb (this->legacy.IO_ADDR_W, buf, len); } static void s3c2440_nand_write_buf(struct nand_chip *this, const u_char *buf,
@@ -881,7 +881,7 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info,switch (info->cpu_type) {case TYPE_S3C2410 : - chip->IO_ADDR_W = regs +S3C2410_NFDATA ; + chip->legacy.IO_ADDR_W = regs +S3C2410_NFDATA ; info->sel_reg = regs +S3C2410_NFCONF ; info->sel_bit = S3C2410_NFCONF_nFCE; chip->cmd_ctrl = s3c2410_nand_hwcontrol;
@@ -889,7 +889,7 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info,break ;case TYPE_S3C2440 : - chip->IO_ADDR_W = regs +S3C2440_NFDATA ; + chip->legacy.IO_ADDR_W = regs +S3C2440_NFDATA ; info->sel_reg = regs +S3C2440_NFCONT ; info->sel_bit = S3C2440_NFCONT_nFCE; chip->cmd_ctrl = s3c2440_nand_hwcontrol;
@@ -899,7 +899,7 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info,break ;case TYPE_S3C2412 : - chip->IO_ADDR_W = regs +S3C2440_NFDATA ; + chip->legacy.IO_ADDR_W = regs +S3C2440_NFDATA ; info->sel_reg = regs +S3C2440_NFCONT ; info->sel_bit = S3C2412_NFCONT_nFCE0; chip->cmd_ctrl = s3c2440_nand_hwcontrol;
@@ -911,7 +911,7 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info,break ; } - chip->IO_ADDR_R = chip->IO_ADDR_W; + chip->legacy.IO_ADDR_R = chip->legacy.IO_ADDR_W; nmtd->info = info; nmtd->set = set;
drivers/mtd/nand/raw/sharpsl.c +3 -3
@@ -75,7 +75,7 @@ static void sharpsl_nand_hwcontrol(struct nand_chip *chip, int cmd, }if (cmd !=NAND_CMD_NONE ) -writeb (cmd, chip->IO_ADDR_W); +writeb (cmd, chip->legacy.IO_ADDR_W); }static int sharpsl_nand_dev_ready (struct nand_chip *chip)
@@ -153,8 +153,8 @@ static int sharpsl_nand_probe(struct platform_device *pdev)writeb (readb (sharpsl->io +FLASHCTL ) |FLWP , sharpsl->io +FLASHCTL );/* Set address of NAND IO lines */ - this->IO_ADDR_R = sharpsl->io +FLASHIO ; - this->IO_ADDR_W = sharpsl->io +FLASHIO ; + this->legacy.IO_ADDR_R = sharpsl->io +FLASHIO ; + this->legacy.IO_ADDR_W = sharpsl->io +FLASHIO ;/* Set address of hardware control function */ this->cmd_ctrl = sharpsl_nand_hwcontrol; this->dev_ready = sharpsl_nand_dev_ready;
drivers/mtd/nand/raw/tmio_nand.c +3 -3
@@ -155,7 +155,7 @@ static void tmio_nand_hwcontrol(struct nand_chip *chip, int cmd, }if (cmd !=NAND_CMD_NONE ) -tmio_iowrite8 (cmd, chip->IO_ADDR_W); +tmio_iowrite8 (cmd, chip->legacy.IO_ADDR_W); }static int tmio_nand_dev_ready (struct nand_chip *chip)
@@ -399,8 +399,8 @@ static int tmio_probe(struct platform_device *dev)return retval;/* Set address of NAND IO lines */ - nand_chip->IO_ADDR_R = tmio->fcr; - nand_chip->IO_ADDR_W = tmio->fcr; + nand_chip->legacy.IO_ADDR_R = tmio->fcr; + nand_chip->legacy.IO_ADDR_W = tmio->fcr;/* Set address of hardware control function */ nand_chip->cmd_ctrl = tmio_nand_hwcontrol;
include/linux/mtd/rawnand.h +20 -6
@@ -1172,13 +1172,27 @@ int nand_op_parser_exec_op(struct nand_chip *chip,const struct nand_op_parser *parser, const struct nand_operation *op, bool check_only); +/** +* struct nand_legacy - NAND chip legacy fields/hooks +* @IO_ADDR_R: address to read the 8 I/O lines of the flash device +* @IO_ADDR_W: address to write the 8 I/O lines of the flash device +* +* If you look at this structure you're already wrong. These fields/hooks are +* all deprecated. +*/ +struct nand_legacy { +void __iomem *IO_ADDR_R; +void __iomem *IO_ADDR_W; +}; +/** * struct nand_chip - NAND Private Flash Chip Data * @mtd: MTD device registered to the MTD framework -* @IO_ADDR_R: [BOARDSPECIFIC] address to read the 8 I/O lines of the -* flash device -* @IO_ADDR_W: [BOARDSPECIFIC] address to write the 8 I/O lines of the -* flash device. +* @legacy: All legacy fields/hooks. If you develop a new driver, +* don't even try to use any of these fields/hooks, and if +* you're modifying an existing driver that is using those +* fields/hooks, you should consider reworking the driver +* avoid using them. * @read_byte: [REPLACEABLE] read one byte from the chip * @write_byte: [REPLACEABLE] write a single byte to the chip on the * low 8 I/O lines
@@ -1280,8 +1294,8 @@ int nand_op_parser_exec_op(struct nand_chip *chip,struct nand_chip {struct mtd_info mtd; -void __iomem *IO_ADDR_R; -void __iomem *IO_ADDR_W; + +struct nand_legacy legacy;uint8_t (*read_byte)(struct nand_chip *chip);void (*write_byte)(struct nand_chip *chip,uint8_t byte);
Signature · 1 line
2.14.1
PATCH 3/19 mtd: rawnand: Deprecate ->{read,write}_{byte,buf}() hooks
In reply to Boris BrezillonAll those hooks have been replaced by ->exec_op(). Move them to the nand_legacy struct.
--- drivers/mtd/nand/raw/ams-delta.c | 6 +-- drivers/mtd/nand/raw/atmel/nand-controller.c | 8 ++-- drivers/mtd/nand/raw/au1550nd.c | 6 +-- drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c | 6 +-- drivers/mtd/nand/raw/brcmnand/brcmnand.c | 6 +-- drivers/mtd/nand/raw/cafe_nand.c | 10 ++--- drivers/mtd/nand/raw/cmx270_nand.c | 6 +-- drivers/mtd/nand/raw/cs553x_nand.c | 6 +-- drivers/mtd/nand/raw/davinci_nand.c | 4 +- drivers/mtd/nand/raw/denali.c | 12 +++--- drivers/mtd/nand/raw/diskonchip.c | 28 ++++++------- drivers/mtd/nand/raw/fsl_elbc_nand.c | 6 +-- drivers/mtd/nand/raw/fsl_ifc_nand.c | 12 +++--- drivers/mtd/nand/raw/fsl_upm.c | 6 +-- drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 14 +++---- drivers/mtd/nand/raw/hisi504_nand.c | 10 ++--- drivers/mtd/nand/raw/lpc32xx_slc.c | 16 ++++---- drivers/mtd/nand/raw/mpc5121_nfc.c | 6 +-- drivers/mtd/nand/raw/mtk_nand.c | 8 ++-- drivers/mtd/nand/raw/mxc_nand.c | 10 ++--- drivers/mtd/nand/raw/nand_base.c | 50 ++++++++++++------------ drivers/mtd/nand/raw/nand_hynix.c | 2 +- drivers/mtd/nand/raw/nandsim.c | 8 ++-- drivers/mtd/nand/raw/ndfc.c | 4 +- drivers/mtd/nand/raw/nuc900_nand.c | 6 +-- drivers/mtd/nand/raw/omap2.c | 22 +++++------ drivers/mtd/nand/raw/orion_nand.c | 2 +- drivers/mtd/nand/raw/oxnas_nand.c | 6 +-- drivers/mtd/nand/raw/pasemi_nand.c | 4 +- drivers/mtd/nand/raw/plat_nand.c | 4 +- drivers/mtd/nand/raw/qcom_nandc.c | 17 ++++---- drivers/mtd/nand/raw/r852.c | 6 +-- drivers/mtd/nand/raw/s3c2410.c | 8 ++-- drivers/mtd/nand/raw/sh_flctl.c | 10 ++--- drivers/mtd/nand/raw/socrates_nand.c | 6 +-- drivers/mtd/nand/raw/sunxi_nand.c | 6 +-- drivers/mtd/nand/raw/tango_nand.c | 6 +-- drivers/mtd/nand/raw/tmio_nand.c | 6 +-- drivers/mtd/nand/raw/txx9ndfmc.c | 6 +-- drivers/mtd/nand/raw/xway_nand.c | 6 +-- drivers/staging/mt29f_spinand/mt29f_spinand.c | 8 ++-- include/linux/mtd/rawnand.h | 21 +++++----- 42 files changed, 200 insertions(+), 200 deletions(-)
drivers/mtd/nand/raw/ams-delta.c +3 -3
@@ -210,9 +210,9 @@ static int ams_delta_init(struct platform_device *pdev)/* Set address of NAND IO lines */ this->legacy.IO_ADDR_R = io_base +OMAP_MPUIO_INPUT_LATCH ; this->legacy.IO_ADDR_W = io_base +OMAP_MPUIO_OUTPUT ; - this->read_byte = ams_delta_read_byte; - this->write_buf = ams_delta_write_buf; - this->read_buf = ams_delta_read_buf; + this->legacy.read_byte = ams_delta_read_byte; + this->legacy.write_buf = ams_delta_write_buf; + this->legacy.read_buf = ams_delta_read_buf; this->cmd_ctrl = ams_delta_hwcontrol;if (gpio_request (AMS_DELTA_GPIO_PIN_NAND_RB ,"nand_rdy" ) ==0 ) { this->dev_ready = ams_delta_nand_ready;
drivers/mtd/nand/raw/atmel/nand-controller.c +4 -4
@@ -1473,10 +1473,10 @@ static void atmel_nand_init(struct atmel_nand_controller *nc, nand->base.controller = &nc->base; chip->cmd_ctrl = atmel_nand_cmd_ctrl; - chip->read_byte = atmel_nand_read_byte; - chip->write_byte = atmel_nand_write_byte; - chip->read_buf = atmel_nand_read_buf; - chip->write_buf = atmel_nand_write_buf; + chip->legacy.read_byte = atmel_nand_read_byte; + chip->legacy.write_byte = atmel_nand_write_byte; + chip->legacy.read_buf = atmel_nand_read_buf; + chip->legacy.write_buf = atmel_nand_write_buf; chip->select_chip = atmel_nand_select_chip;if (nc->mck && nc->caps->ops->setup_data_interface)
drivers/mtd/nand/raw/au1550nd.c +3 -3
@@ -440,10 +440,10 @@ static int au1550nd_probe(struct platform_device *pdev)if (pd->devwidth) this->options |=NAND_BUSWIDTH_16 ; - this->read_byte = (pd->devwidth) ? au_read_byte16 : au_read_byte; + this->legacy.read_byte = (pd->devwidth) ? au_read_byte16 : au_read_byte; ctx->write_byte = (pd->devwidth) ? au_write_byte16 : au_write_byte; - this->write_buf = (pd->devwidth) ? au_write_buf16 : au_write_buf; - this->read_buf = (pd->devwidth) ? au_read_buf16 : au_read_buf; + this->legacy.write_buf = (pd->devwidth) ? au_write_buf16 : au_write_buf; + this->legacy.read_buf = (pd->devwidth) ? au_read_buf16 : au_read_buf; ret =nand_scan (this,1 );if (ret) {
drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c +3 -3
@@ -387,9 +387,9 @@ int bcm47xxnflash_ops_bcm4706_init(struct bcm47xxnflash *b47n) nand_chip->cmd_ctrl = bcm47xxnflash_ops_bcm4706_cmd_ctrl; nand_chip->dev_ready = bcm47xxnflash_ops_bcm4706_dev_ready; b47n->nand_chip.cmdfunc = bcm47xxnflash_ops_bcm4706_cmdfunc; - b47n->nand_chip.read_byte = bcm47xxnflash_ops_bcm4706_read_byte; - b47n->nand_chip.read_buf = bcm47xxnflash_ops_bcm4706_read_buf; - b47n->nand_chip.write_buf = bcm47xxnflash_ops_bcm4706_write_buf; + b47n->nand_chip.legacy.read_byte = bcm47xxnflash_ops_bcm4706_read_byte; + b47n->nand_chip.legacy.read_buf = bcm47xxnflash_ops_bcm4706_read_buf; + b47n->nand_chip.legacy.write_buf = bcm47xxnflash_ops_bcm4706_write_buf; b47n->nand_chip.set_features = nand_get_set_features_notsupp; b47n->nand_chip.get_features = nand_get_set_features_notsupp;
drivers/mtd/nand/raw/brcmnand/brcmnand.c +3 -3
@@ -2273,9 +2273,9 @@ static int brcmnand_init_cs(struct brcmnand_host *host, struct device_node *dn) chip->cmd_ctrl = brcmnand_cmd_ctrl; chip->cmdfunc = brcmnand_cmdfunc; chip->waitfunc = brcmnand_waitfunc; - chip->read_byte = brcmnand_read_byte; - chip->read_buf = brcmnand_read_buf; - chip->write_buf = brcmnand_write_buf; + chip->legacy.read_byte = brcmnand_read_byte; + chip->legacy.read_buf = brcmnand_read_buf; + chip->legacy.write_buf = brcmnand_write_buf; chip->ecc.mode =NAND_ECC_HW ; chip->ecc.read_page = brcmnand_read_page;
drivers/mtd/nand/raw/cafe_nand.c +5 -5
@@ -378,7 +378,7 @@ static int cafe_nand_read_page(struct nand_chip *chip, uint8_t *buf, cafe_readl(cafe, NAND_ECC_SYN01));nand_read_page_op (chip, page,0 , buf, mtd->writesize); - chip->read_buf (chip, chip->oob_poi, mtd->oobsize); + chip->legacy.read_buf (chip, chip->oob_poi, mtd->oobsize);if (checkecc &&cafe_readl (cafe,NAND_ECC_RESULT ) & (1 <<18 )) {unsigned short syn[8 ], pat[4 ];
@@ -537,7 +537,7 @@ static int cafe_nand_write_page_lowlevel(struct nand_chip *chip,struct cafe_priv *cafe =nand_get_controller_data (chip);nand_prog_page_begin_op (chip, page,0 , buf, mtd->writesize); - chip->write_buf (chip, chip->oob_poi, mtd->oobsize); + chip->legacy.write_buf (chip, chip->oob_poi, mtd->oobsize);/* Set up ECC autogeneration */ cafe->ctl2 |= (1 <<30 );
@@ -705,9 +705,9 @@ static int cafe_nand_probe(struct pci_dev *pdev, cafe->nand.cmdfunc = cafe_nand_cmdfunc; cafe->nand.dev_ready = cafe_device_ready; - cafe->nand.read_byte = cafe_read_byte; - cafe->nand.read_buf = cafe_read_buf; - cafe->nand.write_buf = cafe_write_buf; + cafe->nand.legacy.read_byte = cafe_read_byte; + cafe->nand.legacy.read_buf = cafe_read_buf; + cafe->nand.legacy.write_buf = cafe_write_buf; cafe->nand.select_chip = cafe_select_chip; cafe->nand.set_features = nand_get_set_features_notsupp; cafe->nand.get_features = nand_get_set_features_notsupp;
drivers/mtd/nand/raw/cmx270_nand.c +3 -3
@@ -184,9 +184,9 @@ static int __init cmx270_init(void) this->ecc.algo =NAND_ECC_HAMMING ;/* read/write functions */ - this->read_byte = cmx270_read_byte; - this->read_buf = cmx270_read_buf; - this->write_buf = cmx270_write_buf; + this->legacy.read_byte = cmx270_read_byte; + this->legacy.read_buf = cmx270_read_buf; + this->legacy.write_buf = cmx270_write_buf;/* Scan to find existence of the device */ ret =nand_scan (this,1 );
drivers/mtd/nand/raw/cs553x_nand.c +3 -3
@@ -208,9 +208,9 @@ static int __init cs553x_init_one(int cs, int mmio, unsigned long adr) this->cmd_ctrl = cs553x_hwcontrol; this->dev_ready = cs553x_device_ready; - this->read_byte = cs553x_read_byte; - this->read_buf = cs553x_read_buf; - this->write_buf = cs553x_write_buf; + this->legacy.read_byte = cs553x_read_byte; + this->legacy.read_buf = cs553x_read_buf; + this->legacy.write_buf = cs553x_write_buf; this->chip_delay =0 ;
drivers/mtd/nand/raw/davinci_nand.c +2 -2
@@ -785,8 +785,8 @@ static int nand_davinci_probe(struct platform_device *pdev) info->chip.dev_ready = nand_davinci_dev_ready;/* Speed up buffer I/O */ - info->chip.read_buf = nand_davinci_read_buf; - info->chip.write_buf = nand_davinci_write_buf; + info->chip.legacy.read_buf = nand_davinci_read_buf; + info->chip.legacy.write_buf = nand_davinci_write_buf;/* Use board-specific ECC config */ info->chip.ecc.mode = pdata->ecc_mode;
drivers/mtd/nand/raw/denali.c +6 -6
@@ -1262,11 +1262,11 @@ static int denali_attach_chip(struct nand_chip *chip)mtd_set_ooblayout (mtd, &denali_ooblayout_ops);if (chip->options &NAND_BUSWIDTH_16 ) { - chip->read_buf = denali_read_buf16; - chip->write_buf = denali_write_buf16; + chip->legacy.read_buf = denali_read_buf16; + chip->legacy.write_buf = denali_write_buf16; }else { - chip->read_buf = denali_read_buf; - chip->write_buf = denali_write_buf; + chip->legacy.read_buf = denali_read_buf; + chip->legacy.write_buf = denali_write_buf; } chip->ecc.read_page = denali_read_page; chip->ecc.read_page_raw = denali_read_page_raw;
@@ -1343,8 +1343,8 @@ int denali_init(struct denali_nand_info *denali) mtd->name ="denali-nand" ; chip->select_chip = denali_select_chip; - chip->read_byte = denali_read_byte; - chip->write_byte = denali_write_byte; + chip->legacy.read_byte = denali_read_byte; + chip->legacy.write_byte = denali_write_byte; chip->cmd_ctrl = denali_cmd_ctrl; chip->dev_ready = denali_dev_ready; chip->waitfunc = denali_waitfunc;
drivers/mtd/nand/raw/diskonchip.c +14 -14
@@ -382,8 +382,8 @@ static uint16_t __init doc200x_ident_chip(struct mtd_info *mtd, int nr)*/ udelay (50 ); - ret = this->read_byte (this) <<8 ; - ret |= this->read_byte (this); + ret = this->legacy.read_byte (this) <<8 ; + ret |= this->legacy.read_byte (this);if (doc->ChipID == DOC_ChipID_Doc2k && try_dword && !nr) {/* First chip probe. See if we get same results by 32-bit access */
@@ -404,7 +404,7 @@ static uint16_t __init doc200x_ident_chip(struct mtd_info *mtd, int nr) ident.dword =readl (docptr + DoC_2k_CDSN_IO);if (((ident.byte[0 ] <<8 ) | ident.byte[1 ]) == ret) {pr_info ("DiskOnChip 2000 responds to DWORD access\n" ); - this->read_buf = &doc2000_readbuf_dword; + this->legacy.read_buf = &doc2000_readbuf_dword; } }
@@ -442,7 +442,7 @@ static int doc200x_wait(struct nand_chip *this)DoC_WaitReady (doc);nand_status_op (this,NULL );DoC_WaitReady (doc); - status = (int )this->read_byte (this); + status = (int )this->legacy.read_byte (this);return status; }
@@ -721,7 +721,7 @@ static void doc2001plus_command(struct nand_chip *this, unsigned command,WriteDOC (NAND_CMD_STATUS , docptr, Mplus_FlashCmd);WriteDOC (0 , docptr, Mplus_WritePipeTerm);WriteDOC (0 , docptr, Mplus_WritePipeTerm); -while (!(this->read_byte (this) &0x40 )) ; +while (!(this->legacy.read_byte (this) &0x40 )) ;return ;/* This applies to read commands */
@@ -1339,9 +1339,9 @@ static inline int __init doc2000_init(struct mtd_info *mtd)struct nand_chip *this =mtd_to_nand (mtd);struct doc_priv *doc =nand_get_controller_data (this); - this->read_byte = doc2000_read_byte; - this->write_buf = doc2000_writebuf; - this->read_buf = doc2000_readbuf; + this->legacy.read_byte = doc2000_read_byte; + this->legacy.write_buf = doc2000_writebuf; + this->legacy.read_buf = doc2000_readbuf; doc->late_init = nftl_scan_bbt; doc->CDSNControl =CDSN_CTRL_FLASH_IO |CDSN_CTRL_ECC_IO ;
@@ -1355,9 +1355,9 @@ static inline int __init doc2001_init(struct mtd_info *mtd)struct nand_chip *this =mtd_to_nand (mtd);struct doc_priv *doc =nand_get_controller_data (this); - this->read_byte = doc2001_read_byte; - this->write_buf = doc2001_writebuf; - this->read_buf = doc2001_readbuf; + this->legacy.read_byte = doc2001_read_byte; + this->legacy.write_buf = doc2001_writebuf; + this->legacy.read_buf = doc2001_readbuf;ReadDOC (doc->virtadr, ChipID);ReadDOC (doc->virtadr, ChipID);
@@ -1385,9 +1385,9 @@ static inline int __init doc2001plus_init(struct mtd_info *mtd)struct nand_chip *this =mtd_to_nand (mtd);struct doc_priv *doc =nand_get_controller_data (this); - this->read_byte = doc2001plus_read_byte; - this->write_buf = doc2001plus_writebuf; - this->read_buf = doc2001plus_readbuf; + this->legacy.read_byte = doc2001plus_read_byte; + this->legacy.write_buf = doc2001plus_writebuf; + this->legacy.read_buf = doc2001plus_readbuf; doc->late_init = inftl_scan_bbt; this->cmd_ctrl =NULL ; this->select_chip = doc2001plus_select_chip;
drivers/mtd/nand/raw/fsl_elbc_nand.c +3 -3
@@ -776,9 +776,9 @@ static int fsl_elbc_chip_init(struct fsl_elbc_mtd *priv)/* fill in nand_chip structure */ /* set up function call table */ - chip->read_byte = fsl_elbc_read_byte; - chip->write_buf = fsl_elbc_write_buf; - chip->read_buf = fsl_elbc_read_buf; + chip->legacy.read_byte = fsl_elbc_read_byte; + chip->legacy.write_buf = fsl_elbc_write_buf; + chip->legacy.read_buf = fsl_elbc_read_buf; chip->select_chip = fsl_elbc_select_chip; chip->cmdfunc = fsl_elbc_cmdfunc; chip->waitfunc = fsl_elbc_wait;
drivers/mtd/nand/raw/fsl_ifc_nand.c +6 -6
@@ -858,12 +858,12 @@ static int fsl_ifc_chip_init(struct fsl_ifc_mtd *priv)/* set up function call table */ if ((ifc_in32 (&ifc_global->cspr_cs[priv->bank].cspr)) &CSPR_PORT_SIZE_16 ) - chip->read_byte = fsl_ifc_read_byte16; + chip->legacy.read_byte = fsl_ifc_read_byte16;else - chip->read_byte = fsl_ifc_read_byte; + chip->legacy.read_byte = fsl_ifc_read_byte; - chip->write_buf = fsl_ifc_write_buf; - chip->read_buf = fsl_ifc_read_buf; + chip->legacy.write_buf = fsl_ifc_write_buf; + chip->legacy.read_buf = fsl_ifc_read_buf; chip->select_chip = fsl_ifc_select_chip; chip->cmdfunc = fsl_ifc_cmdfunc; chip->waitfunc = fsl_ifc_wait;
@@ -881,10 +881,10 @@ static int fsl_ifc_chip_init(struct fsl_ifc_mtd *priv)if (ifc_in32 (&ifc_global->cspr_cs[priv->bank].cspr) &CSPR_PORT_SIZE_16 ) { - chip->read_byte = fsl_ifc_read_byte16; + chip->legacy.read_byte = fsl_ifc_read_byte16; chip->options |=NAND_BUSWIDTH_16 ; }else { - chip->read_byte = fsl_ifc_read_byte; + chip->legacy.read_byte = fsl_ifc_read_byte; } chip->controller = &ifc_nand_ctrl->controller;
drivers/mtd/nand/raw/fsl_upm.c +3 -3
@@ -164,9 +164,9 @@ static int fun_chip_init(struct fsl_upm_nand *fun, fun->chip.legacy.IO_ADDR_W = fun->io_base; fun->chip.cmd_ctrl = fun_cmd_ctrl; fun->chip.chip_delay = fun->chip_delay; - fun->chip.read_byte = fun_read_byte; - fun->chip.read_buf = fun_read_buf; - fun->chip.write_buf = fun_write_buf; + fun->chip.legacy.read_byte = fun_read_byte; + fun->chip.legacy.read_buf = fun_read_buf; + fun->chip.legacy.write_buf = fun_write_buf; fun->chip.ecc.mode =NAND_ECC_SOFT ; fun->chip.ecc.algo =NAND_ECC_HAMMING ;if (fun->mchip_count >1 )
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +7 -7
@@ -1330,7 +1330,7 @@ static int gpmi_ecc_read_oob(struct nand_chip *chip, int page)/* Read out the conventional OOB. */ nand_read_page_op (chip, page, mtd->writesize,NULL ,0 ); - chip->read_buf (chip, chip->oob_poi, mtd->oobsize); + chip->legacy.read_buf (chip, chip->oob_poi, mtd->oobsize);/* * Now, we want to make sure the block mark is correct. In the
@@ -1340,7 +1340,7 @@ static int gpmi_ecc_read_oob(struct nand_chip *chip, int page)if (GPMI_IS_MX23 (this)) {/* Read the block mark into the first byte of the OOB buffer. */ nand_read_page_op (chip, page,0 ,NULL ,0 ); - chip->oob_poi[0 ] = chip->read_byte (chip); + chip->oob_poi[0 ] = chip->legacy.read_byte (chip); }return 0 ;
@@ -1628,7 +1628,7 @@ static int mx23_check_transcription_stamp(struct gpmi_nand_data *this)* and starts in the 12th byte of the page. */ nand_read_page_op (chip, page,12 ,NULL ,0 ); - chip->read_buf (chip, buffer,strlen (fingerprint)); + chip->legacy.read_buf (chip, buffer,strlen (fingerprint));/* Look for the fingerprint. */ if (!memcmp (buffer, fingerprint,strlen (fingerprint))) {
@@ -1764,7 +1764,7 @@ static int mx23_boot_init(struct gpmi_nand_data *this)/* Send the command to read the conventional block mark. */ chip->select_chip (chip, chipnr);nand_read_page_op (chip, page, mtd->writesize,NULL ,0 ); - block_mark = chip->read_byte (chip); + block_mark = chip->legacy.read_byte (chip); chip->select_chip (chip,-1 );/*
@@ -1904,9 +1904,9 @@ static int gpmi_nand_init(struct gpmi_nand_data *this) chip->setup_data_interface = gpmi_setup_data_interface; chip->cmd_ctrl = gpmi_cmd_ctrl; chip->dev_ready = gpmi_dev_ready; - chip->read_byte = gpmi_read_byte; - chip->read_buf = gpmi_read_buf; - chip->write_buf = gpmi_write_buf; + chip->legacy.read_byte = gpmi_read_byte; + chip->legacy.read_buf = gpmi_read_buf; + chip->legacy.write_buf = gpmi_write_buf; chip->badblock_pattern = &gpmi_bbt_descr; chip->block_markbad = gpmi_block_markbad; chip->options |=NAND_NO_SUBPAGE_WRITE ;
drivers/mtd/nand/raw/hisi504_nand.c +5 -5
@@ -533,7 +533,7 @@ static int hisi_nand_read_page_hwecc(struct nand_chip *chip, uint8_t *buf,int stat_1, stat_2;nand_read_page_op (chip, page,0 , buf, mtd->writesize); - chip->read_buf (chip, chip->oob_poi, mtd->oobsize); + chip->legacy.read_buf (chip, chip->oob_poi, mtd->oobsize);/* errors which can not be corrected by ECC */ if (host->irq_status &HINFC504_INTS_UE ) {
@@ -581,7 +581,7 @@ static int hisi_nand_write_page_hwecc(struct nand_chip *chip,nand_prog_page_begin_op (chip, page,0 , buf, mtd->writesize);if (oob_required) - chip->write_buf (chip, chip->oob_poi, mtd->oobsize); + chip->legacy.write_buf (chip, chip->oob_poi, mtd->oobsize);return nand_prog_page_end_op (chip); }
@@ -784,9 +784,9 @@ static int hisi_nfc_probe(struct platform_device *pdev)nand_set_flash_node (chip, np); chip->cmdfunc = hisi_nfc_cmdfunc; chip->select_chip = hisi_nfc_select_chip; - chip->read_byte = hisi_nfc_read_byte; - chip->write_buf = hisi_nfc_write_buf; - chip->read_buf = hisi_nfc_read_buf; + chip->legacy.read_byte = hisi_nfc_read_byte; + chip->legacy.write_buf = hisi_nfc_write_buf; + chip->legacy.read_buf = hisi_nfc_read_buf; chip->chip_delay =HINFC504_CHIP_DELAY ; chip->set_features = nand_get_set_features_notsupp; chip->get_features = nand_get_set_features_notsupp;
drivers/mtd/nand/raw/lpc32xx_slc.c +8 -8
@@ -624,7 +624,7 @@ static int lpc32xx_nand_read_page_syndrome(struct nand_chip *chip, uint8_t *buf, status =lpc32xx_xfer (mtd, buf, chip->ecc.steps,1 );/* Get OOB data */ - chip->read_buf (chip, chip->oob_poi, mtd->oobsize); + chip->legacy.read_buf (chip, chip->oob_poi, mtd->oobsize);/* Convert to stored ECC format */ lpc32xx_slc_ecc_copy (tmpecc, (uint32_t *) host->ecc_buf, chip->ecc.steps);
@@ -665,8 +665,8 @@ static int lpc32xx_nand_read_page_raw_syndrome(struct nand_chip *chip,nand_read_page_op (chip, page,0 ,NULL ,0 );/* Raw reads can just use the FIFO interface */ - chip->read_buf (chip, buf, chip->ecc.size * chip->ecc.steps); - chip->read_buf (chip, chip->oob_poi, mtd->oobsize); + chip->legacy.read_buf (chip, buf, chip->ecc.size * chip->ecc.steps); + chip->legacy.read_buf (chip, chip->oob_poi, mtd->oobsize);return 0 ; }
@@ -704,7 +704,7 @@ static int lpc32xx_nand_write_page_syndrome(struct nand_chip *chip,lpc32xx_slc_ecc_copy (pb, (uint32_t *)host->ecc_buf, chip->ecc.steps);/* Write ECC data to device */ - chip->write_buf (chip, chip->oob_poi, mtd->oobsize); + chip->legacy.write_buf (chip, chip->oob_poi, mtd->oobsize);return nand_prog_page_end_op (chip); }
@@ -722,7 +722,7 @@ static int lpc32xx_nand_write_page_raw_syndrome(struct nand_chip *chip,/* Raw writes can just use the FIFO interface */ nand_prog_page_begin_op (chip, page,0 , buf, chip->ecc.size * chip->ecc.steps); - chip->write_buf (chip, chip->oob_poi, mtd->oobsize); + chip->legacy.write_buf (chip, chip->oob_poi, mtd->oobsize);return nand_prog_page_end_op (chip); }
@@ -891,9 +891,9 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)/* NAND callbacks for LPC32xx SLC hardware */ chip->ecc.mode =NAND_ECC_HW_SYNDROME ; - chip->read_byte = lpc32xx_nand_read_byte; - chip->read_buf = lpc32xx_nand_read_buf; - chip->write_buf = lpc32xx_nand_write_buf; + chip->legacy.read_byte = lpc32xx_nand_read_byte; + chip->legacy.read_buf = lpc32xx_nand_read_buf; + chip->legacy.write_buf = lpc32xx_nand_write_buf; chip->ecc.read_page_raw = lpc32xx_nand_read_page_raw_syndrome; chip->ecc.read_page = lpc32xx_nand_read_page_syndrome; chip->ecc.write_page_raw = lpc32xx_nand_write_page_raw_syndrome;
drivers/mtd/nand/raw/mpc5121_nfc.c +3 -3
@@ -694,9 +694,9 @@ static int mpc5121_nfc_probe(struct platform_device *op) mtd->name ="MPC5121 NAND" ; chip->dev_ready = mpc5121_nfc_dev_ready; chip->cmdfunc = mpc5121_nfc_command; - chip->read_byte = mpc5121_nfc_read_byte; - chip->read_buf = mpc5121_nfc_read_buf; - chip->write_buf = mpc5121_nfc_write_buf; + chip->legacy.read_byte = mpc5121_nfc_read_byte; + chip->legacy.read_buf = mpc5121_nfc_read_buf; + chip->legacy.write_buf = mpc5121_nfc_write_buf; chip->select_chip = mpc5121_nfc_select_chip; chip->set_features = nand_get_set_features_notsupp; chip->get_features = nand_get_set_features_notsupp;
drivers/mtd/nand/raw/mtk_nand.c +4 -4
@@ -1334,10 +1334,10 @@ static int mtk_nfc_nand_chip_init(struct device *dev, struct mtk_nfc *nfc, nand->options |=NAND_USE_BOUNCE_BUFFER |NAND_SUBPAGE_READ ; nand->dev_ready = mtk_nfc_dev_ready; nand->select_chip = mtk_nfc_select_chip; - nand->write_byte = mtk_nfc_write_byte; - nand->write_buf = mtk_nfc_write_buf; - nand->read_byte = mtk_nfc_read_byte; - nand->read_buf = mtk_nfc_read_buf; + nand->legacy.write_byte = mtk_nfc_write_byte; + nand->legacy.write_buf = mtk_nfc_write_buf; + nand->legacy.read_byte = mtk_nfc_read_byte; + nand->legacy.read_buf = mtk_nfc_read_buf; nand->cmd_ctrl = mtk_nfc_cmd_ctrl; nand->setup_data_interface = mtk_nfc_setup_data_interface;
drivers/mtd/nand/raw/mxc_nand.c +5 -5
@@ -1402,7 +1402,7 @@ static int mxc_nand_set_features(struct nand_chip *chip, int addr, host->buf_start =0 ;for (i =0 ; i <ONFI_SUBFEATURE_PARAM_LEN ; ++i) - chip->write_byte (chip, subfeature_param[i]); + chip->legacy.write_byte (chip, subfeature_param[i]);memcpy32_toio (host->main_area0, host->data_buf, mtd->writesize); host->devtype_data->send_cmd (host,NAND_CMD_SET_FEATURES , false);
@@ -1426,7 +1426,7 @@ static int mxc_nand_get_features(struct nand_chip *chip, int addr, host->buf_start =0 ;for (i =0 ; i <ONFI_SUBFEATURE_PARAM_LEN ; ++i) - *subfeature_param++ = chip->read_byte (chip); + *subfeature_param++ = chip->legacy.read_byte (chip);return 0 ; }
@@ -1775,9 +1775,9 @@ static int mxcnd_probe(struct platform_device *pdev)nand_set_flash_node (this, pdev->dev.of_node), this->dev_ready = mxc_nand_dev_ready; this->cmdfunc = mxc_nand_command; - this->read_byte = mxc_nand_read_byte; - this->write_buf = mxc_nand_write_buf; - this->read_buf = mxc_nand_read_buf; + this->legacy.read_byte = mxc_nand_read_byte; + this->legacy.write_buf = mxc_nand_write_buf; + this->legacy.read_buf = mxc_nand_read_buf; this->set_features = mxc_nand_set_features; this->get_features = mxc_nand_get_features;
drivers/mtd/nand/raw/nand_base.c +25 -25
152 lines not on this page · raw message
drivers/mtd/nand/raw/nand_hynix.c +1 -1
@@ -108,7 +108,7 @@ static int hynix_nand_reg_write_op(struct nand_chip *chip, u8 addr, u8 val) } chip->cmdfunc (chip,NAND_CMD_NONE , column,-1 ); - chip->write_byte (chip, val); + chip->legacy.write_byte (chip, val);return 0 ; }
drivers/mtd/nand/raw/nandsim.c +4 -4
@@ -2156,7 +2156,7 @@ static void ns_nand_read_buf(struct nand_chip *chip, u_char *buf, int len)int i;for (i =0 ; i < len; i++) - buf[i] = chip->read_byte (chip); + buf[i] = chip->legacy.read_byte (chip);return ; }
@@ -2250,10 +2250,10 @@ static int __init ns_init_module(void)* Register simulator's callbacks. */ chip->cmd_ctrl = ns_hwcontrol; - chip->read_byte = ns_nand_read_byte; + chip->legacy.read_byte = ns_nand_read_byte; chip->dev_ready = ns_device_ready; - chip->write_buf = ns_nand_write_buf; - chip->read_buf = ns_nand_read_buf; + chip->legacy.write_buf = ns_nand_write_buf; + chip->legacy.read_buf = ns_nand_read_buf; chip->ecc.mode =NAND_ECC_SOFT ; chip->ecc.algo =NAND_ECC_HAMMING ;/* The NAND_SKIP_BBTSCAN option is necessary for 'overridesize' */
drivers/mtd/nand/raw/ndfc.c +2 -2
@@ -149,8 +149,8 @@ static int ndfc_chip_init(struct ndfc_controller *ndfc, chip->select_chip = ndfc_select_chip; chip->chip_delay =50 ; chip->controller = &ndfc->ndfc_control; - chip->read_buf = ndfc_read_buf; - chip->write_buf = ndfc_write_buf; + chip->legacy.read_buf = ndfc_read_buf; + chip->legacy.write_buf = ndfc_write_buf; chip->ecc.correct = nand_correct_data; chip->ecc.hwctl = ndfc_enable_hwecc; chip->ecc.calculate = ndfc_calculate_ecc;
drivers/mtd/nand/raw/nuc900_nand.c +3 -3
@@ -256,9 +256,9 @@ static int nuc900_nand_probe(struct platform_device *pdev) chip->cmdfunc = nuc900_nand_command_lp; chip->dev_ready = nuc900_nand_devready; - chip->read_byte = nuc900_nand_read_byte; - chip->write_buf = nuc900_nand_write_buf; - chip->read_buf = nuc900_nand_read_buf; + chip->legacy.read_byte = nuc900_nand_read_byte; + chip->legacy.write_buf = nuc900_nand_write_buf; + chip->legacy.read_buf = nuc900_nand_read_buf; chip->chip_delay =50 ; chip->options =0 ; chip->ecc.mode =NAND_ECC_SOFT ;
drivers/mtd/nand/raw/omap2.c +11 -11
@@ -1539,7 +1539,7 @@ static int omap_write_page_bch(struct nand_chip *chip, const uint8_t *buf, chip->ecc.hwctl (chip,NAND_ECC_WRITE );/* Write data */ - chip->write_buf (chip, buf, mtd->writesize); + chip->legacy.write_buf (chip, buf, mtd->writesize);/* Update ecc vector from GPMC result registers */ omap_calculate_ecc_bch_multi (mtd, buf, &ecc_calc[0 ]);
@@ -1550,7 +1550,7 @@ static int omap_write_page_bch(struct nand_chip *chip, const uint8_t *buf,return ret;/* Write ecc vector to OOB area */ - chip->write_buf (chip, chip->oob_poi, mtd->oobsize); + chip->legacy.write_buf (chip, chip->oob_poi, mtd->oobsize);return nand_prog_page_end_op (chip); }
@@ -1591,7 +1591,7 @@ static int omap_write_subpage_bch(struct nand_chip *chip, u32 offset, chip->ecc.hwctl (chip,NAND_ECC_WRITE );/* Write data */ - chip->write_buf (chip, buf, mtd->writesize); + chip->legacy.write_buf (chip, buf, mtd->writesize);for (step =0 ; step < ecc_steps; step++) {/* mask ECC of un-touched subpages by padding 0xFF */
@@ -1616,7 +1616,7 @@ static int omap_write_subpage_bch(struct nand_chip *chip, u32 offset,return ret;/* write OOB buffer to NAND device */ - chip->write_buf (chip, chip->oob_poi, mtd->oobsize); + chip->legacy.write_buf (chip, chip->oob_poi, mtd->oobsize);return nand_prog_page_end_op (chip); }
@@ -1650,7 +1650,7 @@ static int omap_read_page_bch(struct nand_chip *chip, uint8_t *buf, chip->ecc.hwctl (chip,NAND_ECC_READ );/* Read data */ - chip->read_buf (chip, buf, mtd->writesize); + chip->legacy.read_buf (chip, buf, mtd->writesize);/* Read oob bytes */ nand_change_read_column_op(chip,
@@ -1933,8 +1933,8 @@ static int omap_nand_attach_chip(struct nand_chip *chip)/* Re-populate low-level callbacks based on xfer modes */ switch (info->xfer_type) {case NAND_OMAP_PREFETCH_POLLED : - chip->read_buf = omap_read_buf_pref; - chip->write_buf = omap_write_buf_pref; + chip->legacy.read_buf = omap_read_buf_pref; + chip->legacy.write_buf = omap_write_buf_pref;break ;case NAND_OMAP_POLLED :
@@ -1966,8 +1966,8 @@ static int omap_nand_attach_chip(struct nand_chip *chip) err);return err; } - chip->read_buf = omap_read_buf_dma_pref; - chip->write_buf = omap_write_buf_dma_pref; + chip->legacy.read_buf = omap_read_buf_dma_pref; + chip->legacy.write_buf = omap_write_buf_dma_pref; }break ;
@@ -2002,8 +2002,8 @@ static int omap_nand_attach_chip(struct nand_chip *chip)return err; } - chip->read_buf = omap_read_buf_irq_pref; - chip->write_buf = omap_write_buf_irq_pref; + chip->legacy.read_buf = omap_read_buf_irq_pref; + chip->legacy.write_buf = omap_write_buf_irq_pref;break ;
drivers/mtd/nand/raw/orion_nand.c +1 -1
@@ -138,7 +138,7 @@ static int __init orion_nand_probe(struct platform_device *pdev)nand_set_flash_node (nc, pdev->dev.of_node); nc->legacy.IO_ADDR_R = nc->legacy.IO_ADDR_W = io_base; nc->cmd_ctrl = orion_nand_cmd_ctrl; - nc->read_buf = orion_nand_read_buf; + nc->legacy.read_buf = orion_nand_read_buf; nc->ecc.mode =NAND_ECC_SOFT ; nc->ecc.algo =NAND_ECC_HAMMING ;
drivers/mtd/nand/raw/oxnas_nand.c +3 -3
@@ -133,9 +133,9 @@ static int oxnas_nand_probe(struct platform_device *pdev) mtd->priv = chip; chip->cmd_ctrl = oxnas_nand_cmd_ctrl; - chip->read_buf = oxnas_nand_read_buf; - chip->read_byte = oxnas_nand_read_byte; - chip->write_buf = oxnas_nand_write_buf; + chip->legacy.read_buf = oxnas_nand_read_buf; + chip->legacy.read_byte = oxnas_nand_read_byte; + chip->legacy.write_buf = oxnas_nand_write_buf; chip->chip_delay =30 ;/* Scan to find existence of the device */
drivers/mtd/nand/raw/pasemi_nand.c +2 -2
@@ -141,8 +141,8 @@ static int pasemi_nand_probe(struct platform_device *ofdev) chip->cmd_ctrl = pasemi_hwcontrol; chip->dev_ready = pasemi_device_ready; - chip->read_buf = pasemi_read_buf; - chip->write_buf = pasemi_write_buf; + chip->legacy.read_buf = pasemi_read_buf; + chip->legacy.write_buf = pasemi_write_buf; chip->chip_delay =0 ; chip->ecc.mode =NAND_ECC_SOFT ; chip->ecc.algo =NAND_ECC_HAMMING ;
drivers/mtd/nand/raw/plat_nand.c +2 -2
@@ -65,8 +65,8 @@ static int plat_nand_probe(struct platform_device *pdev) data->chip.cmd_ctrl = pdata->ctrl.cmd_ctrl; data->chip.dev_ready = pdata->ctrl.dev_ready; data->chip.select_chip = pdata->ctrl.select_chip; - data->chip.write_buf = pdata->ctrl.write_buf; - data->chip.read_buf = pdata->ctrl.read_buf; + data->chip.legacy.write_buf = pdata->ctrl.write_buf; + data->chip.legacy.read_buf = pdata->ctrl.read_buf; data->chip.chip_delay = pdata->chip.chip_delay; data->chip.options |= pdata->chip.options; data->chip.bbt_options |= pdata->chip.bbt_options;
drivers/mtd/nand/raw/qcom_nandc.c +9 -8
@@ -349,7 +349,8 @@ struct nandc_regs {* @data_buffer: our local DMA buffer for page read/writes, * used when we can't use the buffer provided * by upper layers directly -* @buf_size/count/start: markers for chip->read_buf/write_buf functions +* @buf_size/count/start: markers for chip->legacy.read_buf/write_buf +* functions * @reg_read_buf: local buffer for reading back registers via DMA * @reg_read_dma: contains dma address for register read buffer * @reg_read_pos: marker for data read in reg_read_buf
@@ -2275,10 +2276,10 @@ static int qcom_nandc_block_markbad(struct nand_chip *chip, loff_t ofs) }/* -* the three functions below implement chip->read_byte(), chip->read_buf() -* and chip->write_buf() respectively. these aren't used for -* reading/writing page data, they are used for smaller data like reading -* id, status etc +* the three functions below implement chip->legacy.read_byte(), +* chip->legacy.read_buf() and chip->legacy.write_buf() respectively. these +* aren't used for reading/writing page data, they are used for smaller data +* like reading id, status etc */ static uint8_t qcom_nandc_read_byte (struct nand_chip *chip) {
@@ -2804,9 +2805,9 @@ static int qcom_nand_host_init_and_register(struct qcom_nand_controller *nandc, chip->cmdfunc = qcom_nandc_command; chip->select_chip = qcom_nandc_select_chip; - chip->read_byte = qcom_nandc_read_byte; - chip->read_buf = qcom_nandc_read_buf; - chip->write_buf = qcom_nandc_write_buf; + chip->legacy.read_byte = qcom_nandc_read_byte; + chip->legacy.read_buf = qcom_nandc_read_buf; + chip->legacy.write_buf = qcom_nandc_write_buf; chip->set_features = nand_get_set_features_notsupp; chip->get_features = nand_get_set_features_notsupp;
drivers/mtd/nand/raw/r852.c +3 -3
@@ -858,9 +858,9 @@ static int r852_probe(struct pci_dev *pci_dev, const struct pci_device_id *id) chip->dev_ready = r852_ready;/* I/O */ - chip->read_byte = r852_read_byte; - chip->read_buf = r852_read_buf; - chip->write_buf = r852_write_buf; + chip->legacy.read_byte = r852_read_byte; + chip->legacy.read_buf = r852_read_buf; + chip->legacy.write_buf = r852_write_buf;/* ecc */ chip->ecc.mode =NAND_ECC_HW_SYNDROME ;
drivers/mtd/nand/raw/s3c2410.c +4 -4
@@ -864,8 +864,8 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info,nand_set_flash_node (chip, set->of_node); - chip->write_buf = s3c2410_nand_write_buf; - chip->read_buf = s3c2410_nand_read_buf; + chip->legacy.write_buf = s3c2410_nand_write_buf; + chip->legacy.read_buf = s3c2410_nand_read_buf; chip->select_chip = s3c2410_nand_select_chip; chip->chip_delay =50 ;nand_set_controller_data (chip, nmtd);
@@ -894,8 +894,8 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info, info->sel_bit = S3C2440_NFCONT_nFCE; chip->cmd_ctrl = s3c2440_nand_hwcontrol; chip->dev_ready = s3c2440_nand_devready; - chip->read_buf = s3c2440_nand_read_buf; - chip->write_buf = s3c2440_nand_write_buf; + chip->legacy.read_buf = s3c2440_nand_read_buf; + chip->legacy.write_buf = s3c2440_nand_write_buf;break ;case TYPE_S3C2412 :
drivers/mtd/nand/raw/sh_flctl.c +5 -5
@@ -618,7 +618,7 @@ static int flctl_read_page_hwecc(struct nand_chip *chip, uint8_t *buf,nand_read_page_op (chip, page,0 , buf, mtd->writesize);if (oob_required) - chip->read_buf (chip, chip->oob_poi, mtd->oobsize); + chip->legacy.read_buf (chip, chip->oob_poi, mtd->oobsize);return 0 ; }
@@ -628,7 +628,7 @@ static int flctl_write_page_hwecc(struct nand_chip *chip, const uint8_t *buf,struct mtd_info *mtd =nand_to_mtd (chip);nand_prog_page_begin_op (chip, page,0 , buf, mtd->writesize); - chip->write_buf (chip, chip->oob_poi, mtd->oobsize); + chip->legacy.write_buf (chip, chip->oob_poi, mtd->oobsize);return nand_prog_page_end_op (chip); }
@@ -1180,9 +1180,9 @@ static int flctl_probe(struct platform_device *pdev)/* 20 us command delay time */ nand->chip_delay =20 ; - nand->read_byte = flctl_read_byte; - nand->write_buf = flctl_write_buf; - nand->read_buf = flctl_read_buf; + nand->legacy.read_byte = flctl_read_byte; + nand->legacy.write_buf = flctl_write_buf; + nand->legacy.read_buf = flctl_read_buf; nand->select_chip = flctl_select_chip; nand->cmdfunc = flctl_cmdfunc; nand->set_features = nand_get_set_features_notsupp;
drivers/mtd/nand/raw/socrates_nand.c +3 -3
@@ -153,9 +153,9 @@ static int socrates_nand_probe(struct platform_device *ofdev) mtd->dev.parent = &ofdev->dev; nand_chip->cmd_ctrl = socrates_nand_cmd_ctrl; - nand_chip->read_byte = socrates_nand_read_byte; - nand_chip->write_buf = socrates_nand_write_buf; - nand_chip->read_buf = socrates_nand_read_buf; + nand_chip->legacy.read_byte = socrates_nand_read_byte; + nand_chip->legacy.write_buf = socrates_nand_write_buf; + nand_chip->legacy.read_buf = socrates_nand_read_buf; nand_chip->dev_ready = socrates_nand_device_ready; nand_chip->ecc.mode =NAND_ECC_SOFT ;/* enable ECC */
drivers/mtd/nand/raw/sunxi_nand.c +3 -3
@@ -1924,9 +1924,9 @@ static int sunxi_nand_chip_init(struct device *dev, struct sunxi_nfc *nfc,nand_set_flash_node (nand, np); nand->select_chip = sunxi_nfc_select_chip; nand->cmd_ctrl = sunxi_nfc_cmd_ctrl; - nand->read_buf = sunxi_nfc_read_buf; - nand->write_buf = sunxi_nfc_write_buf; - nand->read_byte = sunxi_nfc_read_byte; + nand->legacy.read_buf = sunxi_nfc_read_buf; + nand->legacy.write_buf = sunxi_nfc_write_buf; + nand->legacy.read_byte = sunxi_nfc_read_byte; nand->setup_data_interface = sunxi_nfc_setup_data_interface; mtd =nand_to_mtd (nand);
drivers/mtd/nand/raw/tango_nand.c +3 -3
@@ -564,9 +564,9 @@ static int chip_init(struct device *dev, struct device_node *np) ecc = &chip->ecc; mtd =nand_to_mtd (chip); - chip->read_byte = tango_read_byte; - chip->write_buf = tango_write_buf; - chip->read_buf = tango_read_buf; + chip->legacy.read_byte = tango_read_byte; + chip->legacy.write_buf = tango_write_buf; + chip->legacy.read_buf = tango_read_buf; chip->select_chip = tango_select_chip; chip->cmd_ctrl = tango_cmd_ctrl; chip->dev_ready = tango_dev_ready;
drivers/mtd/nand/raw/tmio_nand.c +3 -3
@@ -405,9 +405,9 @@ static int tmio_probe(struct platform_device *dev)/* Set address of hardware control function */ nand_chip->cmd_ctrl = tmio_nand_hwcontrol; nand_chip->dev_ready = tmio_nand_dev_ready; - nand_chip->read_byte = tmio_nand_read_byte; - nand_chip->write_buf = tmio_nand_write_buf; - nand_chip->read_buf = tmio_nand_read_buf; + nand_chip->legacy.read_byte = tmio_nand_read_byte; + nand_chip->legacy.write_buf = tmio_nand_write_buf; + nand_chip->legacy.read_buf = tmio_nand_read_buf;/* set eccmode using hardware ECC */ nand_chip->ecc.mode =NAND_ECC_HW ;
drivers/mtd/nand/raw/txx9ndfmc.c +3 -3
@@ -324,9 +324,9 @@ static int __init txx9ndfmc_probe(struct platform_device *dev) mtd =nand_to_mtd (chip); mtd->dev.parent = &dev->dev; - chip->read_byte = txx9ndfmc_read_byte; - chip->read_buf = txx9ndfmc_read_buf; - chip->write_buf = txx9ndfmc_write_buf; + chip->legacy.read_byte = txx9ndfmc_read_byte; + chip->legacy.read_buf = txx9ndfmc_read_buf; + chip->legacy.write_buf = txx9ndfmc_write_buf; chip->cmd_ctrl = txx9ndfmc_cmd_ctrl; chip->dev_ready = txx9ndfmc_dev_ready; chip->ecc.calculate = txx9ndfmc_calculate_ecc;
drivers/mtd/nand/raw/xway_nand.c +3 -3
@@ -177,9 +177,9 @@ static int xway_nand_probe(struct platform_device *pdev) data->chip.cmd_ctrl = xway_cmd_ctrl; data->chip.dev_ready = xway_dev_ready; data->chip.select_chip = xway_select_chip; - data->chip.write_buf = xway_write_buf; - data->chip.read_buf = xway_read_buf; - data->chip.read_byte = xway_read_byte; + data->chip.legacy.write_buf = xway_write_buf; + data->chip.legacy.read_buf = xway_read_buf; + data->chip.legacy.read_byte = xway_read_byte; data->chip.chip_delay =30 ; data->chip.ecc.mode =NAND_ECC_SOFT ;
drivers/staging/mt29f_spinand/mt29f_spinand.c +4 -4
@@ -657,7 +657,7 @@ static int spinand_read_page_hwecc(struct nand_chip *chip, u8 *buf,nand_read_page_op (chip, page,0 , p, eccsize * eccsteps);if (oob_required) - chip->read_buf (chip, chip->oob_poi, mtd->oobsize); + chip->legacy.read_buf (chip, chip->oob_poi, mtd->oobsize);while (1 ) { retval =spinand_read_status (info->spi, &status);
@@ -915,9 +915,9 @@ static int spinand_probe(struct spi_device *spi_nand)nand_set_flash_node (chip, spi_nand->dev.of_node);nand_set_controller_data (chip, info); - chip->read_buf = spinand_read_buf; - chip->write_buf = spinand_write_buf; - chip->read_byte = spinand_read_byte; + chip->legacy.read_buf = spinand_read_buf; + chip->legacy.write_buf = spinand_write_buf; + chip->legacy.read_byte = spinand_read_byte; chip->cmdfunc = spinand_cmdfunc; chip->waitfunc = spinand_wait; chip->options |=NAND_CACHEPRG ;
include/linux/mtd/rawnand.h +10 -11
@@ -1176,6 +1176,10 @@ int nand_op_parser_exec_op(struct nand_chip *chip,* struct nand_legacy - NAND chip legacy fields/hooks * @IO_ADDR_R: address to read the 8 I/O lines of the flash device * @IO_ADDR_W: address to write the 8 I/O lines of the flash device +* @read_byte: read one byte from the chip +* @write_byte: write a single byte to the chip on the low 8 I/O lines +* @write_buf: write data from the buffer to the chip +* @read_buf: read data from the chip into the buffer * * If you look at this structure you're already wrong. These fields/hooks are * all deprecated.
@@ -1183,6 +1187,10 @@ int nand_op_parser_exec_op(struct nand_chip *chip,struct nand_legacy {void __iomem *IO_ADDR_R;void __iomem *IO_ADDR_W; +u8 (*read_byte)(struct nand_chip *chip); +void (*write_byte)(struct nand_chip *chip,u8 byte); +void (*write_buf)(struct nand_chip *chip,const u8 *buf,int len); +void (*read_buf)(struct nand_chip *chip,u8 *buf,int len); };/**
@@ -1193,11 +1201,6 @@ struct nand_legacy {* you're modifying an existing driver that is using those * fields/hooks, you should consider reworking the driver * avoid using them. -* @read_byte: [REPLACEABLE] read one byte from the chip -* @write_byte: [REPLACEABLE] write a single byte to the chip on the -* low 8 I/O lines -* @write_buf: [REPLACEABLE] write data from the buffer to the chip -* @read_buf: [REPLACEABLE] read data from the chip into the buffer * @select_chip: [REPLACEABLE] select chip nr * @block_bad: [REPLACEABLE] check if a block is bad, using OOB markers * @block_markbad: [REPLACEABLE] mark a block bad
@@ -1213,8 +1216,8 @@ struct nand_legacy {* ready. * @exec_op: controller specific method to execute NAND operations. * This method replaces ->cmdfunc(), -* ->{read,write}_{buf,byte,word}(), ->dev_ready() and -* ->waifunc(). +* ->legacy.{read,write}_{buf,byte,word}(), ->dev_ready() +* and ->waifunc(). * @setup_read_retry: [FLASHSPECIFIC] flash (vendor) specific function for * setting the read-retry mode. Mostly needed for MLC NAND. * @ecc: [BOARDSPECIFIC] ECC control structure
@@ -1297,10 +1300,6 @@ struct nand_chip {struct nand_legacy legacy; -uint8_t (*read_byte)(struct nand_chip *chip); -void (*write_byte)(struct nand_chip *chip,uint8_t byte); -void (*write_buf)(struct nand_chip *chip,const uint8_t *buf,int len); -void (*read_buf)(struct nand_chip *chip,uint8_t *buf,int len);void (*select_chip)(struct nand_chip *chip,int cs);int (*block_bad)(struct nand_chip *chip,loff_t ofs);int (*block_markbad)(struct nand_chip *chip,loff_t ofs);
Signature · 1 line
2.14.1
PATCH 4/19 mtd: rawnand: Deprecate ->cmd_ctrl() and ->cmdfunc()
In reply to Boris BrezillonThose hooks have been replaced by ->exec_op(). Move them to the nand_legacy struct.
--- drivers/mtd/nand/raw/ams-delta.c | 2 +- drivers/mtd/nand/raw/atmel/nand-controller.c | 4 +- drivers/mtd/nand/raw/au1550nd.c | 2 +- drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c | 6 +- drivers/mtd/nand/raw/brcmnand/brcmnand.c | 4 +- drivers/mtd/nand/raw/cafe_nand.c | 2 +- drivers/mtd/nand/raw/cmx270_nand.c | 2 +- drivers/mtd/nand/raw/cs553x_nand.c | 2 +- drivers/mtd/nand/raw/davinci_nand.c | 2 +- drivers/mtd/nand/raw/denali.c | 2 +- drivers/mtd/nand/raw/diskonchip.c | 6 +- drivers/mtd/nand/raw/fsl_elbc_nand.c | 2 +- drivers/mtd/nand/raw/fsl_ifc_nand.c | 2 +- drivers/mtd/nand/raw/fsl_upm.c | 4 +- drivers/mtd/nand/raw/gpio.c | 2 +- drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 2 +- drivers/mtd/nand/raw/hisi504_nand.c | 2 +- drivers/mtd/nand/raw/jz4740_nand.c | 2 +- drivers/mtd/nand/raw/jz4780_nand.c | 2 +- drivers/mtd/nand/raw/lpc32xx_mlc.c | 2 +- drivers/mtd/nand/raw/lpc32xx_slc.c | 2 +- drivers/mtd/nand/raw/mpc5121_nfc.c | 2 +- drivers/mtd/nand/raw/mtk_nand.c | 2 +- drivers/mtd/nand/raw/mxc_nand.c | 2 +- drivers/mtd/nand/raw/nand_base.c | 138 ++++++++++++----------- drivers/mtd/nand/raw/nand_hynix.c | 4 +- drivers/mtd/nand/raw/nandsim.c | 2 +- drivers/mtd/nand/raw/ndfc.c | 2 +- drivers/mtd/nand/raw/nuc900_nand.c | 2 +- drivers/mtd/nand/raw/omap2.c | 2 +- drivers/mtd/nand/raw/orion_nand.c | 2 +- drivers/mtd/nand/raw/oxnas_nand.c | 2 +- drivers/mtd/nand/raw/pasemi_nand.c | 2 +- drivers/mtd/nand/raw/plat_nand.c | 2 +- drivers/mtd/nand/raw/qcom_nandc.c | 14 +-- drivers/mtd/nand/raw/r852.c | 2 +- drivers/mtd/nand/raw/s3c2410.c | 6 +- drivers/mtd/nand/raw/sh_flctl.c | 2 +- drivers/mtd/nand/raw/sharpsl.c | 2 +- drivers/mtd/nand/raw/socrates_nand.c | 2 +- drivers/mtd/nand/raw/sunxi_nand.c | 2 +- drivers/mtd/nand/raw/tango_nand.c | 2 +- drivers/mtd/nand/raw/tmio_nand.c | 2 +- drivers/mtd/nand/raw/txx9ndfmc.c | 2 +- drivers/mtd/nand/raw/xway_nand.c | 2 +- drivers/staging/mt29f_spinand/mt29f_spinand.c | 2 +- include/linux/mtd/rawnand.h | 21 ++-- 47 files changed, 144 insertions(+), 137 deletions(-)
drivers/mtd/nand/raw/ams-delta.c +1 -1
@@ -213,7 +213,7 @@ static int ams_delta_init(struct platform_device *pdev) this->legacy.read_byte = ams_delta_read_byte; this->legacy.write_buf = ams_delta_write_buf; this->legacy.read_buf = ams_delta_read_buf; - this->cmd_ctrl = ams_delta_hwcontrol; + this->legacy.cmd_ctrl = ams_delta_hwcontrol;if (gpio_request (AMS_DELTA_GPIO_PIN_NAND_RB ,"nand_rdy" ) ==0 ) { this->dev_ready = ams_delta_nand_ready; }else {
drivers/mtd/nand/raw/atmel/nand-controller.c +2 -2
@@ -1472,7 +1472,7 @@ static void atmel_nand_init(struct atmel_nand_controller *nc, mtd->dev.parent = nc->dev; nand->base.controller = &nc->base; - chip->cmd_ctrl = atmel_nand_cmd_ctrl; + chip->legacy.cmd_ctrl = atmel_nand_cmd_ctrl; chip->legacy.read_byte = atmel_nand_read_byte; chip->legacy.write_byte = atmel_nand_write_byte; chip->legacy.read_buf = atmel_nand_read_buf;
@@ -1524,7 +1524,7 @@ static void atmel_hsmc_nand_init(struct atmel_nand_controller *nc,atmel_nand_init (nc, nand);/* Overload some methods for the HSMC controller. */ - chip->cmd_ctrl = atmel_hsmc_nand_cmd_ctrl; + chip->legacy.cmd_ctrl = atmel_hsmc_nand_cmd_ctrl; chip->select_chip = atmel_hsmc_nand_select_chip; }
drivers/mtd/nand/raw/au1550nd.c +1 -1
@@ -430,7 +430,7 @@ static int au1550nd_probe(struct platform_device *pdev) this->dev_ready = au1550_device_ready; this->select_chip = au1550_select_chip; - this->cmdfunc = au1550_command; + this->legacy.cmdfunc = au1550_command;/* 30 us command delay time */ this->chip_delay =30 ;
drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c +3 -3
@@ -227,7 +227,7 @@ static void bcm47xxnflash_ops_bcm4706_cmdfunc(struct nand_chip *nand_chip,switch (command) {case NAND_CMD_RESET : - nand_chip->cmd_ctrl (nand_chip, command,NAND_CTRL_CLE ); + nand_chip->legacy.cmd_ctrl (nand_chip, command,NAND_CTRL_CLE );ndelay (100 );nand_wait_ready (nand_chip);
@@ -384,9 +384,9 @@ int bcm47xxnflash_ops_bcm4706_init(struct bcm47xxnflash *b47n)u32 val; b47n->nand_chip.select_chip = bcm47xxnflash_ops_bcm4706_select_chip; - nand_chip->cmd_ctrl = bcm47xxnflash_ops_bcm4706_cmd_ctrl; + nand_chip->legacy.cmd_ctrl = bcm47xxnflash_ops_bcm4706_cmd_ctrl; nand_chip->dev_ready = bcm47xxnflash_ops_bcm4706_dev_ready; - b47n->nand_chip.cmdfunc = bcm47xxnflash_ops_bcm4706_cmdfunc; + b47n->nand_chip.legacy.cmdfunc = bcm47xxnflash_ops_bcm4706_cmdfunc; b47n->nand_chip.legacy.read_byte = bcm47xxnflash_ops_bcm4706_read_byte; b47n->nand_chip.legacy.read_buf = bcm47xxnflash_ops_bcm4706_read_buf; b47n->nand_chip.legacy.write_buf = bcm47xxnflash_ops_bcm4706_write_buf;
drivers/mtd/nand/raw/brcmnand/brcmnand.c +2 -2
@@ -2270,8 +2270,8 @@ static int brcmnand_init_cs(struct brcmnand_host *host, struct device_node *dn) mtd->owner =THIS_MODULE ; mtd->dev.parent = &pdev->dev; - chip->cmd_ctrl = brcmnand_cmd_ctrl; - chip->cmdfunc = brcmnand_cmdfunc; + chip->legacy.cmd_ctrl = brcmnand_cmd_ctrl; + chip->legacy.cmdfunc = brcmnand_cmdfunc; chip->waitfunc = brcmnand_waitfunc; chip->legacy.read_byte = brcmnand_read_byte; chip->legacy.read_buf = brcmnand_read_buf;
drivers/mtd/nand/raw/cafe_nand.c +1 -1
@@ -703,7 +703,7 @@ static int cafe_nand_probe(struct pci_dev *pdev, goto out_ior; } - cafe->nand.cmdfunc = cafe_nand_cmdfunc; + cafe->nand.legacy.cmdfunc = cafe_nand_cmdfunc; cafe->nand.dev_ready = cafe_device_ready; cafe->nand.legacy.read_byte = cafe_read_byte; cafe->nand.legacy.read_buf = cafe_read_buf;
drivers/mtd/nand/raw/cmx270_nand.c +1 -1
@@ -175,7 +175,7 @@ static int __init cmx270_init(void)/* insert callbacks */ this->legacy.IO_ADDR_R = cmx270_nand_io; this->legacy.IO_ADDR_W = cmx270_nand_io; - this->cmd_ctrl = cmx270_hwcontrol; + this->legacy.cmd_ctrl = cmx270_hwcontrol; this->dev_ready = cmx270_device_ready;/* 15 us command delay time */
drivers/mtd/nand/raw/cs553x_nand.c +1 -1
@@ -206,7 +206,7 @@ static int __init cs553x_init_one(int cs, int mmio, unsigned long adr) goto out_mtd; } - this->cmd_ctrl = cs553x_hwcontrol; + this->legacy.cmd_ctrl = cs553x_hwcontrol; this->dev_ready = cs553x_device_ready; this->legacy.read_byte = cs553x_read_byte; this->legacy.read_buf = cs553x_read_buf;
drivers/mtd/nand/raw/davinci_nand.c +1 -1
@@ -781,7 +781,7 @@ static int nand_davinci_probe(struct platform_device *pdev) info->mask_cle = pdata->mask_cle ? :MASK_CLE ;/* Set address of hardware control function */ - info->chip.cmd_ctrl = nand_davinci_hwcontrol; + info->chip.legacy.cmd_ctrl = nand_davinci_hwcontrol; info->chip.dev_ready = nand_davinci_dev_ready;/* Speed up buffer I/O */
drivers/mtd/nand/raw/denali.c +1 -1
@@ -1345,7 +1345,7 @@ int denali_init(struct denali_nand_info *denali) chip->select_chip = denali_select_chip; chip->legacy.read_byte = denali_read_byte; chip->legacy.write_byte = denali_write_byte; - chip->cmd_ctrl = denali_cmd_ctrl; + chip->legacy.cmd_ctrl = denali_cmd_ctrl; chip->dev_ready = denali_dev_ready; chip->waitfunc = denali_waitfunc;
drivers/mtd/nand/raw/diskonchip.c +3 -3
@@ -1389,9 +1389,9 @@ static inline int __init doc2001plus_init(struct mtd_info *mtd) this->legacy.write_buf = doc2001plus_writebuf; this->legacy.read_buf = doc2001plus_readbuf; doc->late_init = inftl_scan_bbt; - this->cmd_ctrl =NULL ; + this->legacy.cmd_ctrl =NULL ; this->select_chip = doc2001plus_select_chip; - this->cmdfunc = doc2001plus_command; + this->legacy.cmdfunc = doc2001plus_command; this->ecc.hwctl = doc2001plus_enable_hwecc; doc->chips_per_floor =1 ;
@@ -1569,7 +1569,7 @@ static int __init doc_probe(unsigned long physadr)nand_set_controller_data (nand, doc); nand->select_chip = doc200x_select_chip; - nand->cmd_ctrl = doc200x_hwcontrol; + nand->legacy.cmd_ctrl = doc200x_hwcontrol; nand->dev_ready = doc200x_dev_ready; nand->waitfunc = doc200x_wait; nand->block_bad = doc200x_block_bad;
drivers/mtd/nand/raw/fsl_elbc_nand.c +1 -1
@@ -780,7 +780,7 @@ static int fsl_elbc_chip_init(struct fsl_elbc_mtd *priv) chip->legacy.write_buf = fsl_elbc_write_buf; chip->legacy.read_buf = fsl_elbc_read_buf; chip->select_chip = fsl_elbc_select_chip; - chip->cmdfunc = fsl_elbc_cmdfunc; + chip->legacy.cmdfunc = fsl_elbc_cmdfunc; chip->waitfunc = fsl_elbc_wait; chip->set_features = nand_get_set_features_notsupp; chip->get_features = nand_get_set_features_notsupp;
drivers/mtd/nand/raw/fsl_ifc_nand.c +1 -1
@@ -865,7 +865,7 @@ static int fsl_ifc_chip_init(struct fsl_ifc_mtd *priv) chip->legacy.write_buf = fsl_ifc_write_buf; chip->legacy.read_buf = fsl_ifc_read_buf; chip->select_chip = fsl_ifc_select_chip; - chip->cmdfunc = fsl_ifc_cmdfunc; + chip->legacy.cmdfunc = fsl_ifc_cmdfunc; chip->waitfunc = fsl_ifc_wait; chip->set_features = nand_get_set_features_notsupp; chip->get_features = nand_get_set_features_notsupp;
drivers/mtd/nand/raw/fsl_upm.c +2 -2
@@ -112,7 +112,7 @@ static void fun_select_chip(struct nand_chip *chip, int mchip_nr)struct fsl_upm_nand *fun =to_fsl_upm_nand (nand_to_mtd (chip));if (mchip_nr ==-1 ) { - chip->cmd_ctrl (chip,NAND_CMD_NONE ,0 |NAND_CTRL_CHANGE ); + chip->legacy.cmd_ctrl (chip,NAND_CMD_NONE ,0 |NAND_CTRL_CHANGE ); }else if (mchip_nr >=0 && mchip_nr <NAND_MAX_CHIPS ) { fun->mchip_number = mchip_nr; chip->legacy.IO_ADDR_R = fun->io_base + fun->mchip_offsets[mchip_nr];
@@ -162,7 +162,7 @@ static int fun_chip_init(struct fsl_upm_nand *fun, fun->chip.legacy.IO_ADDR_R = fun->io_base; fun->chip.legacy.IO_ADDR_W = fun->io_base; - fun->chip.cmd_ctrl = fun_cmd_ctrl; + fun->chip.legacy.cmd_ctrl = fun_cmd_ctrl; fun->chip.chip_delay = fun->chip_delay; fun->chip.legacy.read_byte = fun_read_byte; fun->chip.legacy.read_buf = fun_read_buf;
drivers/mtd/nand/raw/gpio.c +1 -1
@@ -279,7 +279,7 @@ static int gpio_nand_probe(struct platform_device *pdev) chip->ecc.algo =NAND_ECC_HAMMING ; chip->options = gpiomtd->plat.options; chip->chip_delay = gpiomtd->plat.chip_delay; - chip->cmd_ctrl = gpio_nand_cmd_ctrl; + chip->legacy.cmd_ctrl = gpio_nand_cmd_ctrl; mtd =nand_to_mtd (chip); mtd->dev.parent = dev;
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +1 -1
@@ -1902,7 +1902,7 @@ static int gpmi_nand_init(struct gpmi_nand_data *this)nand_set_flash_node (chip, this->pdev->dev.of_node); chip->select_chip = gpmi_select_chip; chip->setup_data_interface = gpmi_setup_data_interface; - chip->cmd_ctrl = gpmi_cmd_ctrl; + chip->legacy.cmd_ctrl = gpmi_cmd_ctrl; chip->dev_ready = gpmi_dev_ready; chip->legacy.read_byte = gpmi_read_byte; chip->legacy.read_buf = gpmi_read_buf;
drivers/mtd/nand/raw/hisi504_nand.c +1 -1
@@ -782,7 +782,7 @@ static int hisi_nfc_probe(struct platform_device *pdev)nand_set_controller_data (chip, host);nand_set_flash_node (chip, np); - chip->cmdfunc = hisi_nfc_cmdfunc; + chip->legacy.cmdfunc = hisi_nfc_cmdfunc; chip->select_chip = hisi_nfc_select_chip; chip->legacy.read_byte = hisi_nfc_read_byte; chip->legacy.write_buf = hisi_nfc_write_buf;
drivers/mtd/nand/raw/jz4740_nand.c +1 -1
@@ -426,7 +426,7 @@ static int jz_nand_probe(struct platform_device *pdev) chip->ecc.options =NAND_ECC_GENERIC_ERASED_CHECK ; chip->chip_delay =50 ; - chip->cmd_ctrl = jz_nand_cmd_ctrl; + chip->legacy.cmd_ctrl = jz_nand_cmd_ctrl; chip->select_chip = jz_nand_select_chip; chip->dummy_controller.ops = &jz_nand_controller_ops;
drivers/mtd/nand/raw/jz4780_nand.c +1 -1
@@ -280,7 +280,7 @@ static int jz4780_nand_init_chip(struct platform_device *pdev, chip->chip_delay =RB_DELAY_US ; chip->options =NAND_NO_SUBPAGE_WRITE ; chip->select_chip = jz4780_nand_select_chip; - chip->cmd_ctrl = jz4780_nand_cmd_ctrl; + chip->legacy.cmd_ctrl = jz4780_nand_cmd_ctrl; chip->ecc.mode =NAND_ECC_HW ; chip->controller = &nfc->controller;nand_set_flash_node (chip, np);
drivers/mtd/nand/raw/lpc32xx_mlc.c +1 -1
@@ -739,7 +739,7 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)if (res) goto put_clk; - nand_chip->cmd_ctrl = lpc32xx_nand_cmd_ctrl; + nand_chip->legacy.cmd_ctrl = lpc32xx_nand_cmd_ctrl; nand_chip->dev_ready = lpc32xx_nand_device_ready; nand_chip->chip_delay =25 ;/* us */ nand_chip->legacy.IO_ADDR_R =MLC_DATA (host->io_base);
drivers/mtd/nand/raw/lpc32xx_slc.c +1 -1
@@ -880,7 +880,7 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)/* Set NAND IO addresses and command/ready functions */ chip->legacy.IO_ADDR_R =SLC_DATA (host->io_base); chip->legacy.IO_ADDR_W =SLC_DATA (host->io_base); - chip->cmd_ctrl = lpc32xx_nand_cmd_ctrl; + chip->legacy.cmd_ctrl = lpc32xx_nand_cmd_ctrl; chip->dev_ready = lpc32xx_nand_device_ready; chip->chip_delay =20 ;/* 20us command delay time */
drivers/mtd/nand/raw/mpc5121_nfc.c +1 -1
@@ -693,7 +693,7 @@ static int mpc5121_nfc_probe(struct platform_device *op) mtd->name ="MPC5121 NAND" ; chip->dev_ready = mpc5121_nfc_dev_ready; - chip->cmdfunc = mpc5121_nfc_command; + chip->legacy.cmdfunc = mpc5121_nfc_command; chip->legacy.read_byte = mpc5121_nfc_read_byte; chip->legacy.read_buf = mpc5121_nfc_read_buf; chip->legacy.write_buf = mpc5121_nfc_write_buf;
drivers/mtd/nand/raw/mtk_nand.c +1 -1
@@ -1338,7 +1338,7 @@ static int mtk_nfc_nand_chip_init(struct device *dev, struct mtk_nfc *nfc, nand->legacy.write_buf = mtk_nfc_write_buf; nand->legacy.read_byte = mtk_nfc_read_byte; nand->legacy.read_buf = mtk_nfc_read_buf; - nand->cmd_ctrl = mtk_nfc_cmd_ctrl; + nand->legacy.cmd_ctrl = mtk_nfc_cmd_ctrl; nand->setup_data_interface = mtk_nfc_setup_data_interface;/* set default mode in case dt entry is missing */
drivers/mtd/nand/raw/mxc_nand.c +1 -1
@@ -1774,7 +1774,7 @@ static int mxcnd_probe(struct platform_device *pdev)nand_set_controller_data (this, host);nand_set_flash_node (this, pdev->dev.of_node), this->dev_ready = mxc_nand_dev_ready; - this->cmdfunc = mxc_nand_command; + this->legacy.cmdfunc = mxc_nand_command; this->legacy.read_byte = mxc_nand_read_byte; this->legacy.write_buf = mxc_nand_write_buf; this->legacy.read_buf = mxc_nand_read_buf;
drivers/mtd/nand/raw/nand_base.c +73 -65
330 lines not on this page · raw message
drivers/mtd/nand/raw/nand_hynix.c +2 -2
@@ -88,7 +88,7 @@ static int hynix_nand_cmd_op(struct nand_chip *chip, u8 cmd)return nand_exec_op (chip, &op); } - chip->cmdfunc (chip, cmd,-1 ,-1 ); + chip->legacy.cmdfunc (chip, cmd,-1 ,-1 );return 0 ; }
@@ -107,7 +107,7 @@ static int hynix_nand_reg_write_op(struct nand_chip *chip, u8 addr, u8 val)return nand_exec_op (chip, &op); } - chip->cmdfunc (chip,NAND_CMD_NONE , column,-1 ); + chip->legacy.cmdfunc (chip,NAND_CMD_NONE , column,-1 ); chip->legacy.write_byte (chip, val);return 0 ;
drivers/mtd/nand/raw/nandsim.c +1 -1
@@ -2249,7 +2249,7 @@ static int __init ns_init_module(void)/* * Register simulator's callbacks. */ - chip->cmd_ctrl = ns_hwcontrol; + chip->legacy.cmd_ctrl = ns_hwcontrol; chip->legacy.read_byte = ns_nand_read_byte; chip->dev_ready = ns_device_ready; chip->legacy.write_buf = ns_nand_write_buf;
drivers/mtd/nand/raw/ndfc.c +1 -1
@@ -144,7 +144,7 @@ static int ndfc_chip_init(struct ndfc_controller *ndfc, chip->legacy.IO_ADDR_R = ndfc->ndfcbase +NDFC_DATA ; chip->legacy.IO_ADDR_W = ndfc->ndfcbase +NDFC_DATA ; - chip->cmd_ctrl = ndfc_hwcontrol; + chip->legacy.cmd_ctrl = ndfc_hwcontrol; chip->dev_ready = ndfc_ready; chip->select_chip = ndfc_select_chip; chip->chip_delay =50 ;
drivers/mtd/nand/raw/nuc900_nand.c +1 -1
@@ -254,7 +254,7 @@ static int nuc900_nand_probe(struct platform_device *pdev)return -ENOENT ;clk_enable (nuc900_nand->clk); - chip->cmdfunc = nuc900_nand_command_lp; + chip->legacy.cmdfunc = nuc900_nand_command_lp; chip->dev_ready = nuc900_nand_devready; chip->legacy.read_byte = nuc900_nand_read_byte; chip->legacy.write_buf = nuc900_nand_write_buf;
drivers/mtd/nand/raw/omap2.c +1 -1
@@ -2230,7 +2230,7 @@ static int omap_nand_probe(struct platform_device *pdev) nand_chip->controller = &omap_gpmc_controller; nand_chip->legacy.IO_ADDR_W = nand_chip->legacy.IO_ADDR_R; - nand_chip->cmd_ctrl = omap_hwcontrol; + nand_chip->legacy.cmd_ctrl = omap_hwcontrol; info->ready_gpiod =devm_gpiod_get_optional (&pdev->dev,"rb" ,GPIOD_IN );
drivers/mtd/nand/raw/orion_nand.c +1 -1
@@ -137,7 +137,7 @@ static int __init orion_nand_probe(struct platform_device *pdev)nand_set_controller_data (nc, board);nand_set_flash_node (nc, pdev->dev.of_node); nc->legacy.IO_ADDR_R = nc->legacy.IO_ADDR_W = io_base; - nc->cmd_ctrl = orion_nand_cmd_ctrl; + nc->legacy.cmd_ctrl = orion_nand_cmd_ctrl; nc->legacy.read_buf = orion_nand_read_buf; nc->ecc.mode =NAND_ECC_SOFT ; nc->ecc.algo =NAND_ECC_HAMMING ;
drivers/mtd/nand/raw/oxnas_nand.c +1 -1
@@ -132,7 +132,7 @@ static int oxnas_nand_probe(struct platform_device *pdev) mtd->dev.parent = &pdev->dev; mtd->priv = chip; - chip->cmd_ctrl = oxnas_nand_cmd_ctrl; + chip->legacy.cmd_ctrl = oxnas_nand_cmd_ctrl; chip->legacy.read_buf = oxnas_nand_read_buf; chip->legacy.read_byte = oxnas_nand_read_byte; chip->legacy.write_buf = oxnas_nand_write_buf;
drivers/mtd/nand/raw/pasemi_nand.c +1 -1
@@ -139,7 +139,7 @@ static int pasemi_nand_probe(struct platform_device *ofdev) goto out_ior; } - chip->cmd_ctrl = pasemi_hwcontrol; + chip->legacy.cmd_ctrl = pasemi_hwcontrol; chip->dev_ready = pasemi_device_ready; chip->legacy.read_buf = pasemi_read_buf; chip->legacy.write_buf = pasemi_write_buf;
drivers/mtd/nand/raw/plat_nand.c +1 -1
@@ -62,7 +62,7 @@ static int plat_nand_probe(struct platform_device *pdev) data->chip.legacy.IO_ADDR_R = data->io_base; data->chip.legacy.IO_ADDR_W = data->io_base; - data->chip.cmd_ctrl = pdata->ctrl.cmd_ctrl; + data->chip.legacy.cmd_ctrl = pdata->ctrl.cmd_ctrl; data->chip.dev_ready = pdata->ctrl.dev_ready; data->chip.select_chip = pdata->ctrl.select_chip; data->chip.legacy.write_buf = pdata->ctrl.write_buf;
drivers/mtd/nand/raw/qcom_nandc.c +7 -7
@@ -1155,8 +1155,8 @@ static void config_nand_cw_write(struct qcom_nand_controller *nandc) }/* -* the following functions are used within chip->cmdfunc() to perform different -* NAND_CMD_* commands +* the following functions are used within chip->legacy.cmdfunc() to +* perform different NAND_CMD_* commands */ /* sets up descriptors for NAND_CMD_PARAM */
@@ -1436,10 +1436,10 @@ static void post_command(struct qcom_nand_host *host, int command) }/* -* Implements chip->cmdfunc. It's only used for a limited set of commands. -* The rest of the commands wouldn't be called by upper layers. For example, -* NAND_CMD_READOOB would never be called because we have our own versions -* of read_oob ops for nand_ecc_ctrl. +* Implements chip->legacy.cmdfunc. It's only used for a limited set of +* commands. The rest of the commands wouldn't be called by upper layers. +* For example, NAND_CMD_READOOB would never be called because we have our own +* versions of read_oob ops for nand_ecc_ctrl. */ static void qcom_nandc_command (struct nand_chip *chip,unsigned int command,int column,int page_addr)
@@ -2803,7 +2803,7 @@ static int qcom_nand_host_init_and_register(struct qcom_nand_controller *nandc, mtd->owner =THIS_MODULE ; mtd->dev.parent = dev; - chip->cmdfunc = qcom_nandc_command; + chip->legacy.cmdfunc = qcom_nandc_command; chip->select_chip = qcom_nandc_select_chip; chip->legacy.read_byte = qcom_nandc_read_byte; chip->legacy.read_buf = qcom_nandc_read_buf;
drivers/mtd/nand/raw/r852.c +1 -1
@@ -853,7 +853,7 @@ static int r852_probe(struct pci_dev *pci_dev, const struct pci_device_id *id) goto error4;/* commands */ - chip->cmd_ctrl = r852_cmdctl; + chip->legacy.cmd_ctrl = r852_cmdctl; chip->waitfunc = r852_wait; chip->dev_ready = r852_ready;
drivers/mtd/nand/raw/s3c2410.c +3 -3
@@ -884,7 +884,7 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info, chip->legacy.IO_ADDR_W = regs +S3C2410_NFDATA ; info->sel_reg = regs +S3C2410_NFCONF ; info->sel_bit = S3C2410_NFCONF_nFCE; - chip->cmd_ctrl = s3c2410_nand_hwcontrol; + chip->legacy.cmd_ctrl = s3c2410_nand_hwcontrol; chip->dev_ready = s3c2410_nand_devready;break ;
@@ -892,7 +892,7 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info, chip->legacy.IO_ADDR_W = regs +S3C2440_NFDATA ; info->sel_reg = regs +S3C2440_NFCONT ; info->sel_bit = S3C2440_NFCONT_nFCE; - chip->cmd_ctrl = s3c2440_nand_hwcontrol; + chip->legacy.cmd_ctrl = s3c2440_nand_hwcontrol; chip->dev_ready = s3c2440_nand_devready; chip->legacy.read_buf = s3c2440_nand_read_buf; chip->legacy.write_buf = s3c2440_nand_write_buf;
@@ -902,7 +902,7 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info, chip->legacy.IO_ADDR_W = regs +S3C2440_NFDATA ; info->sel_reg = regs +S3C2440_NFCONT ; info->sel_bit = S3C2412_NFCONT_nFCE0; - chip->cmd_ctrl = s3c2440_nand_hwcontrol; + chip->legacy.cmd_ctrl = s3c2440_nand_hwcontrol; chip->dev_ready = s3c2412_nand_devready;if (readl (regs +S3C2410_NFCONF ) &S3C2412_NFCONF_NANDBOOT )
drivers/mtd/nand/raw/sh_flctl.c +1 -1
@@ -1184,7 +1184,7 @@ static int flctl_probe(struct platform_device *pdev) nand->legacy.write_buf = flctl_write_buf; nand->legacy.read_buf = flctl_read_buf; nand->select_chip = flctl_select_chip; - nand->cmdfunc = flctl_cmdfunc; + nand->legacy.cmdfunc = flctl_cmdfunc; nand->set_features = nand_get_set_features_notsupp; nand->get_features = nand_get_set_features_notsupp;
drivers/mtd/nand/raw/sharpsl.c +1 -1
@@ -156,7 +156,7 @@ static int sharpsl_nand_probe(struct platform_device *pdev) this->legacy.IO_ADDR_R = sharpsl->io +FLASHIO ; this->legacy.IO_ADDR_W = sharpsl->io +FLASHIO ;/* Set address of hardware control function */ - this->cmd_ctrl = sharpsl_nand_hwcontrol; + this->legacy.cmd_ctrl = sharpsl_nand_hwcontrol; this->dev_ready = sharpsl_nand_dev_ready;/* 15 us command delay time */ this->chip_delay =15 ;
drivers/mtd/nand/raw/socrates_nand.c +1 -1
@@ -152,7 +152,7 @@ static int socrates_nand_probe(struct platform_device *ofdev) mtd->name ="socrates_nand" ; mtd->dev.parent = &ofdev->dev; - nand_chip->cmd_ctrl = socrates_nand_cmd_ctrl; + nand_chip->legacy.cmd_ctrl = socrates_nand_cmd_ctrl; nand_chip->legacy.read_byte = socrates_nand_read_byte; nand_chip->legacy.write_buf = socrates_nand_write_buf; nand_chip->legacy.read_buf = socrates_nand_read_buf;
drivers/mtd/nand/raw/sunxi_nand.c +1 -1
@@ -1923,7 +1923,7 @@ static int sunxi_nand_chip_init(struct device *dev, struct sunxi_nfc *nfc, nand->ecc.mode =NAND_ECC_HW ;nand_set_flash_node (nand, np); nand->select_chip = sunxi_nfc_select_chip; - nand->cmd_ctrl = sunxi_nfc_cmd_ctrl; + nand->legacy.cmd_ctrl = sunxi_nfc_cmd_ctrl; nand->legacy.read_buf = sunxi_nfc_read_buf; nand->legacy.write_buf = sunxi_nfc_write_buf; nand->legacy.read_byte = sunxi_nfc_read_byte;
drivers/mtd/nand/raw/tango_nand.c +1 -1
@@ -568,7 +568,7 @@ static int chip_init(struct device *dev, struct device_node *np) chip->legacy.write_buf = tango_write_buf; chip->legacy.read_buf = tango_read_buf; chip->select_chip = tango_select_chip; - chip->cmd_ctrl = tango_cmd_ctrl; + chip->legacy.cmd_ctrl = tango_cmd_ctrl; chip->dev_ready = tango_dev_ready; chip->setup_data_interface = tango_set_timings; chip->options = NAND_USE_BOUNCE_BUFFER |
drivers/mtd/nand/raw/tmio_nand.c +1 -1
@@ -403,7 +403,7 @@ static int tmio_probe(struct platform_device *dev) nand_chip->legacy.IO_ADDR_W = tmio->fcr;/* Set address of hardware control function */ - nand_chip->cmd_ctrl = tmio_nand_hwcontrol; + nand_chip->legacy.cmd_ctrl = tmio_nand_hwcontrol; nand_chip->dev_ready = tmio_nand_dev_ready; nand_chip->legacy.read_byte = tmio_nand_read_byte; nand_chip->legacy.write_buf = tmio_nand_write_buf;
drivers/mtd/nand/raw/txx9ndfmc.c +1 -1
@@ -327,7 +327,7 @@ static int __init txx9ndfmc_probe(struct platform_device *dev) chip->legacy.read_byte = txx9ndfmc_read_byte; chip->legacy.read_buf = txx9ndfmc_read_buf; chip->legacy.write_buf = txx9ndfmc_write_buf; - chip->cmd_ctrl = txx9ndfmc_cmd_ctrl; + chip->legacy.cmd_ctrl = txx9ndfmc_cmd_ctrl; chip->dev_ready = txx9ndfmc_dev_ready; chip->ecc.calculate = txx9ndfmc_calculate_ecc; chip->ecc.correct = txx9ndfmc_correct_data;
drivers/mtd/nand/raw/xway_nand.c +1 -1
@@ -174,7 +174,7 @@ static int xway_nand_probe(struct platform_device *pdev) mtd =nand_to_mtd (&data->chip); mtd->dev.parent = &pdev->dev; - data->chip.cmd_ctrl = xway_cmd_ctrl; + data->chip.legacy.cmd_ctrl = xway_cmd_ctrl; data->chip.dev_ready = xway_dev_ready; data->chip.select_chip = xway_select_chip; data->chip.legacy.write_buf = xway_write_buf;
drivers/staging/mt29f_spinand/mt29f_spinand.c +1 -1
@@ -918,7 +918,7 @@ static int spinand_probe(struct spi_device *spi_nand) chip->legacy.read_buf = spinand_read_buf; chip->legacy.write_buf = spinand_write_buf; chip->legacy.read_byte = spinand_read_byte; - chip->cmdfunc = spinand_cmdfunc; + chip->legacy.cmdfunc = spinand_cmdfunc; chip->waitfunc = spinand_wait; chip->options |=NAND_CACHEPRG ; chip->select_chip = spinand_select_chip;
include/linux/mtd/rawnand.h +10 -11
@@ -199,10 +199,10 @@ enum nand_ecc_algo {#define NAND_USE_BOUNCE_BUFFER 0x00100000/* -* In case your controller is implementing ->cmd_ctrl() and is relying on the -* default ->cmdfunc() implementation, you may want to let the core handle the -* tCCS delay which is required when a column change (RNDIN or RNDOUT) is -* requested. +* In case your controller is implementing ->legacy.cmd_ctrl() and is relying +* on the default ->cmdfunc() implementation, you may want to let the core +* handle the tCCS delay which is required when a column change (RNDIN or +* RNDOUT) is requested. * If your controller already takes care of this delay, you don't need to set * this flag. */
@@ -1180,6 +1180,9 @@ int nand_op_parser_exec_op(struct nand_chip *chip,* @write_byte: write a single byte to the chip on the low 8 I/O lines * @write_buf: write data from the buffer to the chip * @read_buf: read data from the chip into the buffer +* @cmd_ctrl: hardware specific function for controlling ALE/CLE/nCE. Also used +* to write command and address +* @cmdfunc: hardware specific function for writing commands to the chip. * * If you look at this structure you're already wrong. These fields/hooks are * all deprecated.
@@ -1191,6 +1194,9 @@ struct nand_legacy {void (*write_byte)(struct nand_chip *chip,u8 byte);void (*write_buf)(struct nand_chip *chip,const u8 *buf,int len);void (*read_buf)(struct nand_chip *chip,u8 *buf,int len); +void (*cmd_ctrl)(struct nand_chip *chip,int dat,unsigned int ctrl); +void (*cmdfunc)(struct nand_chip *chip,unsigned command,int column, +int page_addr); };/**
@@ -1204,14 +1210,10 @@ struct nand_legacy {* @select_chip: [REPLACEABLE] select chip nr * @block_bad: [REPLACEABLE] check if a block is bad, using OOB markers * @block_markbad: [REPLACEABLE] mark a block bad -* @cmd_ctrl: [BOARDSPECIFIC] hardwarespecific function for controlling -* ALE/CLE/nCE. Also used to write command and address * @dev_ready: [BOARDSPECIFIC] hardwarespecific function for accessing * device ready/busy line. If set to NULL no access to * ready/busy is available and the ready/busy information * is read from the chip status register. -* @cmdfunc: [REPLACEABLE] hardwarespecific function for writing -* commands to the chip. * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on * ready. * @exec_op: controller specific method to execute NAND operations.
@@ -1303,10 +1305,7 @@ struct nand_chip {void (*select_chip)(struct nand_chip *chip,int cs);int (*block_bad)(struct nand_chip *chip,loff_t ofs);int (*block_markbad)(struct nand_chip *chip,loff_t ofs); -void (*cmd_ctrl)(struct nand_chip *chip,int dat,unsigned int ctrl);int (*dev_ready)(struct nand_chip *chip); -void (*cmdfunc)(struct nand_chip *chip,unsigned command,int column, -int page_addr);int (*waitfunc)(struct nand_chip *chip); int (*exec_op)(struct nand_chip *chip, const struct nand_operation *op,
Signature · 1 line
2.14.1
PATCH 5/19 mtd: rawnand: Deprecate ->dev_ready() and ->waitfunc()
In reply to Boris BrezillonThose hooks have been replaced by ->exec_op(). Move them to the nand_legacy struct.
--- Documentation/driver-api/mtdnand.rst | 4 +-- drivers/mtd/nand/raw/ams-delta.c | 4 +-- drivers/mtd/nand/raw/atmel/nand-controller.c | 8 +++--- drivers/mtd/nand/raw/au1550nd.c | 7 +++-- drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c | 2 +- drivers/mtd/nand/raw/brcmnand/brcmnand.c | 2 +- drivers/mtd/nand/raw/cafe_nand.c | 2 +- drivers/mtd/nand/raw/cmx270_nand.c | 2 +- drivers/mtd/nand/raw/cs553x_nand.c | 2 +- drivers/mtd/nand/raw/davinci_nand.c | 2 +- drivers/mtd/nand/raw/denali.c | 7 +++-- drivers/mtd/nand/raw/diskonchip.c | 10 +++---- drivers/mtd/nand/raw/fsl_elbc_nand.c | 2 +- drivers/mtd/nand/raw/fsl_ifc_nand.c | 2 +- drivers/mtd/nand/raw/fsl_upm.c | 2 +- drivers/mtd/nand/raw/gpio.c | 2 +- drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 2 +- drivers/mtd/nand/raw/jz4740_nand.c | 2 +- drivers/mtd/nand/raw/jz4780_nand.c | 2 +- drivers/mtd/nand/raw/lpc32xx_mlc.c | 4 +-- drivers/mtd/nand/raw/lpc32xx_slc.c | 2 +- drivers/mtd/nand/raw/mpc5121_nfc.c | 2 +- drivers/mtd/nand/raw/mtk_nand.c | 2 +- drivers/mtd/nand/raw/mxc_nand.c | 2 +- drivers/mtd/nand/raw/nand_base.c | 36 ++++++++++++------------ drivers/mtd/nand/raw/nandsim.c | 2 +- drivers/mtd/nand/raw/ndfc.c | 2 +- drivers/mtd/nand/raw/nuc900_nand.c | 8 +++--- drivers/mtd/nand/raw/omap2.c | 4 +-- drivers/mtd/nand/raw/pasemi_nand.c | 2 +- drivers/mtd/nand/raw/plat_nand.c | 2 +- drivers/mtd/nand/raw/r852.c | 6 ++-- drivers/mtd/nand/raw/s3c2410.c | 6 ++-- drivers/mtd/nand/raw/sharpsl.c | 2 +- drivers/mtd/nand/raw/socrates_nand.c | 2 +- drivers/mtd/nand/raw/sunxi_nand.c | 4 +-- drivers/mtd/nand/raw/tango_nand.c | 4 +-- drivers/mtd/nand/raw/tmio_nand.c | 4 +-- drivers/mtd/nand/raw/txx9ndfmc.c | 2 +- drivers/mtd/nand/raw/xway_nand.c | 2 +- drivers/staging/mt29f_spinand/mt29f_spinand.c | 2 +- include/linux/mtd/rawnand.h | 18 ++++++------ 42 files changed, 93 insertions(+), 93 deletions(-)
Documentation/driver-api/mtdnand.rst +2 -2
@@ -197,7 +197,7 @@ to read back the state of the pin. The function has no arguments and should return 0, if the device is busy (R/B pin is low) and 1, if the device is ready (R/B pin is high). If the hardware interface does not give access to the ready busy pin, then the function must not be defined -and the function pointer this->dev_ready is set to NULL. +and the function pointer this->legacy.dev_ready is set to NULL. Init function -------------
@@ -242,7 +242,7 @@ necessary information about the device. /* Set command delay time, see datasheet for correct value */ this->chip_delay = CHIP_DEPENDEND_COMMAND_DELAY; /* Assign the device ready function, if available */ - this->dev_ready = board_dev_ready; + this->legacy.dev_ready = board_dev_ready; this->eccmode = NAND_ECC_SOFT; /* Scan to find existence of the device */
drivers/mtd/nand/raw/ams-delta.c +2 -2
@@ -215,9 +215,9 @@ static int ams_delta_init(struct platform_device *pdev) this->legacy.read_buf = ams_delta_read_buf; this->legacy.cmd_ctrl = ams_delta_hwcontrol;if (gpio_request (AMS_DELTA_GPIO_PIN_NAND_RB ,"nand_rdy" ) ==0 ) { - this->dev_ready = ams_delta_nand_ready; + this->legacy.dev_ready = ams_delta_nand_ready; }else { - this->dev_ready =NULL ; + this->legacy.dev_ready =NULL ;pr_notice ("Couldn't request gpio for Delta NAND ready.\n" ); }/* 25 us command delay time */
drivers/mtd/nand/raw/atmel/nand-controller.c +4 -4
@@ -488,14 +488,14 @@ static void atmel_nand_select_chip(struct nand_chip *chip, int cs)if (cs <0 || cs >= nand->numcs) { nand->activecs =NULL ; - chip->dev_ready =NULL ; + chip->legacy.dev_ready =NULL ;return ; } nand->activecs = &nand->cs[cs];if (nand->activecs->rb.type ==ATMEL_NAND_GPIO_RB ) - chip->dev_ready = atmel_nand_dev_ready; + chip->legacy.dev_ready = atmel_nand_dev_ready; }static int atmel_hsmc_nand_dev_ready (struct nand_chip *chip)
@@ -528,7 +528,7 @@ static void atmel_hsmc_nand_select_chip(struct nand_chip *chip, int cs) }if (nand->activecs->rb.type ==ATMEL_NAND_NATIVE_RB ) - chip->dev_ready = atmel_hsmc_nand_dev_ready; + chip->legacy.dev_ready = atmel_hsmc_nand_dev_ready; regmap_update_bits(nc->base.smc, ATMEL_HSMC_NFC_CFG, ATMEL_HSMC_NFC_CFG_PAGESIZE_MASK |
@@ -945,7 +945,7 @@ static int atmel_hsmc_nand_pmecc_write_pg(struct nand_chip *chip,dev_err (nc->base.dev,"Failed to program NAND page (err = %d)\n" , ret); - status = chip->waitfunc (chip); + status = chip->legacy.waitfunc (chip);if (status &NAND_STATUS_FAIL )return -EIO ;
drivers/mtd/nand/raw/au1550nd.c +4 -3
@@ -342,7 +342,8 @@ static void au1550_command(struct nand_chip *this, unsigned command,/* Apply a short delay always to ensure that we do wait tWB. */ ndelay (100 );/* Wait for a chip to become ready... */ -for (i = this->chip_delay; !this->dev_ready (this) && i >0 ; --i) +for (i = this->chip_delay; + !this->legacy.dev_ready (this) && i >0 ; --i)udelay (1 );/* Release -CE and re-enable interrupts. */
@@ -353,7 +354,7 @@ static void au1550_command(struct nand_chip *this, unsigned command,/* Apply this short delay always to ensure that we do wait tWB. */ ndelay (100 ); -while (!this->dev_ready (this)); +while (!this->legacy.dev_ready (this)); }static int find_nand_cs (unsigned long nand_base)
@@ -428,7 +429,7 @@ static int au1550nd_probe(struct platform_device *pdev) } ctx->cs = cs; - this->dev_ready = au1550_device_ready; + this->legacy.dev_ready = au1550_device_ready; this->select_chip = au1550_select_chip; this->legacy.cmdfunc = au1550_command;
drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c +1 -1
@@ -385,7 +385,7 @@ int bcm47xxnflash_ops_bcm4706_init(struct bcm47xxnflash *b47n) b47n->nand_chip.select_chip = bcm47xxnflash_ops_bcm4706_select_chip; nand_chip->legacy.cmd_ctrl = bcm47xxnflash_ops_bcm4706_cmd_ctrl; - nand_chip->dev_ready = bcm47xxnflash_ops_bcm4706_dev_ready; + nand_chip->legacy.dev_ready = bcm47xxnflash_ops_bcm4706_dev_ready; b47n->nand_chip.legacy.cmdfunc = bcm47xxnflash_ops_bcm4706_cmdfunc; b47n->nand_chip.legacy.read_byte = bcm47xxnflash_ops_bcm4706_read_byte; b47n->nand_chip.legacy.read_buf = bcm47xxnflash_ops_bcm4706_read_buf;
drivers/mtd/nand/raw/brcmnand/brcmnand.c +1 -1
@@ -2272,7 +2272,7 @@ static int brcmnand_init_cs(struct brcmnand_host *host, struct device_node *dn) chip->legacy.cmd_ctrl = brcmnand_cmd_ctrl; chip->legacy.cmdfunc = brcmnand_cmdfunc; - chip->waitfunc = brcmnand_waitfunc; + chip->legacy.waitfunc = brcmnand_waitfunc; chip->legacy.read_byte = brcmnand_read_byte; chip->legacy.read_buf = brcmnand_read_buf; chip->legacy.write_buf = brcmnand_write_buf;
drivers/mtd/nand/raw/cafe_nand.c +1 -1
@@ -704,7 +704,7 @@ static int cafe_nand_probe(struct pci_dev *pdev, } cafe->nand.legacy.cmdfunc = cafe_nand_cmdfunc; - cafe->nand.dev_ready = cafe_device_ready; + cafe->nand.legacy.dev_ready = cafe_device_ready; cafe->nand.legacy.read_byte = cafe_read_byte; cafe->nand.legacy.read_buf = cafe_read_buf; cafe->nand.legacy.write_buf = cafe_write_buf;
drivers/mtd/nand/raw/cmx270_nand.c +1 -1
@@ -176,7 +176,7 @@ static int __init cmx270_init(void) this->legacy.IO_ADDR_R = cmx270_nand_io; this->legacy.IO_ADDR_W = cmx270_nand_io; this->legacy.cmd_ctrl = cmx270_hwcontrol; - this->dev_ready = cmx270_device_ready; + this->legacy.dev_ready = cmx270_device_ready;/* 15 us command delay time */ this->chip_delay =20 ;
drivers/mtd/nand/raw/cs553x_nand.c +1 -1
@@ -207,7 +207,7 @@ static int __init cs553x_init_one(int cs, int mmio, unsigned long adr) } this->legacy.cmd_ctrl = cs553x_hwcontrol; - this->dev_ready = cs553x_device_ready; + this->legacy.dev_ready = cs553x_device_ready; this->legacy.read_byte = cs553x_read_byte; this->legacy.read_buf = cs553x_read_buf; this->legacy.write_buf = cs553x_write_buf;
drivers/mtd/nand/raw/davinci_nand.c +1 -1
@@ -782,7 +782,7 @@ static int nand_davinci_probe(struct platform_device *pdev)/* Set address of hardware control function */ info->chip.legacy.cmd_ctrl = nand_davinci_hwcontrol; - info->chip.dev_ready = nand_davinci_dev_ready; + info->chip.legacy.dev_ready = nand_davinci_dev_ready;/* Speed up buffer I/O */ info->chip.legacy.read_buf = nand_davinci_read_buf;
drivers/mtd/nand/raw/denali.c +4 -3
@@ -287,7 +287,8 @@ static void denali_cmd_ctrl(struct nand_chip *chip, int dat, unsigned int ctrl)return ;/* -* Some commands are followed by chip->dev_ready or chip->waitfunc. +* Some commands are followed by chip->legacy.dev_ready or +* chip->legacy.waitfunc. * irq_status must be cleared here to catch the R/B# interrupt later. */ if (ctrl &NAND_CTRL_CHANGE )
@@ -1346,8 +1347,8 @@ int denali_init(struct denali_nand_info *denali) chip->legacy.read_byte = denali_read_byte; chip->legacy.write_byte = denali_write_byte; chip->legacy.cmd_ctrl = denali_cmd_ctrl; - chip->dev_ready = denali_dev_ready; - chip->waitfunc = denali_waitfunc; + chip->legacy.dev_ready = denali_dev_ready; + chip->legacy.waitfunc = denali_waitfunc;if (features &FEATURES__INDEX_ADDR ) { denali->host_read = denali_indexed_read;
drivers/mtd/nand/raw/diskonchip.c +5 -5
@@ -715,7 +715,7 @@ static void doc2001plus_command(struct nand_chip *this, unsigned command,return ;case NAND_CMD_RESET : -if (this->dev_ready) +if (this->legacy.dev_ready)break ;udelay (this->chip_delay);WriteDOC (NAND_CMD_STATUS , docptr, Mplus_FlashCmd);
@@ -730,7 +730,7 @@ static void doc2001plus_command(struct nand_chip *this, unsigned command,* If we don't have access to the busy pin, we apply the given * command delay */ -if (!this->dev_ready) { +if (!this->legacy.dev_ready) {udelay (this->chip_delay);return ; }
@@ -740,7 +740,7 @@ static void doc2001plus_command(struct nand_chip *this, unsigned command,* any case on any machine. */ ndelay (100 );/* wait until command is processed */ -while (!this->dev_ready (this)) ; +while (!this->legacy.dev_ready (this)) ; }static int doc200x_dev_ready (struct nand_chip *this)
@@ -1570,8 +1570,8 @@ static int __init doc_probe(unsigned long physadr)nand_set_controller_data (nand, doc); nand->select_chip = doc200x_select_chip; nand->legacy.cmd_ctrl = doc200x_hwcontrol; - nand->dev_ready = doc200x_dev_ready; - nand->waitfunc = doc200x_wait; + nand->legacy.dev_ready = doc200x_dev_ready; + nand->legacy.waitfunc = doc200x_wait; nand->block_bad = doc200x_block_bad; nand->ecc.hwctl = doc200x_enable_hwecc; nand->ecc.calculate = doc200x_calculate_ecc;
drivers/mtd/nand/raw/fsl_elbc_nand.c +1 -1
@@ -781,7 +781,7 @@ static int fsl_elbc_chip_init(struct fsl_elbc_mtd *priv) chip->legacy.read_buf = fsl_elbc_read_buf; chip->select_chip = fsl_elbc_select_chip; chip->legacy.cmdfunc = fsl_elbc_cmdfunc; - chip->waitfunc = fsl_elbc_wait; + chip->legacy.waitfunc = fsl_elbc_wait; chip->set_features = nand_get_set_features_notsupp; chip->get_features = nand_get_set_features_notsupp;
drivers/mtd/nand/raw/fsl_ifc_nand.c +1 -1
@@ -866,7 +866,7 @@ static int fsl_ifc_chip_init(struct fsl_ifc_mtd *priv) chip->legacy.read_buf = fsl_ifc_read_buf; chip->select_chip = fsl_ifc_select_chip; chip->legacy.cmdfunc = fsl_ifc_cmdfunc; - chip->waitfunc = fsl_ifc_wait; + chip->legacy.waitfunc = fsl_ifc_wait; chip->set_features = nand_get_set_features_notsupp; chip->get_features = nand_get_set_features_notsupp;
drivers/mtd/nand/raw/fsl_upm.c +1 -1
@@ -173,7 +173,7 @@ static int fun_chip_init(struct fsl_upm_nand *fun, fun->chip.select_chip = fun_select_chip;if (fun->rnb_gpio[0 ] >=0 ) - fun->chip.dev_ready = fun_chip_ready; + fun->chip.legacy.dev_ready = fun_chip_ready; mtd->dev.parent = fun->dev;
drivers/mtd/nand/raw/gpio.c +1 -1
@@ -271,7 +271,7 @@ static int gpio_nand_probe(struct platform_device *pdev) }/* Using RDY pin */ if (gpiomtd->rdy) - chip->dev_ready = gpio_nand_devready; + chip->legacy.dev_ready = gpio_nand_devready;nand_set_flash_node (chip, pdev->dev.of_node); chip->legacy.IO_ADDR_W = chip->legacy.IO_ADDR_R;
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +1 -1
@@ -1903,7 +1903,7 @@ static int gpmi_nand_init(struct gpmi_nand_data *this) chip->select_chip = gpmi_select_chip; chip->setup_data_interface = gpmi_setup_data_interface; chip->legacy.cmd_ctrl = gpmi_cmd_ctrl; - chip->dev_ready = gpmi_dev_ready; + chip->legacy.dev_ready = gpmi_dev_ready; chip->legacy.read_byte = gpmi_read_byte; chip->legacy.read_buf = gpmi_read_buf; chip->legacy.write_buf = gpmi_write_buf;
drivers/mtd/nand/raw/jz4740_nand.c +1 -1
@@ -431,7 +431,7 @@ static int jz_nand_probe(struct platform_device *pdev) chip->dummy_controller.ops = &jz_nand_controller_ops;if (nand->busy_gpio) - chip->dev_ready = jz_nand_dev_ready; + chip->legacy.dev_ready = jz_nand_dev_ready;platform_set_drvdata (pdev, nand);
drivers/mtd/nand/raw/jz4780_nand.c +1 -1
@@ -256,7 +256,7 @@ static int jz4780_nand_init_chip(struct platform_device *pdev,dev_err (dev,"failed to request busy GPIO: %d\n" , ret);return ret; }else if (nand->busy_gpio) { - nand->chip.dev_ready = jz4780_nand_dev_ready; + nand->chip.legacy.dev_ready = jz4780_nand_dev_ready; } nand->wp_gpio =devm_gpiod_get_optional (dev,"wp" ,GPIOD_OUT_LOW );
drivers/mtd/nand/raw/lpc32xx_mlc.c +2 -2
@@ -740,7 +740,7 @@ static int lpc32xx_nand_probe(struct platform_device *pdev) goto put_clk; nand_chip->legacy.cmd_ctrl = lpc32xx_nand_cmd_ctrl; - nand_chip->dev_ready = lpc32xx_nand_device_ready; + nand_chip->legacy.dev_ready = lpc32xx_nand_device_ready; nand_chip->chip_delay =25 ;/* us */ nand_chip->legacy.IO_ADDR_R =MLC_DATA (host->io_base); nand_chip->legacy.IO_ADDR_W =MLC_DATA (host->io_base);
@@ -760,7 +760,7 @@ static int lpc32xx_nand_probe(struct platform_device *pdev) nand_chip->ecc.read_oob = lpc32xx_read_oob; nand_chip->ecc.strength =4 ; nand_chip->ecc.bytes =10 ; - nand_chip->waitfunc = lpc32xx_waitfunc; + nand_chip->legacy.waitfunc = lpc32xx_waitfunc; nand_chip->options =NAND_NO_SUBPAGE_WRITE ; nand_chip->bbt_options =NAND_BBT_USE_FLASH |NAND_BBT_NO_OOB ;
drivers/mtd/nand/raw/lpc32xx_slc.c +1 -1
@@ -881,7 +881,7 @@ static int lpc32xx_nand_probe(struct platform_device *pdev) chip->legacy.IO_ADDR_R =SLC_DATA (host->io_base); chip->legacy.IO_ADDR_W =SLC_DATA (host->io_base); chip->legacy.cmd_ctrl = lpc32xx_nand_cmd_ctrl; - chip->dev_ready = lpc32xx_nand_device_ready; + chip->legacy.dev_ready = lpc32xx_nand_device_ready; chip->chip_delay =20 ;/* 20us command delay time */ /* Init NAND controller */
drivers/mtd/nand/raw/mpc5121_nfc.c +1 -1
@@ -692,7 +692,7 @@ static int mpc5121_nfc_probe(struct platform_device *op) } mtd->name ="MPC5121 NAND" ; - chip->dev_ready = mpc5121_nfc_dev_ready; + chip->legacy.dev_ready = mpc5121_nfc_dev_ready; chip->legacy.cmdfunc = mpc5121_nfc_command; chip->legacy.read_byte = mpc5121_nfc_read_byte; chip->legacy.read_buf = mpc5121_nfc_read_buf;
drivers/mtd/nand/raw/mtk_nand.c +1 -1
@@ -1332,7 +1332,7 @@ static int mtk_nfc_nand_chip_init(struct device *dev, struct mtk_nfc *nfc,nand_set_controller_data (nand, nfc); nand->options |=NAND_USE_BOUNCE_BUFFER |NAND_SUBPAGE_READ ; - nand->dev_ready = mtk_nfc_dev_ready; + nand->legacy.dev_ready = mtk_nfc_dev_ready; nand->select_chip = mtk_nfc_select_chip; nand->legacy.write_byte = mtk_nfc_write_byte; nand->legacy.write_buf = mtk_nfc_write_buf;
drivers/mtd/nand/raw/mxc_nand.c +1 -1
@@ -1773,7 +1773,7 @@ static int mxcnd_probe(struct platform_device *pdev)nand_set_controller_data (this, host);nand_set_flash_node (this, pdev->dev.of_node), - this->dev_ready = mxc_nand_dev_ready; + this->legacy.dev_ready = mxc_nand_dev_ready; this->legacy.cmdfunc = mxc_nand_command; this->legacy.read_byte = mxc_nand_read_byte; this->legacy.write_buf = mxc_nand_write_buf;
drivers/mtd/nand/raw/nand_base.c +18 -18
@@ -604,7 +604,7 @@ static void panic_nand_wait_ready(struct mtd_info *mtd, unsigned long timeo)/* Wait for the device to get ready */ for (i =0 ; i < timeo; i++) { -if (chip->dev_ready (chip)) +if (chip->legacy.dev_ready (chip))break ;touch_softlockup_watchdog ();mdelay (1 );
@@ -628,12 +628,12 @@ void nand_wait_ready(struct nand_chip *chip)/* Wait until command is processed or timeout occurs */ timeo = jiffies +msecs_to_jiffies (timeo);do { -if (chip->dev_ready (chip)) +if (chip->legacy.dev_ready (chip))return ;cond_resched (); }while (time_before (jiffies, timeo)); -if (!chip->dev_ready (chip)) +if (!chip->legacy.dev_ready (chip))pr_warn_ratelimited ("timeout while waiting for chip to become ready\n" ); }EXPORT_SYMBOL_GPL (nand_wait_ready);
@@ -804,7 +804,7 @@ static void nand_command(struct nand_chip *chip, unsigned int command,return ;case NAND_CMD_RESET : -if (chip->dev_ready) +if (chip->legacy.dev_ready)break ;udelay (chip->chip_delay); chip->legacy.cmd_ctrl(chip, NAND_CMD_STATUS,
@@ -831,7 +831,7 @@ static void nand_command(struct nand_chip *chip, unsigned int command,* If we don't have access to the busy pin, we apply the given * command delay */ -if (!chip->dev_ready) { +if (!chip->legacy.dev_ready) {udelay (chip->chip_delay);return ; }
@@ -941,7 +941,7 @@ static void nand_command_lp(struct nand_chip *chip, unsigned int command,return ;case NAND_CMD_RESET : -if (chip->dev_ready) +if (chip->legacy.dev_ready)break ;udelay (chip->chip_delay); chip->legacy.cmd_ctrl(chip, NAND_CMD_STATUS,
@@ -983,7 +983,7 @@ static void nand_command_lp(struct nand_chip *chip, unsigned int command,* If we don't have access to the busy pin, we apply the given * command delay. */ -if (!chip->dev_ready) { +if (!chip->legacy.dev_ready) {udelay (chip->chip_delay);return ; }
@@ -1069,8 +1069,8 @@ static void panic_nand_wait(struct nand_chip *chip, unsigned long timeo) {int i;for (i =0 ; i < timeo; i++) { -if (chip->dev_ready) { -if (chip->dev_ready (chip)) +if (chip->legacy.dev_ready) { +if (chip->legacy.dev_ready (chip))break ; }else {int ret;
@@ -1117,8 +1117,8 @@ static int nand_wait(struct nand_chip *chip) else { timeo = jiffies +msecs_to_jiffies (timeo); do { - if (chip->dev_ready) { - if (chip->dev_ready(chip)) + if (chip->legacy.dev_ready) { + if (chip->legacy.dev_ready(chip)) break; } else { ret = nand_read_data_op(chip, &status,
@@ -1827,7 +1827,7 @@ int nand_prog_page_end_op(struct nand_chip *chip)return ret; }else { chip->legacy.cmdfunc (chip,NAND_CMD_PAGEPROG ,-1 ,-1 ); - ret = chip->waitfunc (chip); + ret = chip->legacy.waitfunc (chip);if (ret <0 )return ret;
@@ -1875,7 +1875,7 @@ int nand_prog_page_op(struct nand_chip *chip, unsigned int page, page); chip->legacy.write_buf (chip, buf, len); chip->legacy.cmdfunc (chip,NAND_CMD_PAGEPROG ,-1 ,-1 ); - status = chip->waitfunc (chip); + status = chip->legacy.waitfunc (chip); }if (status &NAND_STATUS_FAIL )
@@ -2106,7 +2106,7 @@ int nand_erase_op(struct nand_chip *chip, unsigned int eraseblock) chip->legacy.cmdfunc (chip,NAND_CMD_ERASE1 ,-1 , page); chip->legacy.cmdfunc (chip,NAND_CMD_ERASE2 ,-1 ,-1 ); - ret = chip->waitfunc (chip); + ret = chip->legacy.waitfunc (chip);if (ret <0 )return ret;
@@ -2157,7 +2157,7 @@ static int nand_set_features_op(struct nand_chip *chip, u8 feature,for (i =0 ; i <ONFI_SUBFEATURE_PARAM_LEN ; ++i) chip->legacy.write_byte (chip, params[i]); - ret = chip->waitfunc (chip); + ret = chip->legacy.waitfunc (chip);if (ret <0 )return ret;
@@ -2222,7 +2222,7 @@ static int nand_wait_rdy_op(struct nand_chip *chip, unsigned int timeout_ms, }/* Apply delay or wait for ready/busy pin */ -if (!chip->dev_ready) +if (!chip->legacy.dev_ready)udelay (chip->chip_delay);else nand_wait_ready (chip);
@@ -4927,8 +4927,8 @@ static void nand_set_defaults(struct nand_chip *chip) chip->legacy.cmdfunc = nand_command;/* check, if a user supplied wait function given */ -if (chip->waitfunc ==NULL ) - chip->waitfunc = nand_wait; +if (chip->legacy.waitfunc ==NULL ) + chip->legacy.waitfunc = nand_wait;if (!chip->select_chip) chip->select_chip = nand_select_chip;
drivers/mtd/nand/raw/nandsim.c +1 -1
@@ -2251,7 +2251,7 @@ static int __init ns_init_module(void)*/ chip->legacy.cmd_ctrl = ns_hwcontrol; chip->legacy.read_byte = ns_nand_read_byte; - chip->dev_ready = ns_device_ready; + chip->legacy.dev_ready = ns_device_ready; chip->legacy.write_buf = ns_nand_write_buf; chip->legacy.read_buf = ns_nand_read_buf; chip->ecc.mode =NAND_ECC_SOFT ;
drivers/mtd/nand/raw/ndfc.c +1 -1
@@ -145,7 +145,7 @@ static int ndfc_chip_init(struct ndfc_controller *ndfc, chip->legacy.IO_ADDR_R = ndfc->ndfcbase +NDFC_DATA ; chip->legacy.IO_ADDR_W = ndfc->ndfcbase +NDFC_DATA ; chip->legacy.cmd_ctrl = ndfc_hwcontrol; - chip->dev_ready = ndfc_ready; + chip->legacy.dev_ready = ndfc_ready; chip->select_chip = ndfc_select_chip; chip->chip_delay =50 ; chip->controller = &ndfc->ndfc_control;
drivers/mtd/nand/raw/nuc900_nand.c +4 -4
@@ -175,7 +175,7 @@ static void nuc900_nand_command_lp(struct nand_chip *chip,return ;case NAND_CMD_RESET : -if (chip->dev_ready) +if (chip->legacy.dev_ready)break ;udelay (chip->chip_delay);
@@ -196,7 +196,7 @@ static void nuc900_nand_command_lp(struct nand_chip *chip,write_cmd_reg (nand,NAND_CMD_READSTART );default : -if (!chip->dev_ready) { +if (!chip->legacy.dev_ready) {udelay (chip->chip_delay);return ; }
@@ -206,7 +206,7 @@ static void nuc900_nand_command_lp(struct nand_chip *chip,* any case on any machine. */ ndelay (100 ); -while (!chip->dev_ready (chip)) +while (!chip->legacy.dev_ready (chip)) ; }
@@ -255,7 +255,7 @@ static int nuc900_nand_probe(struct platform_device *pdev)clk_enable (nuc900_nand->clk); chip->legacy.cmdfunc = nuc900_nand_command_lp; - chip->dev_ready = nuc900_nand_devready; + chip->legacy.dev_ready = nuc900_nand_devready; chip->legacy.read_byte = nuc900_nand_read_byte; chip->legacy.write_buf = nuc900_nand_write_buf; chip->legacy.read_buf = nuc900_nand_read_buf;
drivers/mtd/nand/raw/omap2.c +2 -2
@@ -2247,10 +2247,10 @@ static int omap_nand_probe(struct platform_device *pdev)* device and read status register until you get a failure or success */ if (info->ready_gpiod) { - nand_chip->dev_ready = omap_dev_ready; + nand_chip->legacy.dev_ready = omap_dev_ready; nand_chip->chip_delay =0 ; }else { - nand_chip->waitfunc = omap_wait; + nand_chip->legacy.waitfunc = omap_wait; nand_chip->chip_delay =50 ; }
drivers/mtd/nand/raw/pasemi_nand.c +1 -1
@@ -140,7 +140,7 @@ static int pasemi_nand_probe(struct platform_device *ofdev) } chip->legacy.cmd_ctrl = pasemi_hwcontrol; - chip->dev_ready = pasemi_device_ready; + chip->legacy.dev_ready = pasemi_device_ready; chip->legacy.read_buf = pasemi_read_buf; chip->legacy.write_buf = pasemi_write_buf; chip->chip_delay =0 ;
drivers/mtd/nand/raw/plat_nand.c +1 -1
@@ -63,7 +63,7 @@ static int plat_nand_probe(struct platform_device *pdev) data->chip.legacy.IO_ADDR_R = data->io_base; data->chip.legacy.IO_ADDR_W = data->io_base; data->chip.legacy.cmd_ctrl = pdata->ctrl.cmd_ctrl; - data->chip.dev_ready = pdata->ctrl.dev_ready; + data->chip.legacy.dev_ready = pdata->ctrl.dev_ready; data->chip.select_chip = pdata->ctrl.select_chip; data->chip.legacy.write_buf = pdata->ctrl.write_buf; data->chip.legacy.read_buf = pdata->ctrl.read_buf;
drivers/mtd/nand/raw/r852.c +3 -3
@@ -373,7 +373,7 @@ static int r852_wait(struct nand_chip *chip) msecs_to_jiffies(400) : msecs_to_jiffies(20));while (time_before (jiffies, timeout)) -if (chip->dev_ready (chip)) +if (chip->legacy.dev_ready (chip))break ;nand_status_op (chip, &status);
@@ -854,8 +854,8 @@ static int r852_probe(struct pci_dev *pci_dev, const struct pci_device_id *id)/* commands */ chip->legacy.cmd_ctrl = r852_cmdctl; - chip->waitfunc = r852_wait; - chip->dev_ready = r852_ready; + chip->legacy.waitfunc = r852_wait; + chip->legacy.dev_ready = r852_ready;/* I/O */ chip->legacy.read_byte = r852_read_byte;
drivers/mtd/nand/raw/s3c2410.c +3 -3
@@ -885,7 +885,7 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info, info->sel_reg = regs +S3C2410_NFCONF ; info->sel_bit = S3C2410_NFCONF_nFCE; chip->legacy.cmd_ctrl = s3c2410_nand_hwcontrol; - chip->dev_ready = s3c2410_nand_devready; + chip->legacy.dev_ready = s3c2410_nand_devready;break ;case TYPE_S3C2440 :
@@ -893,7 +893,7 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info, info->sel_reg = regs +S3C2440_NFCONT ; info->sel_bit = S3C2440_NFCONT_nFCE; chip->legacy.cmd_ctrl = s3c2440_nand_hwcontrol; - chip->dev_ready = s3c2440_nand_devready; + chip->legacy.dev_ready = s3c2440_nand_devready; chip->legacy.read_buf = s3c2440_nand_read_buf; chip->legacy.write_buf = s3c2440_nand_write_buf;break ;
@@ -903,7 +903,7 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info, info->sel_reg = regs +S3C2440_NFCONT ; info->sel_bit = S3C2412_NFCONT_nFCE0; chip->legacy.cmd_ctrl = s3c2440_nand_hwcontrol; - chip->dev_ready = s3c2412_nand_devready; + chip->legacy.dev_ready = s3c2412_nand_devready;if (readl (regs +S3C2410_NFCONF ) &S3C2412_NFCONF_NANDBOOT )dev_info (info->device,"System booted from NAND\n" );
drivers/mtd/nand/raw/sharpsl.c +1 -1
@@ -157,7 +157,7 @@ static int sharpsl_nand_probe(struct platform_device *pdev) this->legacy.IO_ADDR_W = sharpsl->io +FLASHIO ;/* Set address of hardware control function */ this->legacy.cmd_ctrl = sharpsl_nand_hwcontrol; - this->dev_ready = sharpsl_nand_dev_ready; + this->legacy.dev_ready = sharpsl_nand_dev_ready;/* 15 us command delay time */ this->chip_delay =15 ;/* set eccmode using hardware ECC */
drivers/mtd/nand/raw/socrates_nand.c +1 -1
@@ -156,7 +156,7 @@ static int socrates_nand_probe(struct platform_device *ofdev) nand_chip->legacy.read_byte = socrates_nand_read_byte; nand_chip->legacy.write_buf = socrates_nand_write_buf; nand_chip->legacy.read_buf = socrates_nand_read_buf; - nand_chip->dev_ready = socrates_nand_device_ready; + nand_chip->legacy.dev_ready = socrates_nand_device_ready; nand_chip->ecc.mode =NAND_ECC_SOFT ;/* enable ECC */ nand_chip->ecc.algo =NAND_ECC_HAMMING ;
drivers/mtd/nand/raw/sunxi_nand.c +2 -2
@@ -442,9 +442,9 @@ static void sunxi_nfc_select_chip(struct nand_chip *nand, int chip) ctl |=NFC_CE_SEL (sel->cs) |NFC_EN |NFC_PAGE_SHIFT (nand->page_shift);if (sel->rb <0 ) { - nand->dev_ready =NULL ; + nand->legacy.dev_ready =NULL ; }else { - nand->dev_ready = sunxi_nfc_dev_ready; + nand->legacy.dev_ready = sunxi_nfc_dev_ready; ctl |=NFC_RB_SEL (sel->rb); }
drivers/mtd/nand/raw/tango_nand.c +2 -2
@@ -314,7 +314,7 @@ static int tango_write_page(struct nand_chip *chip, const u8 *buf,if (err)return err; - status = chip->waitfunc (chip); + status = chip->legacy.waitfunc (chip);if (status &NAND_STATUS_FAIL )return -EIO ;
@@ -569,7 +569,7 @@ static int chip_init(struct device *dev, struct device_node *np) chip->legacy.read_buf = tango_read_buf; chip->select_chip = tango_select_chip; chip->legacy.cmd_ctrl = tango_cmd_ctrl; - chip->dev_ready = tango_dev_ready; + chip->legacy.dev_ready = tango_dev_ready; chip->setup_data_interface = tango_set_timings; chip->options =NAND_USE_BOUNCE_BUFFER | NAND_NO_SUBPAGE_WRITE |
drivers/mtd/nand/raw/tmio_nand.c +2 -2
@@ -404,7 +404,7 @@ static int tmio_probe(struct platform_device *dev)/* Set address of hardware control function */ nand_chip->legacy.cmd_ctrl = tmio_nand_hwcontrol; - nand_chip->dev_ready = tmio_nand_dev_ready; + nand_chip->legacy.dev_ready = tmio_nand_dev_ready; nand_chip->legacy.read_byte = tmio_nand_read_byte; nand_chip->legacy.write_buf = tmio_nand_write_buf; nand_chip->legacy.read_buf = tmio_nand_read_buf;
@@ -432,7 +432,7 @@ static int tmio_probe(struct platform_device *dev) } tmio->irq = irq; - nand_chip->waitfunc = tmio_nand_wait; + nand_chip->legacy.waitfunc = tmio_nand_wait;/* Scan to find existence of the device */ retval =nand_scan (nand_chip,1 );
drivers/mtd/nand/raw/txx9ndfmc.c +1 -1
@@ -328,7 +328,7 @@ static int __init txx9ndfmc_probe(struct platform_device *dev) chip->legacy.read_buf = txx9ndfmc_read_buf; chip->legacy.write_buf = txx9ndfmc_write_buf; chip->legacy.cmd_ctrl = txx9ndfmc_cmd_ctrl; - chip->dev_ready = txx9ndfmc_dev_ready; + chip->legacy.dev_ready = txx9ndfmc_dev_ready; chip->ecc.calculate = txx9ndfmc_calculate_ecc; chip->ecc.correct = txx9ndfmc_correct_data; chip->ecc.hwctl = txx9ndfmc_enable_hwecc;
drivers/mtd/nand/raw/xway_nand.c +1 -1
@@ -175,7 +175,7 @@ static int xway_nand_probe(struct platform_device *pdev) mtd->dev.parent = &pdev->dev; data->chip.legacy.cmd_ctrl = xway_cmd_ctrl; - data->chip.dev_ready = xway_dev_ready; + data->chip.legacy.dev_ready = xway_dev_ready; data->chip.select_chip = xway_select_chip; data->chip.legacy.write_buf = xway_write_buf; data->chip.legacy.read_buf = xway_read_buf;
drivers/staging/mt29f_spinand/mt29f_spinand.c +1 -1
@@ -919,7 +919,7 @@ static int spinand_probe(struct spi_device *spi_nand) chip->legacy.write_buf = spinand_write_buf; chip->legacy.read_byte = spinand_read_byte; chip->legacy.cmdfunc = spinand_cmdfunc; - chip->waitfunc = spinand_wait; + chip->legacy.waitfunc = spinand_wait; chip->options |=NAND_CACHEPRG ; chip->select_chip = spinand_select_chip; chip->set_features = nand_get_set_features_notsupp;
include/linux/mtd/rawnand.h +8 -10
@@ -1183,6 +1183,10 @@ int nand_op_parser_exec_op(struct nand_chip *chip,* @cmd_ctrl: hardware specific function for controlling ALE/CLE/nCE. Also used * to write command and address * @cmdfunc: hardware specific function for writing commands to the chip. +* @dev_ready: hardware specific function for accessing device ready/busy line. +* If set to NULL no access to ready/busy is available and the +* ready/busy information is read from the chip status register. +* @waitfunc: hardware specific function for wait on ready. * * If you look at this structure you're already wrong. These fields/hooks are * all deprecated.
@@ -1197,6 +1201,8 @@ struct nand_legacy {void (*cmd_ctrl)(struct nand_chip *chip,int dat,unsigned int ctrl);void (*cmdfunc)(struct nand_chip *chip,unsigned command,int column,int page_addr); +int (*dev_ready)(struct nand_chip *chip); +int (*waitfunc)(struct nand_chip *chip); };/**
@@ -1210,16 +1216,10 @@ struct nand_legacy {* @select_chip: [REPLACEABLE] select chip nr * @block_bad: [REPLACEABLE] check if a block is bad, using OOB markers * @block_markbad: [REPLACEABLE] mark a block bad -* @dev_ready: [BOARDSPECIFIC] hardwarespecific function for accessing -* device ready/busy line. If set to NULL no access to -* ready/busy is available and the ready/busy information -* is read from the chip status register. -* @waitfunc: [REPLACEABLE] hardwarespecific function for wait on -* ready. * @exec_op: controller specific method to execute NAND operations. * This method replaces ->cmdfunc(), -* ->legacy.{read,write}_{buf,byte,word}(), ->dev_ready() -* and ->waifunc(). +* ->legacy.{read,write}_{buf,byte,word}(), +* ->legacy.dev_ready() and ->waifunc(). * @setup_read_retry: [FLASHSPECIFIC] flash (vendor) specific function for * setting the read-retry mode. Mostly needed for MLC NAND. * @ecc: [BOARDSPECIFIC] ECC control structure
@@ -1305,8 +1305,6 @@ struct nand_chip {void (*select_chip)(struct nand_chip *chip,int cs);int (*block_bad)(struct nand_chip *chip,loff_t ofs);int (*block_markbad)(struct nand_chip *chip,loff_t ofs); -int (*dev_ready)(struct nand_chip *chip); -int (*waitfunc)(struct nand_chip *chip);int (*exec_op)(struct nand_chip *chip,const struct nand_operation *op,bool check_only);
Signature · 1 line
2.14.1
PATCH 6/19 mtd: rawnand: Deprecate ->block_{bad,markbad}() hooks
In reply to Boris BrezillonThose hooks have been overloaded by some drivers for bad reasons:
either the driver was not fitting in the NAND framework and should have been an MTD driver (docg4), or it was not properly implementing the OOB read/write request or had a weird layout where BBM are trashed. In any case, we should discourage people from overloading those methods and encourage them to fix their driver instead.
Move the ->block_{bad,markbad}() hooks to the nand_legacy struct to make it clear.
--- drivers/mtd/nand/raw/cafe_nand.c | 2 +- drivers/mtd/nand/raw/diskonchip.c | 2 +- drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 4 ++-- drivers/mtd/nand/raw/nand_base.c | 37 ++++++++++++++++++++++-------- drivers/mtd/nand/raw/nand_bbt.c | 2 +- drivers/mtd/nand/raw/qcom_nandc.c | 4 ++-- drivers/mtd/nand/raw/sm_common.c | 2 +- include/linux/mtd/rawnand.h | 9 ++++---- 8 files changed, 40 insertions(+), 22 deletions(-)
drivers/mtd/nand/raw/cafe_nand.c +1 -1
@@ -719,7 +719,7 @@ static int cafe_nand_probe(struct pci_dev *pdev,if (skipbbt) { cafe->nand.options |=NAND_SKIP_BBTSCAN ; - cafe->nand.block_bad = cafe_nand_block_bad; + cafe->nand.legacy.block_bad = cafe_nand_block_bad; }if (numtimings && numtimings !=3 ) {
drivers/mtd/nand/raw/diskonchip.c +1 -1
@@ -1572,7 +1572,7 @@ static int __init doc_probe(unsigned long physadr) nand->legacy.cmd_ctrl = doc200x_hwcontrol; nand->legacy.dev_ready = doc200x_dev_ready; nand->legacy.waitfunc = doc200x_wait; - nand->block_bad = doc200x_block_bad; + nand->legacy.block_bad = doc200x_block_bad; nand->ecc.hwctl = doc200x_enable_hwecc; nand->ecc.calculate = doc200x_calculate_ecc; nand->ecc.correct = doc200x_correct_data;
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +2 -2
@@ -1774,7 +1774,7 @@ static int mx23_boot_init(struct gpmi_nand_data *this)*/ if (block_mark !=0xff ) {dev_dbg (dev,"Transcribing mark in block %u\n" , block); - ret = chip->block_markbad (chip, byte); + ret = chip->legacy.block_markbad (chip, byte);if (ret) dev_err(dev, "Failed to mark block bad with ret %d\n",
@@ -1908,7 +1908,7 @@ static int gpmi_nand_init(struct gpmi_nand_data *this) chip->legacy.read_buf = gpmi_read_buf; chip->legacy.write_buf = gpmi_write_buf; chip->badblock_pattern = &gpmi_bbt_descr; - chip->block_markbad = gpmi_block_markbad; + chip->legacy.block_markbad = gpmi_block_markbad; chip->options |=NAND_NO_SUBPAGE_WRITE ;/* Set up swap_block_mark, must be set before the gpmi_set_geometry() */
drivers/mtd/nand/raw/nand_base.c +27 -10
@@ -475,6 +475,27 @@ static int nand_default_block_markbad(struct nand_chip *chip, loff_t ofs)return ret; } +/** +* nand_markbad_bbm - mark a block by updating the BBM +* @chip: NAND chip object +* @ofs: offset of the block to mark bad +*/ +int nand_markbad_bbm (struct nand_chip *chip,loff_t ofs) +{ +if (chip->legacy.block_markbad) +return chip->legacy.block_markbad (chip, ofs); + +return nand_default_block_markbad (chip, ofs); +} + +static int nand_isbad_bbm (struct nand_chip *chip,loff_t ofs) +{ +if (chip->legacy.block_bad) +return chip->legacy.block_bad (chip, ofs); + +return nand_block_bad (chip, ofs); +} +/** * nand_block_markbad_lowlevel - mark a block bad * @mtd: MTD device structure
@@ -482,7 +503,7 @@ static int nand_default_block_markbad(struct nand_chip *chip, loff_t ofs)* * This function performs the generic NAND bad block marking steps (i.e., bad * block table(s) and/or marker(s)). We only allow the hardware driver to -* specify how to write bad block markers to OOB (chip->block_markbad). +* specify how to write bad block markers to OOB (chip->legacy.block_markbad). * * We try operations in the following order: *
@@ -510,7 +531,7 @@ static int nand_block_markbad_lowlevel(struct mtd_info *mtd, loff_t ofs)/* Write bad block marker to OOB */ nand_get_device (mtd,FL_WRITING ); - ret = chip->block_markbad (chip, ofs); + ret =nand_markbad_bbm (chip, ofs);nand_release_device (mtd); }
@@ -582,11 +603,11 @@ static int nand_block_checkbad(struct mtd_info *mtd, loff_t ofs, int allowbbt) {struct nand_chip *chip =mtd_to_nand (mtd); -if (!chip->bbt) -return chip->block_bad (chip, ofs); -/* Return info from the table */ -return nand_isbad_bbt (chip, ofs, allowbbt); +if (chip->bbt) +return nand_isbad_bbt (chip, ofs, allowbbt); + +return nand_isbad_bbm (chip, ofs); }/**
@@ -4942,10 +4963,6 @@ static void nand_set_defaults(struct nand_chip *chip)/* If called twice, pointers that depend on busw may need to be reset */ if (!chip->legacy.read_byte || chip->legacy.read_byte == nand_read_byte) chip->legacy.read_byte = busw ? nand_read_byte16 : nand_read_byte; -if (!chip->block_bad) - chip->block_bad = nand_block_bad; -if (!chip->block_markbad) - chip->block_markbad = nand_default_block_markbad;if (!chip->legacy.write_buf || chip->legacy.write_buf == nand_write_buf) chip->legacy.write_buf = busw ? nand_write_buf16 : nand_write_buf;if (!chip->legacy.write_byte || chip->legacy.write_byte == nand_write_byte)
drivers/mtd/nand/raw/nand_bbt.c +1 -1
@@ -689,7 +689,7 @@ static void mark_bbt_block_bad(struct nand_chip *this,bbt_mark_entry (this, block,BBT_BLOCK_WORN ); to = (loff_t )block << this->bbt_erase_shift; - res = this->block_markbad (this, to); + res =nand_markbad_bbm (this, to);if (res)pr_warn ("nand_bbt: error %d while marking block %d bad\n" , res, block);
drivers/mtd/nand/raw/qcom_nandc.c +2 -2
@@ -2819,8 +2819,8 @@ static int qcom_nand_host_init_and_register(struct qcom_nand_controller *nandc,* and block_markbad helpers until we permanently switch to using * MTD_OPS_RAW for all drivers (with the help of badblockbits) */ - chip->block_bad = qcom_nandc_block_bad; - chip->block_markbad = qcom_nandc_block_markbad; + chip->legacy.block_bad = qcom_nandc_block_bad; + chip->legacy.block_markbad = qcom_nandc_block_markbad; chip->controller = &nandc->controller; chip->options |= NAND_NO_SUBPAGE_WRITE | NAND_USE_BOUNCE_BUFFER |
drivers/mtd/nand/raw/sm_common.c +1 -1
@@ -168,7 +168,7 @@ static int sm_attach_chip(struct nand_chip *chip)/* Bad block marker position */ chip->badblockpos =0x05 ; chip->badblockbits =7 ; - chip->block_markbad = sm_block_markbad; + chip->legacy.block_markbad = sm_block_markbad;/* ECC layout */ if (mtd->writesize ==SM_SECTOR_SIZE )
include/linux/mtd/rawnand.h +5 -4
@@ -1187,6 +1187,8 @@ int nand_op_parser_exec_op(struct nand_chip *chip,* If set to NULL no access to ready/busy is available and the * ready/busy information is read from the chip status register. * @waitfunc: hardware specific function for wait on ready. +* @block_bad: check if a block is bad, using OOB markers +* @block_markbad: mark a block bad * * If you look at this structure you're already wrong. These fields/hooks are * all deprecated.
@@ -1203,6 +1205,8 @@ struct nand_legacy { int page_addr);int (*dev_ready)(struct nand_chip *chip);int (*waitfunc)(struct nand_chip *chip); +int (*block_bad)(struct nand_chip *chip,loff_t ofs); +int (*block_markbad)(struct nand_chip *chip,loff_t ofs); };/**
@@ -1214,8 +1218,6 @@ struct nand_legacy {* fields/hooks, you should consider reworking the driver * avoid using them. * @select_chip: [REPLACEABLE] select chip nr -* @block_bad: [REPLACEABLE] check if a block is bad, using OOB markers -* @block_markbad: [REPLACEABLE] mark a block bad * @exec_op: controller specific method to execute NAND operations. * This method replaces ->cmdfunc(), * ->legacy.{read,write}_{buf,byte,word}(),
@@ -1303,8 +1305,6 @@ struct nand_chip {struct nand_legacy legacy;void (*select_chip)(struct nand_chip *chip,int cs); -int (*block_bad)(struct nand_chip *chip,loff_t ofs); -int (*block_markbad)(struct nand_chip *chip,loff_t ofs);int (*exec_op)(struct nand_chip *chip,const struct nand_operation *op,bool check_only);
@@ -1556,6 +1556,7 @@ extern const struct nand_manufacturer_ops macronix_nand_manuf_ops;int nand_create_bbt (struct nand_chip *chip);int nand_markbad_bbt (struct nand_chip *chip,loff_t offs); +int nand_markbad_bbm (struct nand_chip *chip,loff_t ofs);int nand_isreserved_bbt (struct nand_chip *chip,loff_t offs);int nand_isbad_bbt (struct nand_chip *chip,loff_t offs,int allowbbt); int nand_erase_nand(struct nand_chip *chip, struct erase_info *instr,
Signature · 1 line
2.14.1
PATCH 7/19 mtd: rawnand: Deprecate ->erase()
In reply to Boris BrezillonThe ->erase() hook have been overloaded by some drivers for bad reasons:
either the driver was not fitting in the NAND framework and should have been an MTD driver (docg4), or the driver uses a specific path for the ERASE operation (denali), instead of implementing it generically. In any case, we should discourage people from overloading this method and encourage them to implement ->exec_op() instead.
Move the ->erase() hook to the nand_legacy struct to make it clear.
--- drivers/mtd/nand/raw/denali.c | 2 +- drivers/mtd/nand/raw/nand_base.c | 7 +++++-- include/linux/mtd/rawnand.h | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-)
drivers/mtd/nand/raw/denali.c +1 -1
@@ -1275,7 +1275,7 @@ static int denali_attach_chip(struct nand_chip *chip) chip->ecc.write_page_raw = denali_write_page_raw; chip->ecc.read_oob = denali_read_oob; chip->ecc.write_oob = denali_write_oob; - chip->erase = denali_erase; + chip->legacy.erase = denali_erase; ret =denali_multidev_fixup (denali);if (ret)
drivers/mtd/nand/raw/nand_base.c +5 -2
@@ -4730,7 +4730,11 @@ int nand_erase_nand(struct nand_chip *chip, struct erase_info *instr, (page + pages_per_block)) chip->pagebuf =-1 ; - status = chip->erase (chip, page & chip->pagemask); +if (chip->legacy.erase) + status = chip->legacy.erase (chip, + page & chip->pagemask); +else + status =single_erase (chip, page & chip->pagemask);/* See if block erase succeeded */ if (status) {
@@ -5756,7 +5760,6 @@ static int nand_detect(struct nand_chip *chip, struct nand_flash_dev *type) chip->options |=NAND_ROW_ADDR_3 ; chip->badblockbits =8 ; - chip->erase = single_erase;/* Do not replace user supplied command function! */ if (mtd->writesize >512 && chip->legacy.cmdfunc == nand_command)
include/linux/mtd/rawnand.h +2 -2
@@ -1189,6 +1189,7 @@ int nand_op_parser_exec_op(struct nand_chip *chip,* @waitfunc: hardware specific function for wait on ready. * @block_bad: check if a block is bad, using OOB markers * @block_markbad: mark a block bad +* @erase: erase function * * If you look at this structure you're already wrong. These fields/hooks are * all deprecated.
@@ -1207,6 +1208,7 @@ struct nand_legacy {int (*waitfunc)(struct nand_chip *chip);int (*block_bad)(struct nand_chip *chip,loff_t ofs);int (*block_markbad)(struct nand_chip *chip,loff_t ofs); +int (*erase)(struct nand_chip *chip,int page); };/**
@@ -1228,7 +1230,6 @@ struct nand_legacy {* @buf_align: minimum buffer alignment required by a platform * @dummy_controller: dummy controller implementation for drivers that can * only control a single chip -* @erase: [REPLACEABLE] erase function * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transferring * data from array to read regs (tR). * @state: [INTERN] the current state of the NAND device
@@ -1308,7 +1309,6 @@ struct nand_chip {int (*exec_op)(struct nand_chip *chip,const struct nand_operation *op,bool check_only); -int (*erase)(struct nand_chip *chip,int page);int (*set_features)(struct nand_chip *chip,int feature_addr,uint8_t *subfeature_para); int (*get_features)(struct nand_chip *chip, int feature_addr,
Signature · 1 line
2.14.1
PATCH 8/19 mtd: rawnand: Deprecate ->{set,get}_features() hooks
In reply to Boris BrezillonThose hooks should be replaced by a proper ->exec_op() implementation. Move them to the nand_legacy struct to make it clear.
--- drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c | 4 +- drivers/mtd/nand/raw/cafe_nand.c | 4 +- drivers/mtd/nand/raw/fsl_elbc_nand.c | 4 +- drivers/mtd/nand/raw/fsl_ifc_nand.c | 4 +- drivers/mtd/nand/raw/hisi504_nand.c | 4 +- drivers/mtd/nand/raw/mpc5121_nfc.c | 4 +- drivers/mtd/nand/raw/mxc_nand.c | 4 +- drivers/mtd/nand/raw/nand_base.c | 112 +++++++++-------------- drivers/mtd/nand/raw/qcom_nandc.c | 4 +- drivers/mtd/nand/raw/sh_flctl.c | 4 +- drivers/staging/mt29f_spinand/mt29f_spinand.c | 4 +- include/linux/mtd/rawnand.h | 12 +-- 12 files changed, 70 insertions(+), 94 deletions(-)
drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c +2 -2
@@ -390,8 +390,8 @@ int bcm47xxnflash_ops_bcm4706_init(struct bcm47xxnflash *b47n) b47n->nand_chip.legacy.read_byte = bcm47xxnflash_ops_bcm4706_read_byte; b47n->nand_chip.legacy.read_buf = bcm47xxnflash_ops_bcm4706_read_buf; b47n->nand_chip.legacy.write_buf = bcm47xxnflash_ops_bcm4706_write_buf; - b47n->nand_chip.set_features = nand_get_set_features_notsupp; - b47n->nand_chip.get_features = nand_get_set_features_notsupp; + b47n->nand_chip.legacy.set_features = nand_get_set_features_notsupp; + b47n->nand_chip.legacy.get_features = nand_get_set_features_notsupp; nand_chip->chip_delay =50 ; b47n->nand_chip.bbt_options =NAND_BBT_USE_FLASH ;
drivers/mtd/nand/raw/cafe_nand.c +2 -2
@@ -709,8 +709,8 @@ static int cafe_nand_probe(struct pci_dev *pdev, cafe->nand.legacy.read_buf = cafe_read_buf; cafe->nand.legacy.write_buf = cafe_write_buf; cafe->nand.select_chip = cafe_select_chip; - cafe->nand.set_features = nand_get_set_features_notsupp; - cafe->nand.get_features = nand_get_set_features_notsupp; + cafe->nand.legacy.set_features = nand_get_set_features_notsupp; + cafe->nand.legacy.get_features = nand_get_set_features_notsupp; cafe->nand.chip_delay =0 ;
drivers/mtd/nand/raw/fsl_elbc_nand.c +2 -2
@@ -782,8 +782,8 @@ static int fsl_elbc_chip_init(struct fsl_elbc_mtd *priv) chip->select_chip = fsl_elbc_select_chip; chip->legacy.cmdfunc = fsl_elbc_cmdfunc; chip->legacy.waitfunc = fsl_elbc_wait; - chip->set_features = nand_get_set_features_notsupp; - chip->get_features = nand_get_set_features_notsupp; + chip->legacy.set_features = nand_get_set_features_notsupp; + chip->legacy.get_features = nand_get_set_features_notsupp; chip->bbt_td = &bbt_main_descr; chip->bbt_md = &bbt_mirror_descr;
drivers/mtd/nand/raw/fsl_ifc_nand.c +2 -2
@@ -867,8 +867,8 @@ static int fsl_ifc_chip_init(struct fsl_ifc_mtd *priv) chip->select_chip = fsl_ifc_select_chip; chip->legacy.cmdfunc = fsl_ifc_cmdfunc; chip->legacy.waitfunc = fsl_ifc_wait; - chip->set_features = nand_get_set_features_notsupp; - chip->get_features = nand_get_set_features_notsupp; + chip->legacy.set_features = nand_get_set_features_notsupp; + chip->legacy.get_features = nand_get_set_features_notsupp; chip->bbt_td = &bbt_main_descr; chip->bbt_md = &bbt_mirror_descr;
drivers/mtd/nand/raw/hisi504_nand.c +2 -2
@@ -788,8 +788,8 @@ static int hisi_nfc_probe(struct platform_device *pdev) chip->legacy.write_buf = hisi_nfc_write_buf; chip->legacy.read_buf = hisi_nfc_read_buf; chip->chip_delay =HINFC504_CHIP_DELAY ; - chip->set_features = nand_get_set_features_notsupp; - chip->get_features = nand_get_set_features_notsupp; + chip->legacy.set_features = nand_get_set_features_notsupp; + chip->legacy.get_features = nand_get_set_features_notsupp;hisi_nfc_host_init (host);
drivers/mtd/nand/raw/mpc5121_nfc.c +2 -2
@@ -698,8 +698,8 @@ static int mpc5121_nfc_probe(struct platform_device *op) chip->legacy.read_buf = mpc5121_nfc_read_buf; chip->legacy.write_buf = mpc5121_nfc_write_buf; chip->select_chip = mpc5121_nfc_select_chip; - chip->set_features = nand_get_set_features_notsupp; - chip->get_features = nand_get_set_features_notsupp; + chip->legacy.set_features = nand_get_set_features_notsupp; + chip->legacy.get_features = nand_get_set_features_notsupp; chip->bbt_options =NAND_BBT_USE_FLASH ; chip->ecc.mode =NAND_ECC_SOFT ; chip->ecc.algo =NAND_ECC_HAMMING ;
drivers/mtd/nand/raw/mxc_nand.c +2 -2
@@ -1778,8 +1778,8 @@ static int mxcnd_probe(struct platform_device *pdev) this->legacy.read_byte = mxc_nand_read_byte; this->legacy.write_buf = mxc_nand_write_buf; this->legacy.read_buf = mxc_nand_read_buf; - this->set_features = mxc_nand_set_features; - this->get_features = mxc_nand_get_features; + this->legacy.set_features = mxc_nand_set_features; + this->legacy.get_features = mxc_nand_get_features; host->clk =devm_clk_get (&pdev->dev,NULL );if (IS_ERR (host->clk))
drivers/mtd/nand/raw/nand_base.c +44 -68
136 lines not on this page · raw message
drivers/mtd/nand/raw/qcom_nandc.c +2 -2
@@ -2808,8 +2808,8 @@ static int qcom_nand_host_init_and_register(struct qcom_nand_controller *nandc, chip->legacy.read_byte = qcom_nandc_read_byte; chip->legacy.read_buf = qcom_nandc_read_buf; chip->legacy.write_buf = qcom_nandc_write_buf; - chip->set_features = nand_get_set_features_notsupp; - chip->get_features = nand_get_set_features_notsupp; + chip->legacy.set_features = nand_get_set_features_notsupp; + chip->legacy.get_features = nand_get_set_features_notsupp;/* * the bad block marker is readable only when we read the last codeword
drivers/mtd/nand/raw/sh_flctl.c +2 -2
@@ -1185,8 +1185,8 @@ static int flctl_probe(struct platform_device *pdev) nand->legacy.read_buf = flctl_read_buf; nand->select_chip = flctl_select_chip; nand->legacy.cmdfunc = flctl_cmdfunc; - nand->set_features = nand_get_set_features_notsupp; - nand->get_features = nand_get_set_features_notsupp; + nand->legacy.set_features = nand_get_set_features_notsupp; + nand->legacy.get_features = nand_get_set_features_notsupp;if (pdata->flcmncr_val &SEL_16BIT ) nand->options |=NAND_BUSWIDTH_16 ;
drivers/staging/mt29f_spinand/mt29f_spinand.c +2 -2
@@ -922,8 +922,8 @@ static int spinand_probe(struct spi_device *spi_nand) chip->legacy.waitfunc = spinand_wait; chip->options |=NAND_CACHEPRG ; chip->select_chip = spinand_select_chip; - chip->set_features = nand_get_set_features_notsupp; - chip->get_features = nand_get_set_features_notsupp; + chip->legacy.set_features = nand_get_set_features_notsupp; + chip->legacy.get_features = nand_get_set_features_notsupp; mtd =nand_to_mtd (chip);
include/linux/mtd/rawnand.h +6 -6
@@ -1190,6 +1190,8 @@ int nand_op_parser_exec_op(struct nand_chip *chip,* @block_bad: check if a block is bad, using OOB markers * @block_markbad: mark a block bad * @erase: erase function +* @set_features: set the NAND chip features +* @get_features: get the NAND chip features * * If you look at this structure you're already wrong. These fields/hooks are * all deprecated.
@@ -1209,6 +1211,10 @@ struct nand_legacy {int (*block_bad)(struct nand_chip *chip,loff_t ofs);int (*block_markbad)(struct nand_chip *chip,loff_t ofs);int (*erase)(struct nand_chip *chip,int page); +int (*set_features)(struct nand_chip *chip,int feature_addr, +u8 *subfeature_para); +int (*get_features)(struct nand_chip *chip,int feature_addr, +u8 *subfeature_para); };/**
@@ -1279,8 +1285,6 @@ struct nand_legacy {* @blocks_per_die: [INTERN] The number of PEBs in a die * @data_interface: [INTERN] NAND interface timing information * @read_retries: [INTERN] the number of read retry modes supported -* @set_features: [REPLACEABLE] set the NAND chip features -* @get_features: [REPLACEABLE] get the NAND chip features * @setup_data_interface: [OPTIONAL] setup the data interface and timing. If * chipnr is set to %NAND_DATA_IFACE_CHECK_ONLY this * means the configuration should not be applied but
@@ -1309,10 +1313,6 @@ struct nand_chip {int (*exec_op)(struct nand_chip *chip,const struct nand_operation *op,bool check_only); -int (*set_features)(struct nand_chip *chip,int feature_addr, -uint8_t *subfeature_para); -int (*get_features)(struct nand_chip *chip,int feature_addr, -uint8_t *subfeature_para);int (*setup_read_retry)(struct nand_chip *chip,int retry_mode);int (*setup_data_interface)(struct nand_chip *chip,int chipnr,const struct nand_data_interface *conf);
Signature · 1 line
2.14.1
PATCH 9/19 mtd: rawnand: Deprecate ->chip_delay
In reply to Boris BrezillonThe wait timeouts and delays are directly extracted from the NAND timings and ->chip_delay is only used in legacy path, so let's move it to the nand_legacy struct to make it clear.
--- Documentation/driver-api/mtdnand.rst | 2 +- drivers/mtd/nand/raw/ams-delta.c | 2 +- drivers/mtd/nand/raw/atmel/nand-controller.c | 2 +- drivers/mtd/nand/raw/au1550nd.c | 4 ++-- drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c | 2 +- drivers/mtd/nand/raw/cafe_nand.c | 2 +- drivers/mtd/nand/raw/cmx270_nand.c | 2 +- drivers/mtd/nand/raw/cs553x_nand.c | 2 +- drivers/mtd/nand/raw/davinci_nand.c | 2 +- drivers/mtd/nand/raw/diskonchip.c | 4 ++-- drivers/mtd/nand/raw/fsl_elbc_nand.c | 4 ++-- drivers/mtd/nand/raw/fsl_ifc_nand.c | 4 ++-- drivers/mtd/nand/raw/fsl_upm.c | 2 +- drivers/mtd/nand/raw/fsmc_nand.c | 1 - drivers/mtd/nand/raw/gpio.c | 2 +- drivers/mtd/nand/raw/hisi504_nand.c | 2 +- drivers/mtd/nand/raw/jz4740_nand.c | 2 +- drivers/mtd/nand/raw/jz4780_nand.c | 2 +- drivers/mtd/nand/raw/lpc32xx_mlc.c | 2 +- drivers/mtd/nand/raw/lpc32xx_slc.c | 2 +- drivers/mtd/nand/raw/mxc_nand.c | 2 +- drivers/mtd/nand/raw/nand_base.c | 14 +++++++------- drivers/mtd/nand/raw/nandsim.c | 2 +- drivers/mtd/nand/raw/ndfc.c | 2 +- drivers/mtd/nand/raw/nuc900_nand.c | 6 +++--- drivers/mtd/nand/raw/omap2.c | 4 ++-- drivers/mtd/nand/raw/orion_nand.c | 2 +- drivers/mtd/nand/raw/oxnas_nand.c | 2 +- drivers/mtd/nand/raw/pasemi_nand.c | 2 +- drivers/mtd/nand/raw/plat_nand.c | 2 +- drivers/mtd/nand/raw/s3c2410.c | 2 +- drivers/mtd/nand/raw/sh_flctl.c | 2 +- drivers/mtd/nand/raw/sharpsl.c | 2 +- drivers/mtd/nand/raw/socrates_nand.c | 2 +- drivers/mtd/nand/raw/sunxi_nand.c | 2 +- drivers/mtd/nand/raw/tmio_nand.c | 2 +- drivers/mtd/nand/raw/txx9ndfmc.c | 2 +- drivers/mtd/nand/raw/xway_nand.c | 2 +- include/linux/mtd/rawnand.h | 6 +++--- 39 files changed, 53 insertions(+), 54 deletions(-)
Documentation/driver-api/mtdnand.rst +1 -1
@@ -240,7 +240,7 @@ necessary information about the device. /* Reference hardware control function */ this->hwcontrol = board_hwcontrol; /* Set command delay time, see datasheet for correct value */ - this->chip_delay = CHIP_DEPENDEND_COMMAND_DELAY; + this->legacy.chip_delay = CHIP_DEPENDEND_COMMAND_DELAY; /* Assign the device ready function, if available */ this->legacy.dev_ready = board_dev_ready; this->eccmode = NAND_ECC_SOFT;
drivers/mtd/nand/raw/ams-delta.c +1 -1
@@ -221,7 +221,7 @@ static int ams_delta_init(struct platform_device *pdev)pr_notice ("Couldn't request gpio for Delta NAND ready.\n" ); }/* 25 us command delay time */ - this->chip_delay =30 ; + this->legacy.chip_delay =30 ; this->ecc.mode =NAND_ECC_SOFT ; this->ecc.algo =NAND_ECC_HAMMING ;
drivers/mtd/nand/raw/atmel/nand-controller.c +1 -1
@@ -1483,7 +1483,7 @@ static void atmel_nand_init(struct atmel_nand_controller *nc, chip->setup_data_interface = atmel_nand_setup_data_interface;/* Some NANDs require a longer delay than the default one (20us). */ - chip->chip_delay =40 ; + chip->legacy.chip_delay =40 ;/* * Use a bounce buffer when the buffer passed by the MTD user is not
drivers/mtd/nand/raw/au1550nd.c +2 -2
@@ -342,7 +342,7 @@ static void au1550_command(struct nand_chip *this, unsigned command,/* Apply a short delay always to ensure that we do wait tWB. */ ndelay (100 );/* Wait for a chip to become ready... */ -for (i = this->chip_delay; +for (i = this->legacy.chip_delay; !this->legacy.dev_ready (this) && i >0 ; --i)udelay (1 );
@@ -434,7 +434,7 @@ static int au1550nd_probe(struct platform_device *pdev) this->legacy.cmdfunc = au1550_command;/* 30 us command delay time */ - this->chip_delay =30 ; + this->legacy.chip_delay =30 ; this->ecc.mode =NAND_ECC_SOFT ; this->ecc.algo =NAND_ECC_HAMMING ;
drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c +1 -1
@@ -393,7 +393,7 @@ int bcm47xxnflash_ops_bcm4706_init(struct bcm47xxnflash *b47n) b47n->nand_chip.legacy.set_features = nand_get_set_features_notsupp; b47n->nand_chip.legacy.get_features = nand_get_set_features_notsupp; - nand_chip->chip_delay =50 ; + nand_chip->legacy.chip_delay =50 ; b47n->nand_chip.bbt_options =NAND_BBT_USE_FLASH ; b47n->nand_chip.ecc.mode =NAND_ECC_NONE ;/* TODO: implement ECC */
drivers/mtd/nand/raw/cafe_nand.c +1 -1
@@ -712,7 +712,7 @@ static int cafe_nand_probe(struct pci_dev *pdev, cafe->nand.legacy.set_features = nand_get_set_features_notsupp; cafe->nand.legacy.get_features = nand_get_set_features_notsupp; - cafe->nand.chip_delay =0 ; + cafe->nand.legacy.chip_delay =0 ;/* Enable the following for a flash based bad block table */ cafe->nand.bbt_options =NAND_BBT_USE_FLASH ;
drivers/mtd/nand/raw/cmx270_nand.c +1 -1
@@ -179,7 +179,7 @@ static int __init cmx270_init(void) this->legacy.dev_ready = cmx270_device_ready;/* 15 us command delay time */ - this->chip_delay =20 ; + this->legacy.chip_delay =20 ; this->ecc.mode =NAND_ECC_SOFT ; this->ecc.algo =NAND_ECC_HAMMING ;
drivers/mtd/nand/raw/cs553x_nand.c +1 -1
@@ -212,7 +212,7 @@ static int __init cs553x_init_one(int cs, int mmio, unsigned long adr) this->legacy.read_buf = cs553x_read_buf; this->legacy.write_buf = cs553x_write_buf; - this->chip_delay =0 ; + this->legacy.chip_delay =0 ; this->ecc.mode =NAND_ECC_HW ; this->ecc.size =256 ;
drivers/mtd/nand/raw/davinci_nand.c +1 -1
@@ -761,7 +761,7 @@ static int nand_davinci_probe(struct platform_device *pdev) info->chip.legacy.IO_ADDR_R = vaddr; info->chip.legacy.IO_ADDR_W = vaddr; - info->chip.chip_delay =0 ; + info->chip.legacy.chip_delay =0 ; info->chip.select_chip = nand_davinci_select_chip;/* options such as NAND_BBT_USE_FLASH */
drivers/mtd/nand/raw/diskonchip.c +2 -2
@@ -717,7 +717,7 @@ static void doc2001plus_command(struct nand_chip *this, unsigned command,case NAND_CMD_RESET :if (this->legacy.dev_ready)break ; -udelay (this->chip_delay); +udelay (this->legacy.chip_delay);WriteDOC (NAND_CMD_STATUS , docptr, Mplus_FlashCmd);WriteDOC (0 , docptr, Mplus_WritePipeTerm);WriteDOC (0 , docptr, Mplus_WritePipeTerm);
@@ -731,7 +731,7 @@ static void doc2001plus_command(struct nand_chip *this, unsigned command,* command delay */ if (!this->legacy.dev_ready) { -udelay (this->chip_delay); +udelay (this->legacy.chip_delay);return ; } }
drivers/mtd/nand/raw/fsl_elbc_nand.c +2 -2
@@ -658,8 +658,8 @@ static int fsl_elbc_attach_chip(struct nand_chip *chip) chip->chipsize);dev_dbg (priv->dev,"fsl_elbc_init: nand->pagemask = %8x\n" , chip->pagemask); -dev_dbg (priv->dev,"fsl_elbc_init: nand->chip_delay = %d\n" , - chip->chip_delay); +dev_dbg (priv->dev,"fsl_elbc_init: nand->legacy.chip_delay = %d\n" , + chip->legacy.chip_delay);dev_dbg (priv->dev,"fsl_elbc_init: nand->badblockpos = %d\n" , chip->badblockpos); dev_dbg(priv->dev, "fsl_elbc_init: nand->chip_shift = %d\n",
drivers/mtd/nand/raw/fsl_ifc_nand.c +2 -2
@@ -727,8 +727,8 @@ static int fsl_ifc_attach_chip(struct nand_chip *chip) chip->chipsize);dev_dbg (priv->dev,"%s: nand->pagemask = %8x\n" , __func__, chip->pagemask); -dev_dbg (priv->dev,"%s: nand->chip_delay = %d\n" , __func__, - chip->chip_delay); +dev_dbg (priv->dev,"%s: nand->legacy.chip_delay = %d\n" , __func__, + chip->legacy.chip_delay);dev_dbg (priv->dev,"%s: nand->badblockpos = %d\n" , __func__, chip->badblockpos); dev_dbg(priv->dev, "%s: nand->chip_shift = %d\n", __func__,
drivers/mtd/nand/raw/fsl_upm.c +1 -1
@@ -163,7 +163,7 @@ static int fun_chip_init(struct fsl_upm_nand *fun, fun->chip.legacy.IO_ADDR_R = fun->io_base; fun->chip.legacy.IO_ADDR_W = fun->io_base; fun->chip.legacy.cmd_ctrl = fun_cmd_ctrl; - fun->chip.chip_delay = fun->chip_delay; + fun->chip.legacy.chip_delay = fun->chip_delay; fun->chip.legacy.read_byte = fun_read_byte; fun->chip.legacy.read_buf = fun_read_buf; fun->chip.legacy.write_buf = fun_write_buf;
drivers/mtd/nand/raw/fsmc_nand.c +0 -1
@@ -1080,7 +1080,6 @@ static int __init fsmc_nand_probe(struct platform_device *pdev) mtd->dev.parent = &pdev->dev; nand->exec_op = fsmc_exec_op; nand->select_chip = fsmc_select_chip; - nand->chip_delay =30 ;/* * Setup default ECC mode. nand_dt_init() called from nand_scan_ident()
drivers/mtd/nand/raw/gpio.c +1 -1
@@ -278,7 +278,7 @@ static int gpio_nand_probe(struct platform_device *pdev) chip->ecc.mode =NAND_ECC_SOFT ; chip->ecc.algo =NAND_ECC_HAMMING ; chip->options = gpiomtd->plat.options; - chip->chip_delay = gpiomtd->plat.chip_delay; + chip->legacy.chip_delay = gpiomtd->plat.chip_delay; chip->legacy.cmd_ctrl = gpio_nand_cmd_ctrl; mtd =nand_to_mtd (chip);
drivers/mtd/nand/raw/hisi504_nand.c +1 -1
@@ -787,7 +787,7 @@ static int hisi_nfc_probe(struct platform_device *pdev) chip->legacy.read_byte = hisi_nfc_read_byte; chip->legacy.write_buf = hisi_nfc_write_buf; chip->legacy.read_buf = hisi_nfc_read_buf; - chip->chip_delay =HINFC504_CHIP_DELAY ; + chip->legacy.chip_delay =HINFC504_CHIP_DELAY ; chip->legacy.set_features = nand_get_set_features_notsupp; chip->legacy.get_features = nand_get_set_features_notsupp;
drivers/mtd/nand/raw/jz4740_nand.c +1 -1
@@ -425,7 +425,7 @@ static int jz_nand_probe(struct platform_device *pdev) chip->ecc.strength =4 ; chip->ecc.options =NAND_ECC_GENERIC_ERASED_CHECK ; - chip->chip_delay =50 ; + chip->legacy.chip_delay =50 ; chip->legacy.cmd_ctrl = jz_nand_cmd_ctrl; chip->select_chip = jz_nand_select_chip; chip->dummy_controller.ops = &jz_nand_controller_ops;
drivers/mtd/nand/raw/jz4780_nand.c +1 -1
@@ -277,7 +277,7 @@ static int jz4780_nand_init_chip(struct platform_device *pdev, chip->legacy.IO_ADDR_R = cs->base +OFFSET_DATA ; chip->legacy.IO_ADDR_W = cs->base +OFFSET_DATA ; - chip->chip_delay =RB_DELAY_US ; + chip->legacy.chip_delay =RB_DELAY_US ; chip->options =NAND_NO_SUBPAGE_WRITE ; chip->select_chip = jz4780_nand_select_chip; chip->legacy.cmd_ctrl = jz4780_nand_cmd_ctrl;
drivers/mtd/nand/raw/lpc32xx_mlc.c +1 -1
@@ -741,7 +741,7 @@ static int lpc32xx_nand_probe(struct platform_device *pdev) nand_chip->legacy.cmd_ctrl = lpc32xx_nand_cmd_ctrl; nand_chip->legacy.dev_ready = lpc32xx_nand_device_ready; - nand_chip->chip_delay =25 ;/* us */ + nand_chip->legacy.chip_delay =25 ;/* us */ nand_chip->legacy.IO_ADDR_R =MLC_DATA (host->io_base); nand_chip->legacy.IO_ADDR_W =MLC_DATA (host->io_base);
drivers/mtd/nand/raw/lpc32xx_slc.c +1 -1
@@ -882,7 +882,7 @@ static int lpc32xx_nand_probe(struct platform_device *pdev) chip->legacy.IO_ADDR_W =SLC_DATA (host->io_base); chip->legacy.cmd_ctrl = lpc32xx_nand_cmd_ctrl; chip->legacy.dev_ready = lpc32xx_nand_device_ready; - chip->chip_delay =20 ;/* 20us command delay time */ + chip->legacy.chip_delay =20 ;/* 20us command delay time */ /* Init NAND controller */ lpc32xx_nand_setup (host);
drivers/mtd/nand/raw/mxc_nand.c +1 -1
@@ -1769,7 +1769,7 @@ static int mxcnd_probe(struct platform_device *pdev) mtd->name =DRIVER_NAME ;/* 50 us command delay time */ - this->chip_delay =5 ; + this->legacy.chip_delay =5 ;nand_set_controller_data (this, host); nand_set_flash_node(this, pdev->dev.of_node),
drivers/mtd/nand/raw/nand_base.c +7 -7
@@ -827,7 +827,7 @@ static void nand_command(struct nand_chip *chip, unsigned int command,case NAND_CMD_RESET :if (chip->legacy.dev_ready)break ; -udelay (chip->chip_delay); +udelay (chip->legacy.chip_delay); chip->legacy.cmd_ctrl (chip,NAND_CMD_STATUS ,NAND_CTRL_CLE |NAND_CTRL_CHANGE ); chip->legacy.cmd_ctrl(chip, NAND_CMD_NONE,
@@ -853,7 +853,7 @@ static void nand_command(struct nand_chip *chip, unsigned int command,* command delay */ if (!chip->legacy.dev_ready) { -udelay (chip->chip_delay); +udelay (chip->legacy.chip_delay);return ; } }
@@ -964,7 +964,7 @@ static void nand_command_lp(struct nand_chip *chip, unsigned int command,case NAND_CMD_RESET :if (chip->legacy.dev_ready)break ; -udelay (chip->chip_delay); +udelay (chip->legacy.chip_delay); chip->legacy.cmd_ctrl (chip,NAND_CMD_STATUS ,NAND_NCE |NAND_CLE |NAND_CTRL_CHANGE ); chip->legacy.cmd_ctrl(chip, NAND_CMD_NONE,
@@ -1005,7 +1005,7 @@ static void nand_command_lp(struct nand_chip *chip, unsigned int command,* command delay. */ if (!chip->legacy.dev_ready) { -udelay (chip->chip_delay); +udelay (chip->legacy.chip_delay);return ; } }
@@ -2206,7 +2206,7 @@ static int nand_wait_rdy_op(struct nand_chip *chip, unsigned int timeout_ms,/* Apply delay or wait for ready/busy pin */ if (!chip->legacy.dev_ready) -udelay (chip->chip_delay); +udelay (chip->legacy.chip_delay);else nand_wait_ready (chip);
@@ -4926,8 +4926,8 @@ static void nand_set_defaults(struct nand_chip *chip)unsigned int busw = chip->options &NAND_BUSWIDTH_16 ;/* check for proper chip_delay setup, set 20us if not */ -if (!chip->chip_delay) - chip->chip_delay =20 ; +if (!chip->legacy.chip_delay) + chip->legacy.chip_delay =20 ;/* check, if a user supplied command function given */ if (!chip->legacy.cmdfunc && !chip->exec_op)
drivers/mtd/nand/raw/nandsim.c +1 -1
@@ -656,7 +656,7 @@ static int __init init_nandsim(struct mtd_info *mtd) }/* Force mtd to not do delays */ - chip->chip_delay =0 ; + chip->legacy.chip_delay =0 ;/* Initialize the NAND flash parameters */ ns->busw = chip->options &NAND_BUSWIDTH_16 ?16 :8 ;
drivers/mtd/nand/raw/ndfc.c +1 -1
@@ -147,7 +147,7 @@ static int ndfc_chip_init(struct ndfc_controller *ndfc, chip->legacy.cmd_ctrl = ndfc_hwcontrol; chip->legacy.dev_ready = ndfc_ready; chip->select_chip = ndfc_select_chip; - chip->chip_delay =50 ; + chip->legacy.chip_delay =50 ; chip->controller = &ndfc->ndfc_control; chip->legacy.read_buf = ndfc_read_buf; chip->legacy.write_buf = ndfc_write_buf;
drivers/mtd/nand/raw/nuc900_nand.c +3 -3
@@ -177,7 +177,7 @@ static void nuc900_nand_command_lp(struct nand_chip *chip,case NAND_CMD_RESET :if (chip->legacy.dev_ready)break ; -udelay (chip->chip_delay); +udelay (chip->legacy.chip_delay);write_cmd_reg (nand,NAND_CMD_STATUS );write_cmd_reg (nand, command);
@@ -197,7 +197,7 @@ static void nuc900_nand_command_lp(struct nand_chip *chip,default :if (!chip->legacy.dev_ready) { -udelay (chip->chip_delay); +udelay (chip->legacy.chip_delay);return ; } }
@@ -259,7 +259,7 @@ static int nuc900_nand_probe(struct platform_device *pdev) chip->legacy.read_byte = nuc900_nand_read_byte; chip->legacy.write_buf = nuc900_nand_write_buf; chip->legacy.read_buf = nuc900_nand_read_buf; - chip->chip_delay =50 ; + chip->legacy.chip_delay =50 ; chip->options =0 ; chip->ecc.mode =NAND_ECC_SOFT ; chip->ecc.algo =NAND_ECC_HAMMING ;
drivers/mtd/nand/raw/omap2.c +2 -2
@@ -2248,10 +2248,10 @@ static int omap_nand_probe(struct platform_device *pdev)*/ if (info->ready_gpiod) { nand_chip->legacy.dev_ready = omap_dev_ready; - nand_chip->chip_delay =0 ; + nand_chip->legacy.chip_delay =0 ; }else { nand_chip->legacy.waitfunc = omap_wait; - nand_chip->chip_delay =50 ; + nand_chip->legacy.chip_delay =50 ; }if (info->flash_bbt)
drivers/mtd/nand/raw/orion_nand.c +1 -1
@@ -143,7 +143,7 @@ static int __init orion_nand_probe(struct platform_device *pdev) nc->ecc.algo =NAND_ECC_HAMMING ;if (board->chip_delay) - nc->chip_delay = board->chip_delay; + nc->legacy.chip_delay = board->chip_delay; WARN(board->width > 16, "%d bit bus width out of range",
drivers/mtd/nand/raw/oxnas_nand.c +1 -1
@@ -136,7 +136,7 @@ static int oxnas_nand_probe(struct platform_device *pdev) chip->legacy.read_buf = oxnas_nand_read_buf; chip->legacy.read_byte = oxnas_nand_read_byte; chip->legacy.write_buf = oxnas_nand_write_buf; - chip->chip_delay =30 ; + chip->legacy.chip_delay =30 ;/* Scan to find existence of the device */ err =nand_scan (chip,1 );
drivers/mtd/nand/raw/pasemi_nand.c +1 -1
@@ -143,7 +143,7 @@ static int pasemi_nand_probe(struct platform_device *ofdev) chip->legacy.dev_ready = pasemi_device_ready; chip->legacy.read_buf = pasemi_read_buf; chip->legacy.write_buf = pasemi_write_buf; - chip->chip_delay =0 ; + chip->legacy.chip_delay =0 ; chip->ecc.mode =NAND_ECC_SOFT ; chip->ecc.algo =NAND_ECC_HAMMING ;
drivers/mtd/nand/raw/plat_nand.c +1 -1
@@ -67,7 +67,7 @@ static int plat_nand_probe(struct platform_device *pdev) data->chip.select_chip = pdata->ctrl.select_chip; data->chip.legacy.write_buf = pdata->ctrl.write_buf; data->chip.legacy.read_buf = pdata->ctrl.read_buf; - data->chip.chip_delay = pdata->chip.chip_delay; + data->chip.legacy.chip_delay = pdata->chip.chip_delay; data->chip.options |= pdata->chip.options; data->chip.bbt_options |= pdata->chip.bbt_options;
drivers/mtd/nand/raw/s3c2410.c +1 -1
@@ -867,7 +867,7 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info, chip->legacy.write_buf = s3c2410_nand_write_buf; chip->legacy.read_buf = s3c2410_nand_read_buf; chip->select_chip = s3c2410_nand_select_chip; - chip->chip_delay =50 ; + chip->legacy.chip_delay =50 ;nand_set_controller_data (chip, nmtd); chip->options = set->options; chip->controller = &info->controller;
drivers/mtd/nand/raw/sh_flctl.c +1 -1
@@ -1178,7 +1178,7 @@ static int flctl_probe(struct platform_device *pdev)/* Set address of hardware control function */ /* 20 us command delay time */ - nand->chip_delay =20 ; + nand->legacy.chip_delay =20 ; nand->legacy.read_byte = flctl_read_byte; nand->legacy.write_buf = flctl_write_buf;
drivers/mtd/nand/raw/sharpsl.c +1 -1
@@ -159,7 +159,7 @@ static int sharpsl_nand_probe(struct platform_device *pdev) this->legacy.cmd_ctrl = sharpsl_nand_hwcontrol; this->legacy.dev_ready = sharpsl_nand_dev_ready;/* 15 us command delay time */ - this->chip_delay =15 ; + this->legacy.chip_delay =15 ;/* set eccmode using hardware ECC */ this->ecc.mode =NAND_ECC_HW ; this->ecc.size =256 ;
drivers/mtd/nand/raw/socrates_nand.c +1 -1
@@ -162,7 +162,7 @@ static int socrates_nand_probe(struct platform_device *ofdev) nand_chip->ecc.algo =NAND_ECC_HAMMING ;/* TODO: I have no idea what real delay is. */ - nand_chip->chip_delay =20 ;/* 20us command delay time */ + nand_chip->legacy.chip_delay =20 ;/* 20us command delay time */ dev_set_drvdata (&ofdev->dev, host);
drivers/mtd/nand/raw/sunxi_nand.c +1 -1
@@ -1912,7 +1912,7 @@ static int sunxi_nand_chip_init(struct device *dev, struct sunxi_nfc *nfc, nand = &chip->nand;/* Default tR value specified in the ONFI spec (chapter 4.15.1) */ - nand->chip_delay =200 ; + nand->legacy.chip_delay =200 ; nand->controller = &nfc->controller; nand->controller->ops = &sunxi_nand_controller_ops;
drivers/mtd/nand/raw/tmio_nand.c +1 -1
@@ -422,7 +422,7 @@ static int tmio_probe(struct platform_device *dev) nand_chip->badblock_pattern = data->badblock_pattern;/* 15 us command delay time */ - nand_chip->chip_delay =15 ; + nand_chip->legacy.chip_delay =15 ; retval =devm_request_irq (&dev->dev, irq, &tmio_irq,0 ,dev_name (&dev->dev), tmio);
drivers/mtd/nand/raw/txx9ndfmc.c +1 -1
@@ -334,7 +334,7 @@ static int __init txx9ndfmc_probe(struct platform_device *dev) chip->ecc.hwctl = txx9ndfmc_enable_hwecc; chip->ecc.mode =NAND_ECC_HW ; chip->ecc.strength =1 ; - chip->chip_delay =100 ; + chip->legacy.chip_delay =100 ; chip->controller = &drvdata->controller;nand_set_controller_data (chip, txx9_priv);
drivers/mtd/nand/raw/xway_nand.c +1 -1
@@ -180,7 +180,7 @@ static int xway_nand_probe(struct platform_device *pdev) data->chip.legacy.write_buf = xway_write_buf; data->chip.legacy.read_buf = xway_read_buf; data->chip.legacy.read_byte = xway_read_byte; - data->chip.chip_delay =30 ; + data->chip.legacy.chip_delay =30 ; data->chip.ecc.mode =NAND_ECC_SOFT ; data->chip.ecc.algo =NAND_ECC_HAMMING ;
include/linux/mtd/rawnand.h +3 -3
@@ -1192,6 +1192,8 @@ int nand_op_parser_exec_op(struct nand_chip *chip,* @erase: erase function * @set_features: set the NAND chip features * @get_features: get the NAND chip features +* @chip_delay: chip dependent delay for transferring data from array to read +* regs (tR). * * If you look at this structure you're already wrong. These fields/hooks are * all deprecated.
@@ -1215,6 +1217,7 @@ struct nand_legacy { u8 *subfeature_para);int (*get_features)(struct nand_chip *chip,int feature_addr,u8 *subfeature_para); +int chip_delay; };/**
@@ -1236,8 +1239,6 @@ struct nand_legacy {* @buf_align: minimum buffer alignment required by a platform * @dummy_controller: dummy controller implementation for drivers that can * only control a single chip -* @chip_delay: [BOARDSPECIFIC] chip dependent delay for transferring -* data from array to read regs (tR). * @state: [INTERN] the current state of the NAND device * @oob_poi: "poison value buffer," used for laying out OOB data * before writing
@@ -1317,7 +1318,6 @@ struct nand_chip {int (*setup_data_interface)(struct nand_chip *chip,int chipnr,const struct nand_data_interface *conf); -int chip_delay;unsigned int options;unsigned int bbt_options;
Signature · 1 line
2.14.1
PATCH 10/19 mtd: rawnand: Move function prototypes after struct declarations
In reply to Boris BrezillonMove nand_scan[_with_ids]() and nand_wait_ready() at the end of the file where all function prototype lies. This will also allow us to get rid of the nand_flash_dev forward declaration.
--- include/linux/mtd/rawnand.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
include/linux/mtd/rawnand.h +12 -12
@@ -27,18 +27,6 @@struct nand_chip ;struct nand_flash_dev ; -/* Scan and identify a NAND device */ -int nand_scan_with_ids (struct nand_chip *chip,unsigned int max_chips, -struct nand_flash_dev *ids); - -static inline int nand_scan (struct nand_chip *chip,unsigned int max_chips) -{ -return nand_scan_with_ids (chip, max_chips,NULL ); -} - -/* Internal helper for board drivers which need to override command function */ -void nand_wait_ready (struct nand_chip *chip); -/* The maximum number of NAND chips in an array */ #define NAND_MAX_CHIPS 8
@@ -1739,6 +1727,18 @@ int nand_read_data_op(struct nand_chip *chip, void *buf, unsigned int len,int nand_write_data_op (struct nand_chip *chip,const void *buf,unsigned int len,bool force_8bit); +/* Scan and identify a NAND device */ +int nand_scan_with_ids (struct nand_chip *chip,unsigned int max_chips, +struct nand_flash_dev *ids); + +static inline int nand_scan (struct nand_chip *chip,unsigned int max_chips) +{ +return nand_scan_with_ids (chip, max_chips,NULL ); +} + +/* Internal helper for board drivers which need to override command function */ +void nand_wait_ready (struct nand_chip *chip); +/* * Free resources held by the NAND device, must be called on error after a * sucessful nand_scan().
Signature · 1 line
2.14.1
PATCH 11/19 mtd: rawnand: Get rid of nand_flash_dev forward declation
In reply to Boris Brezillonnand_scan[with_ids]() have been moved at the end of the file. We can now get rid of of the nand_flash_dev forward declaration.
--- include/linux/mtd/rawnand.h | 1 - 1 file changed, 1 deletion(-)
include/linux/mtd/rawnand.h +0 -1
@@ -25,7 +25,6 @@#include <linux/types.h> struct nand_chip ; -struct nand_flash_dev ;/* The maximum number of NAND chips in an array */ #define NAND_MAX_CHIPS 8
Signature · 1 line
2.14.1
PATCH 12/19 mtd: rawnand: Get rid of the duplicate nand_chip forward declaration
In reply to Boris BrezillonThere's already a forward declaration of nand_chip at the beginning of the file. Get rid of this one.
--- include/linux/mtd/rawnand.h | 3 --- 1 file changed, 3 deletions(-)
include/linux/mtd/rawnand.h +0 -3
@@ -210,9 +210,6 @@ enum nand_ecc_algo {#define NAND_CI_CELLTYPE_MSK 0x0C#define NAND_CI_CELLTYPE_SHIFT 2 -/* Keep gcc happy */ -struct nand_chip ; -/* ONFI version bits */ #define ONFI_VERSION_1_0 BIT(1)#define ONFI_VERSION_2_0 BIT(2)
Signature · 1 line
2.14.1
PATCH 13/19 mtd: rawnand: Get rid of a few unused definitions
In reply to Boris BrezillonThose definitions are not used, let's remove them.
--- drivers/mtd/nand/raw/nand_timings.c | 14 -------------- include/linux/mtd/rawnand.h | 8 -------- 2 files changed, 22 deletions(-)
drivers/mtd/nand/raw/nand_timings.c +0 -14
@@ -270,20 +270,6 @@ static const struct nand_data_interface onfi_sdr_timings[] = { }, }; -/** -* onfi_async_timing_mode_to_sdr_timings - [NAND Interface] Retrieve NAND -* timings according to the given ONFI timing mode -* @mode: ONFI timing mode -*/ -const struct nand_sdr_timings *onfi_async_timing_mode_to_sdr_timings (int mode) -{ -if (mode <0 || mode >=ARRAY_SIZE (onfi_sdr_timings)) -return ERR_PTR (-EINVAL ); - -return &onfi_sdr_timings[mode].timings.sdr; -} -EXPORT_SYMBOL (onfi_async_timing_mode_to_sdr_timings); -/** * onfi_fill_data_interface - [NAND Interface] Initialize a data interface from * given ONFI mode
include/linux/mtd/rawnand.h +0 -8
@@ -119,10 +119,6 @@ enum nand_ecc_algo {#define NAND_ECC_GENERIC_ERASED_CHECK BIT(0)#define NAND_ECC_MAXIMIZE BIT(1) -/* Bit mask for flags passed to do_nand_read_ecc */ -#define NAND_GET_DEVICE 0x80 - -/* * Option constants for bizarre disfunctionality and real * features.
@@ -163,9 +159,7 @@ enum nand_ecc_algo {#define NAND_SAMSUNG_LP_OPTIONS NAND_CACHEPRG/* Macros to identify the above */ -#define NAND_HAS_CACHEPROG (chip) ((chip->options & NAND_CACHEPRG))#define NAND_HAS_SUBPAGE_READ (chip) ((chip->options & NAND_SUBPAGE_READ)) -#define NAND_HAS_SUBPAGE_WRITE (chip) !((chip)->options & NAND_NO_SUBPAGE_WRITE)/* Non chip related options */ /* This option skips the bbt scan during initialization. */
@@ -1649,8 +1643,6 @@ static inline int nand_opcode_8bits(unsigned int command)return 0 ; } -/* get timing characteristics from ONFI timing mode. */ -const struct nand_sdr_timings *onfi_async_timing_mode_to_sdr_timings (int mode); int nand_check_erased_ecc_chunk(void *data, int datalen, void *ecc, int ecclen,
Signature · 1 line
2.14.1
PATCH 14/19 mtd: rawnand: Move platform_nand_xxx definitions out of rawnand.h
In reply to Boris Brezillonplatform_nand_xxx definitions are just used by the plat_nand driver. Let's move those definitions out of the core/driver-agnostic rawnand.h header.
--- arch/arm/mach-ep93xx/snappercl15.c | 3 +- arch/arm/mach-ep93xx/ts72xx.c | 3 +- arch/arm/mach-imx/mach-qong.c | 2 +- arch/arm/mach-omap1/board-fsample.c | 3 +- arch/arm/mach-omap1/board-h2.c | 3 +- arch/arm/mach-omap1/board-h3.c | 2 +- arch/arm/mach-omap1/board-perseus2.c | 3 +- arch/arm/mach-orion5x/ts78xx-setup.c | 3 +- arch/arm/mach-pxa/balloon3.c | 3 +- arch/arm/mach-pxa/em-x270.c | 3 +- arch/arm/mach-pxa/palmtx.c | 3 +- arch/mips/alchemy/devboards/db1200.c | 3 +- arch/mips/alchemy/devboards/db1300.c | 3 +- arch/mips/alchemy/devboards/db1550.c | 3 +- arch/mips/netlogic/xlr/platform-flash.c | 3 +- arch/mips/pnx833x/common/platform.c | 3 +- arch/mips/rb532/devices.c | 3 +- arch/sh/boards/mach-migor/setup.c | 2 +- drivers/mtd/nand/raw/plat_nand.c | 3 +- include/linux/mtd/platnand.h | 74 +++++++++++++++++++++++++++++++++ include/linux/mtd/rawnand.h | 60 -------------------------- 21 files changed, 93 insertions(+), 95 deletions(-) create mode 100644 include/linux/mtd/platnand.h
arch/arm/mach-ep93xx/snappercl15.c +1 -2
@@ -23,8 +23,7 @@#include <linux/i2c.h> #include <linux/fb.h> -#include <linux/mtd/partitions.h> -#include <linux/mtd/rawnand.h> +#include <linux/mtd/platnand.h> #include <mach/hardware.h> #include <linux/platform_data/video-ep93xx.h>
arch/arm/mach-ep93xx/ts72xx.c +1 -2
@@ -16,8 +16,7 @@#include <linux/init.h> #include <linux/platform_device.h> #include <linux/io.h> -#include <linux/mtd/rawnand.h> -#include <linux/mtd/partitions.h> +#include <linux/mtd/platnand.h> #include <linux/spi/spi.h> #include <linux/spi/flash.h> #include <linux/spi/mmc_spi.h>
arch/arm/mach-imx/mach-qong.c +1 -1
@@ -18,7 +18,7 @@#include <linux/memory.h> #include <linux/platform_device.h> #include <linux/mtd/physmap.h> -#include <linux/mtd/rawnand.h> +#include <linux/mtd/platnand.h> #include <linux/gpio.h> #include <asm/mach-types.h>
arch/arm/mach-omap1/board-fsample.c +1 -2
@@ -16,8 +16,7 @@#include <linux/platform_device.h> #include <linux/delay.h> #include <linux/mtd/mtd.h> -#include <linux/mtd/rawnand.h> -#include <linux/mtd/partitions.h> +#include <linux/mtd/platnand.h> #include <linux/mtd/physmap.h> #include <linux/input.h> #include <linux/smc91x.h>
arch/arm/mach-omap1/board-h2.c +1 -2
@@ -24,8 +24,7 @@#include <linux/delay.h> #include <linux/i2c.h> #include <linux/mtd/mtd.h> -#include <linux/mtd/rawnand.h> -#include <linux/mtd/partitions.h> +#include <linux/mtd/platnand.h> #include <linux/mtd/physmap.h> #include <linux/input.h> #include <linux/mfd/tps65010.h>
arch/arm/mach-omap1/board-h3.c +1 -1
@@ -23,7 +23,7 @@#include <linux/workqueue.h> #include <linux/i2c.h> #include <linux/mtd/mtd.h> -#include <linux/mtd/rawnand.h> +#include <linux/mtd/platnand.h> #include <linux/mtd/partitions.h> #include <linux/mtd/physmap.h> #include <linux/input.h>
arch/arm/mach-omap1/board-perseus2.c +1 -2
@@ -16,8 +16,7 @@#include <linux/platform_device.h> #include <linux/delay.h> #include <linux/mtd/mtd.h> -#include <linux/mtd/rawnand.h> -#include <linux/mtd/partitions.h> +#include <linux/mtd/platnand.h> #include <linux/mtd/physmap.h> #include <linux/input.h> #include <linux/smc91x.h>
arch/arm/mach-orion5x/ts78xx-setup.c +1 -2
@@ -16,8 +16,7 @@#include <linux/platform_device.h> #include <linux/mv643xx_eth.h> #include <linux/ata_platform.h> -#include <linux/mtd/rawnand.h> -#include <linux/mtd/partitions.h> +#include <linux/mtd/platnand.h> #include <linux/timeriomem-rng.h> #include <asm/mach-types.h> #include <asm/mach/arch.h>
arch/arm/mach-pxa/balloon3.c +1 -2
@@ -25,11 +25,10 @@#include <linux/ioport.h> #include <linux/ucb1400.h> #include <linux/mtd/mtd.h> -#include <linux/mtd/partitions.h> #include <linux/types.h> #include <linux/platform_data/pcf857x.h> #include <linux/platform_data/i2c-pxa.h> -#include <linux/mtd/rawnand.h> +#include <linux/mtd/platnand.h> #include <linux/mtd/physmap.h> #include <linux/regulator/max1586.h>
arch/arm/mach-pxa/em-x270.c +1 -2
@@ -15,8 +15,7 @@#include <linux/dm9000.h> #include <linux/platform_data/rtc-v3020.h> -#include <linux/mtd/rawnand.h> -#include <linux/mtd/partitions.h> +#include <linux/mtd/platnand.h> #include <linux/mtd/physmap.h> #include <linux/input.h> #include <linux/gpio_keys.h>
arch/arm/mach-pxa/palmtx.c +1 -2
@@ -28,8 +28,7 @@#include <linux/wm97xx.h> #include <linux/power_supply.h> #include <linux/usb/gpio_vbus.h> -#include <linux/mtd/rawnand.h> -#include <linux/mtd/partitions.h> +#include <linux/mtd/platnand.h> #include <linux/mtd/mtd.h> #include <linux/mtd/physmap.h>
arch/mips/alchemy/devboards/db1200.c +1 -2
@@ -29,8 +29,7 @@#include <linux/leds.h> #include <linux/mmc/host.h> #include <linux/mtd/mtd.h> -#include <linux/mtd/rawnand.h> -#include <linux/mtd/partitions.h> +#include <linux/mtd/platnand.h> #include <linux/platform_device.h> #include <linux/serial_8250.h> #include <linux/spi/spi.h>
arch/mips/alchemy/devboards/db1300.c +1 -2
@@ -19,8 +19,7 @@#include <linux/mmc/host.h> #include <linux/module.h> #include <linux/mtd/mtd.h> -#include <linux/mtd/rawnand.h> -#include <linux/mtd/partitions.h> +#include <linux/mtd/platnand.h> #include <linux/platform_device.h> #include <linux/smsc911x.h> #include <linux/wm97xx.h>
arch/mips/alchemy/devboards/db1550.c +1 -2
@@ -13,8 +13,7 @@#include <linux/io.h> #include <linux/interrupt.h> #include <linux/mtd/mtd.h> -#include <linux/mtd/rawnand.h> -#include <linux/mtd/partitions.h> +#include <linux/mtd/platnand.h> #include <linux/platform_device.h> #include <linux/pm.h> #include <linux/spi/spi.h>
arch/mips/netlogic/xlr/platform-flash.c +1 -2
@@ -19,8 +19,7 @@#include <linux/mtd/mtd.h> #include <linux/mtd/physmap.h> -#include <linux/mtd/rawnand.h> -#include <linux/mtd/partitions.h> +#include <linux/mtd/platnand.h> #include <asm/netlogic/haldefs.h> #include <asm/netlogic/xlr/iomap.h>
arch/mips/pnx833x/common/platform.c +1 -2
@@ -30,8 +30,7 @@#include <linux/resource.h> #include <linux/serial.h> #include <linux/serial_pnx8xxx.h> -#include <linux/mtd/rawnand.h> -#include <linux/mtd/partitions.h> +#include <linux/mtd/platnand.h> #include <irq.h> #include <irq-mapping.h>
arch/mips/rb532/devices.c +1 -2
@@ -20,9 +20,8 @@#include <linux/ctype.h> #include <linux/string.h> #include <linux/platform_device.h> -#include <linux/mtd/rawnand.h> +#include <linux/mtd/platnand.h> #include <linux/mtd/mtd.h> -#include <linux/mtd/partitions.h> #include <linux/gpio.h> #include <linux/gpio_keys.h> #include <linux/input.h>
arch/sh/boards/mach-migor/setup.c +1 -1
@@ -14,7 +14,7 @@#include <linux/mmc/host.h> #include <linux/mtd/physmap.h> #include <linux/mfd/tmio.h> -#include <linux/mtd/rawnand.h> +#include <linux/mtd/platnand.h> #include <linux/i2c.h> #include <linux/regulator/fixed.h> #include <linux/regulator/machine.h>
drivers/mtd/nand/raw/plat_nand.c +1 -2
@@ -15,8 +15,7 @@#include <linux/platform_device.h> #include <linux/slab.h> #include <linux/mtd/mtd.h> -#include <linux/mtd/rawnand.h> -#include <linux/mtd/partitions.h> +#include <linux/mtd/platnand.h> struct plat_nand_data {struct nand_chip chip;
include/linux/mtd/platnand.h new file +74 -0
74 lines not on this page · raw message
include/linux/mtd/rawnand.h +0 -60
66 lines not on this page · raw message
Signature · 6 lines
2.14.1 _______________________________________________ devel mailing list [email protected] http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
PATCH 15/19 mtd: rawnand: Inline onfi_get_async_timing_mode()
In reply to Boris Brezillononfi_get_async_timing_mode() is only used in one place inside nand_base.c. Let's inline the code and kill the helper.
--- drivers/mtd/nand/raw/nand_base.c | 5 +++-- include/linux/mtd/rawnand.h | 9 --------- 2 files changed, 3 insertions(+), 11 deletions(-)
drivers/mtd/nand/raw/nand_base.c +3 -2
@@ -1310,8 +1310,9 @@ static int nand_init_data_interface(struct nand_chip *chip)* if the NAND does not support ONFI, fallback to the default ONFI * timing mode. */ - modes =onfi_get_async_timing_mode (chip); -if (modes ==ONFI_TIMING_MODE_UNKNOWN ) { +if (chip->parameters.onfi) { + modes = chip->parameters.onfi->async_timing_mode; + }else {if (!chip->onfi_timing_mode_default)return 0 ;
include/linux/mtd/rawnand.h +0 -9
@@ -1540,15 +1540,6 @@ int nand_isbad_bbt(struct nand_chip *chip, loff_t offs, int allowbbt);int nand_erase_nand (struct nand_chip *chip,struct erase_info *instr,int allowbbt); -/* return the supported asynchronous timing mode. */ -static inline int onfi_get_async_timing_mode (struct nand_chip *chip) -{ -if (!chip->parameters.onfi) -return ONFI_TIMING_MODE_UNKNOWN ; - -return chip->parameters.onfi->async_timing_mode; -} -int onfi_fill_data_interface (struct nand_chip *chip,enum nand_data_interface_type type,int timing_mode);
Signature · 1 line
2.14.1
PATCH 16/19 mtd: rawnand: Keep all internal stuff private
In reply to Boris BrezillonA lot of things defined in rawnand.h should not be exposed to NAND controller drivers and should only be shared by core files.
Create the drivers/mtd/nand/rawn/internals.h header to store such definitions, and move all private defs to this header.
Also remove EXPORT_SYMBOLS() on functions that are not supposed to be exposed.
--- drivers/mtd/nand/raw/internals.h | 98 ++++++++++++++++++++++++++++++++++++ drivers/mtd/nand/raw/nand_amd.c | 2 +- drivers/mtd/nand/raw/nand_base.c | 21 ++++---- drivers/mtd/nand/raw/nand_bbt.c | 3 +- drivers/mtd/nand/raw/nand_hynix.c | 3 +- drivers/mtd/nand/raw/nand_ids.c | 4 +- drivers/mtd/nand/raw/nand_macronix.c | 2 +- drivers/mtd/nand/raw/nand_micron.c | 3 +- drivers/mtd/nand/raw/nand_samsung.c | 2 +- drivers/mtd/nand/raw/nand_timings.c | 4 +- drivers/mtd/nand/raw/nand_toshiba.c | 2 +- include/linux/mtd/rawnand.h | 96 ----------------------------------- 12 files changed, 123 insertions(+), 117 deletions(-) create mode 100644 drivers/mtd/nand/raw/internals.h
drivers/mtd/nand/raw/internals.h new file +98 -0
@@ -0,0 +1,98 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Copyright (c) 2018 - Bootlin +* +* Author: Boris Brezillon <[email protected]> +* +* Header containing internal definitions to be used only by core files. +* NAND controller drivers should not include this file. +*/ + +#ifndef __LINUX_RAWNAND_INTERNALS +#define __LINUX_RAWNAND_INTERNALS + +#include <linux/mtd/rawnand.h> + +/* +* NAND Flash Manufacturer ID Codes +*/ +#define NAND_MFR_TOSHIBA 0x98 +#define NAND_MFR_ESMT 0xc8 +#define NAND_MFR_SAMSUNG 0xec +#define NAND_MFR_FUJITSU 0x04 +#define NAND_MFR_NATIONAL 0x8f +#define NAND_MFR_RENESAS 0x07 +#define NAND_MFR_STMICRO 0x20 +#define NAND_MFR_HYNIX 0xad +#define NAND_MFR_MICRON 0x2c +#define NAND_MFR_AMD 0x01 +#define NAND_MFR_MACRONIX 0xc2 +#define NAND_MFR_EON 0x92 +#define NAND_MFR_SANDISK 0x45 +#define NAND_MFR_INTEL 0x89 +#define NAND_MFR_ATO 0x9b +#define NAND_MFR_WINBOND 0xef + +/** +* struct nand_manufacturer_ops - NAND Manufacturer operations +* @detect: detect the NAND memory organization and capabilities +* @init: initialize all vendor specific fields (like the ->read_retry() +* implementation) if any. +* @cleanup: the ->init() function may have allocated resources, ->cleanup() +* is here to let vendor specific code release those resources. +* @fixup_onfi_param_page: apply vendor specific fixups to the ONFI parameter +* page. This is called after the checksum is verified. +*/ +struct nand_manufacturer_ops { +void (*detect)(struct nand_chip *chip); +int (*init)(struct nand_chip *chip); +void (*cleanup)(struct nand_chip *chip); +void (*fixup_onfi_param_page)(struct nand_chip *chip, +struct nand_onfi_params *p); +}; + +/** +* struct nand_manufacturer - NAND Flash Manufacturer structure +* @name: Manufacturer name +* @id: manufacturer ID code of device. +* @ops: manufacturer operations +*/ +struct nand_manufacturer { +int id; +char *name; +const struct nand_manufacturer_ops *ops; +}; + + +extern struct nand_flash_dev nand_flash_ids[]; + +extern const struct nand_manufacturer_ops toshiba_nand_manuf_ops; +extern const struct nand_manufacturer_ops samsung_nand_manuf_ops; +extern const struct nand_manufacturer_ops hynix_nand_manuf_ops; +extern const struct nand_manufacturer_ops micron_nand_manuf_ops; +extern const struct nand_manufacturer_ops amd_nand_manuf_ops; +extern const struct nand_manufacturer_ops macronix_nand_manuf_ops; + +/* Core functions */ +const struct nand_manufacturer *nand_get_manufacturer (u8 id); +int nand_markbad_bbm (struct nand_chip *chip,loff_t ofs); +int nand_erase_nand (struct nand_chip *chip,struct erase_info *instr, +int allowbbt); +int onfi_fill_data_interface (struct nand_chip *chip, +enum nand_data_interface_type type, +int timing_mode); +int nand_get_features (struct nand_chip *chip,int addr,u8 *subfeature_param); +int nand_set_features (struct nand_chip *chip,int addr,u8 *subfeature_param); +int nand_read_page_raw_notsupp (struct nand_chip *chip,u8 *buf, +int oob_required,int page); +int nand_write_page_raw_notsupp (struct nand_chip *chip,const u8 *buf, +int oob_required,int page); +int nand_exit_status_op (struct nand_chip *chip); +void nand_decode_ext_id (struct nand_chip *chip); + +/* BBT functions */ +int nand_markbad_bbt (struct nand_chip *chip,loff_t offs); +int nand_isreserved_bbt (struct nand_chip *chip,loff_t offs); +int nand_isbad_bbt (struct nand_chip *chip,loff_t offs,int allowbbt); + +#endif /* __LINUX_RAWNAND_INTERNALS */
drivers/mtd/nand/raw/nand_amd.c +1 -1
@@ -15,7 +15,7 @@* GNU General Public License for more details. */ -#include <linux/mtd/rawnand.h> +#include "internals.h" static void amd_nand_decode_id (struct nand_chip *chip) {
drivers/mtd/nand/raw/nand_base.c +10 -11
@@ -39,7 +39,6 @@#include <linux/nmi.h> #include <linux/types.h> #include <linux/mtd/mtd.h> -#include <linux/mtd/rawnand.h> #include <linux/mtd/nand_ecc.h> #include <linux/mtd/nand_bch.h> #include <linux/interrupt.h>
@@ -48,6 +47,8 @@#include <linux/mtd/partitions.h> #include <linux/of.h> +#include "internals.h" +static int nand_get_device (struct mtd_info *mtd,int new_state); static int nand_do_write_oob(struct mtd_info *mtd, loff_t to,
@@ -1319,7 +1320,6 @@ static int nand_init_data_interface(struct nand_chip *chip) modes =GENMASK (chip->onfi_timing_mode_default,0 ); } -for (mode =fls (modes) -1 ; mode >=0 ; mode--) { ret =onfi_fill_data_interface (chip,NAND_SDR_IFACE , mode);if (ret)
@@ -2043,7 +2043,6 @@ int nand_exit_status_op(struct nand_chip *chip)return 0 ; } -EXPORT_SYMBOL_GPL (nand_exit_status_op);/** * nand_erase_op - Do an erase operation
@@ -2816,7 +2815,6 @@ int nand_get_features(struct nand_chip *chip, int addr,return nand_get_features_op (chip, addr, subfeature_param); } -EXPORT_SYMBOL_GPL (nand_get_features);/** * nand_set_features - wrapper to perform a SET_FEATURE
@@ -2838,7 +2836,6 @@ int nand_set_features(struct nand_chip *chip, int addr,return nand_set_features_op (chip, addr, subfeature_param); } -EXPORT_SYMBOL_GPL (nand_set_features);/** * nand_check_erased_buf - check if a buffer contains (almost) only 0xff data
@@ -2985,7 +2982,6 @@ int nand_read_page_raw_notsupp(struct nand_chip *chip, u8 *buf, {return -ENOTSUPP ; } -EXPORT_SYMBOL (nand_read_page_raw_notsupp);/** * nand_read_page_raw - [INTERN] read raw page data without ecc
@@ -3729,7 +3725,7 @@ EXPORT_SYMBOL(nand_read_oob_std);* @chip: nand chip info structure * @page: page number to read */ -int nand_read_oob_syndrome (struct nand_chip *chip,int page) +static int nand_read_oob_syndrome (struct nand_chip *chip,int page) {struct mtd_info *mtd =nand_to_mtd (chip);int length = mtd->oobsize;
@@ -3776,7 +3772,6 @@ int nand_read_oob_syndrome(struct nand_chip *chip, int page)return 0 ; } -EXPORT_SYMBOL (nand_read_oob_syndrome);/** * nand_write_oob_std - [REPLACEABLE] the most common OOB data write function
@@ -3798,7 +3793,7 @@ EXPORT_SYMBOL(nand_write_oob_std);* @chip: nand chip info structure * @page: page number to write */ -int nand_write_oob_syndrome (struct nand_chip *chip,int page) +static int nand_write_oob_syndrome (struct nand_chip *chip,int page) {struct mtd_info *mtd =nand_to_mtd (chip);int chunk = chip->ecc.bytes + chip->ecc.prepad + chip->ecc.postpad;
@@ -3864,7 +3859,6 @@ int nand_write_oob_syndrome(struct nand_chip *chip, int page)return nand_prog_page_end_op (chip); } -EXPORT_SYMBOL (nand_write_oob_syndrome);/** * nand_do_read_oob - [INTERN] NAND read out-of-band
@@ -3989,7 +3983,6 @@ int nand_write_page_raw_notsupp(struct nand_chip *chip, const u8 *buf, {return -ENOTSUPP ; } -EXPORT_SYMBOL (nand_write_page_raw_notsupp);/** * nand_write_page_raw - [INTERN] raw page write function
@@ -5579,6 +5572,12 @@ static void nand_manufacturer_cleanup(struct nand_chip *chip) chip->manufacturer.desc->ops->cleanup (chip); } +static const char * +nand_manufacturer_name (const struct nand_manufacturer *manufacturer) +{ +return manufacturer ? manufacturer->name :"Unknown" ; +} +/* * Get the flash and manufacturer id and lookup if the type is supported. */
drivers/mtd/nand/raw/nand_bbt.c +2 -1
@@ -61,13 +61,14 @@#include <linux/types.h> #include <linux/mtd/mtd.h> #include <linux/mtd/bbm.h> -#include <linux/mtd/rawnand.h> #include <linux/bitops.h> #include <linux/delay.h> #include <linux/vmalloc.h> #include <linux/export.h> #include <linux/string.h> +#include "internals.h" +#define BBT_BLOCK_GOOD 0x00#define BBT_BLOCK_WORN 0x01#define BBT_BLOCK_RESERVED 0x02
drivers/mtd/nand/raw/nand_hynix.c +2 -1
@@ -15,10 +15,11 @@* GNU General Public License for more details. */ -#include <linux/mtd/rawnand.h> #include <linux/sizes.h> #include <linux/slab.h> +#include "internals.h" +#define NAND_HYNIX_CMD_SET_PARAMS 0x36#define NAND_HYNIX_CMD_APPLY_PARAMS 0x16
drivers/mtd/nand/raw/nand_ids.c +3 -1
@@ -6,9 +6,11 @@* published by the Free Software Foundation. * */ -#include <linux/mtd/rawnand.h> +#include <linux/sizes.h> +#include "internals.h" +#define LP_OPTIONS 0#define LP_OPTIONS16 (LP_OPTIONS | NAND_BUSWIDTH_16)
drivers/mtd/nand/raw/nand_macronix.c +1 -1
@@ -15,7 +15,7 @@* GNU General Public License for more details. */ -#include <linux/mtd/rawnand.h> +#include "internals.h" /* * Macronix AC series does not support using SET/GET_FEATURES to change
drivers/mtd/nand/raw/nand_micron.c +2 -1
@@ -15,9 +15,10 @@* GNU General Public License for more details. */ -#include <linux/mtd/rawnand.h> #include <linux/slab.h> +#include "internals.h" +/* * Special Micron status bit 3 indicates that the block has been * corrected by on-die ECC and should be rewritten.
drivers/mtd/nand/raw/nand_samsung.c +1 -1
@@ -15,7 +15,7 @@* GNU General Public License for more details. */ -#include <linux/mtd/rawnand.h> +#include "internals.h" static void samsung_nand_decode_id (struct nand_chip *chip) {
drivers/mtd/nand/raw/nand_timings.c +2 -2
@@ -11,7 +11,8 @@#include <linux/kernel.h> #include <linux/err.h> #include <linux/export.h> -#include <linux/mtd/rawnand.h> + +#include "internals.h" #define ONFI_DYN_TIMING_MAX U16_MAX
@@ -325,4 +326,3 @@ int onfi_fill_data_interface(struct nand_chip *chip,return 0 ; } -EXPORT_SYMBOL (onfi_fill_data_interface);
drivers/mtd/nand/raw/nand_toshiba.c +1 -1
@@ -15,7 +15,7 @@* GNU General Public License for more details. */ -#include <linux/mtd/rawnand.h> +#include "internals.h" /* Bit for detecting BENAND */ #define TOSHIBA_NAND_ID4_IS_BENAND BIT(7)
include/linux/mtd/rawnand.h +0 -96
152 lines not on this page · raw message
Signature · 1 line
2.14.1
PATCH 17/19 mtd: rawnand: Move legacy code to nand_legacy.c
In reply to Boris BrezillonAllows us to move a few hundred lines of deprecated code out of the core file which is quite big.
--- drivers/mtd/nand/raw/Makefile | 2 +- drivers/mtd/nand/raw/internals.h | 6 + drivers/mtd/nand/raw/nand_base.c | 618 +---------------------------------- drivers/mtd/nand/raw/nand_legacy.c | 642 +++++++++++++++++++++++++++++++++++++ 4 files changed, 660 insertions(+), 608 deletions(-) create mode 100644 drivers/mtd/nand/raw/nand_legacy.c
drivers/mtd/nand/raw/Makefile +1 -1
@@ -57,7 +57,7 @@ obj-$(CONFIG_MTD_NAND_QCOM) += qcom_nandc.o obj-$(CONFIG_MTD_NAND_MTK) += mtk_ecc.o mtk_nand.o obj-$(CONFIG_MTD_NAND_TEGRA) += tegra_nand.o -nand-objs := nand_base.o nand_bbt.o nand_timings.o nand_ids.o +nand-objs := nand_base.o nand_legacy.o nand_bbt.o nand_timings.o nand_ids.o nand-objs += nand_amd.o nand-objs += nand_hynix.o nand-objs += nand_macronix.o
drivers/mtd/nand/raw/internals.h +6 -0
@@ -89,10 +89,16 @@ int nand_write_page_raw_notsupp(struct nand_chip *chip, const u8 *buf, int oob_required, int page);int nand_exit_status_op (struct nand_chip *chip);void nand_decode_ext_id (struct nand_chip *chip); +void panic_nand_wait (struct nand_chip *chip,unsigned long timeo);/* BBT functions */ int nand_markbad_bbt (struct nand_chip *chip,loff_t offs);int nand_isreserved_bbt (struct nand_chip *chip,loff_t offs);int nand_isbad_bbt (struct nand_chip *chip,loff_t offs,int allowbbt); +/* Legacy */ +void nand_legacy_set_defaults (struct nand_chip *chip); +void nand_legacy_adjust_cmdfunc (struct nand_chip *chip); +int nand_legacy_check_hooks (struct nand_chip *chip); +#endif /* __LINUX_RAWNAND_INTERNALS */
drivers/mtd/nand/raw/nand_base.c +11 -607
686 lines not on this page · raw message
drivers/mtd/nand/raw/nand_legacy.c new file +642 -0
642 lines not on this page · raw message
Signature · 1 line
2.14.1
PATCH 18/19 mtd: rawnand: Move ONFI code to nand_onfi.c
In reply to Boris BrezillonThis moves ONFI related code to nand_onfi.c and ONFI related struct/macros to include/linux/mtd/onfi.h.
--- drivers/mtd/nand/raw/Makefile | 1 + drivers/mtd/nand/raw/internals.h | 7 + drivers/mtd/nand/raw/nand_base.c | 296 +------------------------------------ drivers/mtd/nand/raw/nand_onfi.c | 305 +++++++++++++++++++++++++++++++++++++++ include/linux/mtd/onfi.h | 178 +++++++++++++++++++++++ include/linux/mtd/rawnand.h | 164 +-------------------- 6 files changed, 496 insertions(+), 455 deletions(-) create mode 100644 drivers/mtd/nand/raw/nand_onfi.c create mode 100644 include/linux/mtd/onfi.h
drivers/mtd/nand/raw/Makefile +1 -0
@@ -58,6 +58,7 @@ obj-$(CONFIG_MTD_NAND_MTK) += mtk_ecc.o mtk_nand.o obj-$(CONFIG_MTD_NAND_TEGRA) += tegra_nand.o nand-objs := nand_base.o nand_legacy.o nand_bbt.o nand_timings.o nand_ids.o +nand-objs += nand_onfi.o nand-objs += nand_amd.o nand-objs += nand_hynix.o nand-objs += nand_macronix.o
drivers/mtd/nand/raw/internals.h +7 -0
@@ -88,8 +88,11 @@ int nand_read_page_raw_notsupp(struct nand_chip *chip, u8 *buf,int nand_write_page_raw_notsupp (struct nand_chip *chip,const u8 *buf,int oob_required,int page);int nand_exit_status_op (struct nand_chip *chip); +int nand_read_param_page_op (struct nand_chip *chip,u8 page,void *buf, +unsigned int len);void nand_decode_ext_id (struct nand_chip *chip);void panic_nand_wait (struct nand_chip *chip,unsigned long timeo); +void sanitize_string (uint8_t *s,size_t len);/* BBT functions */ int nand_markbad_bbt (struct nand_chip *chip,loff_t offs);
@@ -101,4 +104,8 @@ void nand_legacy_set_defaults(struct nand_chip *chip);void nand_legacy_adjust_cmdfunc (struct nand_chip *chip);int nand_legacy_check_hooks (struct nand_chip *chip); +/* ONFI functions */ +u16 onfi_crc16 (u16 crc,u8 const *p,size_t len); +int nand_onfi_detect (struct nand_chip *chip); +#endif /* __LINUX_RAWNAND_INTERNALS */
drivers/mtd/nand/raw/nand_base.c +4 -292
320 lines not on this page · raw message
drivers/mtd/nand/raw/nand_onfi.c new file +305 -0
305 lines not on this page · raw message
include/linux/mtd/onfi.h new file +178 -0
178 lines not on this page · raw message
include/linux/mtd/rawnand.h +1 -163
182 lines not on this page · raw message
Signature · 6 lines
2.14.1 _______________________________________________ devel mailing list [email protected] http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
PATCH 19/19 mtd: rawnand: Move JEDEC code to nand_jedec.c
In reply to Boris BrezillonThis moves ONFI related code to nand_onfi.c and ONFI related struct/macros to include/linux/mtd/onfi.h.
--- drivers/mtd/nand/raw/Makefile | 1 + drivers/mtd/nand/raw/internals.h | 3 + drivers/mtd/nand/raw/nand_base.c | 98 +-------------------------------- drivers/mtd/nand/raw/nand_jedec.c | 113 ++++++++++++++++++++++++++++++++++++++ include/linux/mtd/jedec.h | 91 ++++++++++++++++++++++++++++++ include/linux/mtd/rawnand.h | 79 +------------------------- 6 files changed, 210 insertions(+), 175 deletions(-) create mode 100644 drivers/mtd/nand/raw/nand_jedec.c create mode 100644 include/linux/mtd/jedec.h
drivers/mtd/nand/raw/Makefile +1 -0
@@ -59,6 +59,7 @@ obj-$(CONFIG_MTD_NAND_TEGRA) += tegra_nand.o nand-objs := nand_base.o nand_legacy.o nand_bbt.o nand_timings.o nand_ids.o nand-objs += nand_onfi.o +nand-objs += nand_jedec.o nand-objs += nand_amd.o nand-objs += nand_hynix.o nand-objs += nand_macronix.o
drivers/mtd/nand/raw/internals.h +3 -0
@@ -108,4 +108,7 @@ int nand_legacy_check_hooks(struct nand_chip *chip);u16 onfi_crc16 (u16 crc,u8 const *p,size_t len);int nand_onfi_detect (struct nand_chip *chip); +/* JEDEC functions */ +int nand_jedec_detect (struct nand_chip *chip); +#endif /* __LINUX_RAWNAND_INTERNALS */
drivers/mtd/nand/raw/nand_base.c +1 -97
110 lines not on this page · raw message
drivers/mtd/nand/raw/nand_jedec.c new file +113 -0
113 lines not on this page · raw message
include/linux/mtd/jedec.h new file +91 -0
91 lines not on this page · raw message
include/linux/mtd/rawnand.h +1 -78
91 lines not on this page · raw message
Signature · 6 lines
2.14.1 _______________________________________________ devel mailing list [email protected] http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 19/19] mtd: rawnand: Move JEDEC code to nand_jedec.c
Hi Boris,
this patchseries is really amazing clean up. Thank you!
Quoted 2 lines · Boris Brezillon
This moves ONFI related code to
nand_onfi.cand ONFI related struct/macros toinclude/linux/mtd/onfi.h.
Seems above commit log comes from previous patch.
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
Re: [PATCH 19/19] mtd: rawnand: Move JEDEC code to nand_jedec.c
Quoted 3 lines · On Fri, 7 Sep 2018 10:40:44 +0200 Ladislav Michl <[email protected]> wrote:
Hi Boris,
this patchseries is really amazing clean up. Thank you!
I'm glad I'm not the only one to find it useful :-).
Quoted 6 lines · Boris Brezillon
Quoted 2 lines
This moves ONFI related code to
nand_onfi.cand ONFI related struct/macros toinclude/linux/mtd/onfi.h.Seems above commit log comes from previous patch.
Oops, will fix that.
Thanks,
Boris
Miquel Raynal
maintainerHi Boris,
Boris Brezillon <[email protected]> wrote on Fri, 7 Sep 2018 00:38:32 +0200:
Quoted 126 lines
Hello,
This is the 2nd batch of API cleanup patches. This time we move deprecated hooks/fields to the
nand_legacystruct, and then move some of the code found innand_base.cinto separate source/header files.With this new organization, new comers should more easily identify the bits they can use in their NAND controller drivers and those that are only meant for core code. It also shrink a bit
nand_base.cwhich was over 6000 lines of code.Note that existing coding style issues (reported by checkpatch) in arch or driver code are intentionally not fixed to keep the series focused on the API/core cleanup.
Regards,
Boris
Boris Brezillon (19):
mtd: rawnand: Leave chip->IO_ADDR_{R,W} to NULL when unused
mtd: rawnand: Create a legacy struct and move ->IO_ADDR_{R,W} there
mtd: rawnand: Deprecate ->{read,write}_{byte,buf}() hooks
mtd: rawnand: Deprecate ->cmd_ctrl() and ->cmdfunc()
mtd: rawnand: Deprecate ->dev_ready() and ->waitfunc()
mtd: rawnand: Deprecate ->block_{bad,markbad}() hooks
mtd: rawnand: Deprecate ->erase()
mtd: rawnand: Deprecate ->{set,get}_features() hooks
mtd: rawnand: Deprecate ->chip_delay
mtd: rawnand: Move function prototypes after struct declarations
mtd: rawnand: Get rid ofnand_flash_devforward declation
mtd: rawnand: Get rid of the duplicatenand_chipforward declaration
mtd: rawnand: Get rid of a few unused definitions
mtd: rawnand: Moveplatform_nand_xxxdefinitions out ofrawnand.h
mtd: rawnand: Inlineonfi_get_async_timing_mode()
mtd: rawnand: Keep all internal stuff private
mtd: rawnand: Move legacy code tonand_legacy.c
mtd: rawnand: Move ONFI code tonand_onfi.c
mtd: rawnand: Move JEDEC code tonand_jedec.cDocumentation/driver-api/mtdnand.rst | 30 +- arch/arm/mach-ep93xx/snappercl15.c | 8 +- arch/arm/mach-ep93xx/ts72xx.c | 9 +- arch/arm/mach-imx/mach-qong.c | 6 +- arch/arm/mach-ixp4xx/ixdp425-setup.c | 2 +- arch/arm/mach-omap1/board-fsample.c | 3 +- arch/arm/mach-omap1/board-h2.c | 3 +- arch/arm/mach-omap1/board-h3.c | 2 +- arch/arm/mach-omap1/board-nand.c | 2 +- arch/arm/mach-omap1/board-perseus2.c | 3 +- arch/arm/mach-orion5x/ts78xx-setup.c | 9 +- arch/arm/mach-pxa/balloon3.c | 5 +- arch/arm/mach-pxa/em-x270.c | 9 +- arch/arm/mach-pxa/palmtx.c | 5 +- arch/mips/alchemy/devboards/db1200.c | 9 +- arch/mips/alchemy/devboards/db1300.c | 9 +- arch/mips/alchemy/devboards/db1550.c | 9 +- arch/mips/netlogic/xlr/platform-flash.c | 3 +- arch/mips/pnx833x/common/platform.c | 5 +- arch/mips/rb532/devices.c | 5 +- arch/sh/boards/mach-migor/setup.c | 8 +- drivers/mtd/nand/raw/Makefile | 4 +- drivers/mtd/nand/raw/ams-delta.c | 22 +- drivers/mtd/nand/raw/atmel/nand-controller.c | 22 +- drivers/mtd/nand/raw/au1550nd.c | 43 +- drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c | 22 +- drivers/mtd/nand/raw/brcmnand/brcmnand.c | 15 +- drivers/mtd/nand/raw/cafe_nand.c | 22 +- drivers/mtd/nand/raw/cmx270_nand.c | 28 +- drivers/mtd/nand/raw/cs553x_nand.c | 42 +- drivers/mtd/nand/raw/davinci_nand.c | 34 +- drivers/mtd/nand/raw/denali.c | 23 +- drivers/mtd/nand/raw/diskonchip.c | 50 +- drivers/mtd/nand/raw/fsl_elbc_nand.c | 18 +- drivers/mtd/nand/raw/fsl_ifc_nand.c | 24 +- drivers/mtd/nand/raw/fsl_upm.c | 30 +- drivers/mtd/nand/raw/fsmc_nand.c | 1 - drivers/mtd/nand/raw/gpio.c | 16 +- drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 22 +- drivers/mtd/nand/raw/hisi504_nand.c | 18 +- drivers/mtd/nand/raw/internals.h | 114 ++ drivers/mtd/nand/raw/jz4740_nand.c | 14 +- drivers/mtd/nand/raw/jz4780_nand.c | 10 +- drivers/mtd/nand/raw/lpc32xx_mlc.c | 12 +- drivers/mtd/nand/raw/lpc32xx_slc.c | 26 +- drivers/mtd/nand/raw/mpc5121_nfc.c | 14 +- drivers/mtd/nand/raw/mtk_nand.c | 12 +- drivers/mtd/nand/raw/mxc_nand.c | 20 +- drivers/mtd/nand/raw/nand_amd.c | 2 +- drivers/mtd/nand/raw/nand_base.c | 1260 +++------------------- drivers/mtd/nand/raw/nand_bbt.c | 5 +- drivers/mtd/nand/raw/nand_hynix.c | 9 +- drivers/mtd/nand/raw/nand_ids.c | 4 +- drivers/mtd/nand/raw/nand_jedec.c | 113 ++ drivers/mtd/nand/raw/nand_legacy.c | 642 +++++++++++ drivers/mtd/nand/raw/nand_macronix.c | 2 +- drivers/mtd/nand/raw/nand_micron.c | 3 +- drivers/mtd/nand/raw/nand_onfi.c | 305 ++++++ drivers/mtd/nand/raw/nand_samsung.c | 2 +- drivers/mtd/nand/raw/nand_timings.c | 18 +- drivers/mtd/nand/raw/nand_toshiba.c | 2 +- drivers/mtd/nand/raw/nandsim.c | 14 +- drivers/mtd/nand/raw/ndfc.c | 14 +- drivers/mtd/nand/raw/nuc900_nand.c | 22 +- drivers/mtd/nand/raw/omap2.c | 62 +- drivers/mtd/nand/raw/orion_nand.c | 12 +- drivers/mtd/nand/raw/oxnas_nand.c | 10 +- drivers/mtd/nand/raw/pasemi_nand.c | 32 +- drivers/mtd/nand/raw/plat_nand.c | 17 +- drivers/mtd/nand/raw/qcom_nandc.c | 39 +- drivers/mtd/nand/raw/r852.c | 14 +- drivers/mtd/nand/raw/s3c2410.c | 34 +- drivers/mtd/nand/raw/sh_flctl.c | 18 +- drivers/mtd/nand/raw/sharpsl.c | 12 +- drivers/mtd/nand/raw/sm_common.c | 2 +- drivers/mtd/nand/raw/socrates_nand.c | 16 +- drivers/mtd/nand/raw/sunxi_nand.c | 14 +- drivers/mtd/nand/raw/tango_nand.c | 12 +- drivers/mtd/nand/raw/tmio_nand.c | 20 +- drivers/mtd/nand/raw/txx9ndfmc.c | 12 +- drivers/mtd/nand/raw/xway_nand.c | 12 +- drivers/staging/mt29f_spinand/mt29f_spinand.c | 16 +- include/linux/mtd/jedec.h | 91 ++ include/linux/mtd/onfi.h | 178 +++ include/linux/mtd/platnand.h | 74 ++ include/linux/mtd/rawnand.h | 555 ++--------
Quoted 9 lines
86 files changed, 2300 insertions(+), 2191 deletions(-) create mode 100644 drivers/mtd/nand/raw/internals.h create mode 100644 drivers/mtd/nand/raw/nand_jedec.c create mode 100644 drivers/mtd/nand/raw/nand_legacy.c create mode 100644 drivers/mtd/nand/raw/nand_onfi.c create mode 100644 include/linux/mtd/jedec.h create mode 100644 include/linux/mtd/onfi.h create mode 100644 include/linux/mtd/platnand.h
Series reviewed, there is one typo in patch 2/19 and 16/19 and a s/ONFI/JEDEC/ in patch 19/19, otherwise I like the cleanup very much! Can I modify when applying or you plan to do more/other changes?
Thanks,
Miquèl
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Quoted 141 lines · On Sat, 15 Sep 2018 19:54:40 +0200 Miquel Raynal <[email protected]>…
Hi Boris,
Boris Brezillon <[email protected]> wrote on Fri, 7 Sep 2018 00:38:32 +0200:
Quoted 126 lines
Hello,
This is the 2nd batch of API cleanup patches. This time we move deprecated hooks/fields to the
nand_legacystruct, and then move some of the code found innand_base.cinto separate source/header files.With this new organization, new comers should more easily identify the bits they can use in their NAND controller drivers and those that are only meant for core code. It also shrink a bit
nand_base.cwhich was over 6000 lines of code.Note that existing coding style issues (reported by checkpatch) in arch or driver code are intentionally not fixed to keep the series focused on the API/core cleanup.
Regards,
Boris
Boris Brezillon (19):
mtd: rawnand: Leave chip->IO_ADDR_{R,W} to NULL when unused
mtd: rawnand: Create a legacy struct and move ->IO_ADDR_{R,W} there
mtd: rawnand: Deprecate ->{read,write}_{byte,buf}() hooks
mtd: rawnand: Deprecate ->cmd_ctrl() and ->cmdfunc()
mtd: rawnand: Deprecate ->dev_ready() and ->waitfunc()
mtd: rawnand: Deprecate ->block_{bad,markbad}() hooks
mtd: rawnand: Deprecate ->erase()
mtd: rawnand: Deprecate ->{set,get}_features() hooks
mtd: rawnand: Deprecate ->chip_delay
mtd: rawnand: Move function prototypes after struct declarations
mtd: rawnand: Get rid ofnand_flash_devforward declation
mtd: rawnand: Get rid of the duplicatenand_chipforward declaration
mtd: rawnand: Get rid of a few unused definitions
mtd: rawnand: Moveplatform_nand_xxxdefinitions out ofrawnand.h
mtd: rawnand: Inlineonfi_get_async_timing_mode()
mtd: rawnand: Keep all internal stuff private
mtd: rawnand: Move legacy code tonand_legacy.c
mtd: rawnand: Move ONFI code tonand_onfi.c
mtd: rawnand: Move JEDEC code tonand_jedec.cDocumentation/driver-api/mtdnand.rst | 30 +- arch/arm/mach-ep93xx/snappercl15.c | 8 +- arch/arm/mach-ep93xx/ts72xx.c | 9 +- arch/arm/mach-imx/mach-qong.c | 6 +- arch/arm/mach-ixp4xx/ixdp425-setup.c | 2 +- arch/arm/mach-omap1/board-fsample.c | 3 +- arch/arm/mach-omap1/board-h2.c | 3 +- arch/arm/mach-omap1/board-h3.c | 2 +- arch/arm/mach-omap1/board-nand.c | 2 +- arch/arm/mach-omap1/board-perseus2.c | 3 +- arch/arm/mach-orion5x/ts78xx-setup.c | 9 +- arch/arm/mach-pxa/balloon3.c | 5 +- arch/arm/mach-pxa/em-x270.c | 9 +- arch/arm/mach-pxa/palmtx.c | 5 +- arch/mips/alchemy/devboards/db1200.c | 9 +- arch/mips/alchemy/devboards/db1300.c | 9 +- arch/mips/alchemy/devboards/db1550.c | 9 +- arch/mips/netlogic/xlr/platform-flash.c | 3 +- arch/mips/pnx833x/common/platform.c | 5 +- arch/mips/rb532/devices.c | 5 +- arch/sh/boards/mach-migor/setup.c | 8 +- drivers/mtd/nand/raw/Makefile | 4 +- drivers/mtd/nand/raw/ams-delta.c | 22 +- drivers/mtd/nand/raw/atmel/nand-controller.c | 22 +- drivers/mtd/nand/raw/au1550nd.c | 43 +- drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c | 22 +- drivers/mtd/nand/raw/brcmnand/brcmnand.c | 15 +- drivers/mtd/nand/raw/cafe_nand.c | 22 +- drivers/mtd/nand/raw/cmx270_nand.c | 28 +- drivers/mtd/nand/raw/cs553x_nand.c | 42 +- drivers/mtd/nand/raw/davinci_nand.c | 34 +- drivers/mtd/nand/raw/denali.c | 23 +- drivers/mtd/nand/raw/diskonchip.c | 50 +- drivers/mtd/nand/raw/fsl_elbc_nand.c | 18 +- drivers/mtd/nand/raw/fsl_ifc_nand.c | 24 +- drivers/mtd/nand/raw/fsl_upm.c | 30 +- drivers/mtd/nand/raw/fsmc_nand.c | 1 - drivers/mtd/nand/raw/gpio.c | 16 +- drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 22 +- drivers/mtd/nand/raw/hisi504_nand.c | 18 +- drivers/mtd/nand/raw/internals.h | 114 ++ drivers/mtd/nand/raw/jz4740_nand.c | 14 +- drivers/mtd/nand/raw/jz4780_nand.c | 10 +- drivers/mtd/nand/raw/lpc32xx_mlc.c | 12 +- drivers/mtd/nand/raw/lpc32xx_slc.c | 26 +- drivers/mtd/nand/raw/mpc5121_nfc.c | 14 +- drivers/mtd/nand/raw/mtk_nand.c | 12 +- drivers/mtd/nand/raw/mxc_nand.c | 20 +- drivers/mtd/nand/raw/nand_amd.c | 2 +- drivers/mtd/nand/raw/nand_base.c | 1260 +++------------------- drivers/mtd/nand/raw/nand_bbt.c | 5 +- drivers/mtd/nand/raw/nand_hynix.c | 9 +- drivers/mtd/nand/raw/nand_ids.c | 4 +- drivers/mtd/nand/raw/nand_jedec.c | 113 ++ drivers/mtd/nand/raw/nand_legacy.c | 642 +++++++++++ drivers/mtd/nand/raw/nand_macronix.c | 2 +- drivers/mtd/nand/raw/nand_micron.c | 3 +- drivers/mtd/nand/raw/nand_onfi.c | 305 ++++++ drivers/mtd/nand/raw/nand_samsung.c | 2 +- drivers/mtd/nand/raw/nand_timings.c | 18 +- drivers/mtd/nand/raw/nand_toshiba.c | 2 +- drivers/mtd/nand/raw/nandsim.c | 14 +- drivers/mtd/nand/raw/ndfc.c | 14 +- drivers/mtd/nand/raw/nuc900_nand.c | 22 +- drivers/mtd/nand/raw/omap2.c | 62 +- drivers/mtd/nand/raw/orion_nand.c | 12 +- drivers/mtd/nand/raw/oxnas_nand.c | 10 +- drivers/mtd/nand/raw/pasemi_nand.c | 32 +- drivers/mtd/nand/raw/plat_nand.c | 17 +- drivers/mtd/nand/raw/qcom_nandc.c | 39 +- drivers/mtd/nand/raw/r852.c | 14 +- drivers/mtd/nand/raw/s3c2410.c | 34 +- drivers/mtd/nand/raw/sh_flctl.c | 18 +- drivers/mtd/nand/raw/sharpsl.c | 12 +- drivers/mtd/nand/raw/sm_common.c | 2 +- drivers/mtd/nand/raw/socrates_nand.c | 16 +- drivers/mtd/nand/raw/sunxi_nand.c | 14 +- drivers/mtd/nand/raw/tango_nand.c | 12 +- drivers/mtd/nand/raw/tmio_nand.c | 20 +- drivers/mtd/nand/raw/txx9ndfmc.c | 12 +- drivers/mtd/nand/raw/xway_nand.c | 12 +- drivers/staging/mt29f_spinand/mt29f_spinand.c | 16 +- include/linux/mtd/jedec.h | 91 ++ include/linux/mtd/onfi.h | 178 +++ include/linux/mtd/platnand.h | 74 ++ include/linux/mtd/rawnand.h | 555 ++--------Quoted 9 lines
86 files changed, 2300 insertions(+), 2191 deletions(-) create mode 100644 drivers/mtd/nand/raw/internals.h create mode 100644 drivers/mtd/nand/raw/nand_jedec.c create mode 100644 drivers/mtd/nand/raw/nand_legacy.c create mode 100644 drivers/mtd/nand/raw/nand_onfi.c create mode 100644 include/linux/mtd/jedec.h create mode 100644 include/linux/mtd/onfi.h create mode 100644 include/linux/mtd/platnand.h
Quoted 3 lines
Series reviewed, there is one typo in patch 2/19 and 16/19 and a s/ONFI/JEDEC/ in patch 19/19, otherwise I like the cleanup very much! Can I modify when applying or you plan to do more/other changes?
Yep, you can fix+apply the series if you're happy with it.
Thanks,
Boris
Miquel Raynal
maintainerHi Boris,
Boris Brezillon <[email protected]> wrote on Mon, 17 Sep 2018 10:29:39 +0200:
Quoted 144 lines
Quoted 141 lines · On Sat, 15 Sep 2018 19:54:40 +0200 Miquel Raynal <[email protected]>…
Hi Boris,
Boris Brezillon <[email protected]> wrote on Fri, 7 Sep 2018 00:38:32 +0200:
Quoted 135 lines
Hello,
This is the 2nd batch of API cleanup patches. This time we move deprecated hooks/fields to the
nand_legacystruct, and then move some of the code found innand_base.cinto separate source/header files.With this new organization, new comers should more easily identify the bits they can use in their NAND controller drivers and those that are only meant for core code. It also shrink a bit
nand_base.cwhich was over 6000 lines of code.Note that existing coding style issues (reported by checkpatch) in arch or driver code are intentionally not fixed to keep the series focused on the API/core cleanup.
Regards,
Boris
Boris Brezillon (19):
mtd: rawnand: Leave chip->IO_ADDR_{R,W} to NULL when unused
mtd: rawnand: Create a legacy struct and move ->IO_ADDR_{R,W} there
mtd: rawnand: Deprecate ->{read,write}_{byte,buf}() hooks
mtd: rawnand: Deprecate ->cmd_ctrl() and ->cmdfunc()
mtd: rawnand: Deprecate ->dev_ready() and ->waitfunc()
mtd: rawnand: Deprecate ->block_{bad,markbad}() hooks
mtd: rawnand: Deprecate ->erase()
mtd: rawnand: Deprecate ->{set,get}_features() hooks
mtd: rawnand: Deprecate ->chip_delay
mtd: rawnand: Move function prototypes after struct declarations
mtd: rawnand: Get rid ofnand_flash_devforward declation
mtd: rawnand: Get rid of the duplicatenand_chipforward declaration
mtd: rawnand: Get rid of a few unused definitions
mtd: rawnand: Moveplatform_nand_xxxdefinitions out ofrawnand.h
mtd: rawnand: Inlineonfi_get_async_timing_mode()
mtd: rawnand: Keep all internal stuff private
mtd: rawnand: Move legacy code tonand_legacy.c
mtd: rawnand: Move ONFI code tonand_onfi.c
mtd: rawnand: Move JEDEC code tonand_jedec.cDocumentation/driver-api/mtdnand.rst | 30 +- arch/arm/mach-ep93xx/snappercl15.c | 8 +- arch/arm/mach-ep93xx/ts72xx.c | 9 +- arch/arm/mach-imx/mach-qong.c | 6 +- arch/arm/mach-ixp4xx/ixdp425-setup.c | 2 +- arch/arm/mach-omap1/board-fsample.c | 3 +- arch/arm/mach-omap1/board-h2.c | 3 +- arch/arm/mach-omap1/board-h3.c | 2 +- arch/arm/mach-omap1/board-nand.c | 2 +- arch/arm/mach-omap1/board-perseus2.c | 3 +- arch/arm/mach-orion5x/ts78xx-setup.c | 9 +- arch/arm/mach-pxa/balloon3.c | 5 +- arch/arm/mach-pxa/em-x270.c | 9 +- arch/arm/mach-pxa/palmtx.c | 5 +- arch/mips/alchemy/devboards/db1200.c | 9 +- arch/mips/alchemy/devboards/db1300.c | 9 +- arch/mips/alchemy/devboards/db1550.c | 9 +- arch/mips/netlogic/xlr/platform-flash.c | 3 +- arch/mips/pnx833x/common/platform.c | 5 +- arch/mips/rb532/devices.c | 5 +- arch/sh/boards/mach-migor/setup.c | 8 +- drivers/mtd/nand/raw/Makefile | 4 +- drivers/mtd/nand/raw/ams-delta.c | 22 +- drivers/mtd/nand/raw/atmel/nand-controller.c | 22 +- drivers/mtd/nand/raw/au1550nd.c | 43 +- drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c | 22 +- drivers/mtd/nand/raw/brcmnand/brcmnand.c | 15 +- drivers/mtd/nand/raw/cafe_nand.c | 22 +- drivers/mtd/nand/raw/cmx270_nand.c | 28 +- drivers/mtd/nand/raw/cs553x_nand.c | 42 +- drivers/mtd/nand/raw/davinci_nand.c | 34 +- drivers/mtd/nand/raw/denali.c | 23 +- drivers/mtd/nand/raw/diskonchip.c | 50 +- drivers/mtd/nand/raw/fsl_elbc_nand.c | 18 +- drivers/mtd/nand/raw/fsl_ifc_nand.c | 24 +- drivers/mtd/nand/raw/fsl_upm.c | 30 +- drivers/mtd/nand/raw/fsmc_nand.c | 1 - drivers/mtd/nand/raw/gpio.c | 16 +- drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 22 +- drivers/mtd/nand/raw/hisi504_nand.c | 18 +- drivers/mtd/nand/raw/internals.h | 114 ++ drivers/mtd/nand/raw/jz4740_nand.c | 14 +- drivers/mtd/nand/raw/jz4780_nand.c | 10 +- drivers/mtd/nand/raw/lpc32xx_mlc.c | 12 +- drivers/mtd/nand/raw/lpc32xx_slc.c | 26 +- drivers/mtd/nand/raw/mpc5121_nfc.c | 14 +- drivers/mtd/nand/raw/mtk_nand.c | 12 +- drivers/mtd/nand/raw/mxc_nand.c | 20 +- drivers/mtd/nand/raw/nand_amd.c | 2 +- drivers/mtd/nand/raw/nand_base.c | 1260 +++------------------- drivers/mtd/nand/raw/nand_bbt.c | 5 +- drivers/mtd/nand/raw/nand_hynix.c | 9 +- drivers/mtd/nand/raw/nand_ids.c | 4 +- drivers/mtd/nand/raw/nand_jedec.c | 113 ++ drivers/mtd/nand/raw/nand_legacy.c | 642 +++++++++++ drivers/mtd/nand/raw/nand_macronix.c | 2 +- drivers/mtd/nand/raw/nand_micron.c | 3 +- drivers/mtd/nand/raw/nand_onfi.c | 305 ++++++ drivers/mtd/nand/raw/nand_samsung.c | 2 +- drivers/mtd/nand/raw/nand_timings.c | 18 +- drivers/mtd/nand/raw/nand_toshiba.c | 2 +- drivers/mtd/nand/raw/nandsim.c | 14 +- drivers/mtd/nand/raw/ndfc.c | 14 +- drivers/mtd/nand/raw/nuc900_nand.c | 22 +- drivers/mtd/nand/raw/omap2.c | 62 +- drivers/mtd/nand/raw/orion_nand.c | 12 +- drivers/mtd/nand/raw/oxnas_nand.c | 10 +- drivers/mtd/nand/raw/pasemi_nand.c | 32 +- drivers/mtd/nand/raw/plat_nand.c | 17 +- drivers/mtd/nand/raw/qcom_nandc.c | 39 +- drivers/mtd/nand/raw/r852.c | 14 +- drivers/mtd/nand/raw/s3c2410.c | 34 +- drivers/mtd/nand/raw/sh_flctl.c | 18 +- drivers/mtd/nand/raw/sharpsl.c | 12 +- drivers/mtd/nand/raw/sm_common.c | 2 +- drivers/mtd/nand/raw/socrates_nand.c | 16 +- drivers/mtd/nand/raw/sunxi_nand.c | 14 +- drivers/mtd/nand/raw/tango_nand.c | 12 +- drivers/mtd/nand/raw/tmio_nand.c | 20 +- drivers/mtd/nand/raw/txx9ndfmc.c | 12 +- drivers/mtd/nand/raw/xway_nand.c | 12 +- drivers/staging/mt29f_spinand/mt29f_spinand.c | 16 +- include/linux/mtd/jedec.h | 91 ++ include/linux/mtd/onfi.h | 178 +++ include/linux/mtd/platnand.h | 74 ++ include/linux/mtd/rawnand.h | 555 ++-------- 86 files changed, 2300 insertions(+), 2191 deletions(-) create mode 100644 drivers/mtd/nand/raw/internals.h create mode 100644 drivers/mtd/nand/raw/nand_jedec.c create mode 100644 drivers/mtd/nand/raw/nand_legacy.c create mode 100644 drivers/mtd/nand/raw/nand_onfi.c create mode 100644 include/linux/mtd/jedec.h create mode 100644 include/linux/mtd/onfi.h create mode 100644 include/linux/mtd/platnand.h
Quoted 5 lines
Quoted 3 lines
Series reviewed, there is one typo in patch 2/19 and 16/19 and a s/ONFI/JEDEC/ in patch 19/19, otherwise I like the cleanup very much! Can I modify when applying or you plan to do more/other changes?
Yep, you can fix+apply the series if you're happy with it.
Applied on nand/next (with fixes).
Thanks,
Miquèl
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel