* [PATCH v7 0/4] add the GPMI-NAND support for imx23/imx28 @ 2011-07-11 8:01 ` Huang Shijie 0 siblings, 0 replies; 14+ messages in thread From: Huang Shijie @ 2011-07-11 8:01 UTC (permalink / raw) To: s.hauer Cc: arnd, w.sang, Huang Shijie, linux-mtd, u.kleine-koenig, shijie8, linux-arm-kernel, LW The patch is based on branch "imx-for-3.1" of tree : git://git.pengutronix.de/git/imx/linux-2.6.git The general-purpose media interface(GPMI) controller is a flexible interface to up to several NAND flashs. The Bose Ray-Choudhury Hocquenghem(BCH) module is a hardware ECC accelerator. With the help of BCH, the GPMI controller can choose to do the hardware ECC or not. v6 --> v7: [0] rename RES_SIZE to GPMI_NAND_RES_SIZE. [1] move gpmi-nand.h to `include/linux/mtd/` directory. [2] remove comment for new pad control. [3] others v5 --> v6: [0] rename `gpmi-nfc` to `gpmi-nand`. [1] remove ->exit() in structure gpmi_nand_platform_data{}. [2] drop the macros for the resource's definition of gpmi-nand. [3] add a new pad control `MXS_PAD_CTRL_12MA`. [4] others. v4 --> v5: [0] split out the mach code and the machine code. v3 --> v4: merge the GPMI-NFC device code to the new branch. Huang Shijie (4): ARM: mxs: add GPMI-NAND support for imx23/imx28 ARM: mxs: add new a pad control ARM: mxs/mx23evk: add GPMI-NAND device ARM: mxs/mx28evk: add GPMI-NAND device arch/arm/mach-mxs/Kconfig | 2 + arch/arm/mach-mxs/clock-mx23.c | 1 + arch/arm/mach-mxs/clock-mx28.c | 1 + arch/arm/mach-mxs/devices-mx23.h | 4 + arch/arm/mach-mxs/devices-mx28.h | 4 + arch/arm/mach-mxs/devices/Kconfig | 3 + arch/arm/mach-mxs/devices/Makefile | 1 + arch/arm/mach-mxs/devices/platform-gpmi-nand.c | 108 +++++++++++++++++++++++ arch/arm/mach-mxs/include/mach/devices-common.h | 10 ++ arch/arm/mach-mxs/include/mach/iomux.h | 1 + arch/arm/mach-mxs/mach-mx23evk.c | 36 ++++++++ arch/arm/mach-mxs/mach-mx28evk.c | 36 ++++++++ include/linux/mtd/gpmi-nand.h | 68 ++++++++++++++ 13 files changed, 275 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-mxs/devices/platform-gpmi-nand.c create mode 100644 include/linux/mtd/gpmi-nand.h ^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v7 0/4] add the GPMI-NAND support for imx23/imx28 @ 2011-07-11 8:01 ` Huang Shijie 0 siblings, 0 replies; 14+ messages in thread From: Huang Shijie @ 2011-07-11 8:01 UTC (permalink / raw) To: linux-arm-kernel The patch is based on branch "imx-for-3.1" of tree : git://git.pengutronix.de/git/imx/linux-2.6.git The general-purpose media interface(GPMI) controller is a flexible interface to up to several NAND flashs. The Bose Ray-Choudhury Hocquenghem(BCH) module is a hardware ECC accelerator. With the help of BCH, the GPMI controller can choose to do the hardware ECC or not. v6 --> v7: [0] rename RES_SIZE to GPMI_NAND_RES_SIZE. [1] move gpmi-nand.h to `include/linux/mtd/` directory. [2] remove comment for new pad control. [3] others v5 --> v6: [0] rename `gpmi-nfc` to `gpmi-nand`. [1] remove ->exit() in structure gpmi_nand_platform_data{}. [2] drop the macros for the resource's definition of gpmi-nand. [3] add a new pad control `MXS_PAD_CTRL_12MA`. [4] others. v4 --> v5: [0] split out the mach code and the machine code. v3 --> v4: merge the GPMI-NFC device code to the new branch. Huang Shijie (4): ARM: mxs: add GPMI-NAND support for imx23/imx28 ARM: mxs: add new a pad control ARM: mxs/mx23evk: add GPMI-NAND device ARM: mxs/mx28evk: add GPMI-NAND device arch/arm/mach-mxs/Kconfig | 2 + arch/arm/mach-mxs/clock-mx23.c | 1 + arch/arm/mach-mxs/clock-mx28.c | 1 + arch/arm/mach-mxs/devices-mx23.h | 4 + arch/arm/mach-mxs/devices-mx28.h | 4 + arch/arm/mach-mxs/devices/Kconfig | 3 + arch/arm/mach-mxs/devices/Makefile | 1 + arch/arm/mach-mxs/devices/platform-gpmi-nand.c | 108 +++++++++++++++++++++++ arch/arm/mach-mxs/include/mach/devices-common.h | 10 ++ arch/arm/mach-mxs/include/mach/iomux.h | 1 + arch/arm/mach-mxs/mach-mx23evk.c | 36 ++++++++ arch/arm/mach-mxs/mach-mx28evk.c | 36 ++++++++ include/linux/mtd/gpmi-nand.h | 68 ++++++++++++++ 13 files changed, 275 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-mxs/devices/platform-gpmi-nand.c create mode 100644 include/linux/mtd/gpmi-nand.h ^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v7 1/4] ARM: mxs: add GPMI-NAND support for imx23/imx28 2011-07-11 8:01 ` Huang Shijie @ 2011-07-11 8:01 ` Huang Shijie -1 siblings, 0 replies; 14+ messages in thread From: Huang Shijie @ 2011-07-11 8:01 UTC (permalink / raw) To: s.hauer Cc: arnd, w.sang, Huang Shijie, linux-mtd, u.kleine-koenig, shijie8, linux-arm-kernel, LW add GPMI-NAND support for imx23 and imx28. Signed-off-by: Huang Shijie <b32955@freescale.com> --- arch/arm/mach-mxs/clock-mx23.c | 1 + arch/arm/mach-mxs/clock-mx28.c | 1 + arch/arm/mach-mxs/devices-mx23.h | 4 + arch/arm/mach-mxs/devices-mx28.h | 4 + arch/arm/mach-mxs/devices/Kconfig | 3 + arch/arm/mach-mxs/devices/Makefile | 1 + arch/arm/mach-mxs/devices/platform-gpmi-nand.c | 108 +++++++++++++++++++++++ arch/arm/mach-mxs/include/mach/devices-common.h | 10 ++ include/linux/mtd/gpmi-nand.h | 68 ++++++++++++++ 9 files changed, 200 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-mxs/devices/platform-gpmi-nand.c create mode 100644 include/linux/mtd/gpmi-nand.h diff --git a/arch/arm/mach-mxs/clock-mx23.c b/arch/arm/mach-mxs/clock-mx23.c index 0163b6d..4300ce5 100644 --- a/arch/arm/mach-mxs/clock-mx23.c +++ b/arch/arm/mach-mxs/clock-mx23.c @@ -456,6 +456,7 @@ static struct clk_lookup lookups[] = { _REGISTER_CLOCK("mxs-pwm.3", NULL, pwm_clk) _REGISTER_CLOCK("mxs-pwm.4", NULL, pwm_clk) _REGISTER_CLOCK("imx23-fb", NULL, lcdif_clk) + _REGISTER_CLOCK("imx23-gpmi-nand", NULL, gpmi_clk) }; static int clk_misc_init(void) diff --git a/arch/arm/mach-mxs/clock-mx28.c b/arch/arm/mach-mxs/clock-mx28.c index 5dcc59d..dc2052c 100644 --- a/arch/arm/mach-mxs/clock-mx28.c +++ b/arch/arm/mach-mxs/clock-mx28.c @@ -614,6 +614,7 @@ static struct clk_lookup lookups[] = { _REGISTER_CLOCK("duart", NULL, uart_clk) _REGISTER_CLOCK("imx28-fec.0", NULL, fec_clk) _REGISTER_CLOCK("imx28-fec.1", NULL, fec_clk) + _REGISTER_CLOCK("imx28-gpmi-nand", NULL, gpmi_clk) _REGISTER_CLOCK("mxs-auart.0", NULL, uart_clk) _REGISTER_CLOCK("mxs-auart.1", NULL, uart_clk) _REGISTER_CLOCK("mxs-auart.2", NULL, uart_clk) diff --git a/arch/arm/mach-mxs/devices-mx23.h b/arch/arm/mach-mxs/devices-mx23.h index c6f345f..ee8c525 100644 --- a/arch/arm/mach-mxs/devices-mx23.h +++ b/arch/arm/mach-mxs/devices-mx23.h @@ -21,6 +21,10 @@ extern const struct mxs_auart_data mx23_auart_data[] __initconst; #define mx23_add_auart0() mx23_add_auart(0) #define mx23_add_auart1() mx23_add_auart(1) +extern const struct mxs_gpmi_nand_data mx23_gpmi_nand_data __initconst; +#define mx23_add_gpmi_nand(pdata) \ + mxs_add_gpmi_nand(pdata, &mx23_gpmi_nand_data) + extern const struct mxs_mxs_mmc_data mx23_mxs_mmc_data[] __initconst; #define mx23_add_mxs_mmc(id, pdata) \ mxs_add_mxs_mmc(&mx23_mxs_mmc_data[id], pdata) diff --git a/arch/arm/mach-mxs/devices-mx28.h b/arch/arm/mach-mxs/devices-mx28.h index 79b9452..2953f0d 100644 --- a/arch/arm/mach-mxs/devices-mx28.h +++ b/arch/arm/mach-mxs/devices-mx28.h @@ -34,6 +34,10 @@ extern const struct mxs_flexcan_data mx28_flexcan_data[] __initconst; #define mx28_add_flexcan0(pdata) mx28_add_flexcan(0, pdata) #define mx28_add_flexcan1(pdata) mx28_add_flexcan(1, pdata) +extern const struct mxs_gpmi_nand_data mx28_gpmi_nand_data __initconst; +#define mx28_add_gpmi_nand(pdata) \ + mxs_add_gpmi_nand(pdata, &mx28_gpmi_nand_data) + extern const struct mxs_mxs_i2c_data mx28_mxs_i2c_data[] __initconst; #define mx28_add_mxs_i2c(id) mxs_add_mxs_i2c(&mx28_mxs_i2c_data[id]) diff --git a/arch/arm/mach-mxs/devices/Kconfig b/arch/arm/mach-mxs/devices/Kconfig index acf9eea..a3bca3c 100644 --- a/arch/arm/mach-mxs/devices/Kconfig +++ b/arch/arm/mach-mxs/devices/Kconfig @@ -12,6 +12,9 @@ config MXS_HAVE_PLATFORM_FLEXCAN select HAVE_CAN_FLEXCAN if CAN bool +config MXS_HAVE_PLATFORM_GPMI_NAND + bool + config MXS_HAVE_PLATFORM_MXS_I2C bool diff --git a/arch/arm/mach-mxs/devices/Makefile b/arch/arm/mach-mxs/devices/Makefile index 351915c..7d26eb1 100644 --- a/arch/arm/mach-mxs/devices/Makefile +++ b/arch/arm/mach-mxs/devices/Makefile @@ -3,6 +3,7 @@ obj-$(CONFIG_MXS_HAVE_PLATFORM_AUART) += platform-auart.o obj-y += platform-dma.o obj-$(CONFIG_MXS_HAVE_PLATFORM_FEC) += platform-fec.o obj-$(CONFIG_MXS_HAVE_PLATFORM_FLEXCAN) += platform-flexcan.o +obj-$(CONFIG_MXS_HAVE_PLATFORM_GPMI_NAND) += platform-gpmi-nand.o obj-$(CONFIG_MXS_HAVE_PLATFORM_MXS_I2C) += platform-mxs-i2c.o obj-$(CONFIG_MXS_HAVE_PLATFORM_MXS_MMC) += platform-mxs-mmc.o obj-$(CONFIG_MXS_HAVE_PLATFORM_MXS_PWM) += platform-mxs-pwm.o diff --git a/arch/arm/mach-mxs/devices/platform-gpmi-nand.c b/arch/arm/mach-mxs/devices/platform-gpmi-nand.c new file mode 100644 index 0000000..b7d1f2e --- /dev/null +++ b/arch/arm/mach-mxs/devices/platform-gpmi-nand.c @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include <asm/sizes.h> +#include <mach/mx23.h> +#include <mach/mx28.h> +#include <mach/devices-common.h> + +#ifdef CONFIG_SOC_IMX23 +const struct mxs_gpmi_nand_data mx23_gpmi_nand_data __initconst = { + .devid = "imx23-gpmi-nand", + .res = { + { /* GPMI */ + .start = MX23_GPMI_BASE_ADDR, + .end = MX23_GPMI_BASE_ADDR + SZ_8K - 1, + .name = GPMI_NAND_GPMI_REGS_ADDR_RES_NAME, + .flags = IORESOURCE_MEM, + }, { + .start = MX23_INT_GPMI_ATTENTION, + .end = MX23_INT_GPMI_ATTENTION, + .name = GPMI_NAND_GPMI_INTERRUPT_RES_NAME, + .flags = IORESOURCE_IRQ, + }, { /* BCH */ + .start = MX23_BCH_BASE_ADDR, + .end = MX23_BCH_BASE_ADDR + SZ_8K - 1, + .name = GPMI_NAND_BCH_REGS_ADDR_RES_NAME, + .flags = IORESOURCE_MEM, + }, { + .start = MX23_INT_BCH, + .end = MX23_INT_BCH, + .name = GPMI_NAND_BCH_INTERRUPT_RES_NAME, + .flags = IORESOURCE_IRQ, + }, { /* DMA */ + .start = MX23_DMA_GPMI0, + .end = MX23_DMA_GPMI3, + .name = GPMI_NAND_DMA_CHANNELS_RES_NAME, + .flags = IORESOURCE_DMA, + }, { + .start = MX23_INT_GPMI_DMA, + .end = MX23_INT_GPMI_DMA, + .name = GPMI_NAND_DMA_INTERRUPT_RES_NAME, + .flags = IORESOURCE_IRQ, + }, + }, +}; +#endif + +#ifdef CONFIG_SOC_IMX28 +const struct mxs_gpmi_nand_data mx28_gpmi_nand_data __initconst = { + .devid = "imx28-gpmi-nand", + .res = { + { /* GPMI */ + .start = MX28_GPMI_BASE_ADDR, + .end = MX28_GPMI_BASE_ADDR + SZ_8K - 1, + .name = GPMI_NAND_GPMI_REGS_ADDR_RES_NAME, + .flags = IORESOURCE_MEM, + }, { + .start = MX28_INT_GPMI, + .end = MX28_INT_GPMI, + .name = GPMI_NAND_GPMI_INTERRUPT_RES_NAME, + .flags = IORESOURCE_IRQ, + }, { /* BCH */ + .start = MX28_BCH_BASE_ADDR, + .end = MX28_BCH_BASE_ADDR + SZ_8K - 1, + .name = GPMI_NAND_BCH_REGS_ADDR_RES_NAME, + .flags = IORESOURCE_MEM, + }, { + .start = MX28_INT_BCH, + .end = MX28_INT_BCH, + .name = GPMI_NAND_BCH_INTERRUPT_RES_NAME, + .flags = IORESOURCE_IRQ, + }, { /* DMA */ + .start = MX28_DMA_GPMI0, + .end = MX28_DMA_GPMI7, + .name = GPMI_NAND_DMA_CHANNELS_RES_NAME, + .flags = IORESOURCE_DMA, + }, { + .start = MX28_INT_GPMI_DMA, + .end = MX28_INT_GPMI_DMA, + .name = GPMI_NAND_DMA_INTERRUPT_RES_NAME, + .flags = IORESOURCE_IRQ, + }, + }, +}; +#endif + +struct platform_device *__init +mxs_add_gpmi_nand(const struct gpmi_nand_platform_data *pdata, + const struct mxs_gpmi_nand_data *data) +{ + return mxs_add_platform_device_dmamask(data->devid, -1, + data->res, GPMI_NAND_RES_SIZE, + pdata, sizeof(*pdata), DMA_BIT_MASK(32)); +} diff --git a/arch/arm/mach-mxs/include/mach/devices-common.h b/arch/arm/mach-mxs/include/mach/devices-common.h index 812d7a8..ce71c89 100644 --- a/arch/arm/mach-mxs/include/mach/devices-common.h +++ b/arch/arm/mach-mxs/include/mach/devices-common.h @@ -66,6 +66,16 @@ struct platform_device *__init mxs_add_flexcan( const struct mxs_flexcan_data *data, const struct flexcan_platform_data *pdata); +/* gpmi-nand */ +#include <linux/mtd/gpmi-nand.h> +struct mxs_gpmi_nand_data { + const char *devid; + const struct resource res[GPMI_NAND_RES_SIZE]; +}; +struct platform_device *__init +mxs_add_gpmi_nand(const struct gpmi_nand_platform_data *pdata, + const struct mxs_gpmi_nand_data *data); + /* i2c */ struct mxs_mxs_i2c_data { int id; diff --git a/include/linux/mtd/gpmi-nand.h b/include/linux/mtd/gpmi-nand.h new file mode 100644 index 0000000..69b6dbf --- /dev/null +++ b/include/linux/mtd/gpmi-nand.h @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef __MACH_MXS_GPMI_NAND_H__ +#define __MACH_MXS_GPMI_NAND_H__ + +/* The size of the resources is fixed. */ +#define GPMI_NAND_RES_SIZE 6 + +/* Resource names for the GPMI NAND driver. */ +#define GPMI_NAND_GPMI_REGS_ADDR_RES_NAME "GPMI NAND GPMI Registers" +#define GPMI_NAND_GPMI_INTERRUPT_RES_NAME "GPMI NAND GPMI Interrupt" +#define GPMI_NAND_BCH_REGS_ADDR_RES_NAME "GPMI NAND BCH Registers" +#define GPMI_NAND_BCH_INTERRUPT_RES_NAME "GPMI NAND BCH Interrupt" +#define GPMI_NAND_DMA_CHANNELS_RES_NAME "GPMI NAND DMA Channels" +#define GPMI_NAND_DMA_INTERRUPT_RES_NAME "GPMI NAND DMA Interrupt" + +/** + * struct gpmi_nand_platform_data - GPMI NAND driver platform data. + * + * This structure communicates platform-specific information to the GPMI NAND + * driver that can't be expressed as resources. + * + * @platform_init: A pointer to a function the driver will call to + * initialize the platform (e.g., set up the pin mux). + * @min_prop_delay_in_ns: Minimum propagation delay of GPMI signals to and + * from the NAND Flash device, in nanoseconds. + * @max_prop_delay_in_ns: Maximum propagation delay of GPMI signals to and + * from the NAND Flash device, in nanoseconds. + * @max_chip_count: The maximum number of chips for which the driver + * should configure the hardware. This value most + * likely reflects the number of pins that are + * connected to a NAND Flash device. If this is + * greater than the SoC hardware can support, the + * driver will print a message and fail to initialize. + * @partitions: An optional pointer to an array of partition + * descriptions. + * @partition_count: The number of elements in the partitions array. + */ +struct gpmi_nand_platform_data { + /* SoC hardware information. */ + int (*platform_init)(void); + + /* NAND Flash information. */ + unsigned int min_prop_delay_in_ns; + unsigned int max_prop_delay_in_ns; + unsigned int max_chip_count; + + /* Medium information. */ + struct mtd_partition *partitions; + unsigned partition_count; +}; +#endif -- 1.7.0.4 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v7 1/4] ARM: mxs: add GPMI-NAND support for imx23/imx28 @ 2011-07-11 8:01 ` Huang Shijie 0 siblings, 0 replies; 14+ messages in thread From: Huang Shijie @ 2011-07-11 8:01 UTC (permalink / raw) To: linux-arm-kernel add GPMI-NAND support for imx23 and imx28. Signed-off-by: Huang Shijie <b32955@freescale.com> --- arch/arm/mach-mxs/clock-mx23.c | 1 + arch/arm/mach-mxs/clock-mx28.c | 1 + arch/arm/mach-mxs/devices-mx23.h | 4 + arch/arm/mach-mxs/devices-mx28.h | 4 + arch/arm/mach-mxs/devices/Kconfig | 3 + arch/arm/mach-mxs/devices/Makefile | 1 + arch/arm/mach-mxs/devices/platform-gpmi-nand.c | 108 +++++++++++++++++++++++ arch/arm/mach-mxs/include/mach/devices-common.h | 10 ++ include/linux/mtd/gpmi-nand.h | 68 ++++++++++++++ 9 files changed, 200 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-mxs/devices/platform-gpmi-nand.c create mode 100644 include/linux/mtd/gpmi-nand.h diff --git a/arch/arm/mach-mxs/clock-mx23.c b/arch/arm/mach-mxs/clock-mx23.c index 0163b6d..4300ce5 100644 --- a/arch/arm/mach-mxs/clock-mx23.c +++ b/arch/arm/mach-mxs/clock-mx23.c @@ -456,6 +456,7 @@ static struct clk_lookup lookups[] = { _REGISTER_CLOCK("mxs-pwm.3", NULL, pwm_clk) _REGISTER_CLOCK("mxs-pwm.4", NULL, pwm_clk) _REGISTER_CLOCK("imx23-fb", NULL, lcdif_clk) + _REGISTER_CLOCK("imx23-gpmi-nand", NULL, gpmi_clk) }; static int clk_misc_init(void) diff --git a/arch/arm/mach-mxs/clock-mx28.c b/arch/arm/mach-mxs/clock-mx28.c index 5dcc59d..dc2052c 100644 --- a/arch/arm/mach-mxs/clock-mx28.c +++ b/arch/arm/mach-mxs/clock-mx28.c @@ -614,6 +614,7 @@ static struct clk_lookup lookups[] = { _REGISTER_CLOCK("duart", NULL, uart_clk) _REGISTER_CLOCK("imx28-fec.0", NULL, fec_clk) _REGISTER_CLOCK("imx28-fec.1", NULL, fec_clk) + _REGISTER_CLOCK("imx28-gpmi-nand", NULL, gpmi_clk) _REGISTER_CLOCK("mxs-auart.0", NULL, uart_clk) _REGISTER_CLOCK("mxs-auart.1", NULL, uart_clk) _REGISTER_CLOCK("mxs-auart.2", NULL, uart_clk) diff --git a/arch/arm/mach-mxs/devices-mx23.h b/arch/arm/mach-mxs/devices-mx23.h index c6f345f..ee8c525 100644 --- a/arch/arm/mach-mxs/devices-mx23.h +++ b/arch/arm/mach-mxs/devices-mx23.h @@ -21,6 +21,10 @@ extern const struct mxs_auart_data mx23_auart_data[] __initconst; #define mx23_add_auart0() mx23_add_auart(0) #define mx23_add_auart1() mx23_add_auart(1) +extern const struct mxs_gpmi_nand_data mx23_gpmi_nand_data __initconst; +#define mx23_add_gpmi_nand(pdata) \ + mxs_add_gpmi_nand(pdata, &mx23_gpmi_nand_data) + extern const struct mxs_mxs_mmc_data mx23_mxs_mmc_data[] __initconst; #define mx23_add_mxs_mmc(id, pdata) \ mxs_add_mxs_mmc(&mx23_mxs_mmc_data[id], pdata) diff --git a/arch/arm/mach-mxs/devices-mx28.h b/arch/arm/mach-mxs/devices-mx28.h index 79b9452..2953f0d 100644 --- a/arch/arm/mach-mxs/devices-mx28.h +++ b/arch/arm/mach-mxs/devices-mx28.h @@ -34,6 +34,10 @@ extern const struct mxs_flexcan_data mx28_flexcan_data[] __initconst; #define mx28_add_flexcan0(pdata) mx28_add_flexcan(0, pdata) #define mx28_add_flexcan1(pdata) mx28_add_flexcan(1, pdata) +extern const struct mxs_gpmi_nand_data mx28_gpmi_nand_data __initconst; +#define mx28_add_gpmi_nand(pdata) \ + mxs_add_gpmi_nand(pdata, &mx28_gpmi_nand_data) + extern const struct mxs_mxs_i2c_data mx28_mxs_i2c_data[] __initconst; #define mx28_add_mxs_i2c(id) mxs_add_mxs_i2c(&mx28_mxs_i2c_data[id]) diff --git a/arch/arm/mach-mxs/devices/Kconfig b/arch/arm/mach-mxs/devices/Kconfig index acf9eea..a3bca3c 100644 --- a/arch/arm/mach-mxs/devices/Kconfig +++ b/arch/arm/mach-mxs/devices/Kconfig @@ -12,6 +12,9 @@ config MXS_HAVE_PLATFORM_FLEXCAN select HAVE_CAN_FLEXCAN if CAN bool +config MXS_HAVE_PLATFORM_GPMI_NAND + bool + config MXS_HAVE_PLATFORM_MXS_I2C bool diff --git a/arch/arm/mach-mxs/devices/Makefile b/arch/arm/mach-mxs/devices/Makefile index 351915c..7d26eb1 100644 --- a/arch/arm/mach-mxs/devices/Makefile +++ b/arch/arm/mach-mxs/devices/Makefile @@ -3,6 +3,7 @@ obj-$(CONFIG_MXS_HAVE_PLATFORM_AUART) += platform-auart.o obj-y += platform-dma.o obj-$(CONFIG_MXS_HAVE_PLATFORM_FEC) += platform-fec.o obj-$(CONFIG_MXS_HAVE_PLATFORM_FLEXCAN) += platform-flexcan.o +obj-$(CONFIG_MXS_HAVE_PLATFORM_GPMI_NAND) += platform-gpmi-nand.o obj-$(CONFIG_MXS_HAVE_PLATFORM_MXS_I2C) += platform-mxs-i2c.o obj-$(CONFIG_MXS_HAVE_PLATFORM_MXS_MMC) += platform-mxs-mmc.o obj-$(CONFIG_MXS_HAVE_PLATFORM_MXS_PWM) += platform-mxs-pwm.o diff --git a/arch/arm/mach-mxs/devices/platform-gpmi-nand.c b/arch/arm/mach-mxs/devices/platform-gpmi-nand.c new file mode 100644 index 0000000..b7d1f2e --- /dev/null +++ b/arch/arm/mach-mxs/devices/platform-gpmi-nand.c @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include <asm/sizes.h> +#include <mach/mx23.h> +#include <mach/mx28.h> +#include <mach/devices-common.h> + +#ifdef CONFIG_SOC_IMX23 +const struct mxs_gpmi_nand_data mx23_gpmi_nand_data __initconst = { + .devid = "imx23-gpmi-nand", + .res = { + { /* GPMI */ + .start = MX23_GPMI_BASE_ADDR, + .end = MX23_GPMI_BASE_ADDR + SZ_8K - 1, + .name = GPMI_NAND_GPMI_REGS_ADDR_RES_NAME, + .flags = IORESOURCE_MEM, + }, { + .start = MX23_INT_GPMI_ATTENTION, + .end = MX23_INT_GPMI_ATTENTION, + .name = GPMI_NAND_GPMI_INTERRUPT_RES_NAME, + .flags = IORESOURCE_IRQ, + }, { /* BCH */ + .start = MX23_BCH_BASE_ADDR, + .end = MX23_BCH_BASE_ADDR + SZ_8K - 1, + .name = GPMI_NAND_BCH_REGS_ADDR_RES_NAME, + .flags = IORESOURCE_MEM, + }, { + .start = MX23_INT_BCH, + .end = MX23_INT_BCH, + .name = GPMI_NAND_BCH_INTERRUPT_RES_NAME, + .flags = IORESOURCE_IRQ, + }, { /* DMA */ + .start = MX23_DMA_GPMI0, + .end = MX23_DMA_GPMI3, + .name = GPMI_NAND_DMA_CHANNELS_RES_NAME, + .flags = IORESOURCE_DMA, + }, { + .start = MX23_INT_GPMI_DMA, + .end = MX23_INT_GPMI_DMA, + .name = GPMI_NAND_DMA_INTERRUPT_RES_NAME, + .flags = IORESOURCE_IRQ, + }, + }, +}; +#endif + +#ifdef CONFIG_SOC_IMX28 +const struct mxs_gpmi_nand_data mx28_gpmi_nand_data __initconst = { + .devid = "imx28-gpmi-nand", + .res = { + { /* GPMI */ + .start = MX28_GPMI_BASE_ADDR, + .end = MX28_GPMI_BASE_ADDR + SZ_8K - 1, + .name = GPMI_NAND_GPMI_REGS_ADDR_RES_NAME, + .flags = IORESOURCE_MEM, + }, { + .start = MX28_INT_GPMI, + .end = MX28_INT_GPMI, + .name = GPMI_NAND_GPMI_INTERRUPT_RES_NAME, + .flags = IORESOURCE_IRQ, + }, { /* BCH */ + .start = MX28_BCH_BASE_ADDR, + .end = MX28_BCH_BASE_ADDR + SZ_8K - 1, + .name = GPMI_NAND_BCH_REGS_ADDR_RES_NAME, + .flags = IORESOURCE_MEM, + }, { + .start = MX28_INT_BCH, + .end = MX28_INT_BCH, + .name = GPMI_NAND_BCH_INTERRUPT_RES_NAME, + .flags = IORESOURCE_IRQ, + }, { /* DMA */ + .start = MX28_DMA_GPMI0, + .end = MX28_DMA_GPMI7, + .name = GPMI_NAND_DMA_CHANNELS_RES_NAME, + .flags = IORESOURCE_DMA, + }, { + .start = MX28_INT_GPMI_DMA, + .end = MX28_INT_GPMI_DMA, + .name = GPMI_NAND_DMA_INTERRUPT_RES_NAME, + .flags = IORESOURCE_IRQ, + }, + }, +}; +#endif + +struct platform_device *__init +mxs_add_gpmi_nand(const struct gpmi_nand_platform_data *pdata, + const struct mxs_gpmi_nand_data *data) +{ + return mxs_add_platform_device_dmamask(data->devid, -1, + data->res, GPMI_NAND_RES_SIZE, + pdata, sizeof(*pdata), DMA_BIT_MASK(32)); +} diff --git a/arch/arm/mach-mxs/include/mach/devices-common.h b/arch/arm/mach-mxs/include/mach/devices-common.h index 812d7a8..ce71c89 100644 --- a/arch/arm/mach-mxs/include/mach/devices-common.h +++ b/arch/arm/mach-mxs/include/mach/devices-common.h @@ -66,6 +66,16 @@ struct platform_device *__init mxs_add_flexcan( const struct mxs_flexcan_data *data, const struct flexcan_platform_data *pdata); +/* gpmi-nand */ +#include <linux/mtd/gpmi-nand.h> +struct mxs_gpmi_nand_data { + const char *devid; + const struct resource res[GPMI_NAND_RES_SIZE]; +}; +struct platform_device *__init +mxs_add_gpmi_nand(const struct gpmi_nand_platform_data *pdata, + const struct mxs_gpmi_nand_data *data); + /* i2c */ struct mxs_mxs_i2c_data { int id; diff --git a/include/linux/mtd/gpmi-nand.h b/include/linux/mtd/gpmi-nand.h new file mode 100644 index 0000000..69b6dbf --- /dev/null +++ b/include/linux/mtd/gpmi-nand.h @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef __MACH_MXS_GPMI_NAND_H__ +#define __MACH_MXS_GPMI_NAND_H__ + +/* The size of the resources is fixed. */ +#define GPMI_NAND_RES_SIZE 6 + +/* Resource names for the GPMI NAND driver. */ +#define GPMI_NAND_GPMI_REGS_ADDR_RES_NAME "GPMI NAND GPMI Registers" +#define GPMI_NAND_GPMI_INTERRUPT_RES_NAME "GPMI NAND GPMI Interrupt" +#define GPMI_NAND_BCH_REGS_ADDR_RES_NAME "GPMI NAND BCH Registers" +#define GPMI_NAND_BCH_INTERRUPT_RES_NAME "GPMI NAND BCH Interrupt" +#define GPMI_NAND_DMA_CHANNELS_RES_NAME "GPMI NAND DMA Channels" +#define GPMI_NAND_DMA_INTERRUPT_RES_NAME "GPMI NAND DMA Interrupt" + +/** + * struct gpmi_nand_platform_data - GPMI NAND driver platform data. + * + * This structure communicates platform-specific information to the GPMI NAND + * driver that can't be expressed as resources. + * + * @platform_init: A pointer to a function the driver will call to + * initialize the platform (e.g., set up the pin mux). + * @min_prop_delay_in_ns: Minimum propagation delay of GPMI signals to and + * from the NAND Flash device, in nanoseconds. + * @max_prop_delay_in_ns: Maximum propagation delay of GPMI signals to and + * from the NAND Flash device, in nanoseconds. + * @max_chip_count: The maximum number of chips for which the driver + * should configure the hardware. This value most + * likely reflects the number of pins that are + * connected to a NAND Flash device. If this is + * greater than the SoC hardware can support, the + * driver will print a message and fail to initialize. + * @partitions: An optional pointer to an array of partition + * descriptions. + * @partition_count: The number of elements in the partitions array. + */ +struct gpmi_nand_platform_data { + /* SoC hardware information. */ + int (*platform_init)(void); + + /* NAND Flash information. */ + unsigned int min_prop_delay_in_ns; + unsigned int max_prop_delay_in_ns; + unsigned int max_chip_count; + + /* Medium information. */ + struct mtd_partition *partitions; + unsigned partition_count; +}; +#endif -- 1.7.0.4 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v7 2/4] ARM: mxs: add new a pad control 2011-07-11 8:01 ` Huang Shijie @ 2011-07-11 8:01 ` Huang Shijie -1 siblings, 0 replies; 14+ messages in thread From: Huang Shijie @ 2011-07-11 8:01 UTC (permalink / raw) To: s.hauer Cc: arnd, w.sang, Huang Shijie, linux-mtd, u.kleine-koenig, shijie8, linux-arm-kernel, LW add a new pad control which is used in some rare cases, such as gpmi-nand device. Signed-off-by: Huang Shijie <b32955@freescale.com> --- arch/arm/mach-mxs/include/mach/iomux.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-mxs/include/mach/iomux.h b/arch/arm/mach-mxs/include/mach/iomux.h index 7abdf58..1b6f55a 100644 --- a/arch/arm/mach-mxs/include/mach/iomux.h +++ b/arch/arm/mach-mxs/include/mach/iomux.h @@ -93,6 +93,7 @@ typedef u32 iomux_cfg_t; /* generic pad control used in most cases */ #define MXS_PAD_CTRL (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL) +#define MXS_PAD_CTRL_12MA (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_NOPULL) #define MXS_IOMUX_PAD(_bank, _pin, _muxsel, _ma, _vol, _pull) \ (((iomux_cfg_t)(_bank) << MXS_PAD_BANK_SHIFT) | \ -- 1.7.0.4 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v7 2/4] ARM: mxs: add new a pad control @ 2011-07-11 8:01 ` Huang Shijie 0 siblings, 0 replies; 14+ messages in thread From: Huang Shijie @ 2011-07-11 8:01 UTC (permalink / raw) To: linux-arm-kernel add a new pad control which is used in some rare cases, such as gpmi-nand device. Signed-off-by: Huang Shijie <b32955@freescale.com> --- arch/arm/mach-mxs/include/mach/iomux.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-mxs/include/mach/iomux.h b/arch/arm/mach-mxs/include/mach/iomux.h index 7abdf58..1b6f55a 100644 --- a/arch/arm/mach-mxs/include/mach/iomux.h +++ b/arch/arm/mach-mxs/include/mach/iomux.h @@ -93,6 +93,7 @@ typedef u32 iomux_cfg_t; /* generic pad control used in most cases */ #define MXS_PAD_CTRL (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL) +#define MXS_PAD_CTRL_12MA (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_NOPULL) #define MXS_IOMUX_PAD(_bank, _pin, _muxsel, _ma, _vol, _pull) \ (((iomux_cfg_t)(_bank) << MXS_PAD_BANK_SHIFT) | \ -- 1.7.0.4 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v7 3/4] ARM: mxs/mx23evk: add GPMI-NAND device 2011-07-11 8:01 ` Huang Shijie @ 2011-07-11 8:01 ` Huang Shijie -1 siblings, 0 replies; 14+ messages in thread From: Huang Shijie @ 2011-07-11 8:01 UTC (permalink / raw) To: s.hauer Cc: arnd, w.sang, Huang Shijie, linux-mtd, u.kleine-koenig, shijie8, linux-arm-kernel, LW add the GPMI-NAND device for mx23evk board. Signed-off-by: Huang Shijie <b32955@freescale.com> --- arch/arm/mach-mxs/Kconfig | 1 + arch/arm/mach-mxs/mach-mx23evk.c | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig index 1d3985f..ec337d0 100644 --- a/arch/arm/mach-mxs/Kconfig +++ b/arch/arm/mach-mxs/Kconfig @@ -32,6 +32,7 @@ config MACH_MX23EVK select SOC_IMX23 select MXS_HAVE_AMBA_DUART select MXS_HAVE_PLATFORM_AUART + select MXS_HAVE_PLATFORM_GPMI_NAND select MXS_HAVE_PLATFORM_MXS_MMC select MXS_HAVE_PLATFORM_MXSFB help diff --git a/arch/arm/mach-mxs/mach-mx23evk.c b/arch/arm/mach-mxs/mach-mx23evk.c index 3c2de33..d55ee6f 100644 --- a/arch/arm/mach-mxs/mach-mx23evk.c +++ b/arch/arm/mach-mxs/mach-mx23evk.c @@ -107,6 +107,41 @@ static const iomux_cfg_t mx23evk_pads[] __initconst = { (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL), }; +/* gpmi-nand */ +static iomux_cfg_t mx23evk_gpmi_nand_pads[] = { + MX23_PAD_GPMI_D00__GPMI_D00 | MXS_PAD_CTRL, + MX23_PAD_GPMI_D01__GPMI_D01 | MXS_PAD_CTRL, + MX23_PAD_GPMI_D02__GPMI_D02 | MXS_PAD_CTRL, + MX23_PAD_GPMI_D03__GPMI_D03 | MXS_PAD_CTRL, + MX23_PAD_GPMI_D04__GPMI_D04 | MXS_PAD_CTRL, + MX23_PAD_GPMI_D05__GPMI_D05 | MXS_PAD_CTRL, + MX23_PAD_GPMI_D06__GPMI_D06 | MXS_PAD_CTRL, + MX23_PAD_GPMI_D07__GPMI_D07 | MXS_PAD_CTRL, + MX23_PAD_GPMI_CLE__GPMI_CLE | MXS_PAD_CTRL, + MX23_PAD_GPMI_ALE__GPMI_ALE | MXS_PAD_CTRL, + MX23_PAD_GPMI_WPN__GPMI_WPN | MXS_PAD_CTRL_12MA, + MX23_PAD_GPMI_WRN__GPMI_WRN | MXS_PAD_CTRL_12MA, + MX23_PAD_GPMI_RDN__GPMI_RDN | MXS_PAD_CTRL_12MA, + MX23_PAD_GPMI_RDY0__GPMI_RDY0 | MXS_PAD_CTRL, + MX23_PAD_GPMI_RDY1__GPMI_RDY1 | MXS_PAD_CTRL, + MX23_PAD_GPMI_CE0N__GPMI_CE0N | MXS_PAD_CTRL, + MX23_PAD_GPMI_CE1N__GPMI_CE1N | MXS_PAD_CTRL, +}; + +static int mx23evk_gpmi_nand_platform_init(void) +{ + return mxs_iomux_setup_multiple_pads(mx23evk_gpmi_nand_pads, + ARRAY_SIZE(mx23evk_gpmi_nand_pads)); +} + +static const +struct gpmi_nand_platform_data mx23evk_gpmi_nand_data __initconst = { + .platform_init = mx23evk_gpmi_nand_platform_init, + .min_prop_delay_in_ns = 5, + .max_prop_delay_in_ns = 9, + .max_chip_count = 1, +}; + /* mxsfb (lcdif) */ static struct fb_videomode mx23evk_video_modes[] = { { @@ -166,6 +201,7 @@ static void __init mx23evk_init(void) else gpio_set_value(MX23EVK_BL_ENABLE, 1); + mx23_add_gpmi_nand(&mx23evk_gpmi_nand_data); mx23_add_mxsfb(&mx23evk_mxsfb_pdata); } -- 1.7.0.4 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v7 3/4] ARM: mxs/mx23evk: add GPMI-NAND device @ 2011-07-11 8:01 ` Huang Shijie 0 siblings, 0 replies; 14+ messages in thread From: Huang Shijie @ 2011-07-11 8:01 UTC (permalink / raw) To: linux-arm-kernel add the GPMI-NAND device for mx23evk board. Signed-off-by: Huang Shijie <b32955@freescale.com> --- arch/arm/mach-mxs/Kconfig | 1 + arch/arm/mach-mxs/mach-mx23evk.c | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig index 1d3985f..ec337d0 100644 --- a/arch/arm/mach-mxs/Kconfig +++ b/arch/arm/mach-mxs/Kconfig @@ -32,6 +32,7 @@ config MACH_MX23EVK select SOC_IMX23 select MXS_HAVE_AMBA_DUART select MXS_HAVE_PLATFORM_AUART + select MXS_HAVE_PLATFORM_GPMI_NAND select MXS_HAVE_PLATFORM_MXS_MMC select MXS_HAVE_PLATFORM_MXSFB help diff --git a/arch/arm/mach-mxs/mach-mx23evk.c b/arch/arm/mach-mxs/mach-mx23evk.c index 3c2de33..d55ee6f 100644 --- a/arch/arm/mach-mxs/mach-mx23evk.c +++ b/arch/arm/mach-mxs/mach-mx23evk.c @@ -107,6 +107,41 @@ static const iomux_cfg_t mx23evk_pads[] __initconst = { (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL), }; +/* gpmi-nand */ +static iomux_cfg_t mx23evk_gpmi_nand_pads[] = { + MX23_PAD_GPMI_D00__GPMI_D00 | MXS_PAD_CTRL, + MX23_PAD_GPMI_D01__GPMI_D01 | MXS_PAD_CTRL, + MX23_PAD_GPMI_D02__GPMI_D02 | MXS_PAD_CTRL, + MX23_PAD_GPMI_D03__GPMI_D03 | MXS_PAD_CTRL, + MX23_PAD_GPMI_D04__GPMI_D04 | MXS_PAD_CTRL, + MX23_PAD_GPMI_D05__GPMI_D05 | MXS_PAD_CTRL, + MX23_PAD_GPMI_D06__GPMI_D06 | MXS_PAD_CTRL, + MX23_PAD_GPMI_D07__GPMI_D07 | MXS_PAD_CTRL, + MX23_PAD_GPMI_CLE__GPMI_CLE | MXS_PAD_CTRL, + MX23_PAD_GPMI_ALE__GPMI_ALE | MXS_PAD_CTRL, + MX23_PAD_GPMI_WPN__GPMI_WPN | MXS_PAD_CTRL_12MA, + MX23_PAD_GPMI_WRN__GPMI_WRN | MXS_PAD_CTRL_12MA, + MX23_PAD_GPMI_RDN__GPMI_RDN | MXS_PAD_CTRL_12MA, + MX23_PAD_GPMI_RDY0__GPMI_RDY0 | MXS_PAD_CTRL, + MX23_PAD_GPMI_RDY1__GPMI_RDY1 | MXS_PAD_CTRL, + MX23_PAD_GPMI_CE0N__GPMI_CE0N | MXS_PAD_CTRL, + MX23_PAD_GPMI_CE1N__GPMI_CE1N | MXS_PAD_CTRL, +}; + +static int mx23evk_gpmi_nand_platform_init(void) +{ + return mxs_iomux_setup_multiple_pads(mx23evk_gpmi_nand_pads, + ARRAY_SIZE(mx23evk_gpmi_nand_pads)); +} + +static const +struct gpmi_nand_platform_data mx23evk_gpmi_nand_data __initconst = { + .platform_init = mx23evk_gpmi_nand_platform_init, + .min_prop_delay_in_ns = 5, + .max_prop_delay_in_ns = 9, + .max_chip_count = 1, +}; + /* mxsfb (lcdif) */ static struct fb_videomode mx23evk_video_modes[] = { { @@ -166,6 +201,7 @@ static void __init mx23evk_init(void) else gpio_set_value(MX23EVK_BL_ENABLE, 1); + mx23_add_gpmi_nand(&mx23evk_gpmi_nand_data); mx23_add_mxsfb(&mx23evk_mxsfb_pdata); } -- 1.7.0.4 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v7 4/4] ARM: mxs/mx28evk: add GPMI-NAND device 2011-07-11 8:01 ` Huang Shijie @ 2011-07-11 8:01 ` Huang Shijie -1 siblings, 0 replies; 14+ messages in thread From: Huang Shijie @ 2011-07-11 8:01 UTC (permalink / raw) To: s.hauer Cc: arnd, w.sang, Huang Shijie, linux-mtd, u.kleine-koenig, shijie8, linux-arm-kernel, LW add GPMI-NAND device for mx28evk board. Signed-off-by: Huang Shijie <b32955@freescale.com> --- arch/arm/mach-mxs/Kconfig | 1 + arch/arm/mach-mxs/mach-mx28evk.c | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig index ec337d0..f13e9c1 100644 --- a/arch/arm/mach-mxs/Kconfig +++ b/arch/arm/mach-mxs/Kconfig @@ -47,6 +47,7 @@ config MACH_MX28EVK select MXS_HAVE_PLATFORM_AUART select MXS_HAVE_PLATFORM_FEC select MXS_HAVE_PLATFORM_FLEXCAN + select MXS_HAVE_PLATFORM_GPMI_NAND select MXS_HAVE_PLATFORM_MXS_MMC select MXS_HAVE_PLATFORM_MXSFB select MXS_OCOTP diff --git a/arch/arm/mach-mxs/mach-mx28evk.c b/arch/arm/mach-mxs/mach-mx28evk.c index eaaf6ff..d26bc22 100644 --- a/arch/arm/mach-mxs/mach-mx28evk.c +++ b/arch/arm/mach-mxs/mach-mx28evk.c @@ -314,6 +314,41 @@ static const struct flexcan_platform_data } }; +/* gpmi-nand */ +static iomux_cfg_t mx28evk_gpmi_nand_pads[] = { + MX28_PAD_GPMI_D00__GPMI_D0 | MXS_PAD_CTRL, + MX28_PAD_GPMI_D01__GPMI_D1 | MXS_PAD_CTRL, + MX28_PAD_GPMI_D02__GPMI_D2 | MXS_PAD_CTRL, + MX28_PAD_GPMI_D03__GPMI_D3 | MXS_PAD_CTRL, + MX28_PAD_GPMI_D04__GPMI_D4 | MXS_PAD_CTRL, + MX28_PAD_GPMI_D05__GPMI_D5 | MXS_PAD_CTRL, + MX28_PAD_GPMI_D06__GPMI_D6 | MXS_PAD_CTRL, + MX28_PAD_GPMI_D07__GPMI_D7 | MXS_PAD_CTRL, + MX28_PAD_GPMI_ALE__GPMI_ALE | MXS_PAD_CTRL, + MX28_PAD_GPMI_CLE__GPMI_CLE | MXS_PAD_CTRL, + MX28_PAD_GPMI_CE0N__GPMI_CE0N | MXS_PAD_CTRL, + MX28_PAD_GPMI_CE1N__GPMI_CE1N | MXS_PAD_CTRL, + MX28_PAD_GPMI_RDY0__GPMI_READY0 | MXS_PAD_CTRL, + MX28_PAD_GPMI_RDY1__GPMI_READY1 | MXS_PAD_CTRL, + MX28_PAD_GPMI_RDN__GPMI_RDN | MXS_PAD_CTRL_12MA, + MX28_PAD_GPMI_WRN__GPMI_WRN | MXS_PAD_CTRL_12MA, + MX28_PAD_GPMI_RESETN__GPMI_RESETN | MXS_PAD_CTRL_12MA, +}; + +static int mx28evk_gpmi_nand_platform_init(void) +{ + return mxs_iomux_setup_multiple_pads(mx28evk_gpmi_nand_pads, + ARRAY_SIZE(mx28evk_gpmi_nand_pads)); +} + +static const struct gpmi_nand_platform_data +mx28evk_gpmi_nand_data __initconst = { + .platform_init = mx28evk_gpmi_nand_platform_init, + .min_prop_delay_in_ns = 5, + .max_prop_delay_in_ns = 9, + .max_chip_count = 1, +}; + /* mxsfb (lcdif) */ static struct fb_videomode mx28evk_video_modes[] = { { @@ -390,6 +425,7 @@ static void __init mx28evk_init(void) else gpio_set_value(MX28EVK_BL_ENABLE, 1); + mx28_add_gpmi_nand(&mx28evk_gpmi_nand_data); mx28_add_mxsfb(&mx28evk_mxsfb_pdata); /* power on mmc slot by writing 0 to the gpio */ -- 1.7.0.4 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v7 4/4] ARM: mxs/mx28evk: add GPMI-NAND device @ 2011-07-11 8:01 ` Huang Shijie 0 siblings, 0 replies; 14+ messages in thread From: Huang Shijie @ 2011-07-11 8:01 UTC (permalink / raw) To: linux-arm-kernel add GPMI-NAND device for mx28evk board. Signed-off-by: Huang Shijie <b32955@freescale.com> --- arch/arm/mach-mxs/Kconfig | 1 + arch/arm/mach-mxs/mach-mx28evk.c | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig index ec337d0..f13e9c1 100644 --- a/arch/arm/mach-mxs/Kconfig +++ b/arch/arm/mach-mxs/Kconfig @@ -47,6 +47,7 @@ config MACH_MX28EVK select MXS_HAVE_PLATFORM_AUART select MXS_HAVE_PLATFORM_FEC select MXS_HAVE_PLATFORM_FLEXCAN + select MXS_HAVE_PLATFORM_GPMI_NAND select MXS_HAVE_PLATFORM_MXS_MMC select MXS_HAVE_PLATFORM_MXSFB select MXS_OCOTP diff --git a/arch/arm/mach-mxs/mach-mx28evk.c b/arch/arm/mach-mxs/mach-mx28evk.c index eaaf6ff..d26bc22 100644 --- a/arch/arm/mach-mxs/mach-mx28evk.c +++ b/arch/arm/mach-mxs/mach-mx28evk.c @@ -314,6 +314,41 @@ static const struct flexcan_platform_data } }; +/* gpmi-nand */ +static iomux_cfg_t mx28evk_gpmi_nand_pads[] = { + MX28_PAD_GPMI_D00__GPMI_D0 | MXS_PAD_CTRL, + MX28_PAD_GPMI_D01__GPMI_D1 | MXS_PAD_CTRL, + MX28_PAD_GPMI_D02__GPMI_D2 | MXS_PAD_CTRL, + MX28_PAD_GPMI_D03__GPMI_D3 | MXS_PAD_CTRL, + MX28_PAD_GPMI_D04__GPMI_D4 | MXS_PAD_CTRL, + MX28_PAD_GPMI_D05__GPMI_D5 | MXS_PAD_CTRL, + MX28_PAD_GPMI_D06__GPMI_D6 | MXS_PAD_CTRL, + MX28_PAD_GPMI_D07__GPMI_D7 | MXS_PAD_CTRL, + MX28_PAD_GPMI_ALE__GPMI_ALE | MXS_PAD_CTRL, + MX28_PAD_GPMI_CLE__GPMI_CLE | MXS_PAD_CTRL, + MX28_PAD_GPMI_CE0N__GPMI_CE0N | MXS_PAD_CTRL, + MX28_PAD_GPMI_CE1N__GPMI_CE1N | MXS_PAD_CTRL, + MX28_PAD_GPMI_RDY0__GPMI_READY0 | MXS_PAD_CTRL, + MX28_PAD_GPMI_RDY1__GPMI_READY1 | MXS_PAD_CTRL, + MX28_PAD_GPMI_RDN__GPMI_RDN | MXS_PAD_CTRL_12MA, + MX28_PAD_GPMI_WRN__GPMI_WRN | MXS_PAD_CTRL_12MA, + MX28_PAD_GPMI_RESETN__GPMI_RESETN | MXS_PAD_CTRL_12MA, +}; + +static int mx28evk_gpmi_nand_platform_init(void) +{ + return mxs_iomux_setup_multiple_pads(mx28evk_gpmi_nand_pads, + ARRAY_SIZE(mx28evk_gpmi_nand_pads)); +} + +static const struct gpmi_nand_platform_data +mx28evk_gpmi_nand_data __initconst = { + .platform_init = mx28evk_gpmi_nand_platform_init, + .min_prop_delay_in_ns = 5, + .max_prop_delay_in_ns = 9, + .max_chip_count = 1, +}; + /* mxsfb (lcdif) */ static struct fb_videomode mx28evk_video_modes[] = { { @@ -390,6 +425,7 @@ static void __init mx28evk_init(void) else gpio_set_value(MX28EVK_BL_ENABLE, 1); + mx28_add_gpmi_nand(&mx28evk_gpmi_nand_data); mx28_add_mxsfb(&mx28evk_mxsfb_pdata); /* power on mmc slot by writing 0 to the gpio */ -- 1.7.0.4 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH v7 0/4] add the GPMI-NAND support for imx23/imx28 2011-07-11 8:01 ` Huang Shijie @ 2011-07-11 11:00 ` Wolfram Sang -1 siblings, 0 replies; 14+ messages in thread From: Wolfram Sang @ 2011-07-11 11:00 UTC (permalink / raw) To: Huang Shijie Cc: arnd, s.hauer, linux-mtd, u.kleine-koenig, shijie8, linux-arm-kernel, LW [-- Attachment #1: Type: text/plain, Size: 886 bytes --] Hi, On Mon, Jul 11, 2011 at 04:01:02PM +0800, Huang Shijie wrote: > The general-purpose media interface(GPMI) controller is a flexible interface > to up to several NAND flashs. > > The Bose Ray-Choudhury Hocquenghem(BCH) module is a hardware ECC accelerator. > > With the help of BCH, the GPMI controller can choose to do the hardware ECC or > not. > > v6 --> v7: > [0] rename RES_SIZE to GPMI_NAND_RES_SIZE. > [1] move gpmi-nand.h to `include/linux/mtd/` directory. > [2] remove comment for new pad control. > [3] others Could you also post a driver which is adapted to all these changes? The series looks good now; still I want to test it a little just to make sure... Thanks, Wolfram -- Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ | [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 198 bytes --] ^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v7 0/4] add the GPMI-NAND support for imx23/imx28 @ 2011-07-11 11:00 ` Wolfram Sang 0 siblings, 0 replies; 14+ messages in thread From: Wolfram Sang @ 2011-07-11 11:00 UTC (permalink / raw) To: linux-arm-kernel Hi, On Mon, Jul 11, 2011 at 04:01:02PM +0800, Huang Shijie wrote: > The general-purpose media interface(GPMI) controller is a flexible interface > to up to several NAND flashs. > > The Bose Ray-Choudhury Hocquenghem(BCH) module is a hardware ECC accelerator. > > With the help of BCH, the GPMI controller can choose to do the hardware ECC or > not. > > v6 --> v7: > [0] rename RES_SIZE to GPMI_NAND_RES_SIZE. > [1] move gpmi-nand.h to `include/linux/mtd/` directory. > [2] remove comment for new pad control. > [3] others Could you also post a driver which is adapted to all these changes? The series looks good now; still I want to test it a little just to make sure... Thanks, Wolfram -- Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ | -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110711/2e3b0e8b/attachment.sig> ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v7 0/4] add the GPMI-NAND support for imx23/imx28 2011-07-11 11:00 ` Wolfram Sang @ 2011-07-11 15:19 ` Huang Shijie -1 siblings, 0 replies; 14+ messages in thread From: Huang Shijie @ 2011-07-11 15:19 UTC (permalink / raw) To: Wolfram Sang Cc: arnd, s.hauer, Huang Shijie, linux-mtd, u.kleine-koenig, linux-arm-kernel, LW Hi: On Mon, Jul 11, 2011 at 7:00 AM, Wolfram Sang <w.sang@pengutronix.de> wrote: > Hi, > > On Mon, Jul 11, 2011 at 04:01:02PM +0800, Huang Shijie wrote: > >> The general-purpose media interface(GPMI) controller is a flexible interface >> to up to several NAND flashs. >> >> The Bose Ray-Choudhury Hocquenghem(BCH) module is a hardware ECC accelerator. >> >> With the help of BCH, the GPMI controller can choose to do the hardware ECC or >> not. >> >> v6 --> v7: >> [0] rename RES_SIZE to GPMI_NAND_RES_SIZE. >> [1] move gpmi-nand.h to `include/linux/mtd/` directory. >> [2] remove comment for new pad control. >> [3] others > > Could you also post a driver which is adapted to all these changes? > The series looks good now; still I want to test it a little just to make > sure... ok. I will sent out the GPMI driver as soon as possible. Best Regards Huang Shijie > > Thanks, > > Wolfram > > -- > Pengutronix e.K. | Wolfram Sang | > Industrial Linux Solutions | http://www.pengutronix.de/ | > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.10 (GNU/Linux) > > iEYEARECAAYFAk4a18gACgkQD27XaX1/VRsCUQCfeXzR64/uz3n97nbdrTGxH86+ > 3lUAmweRWjZlouL+9cdGiuu8gz4CzNhH > =CQJw > -----END PGP SIGNATURE----- > > ^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v7 0/4] add the GPMI-NAND support for imx23/imx28 @ 2011-07-11 15:19 ` Huang Shijie 0 siblings, 0 replies; 14+ messages in thread From: Huang Shijie @ 2011-07-11 15:19 UTC (permalink / raw) To: linux-arm-kernel Hi: On Mon, Jul 11, 2011 at 7:00 AM, Wolfram Sang <w.sang@pengutronix.de> wrote: > Hi, > > On Mon, Jul 11, 2011 at 04:01:02PM +0800, Huang Shijie wrote: > >> The general-purpose media interface(GPMI) controller is a flexible interface >> to up to several NAND flashs. >> >> The Bose Ray-Choudhury Hocquenghem(BCH) module is a hardware ECC accelerator. >> >> With the help of BCH, the GPMI controller can choose to do the hardware ECC or >> not. >> >> v6 --> v7: >> ? ? ? [0] rename RES_SIZE to GPMI_NAND_RES_SIZE. >> ? ? ? [1] move gpmi-nand.h to `include/linux/mtd/` directory. >> ? ? ? [2] remove comment for new pad control. >> ? ? ? [3] others > > Could you also post a driver which is adapted to all these changes? > The series looks good now; still I want to test it a little just to make > sure... ok. I will sent out the GPMI driver as soon as possible. Best Regards Huang Shijie > > Thanks, > > ? Wolfram > > -- > Pengutronix e.K. ? ? ? ? ? ? ? ? ? ? ? ? ? | Wolfram Sang ? ? ? ? ? ? ? ?| > Industrial Linux Solutions ? ? ? ? ? ? ? ? | http://www.pengutronix.de/ ?| > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.10 (GNU/Linux) > > iEYEARECAAYFAk4a18gACgkQD27XaX1/VRsCUQCfeXzR64/uz3n97nbdrTGxH86+ > 3lUAmweRWjZlouL+9cdGiuu8gz4CzNhH > =CQJw > -----END PGP SIGNATURE----- > > ^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2011-07-11 15:19 UTC | newest] Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2011-07-11 8:01 [PATCH v7 0/4] add the GPMI-NAND support for imx23/imx28 Huang Shijie 2011-07-11 8:01 ` Huang Shijie 2011-07-11 8:01 ` [PATCH v7 1/4] ARM: mxs: add " Huang Shijie 2011-07-11 8:01 ` Huang Shijie 2011-07-11 8:01 ` [PATCH v7 2/4] ARM: mxs: add new a pad control Huang Shijie 2011-07-11 8:01 ` Huang Shijie 2011-07-11 8:01 ` [PATCH v7 3/4] ARM: mxs/mx23evk: add GPMI-NAND device Huang Shijie 2011-07-11 8:01 ` Huang Shijie 2011-07-11 8:01 ` [PATCH v7 4/4] ARM: mxs/mx28evk: " Huang Shijie 2011-07-11 8:01 ` Huang Shijie 2011-07-11 11:00 ` [PATCH v7 0/4] add the GPMI-NAND support for imx23/imx28 Wolfram Sang 2011-07-11 11:00 ` Wolfram Sang 2011-07-11 15:19 ` Huang Shijie 2011-07-11 15:19 ` Huang Shijie
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.