diff options
author | Huang Shijie <b32955@freescale.com> | 2012-02-06 00:08:21 -0500 |
---|---|---|
committer | Shawn Guo <shawn.guo@linaro.org> | 2012-02-11 10:39:53 -0500 |
commit | 60c15358f603ca21e791d2cc17029b620c625258 (patch) | |
tree | 07c1c1a6d03c9652e5f43419aa22a10f6e3caf3a /arch/arm/mach-mxs | |
parent | 62aa2b537c6f5957afd98e29f96897419ed5ebab (diff) |
ARM: mxs: add GPMI-NAND support for imx23/imx28
add GPMI-NAND support for imx23 and imx28.
Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Diffstat (limited to 'arch/arm/mach-mxs')
-rw-r--r-- | arch/arm/mach-mxs/clock-mx23.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-mxs/clock-mx28.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-mxs/devices-mx23.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-mxs/devices-mx28.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-mxs/devices/Kconfig | 3 | ||||
-rw-r--r-- | arch/arm/mach-mxs/devices/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-mxs/devices/platform-gpmi-nand.c | 81 | ||||
-rw-r--r-- | arch/arm/mach-mxs/include/mach/devices-common.h | 10 |
8 files changed, 105 insertions, 0 deletions
diff --git a/arch/arm/mach-mxs/clock-mx23.c b/arch/arm/mach-mxs/clock-mx23.c index e12e11231dc7..aec34712c321 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[] = { | |||
456 | _REGISTER_CLOCK("mxs-pwm.3", NULL, pwm_clk) | 456 | _REGISTER_CLOCK("mxs-pwm.3", NULL, pwm_clk) |
457 | _REGISTER_CLOCK("mxs-pwm.4", NULL, pwm_clk) | 457 | _REGISTER_CLOCK("mxs-pwm.4", NULL, pwm_clk) |
458 | _REGISTER_CLOCK("imx23-fb", NULL, lcdif_clk) | 458 | _REGISTER_CLOCK("imx23-fb", NULL, lcdif_clk) |
459 | _REGISTER_CLOCK("imx23-gpmi-nand", NULL, gpmi_clk) | ||
459 | }; | 460 | }; |
460 | 461 | ||
461 | static int clk_misc_init(void) | 462 | 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 5d68e4152220..8dd7b02a4b96 100644 --- a/arch/arm/mach-mxs/clock-mx28.c +++ b/arch/arm/mach-mxs/clock-mx28.c | |||
@@ -643,6 +643,7 @@ static struct clk_lookup lookups[] = { | |||
643 | _REGISTER_CLOCK("duart", NULL, uart_clk) | 643 | _REGISTER_CLOCK("duart", NULL, uart_clk) |
644 | _REGISTER_CLOCK("imx28-fec.0", NULL, fec_clk) | 644 | _REGISTER_CLOCK("imx28-fec.0", NULL, fec_clk) |
645 | _REGISTER_CLOCK("imx28-fec.1", NULL, fec_clk) | 645 | _REGISTER_CLOCK("imx28-fec.1", NULL, fec_clk) |
646 | _REGISTER_CLOCK("imx28-gpmi-nand", NULL, gpmi_clk) | ||
646 | _REGISTER_CLOCK("mxs-auart.0", NULL, uart_clk) | 647 | _REGISTER_CLOCK("mxs-auart.0", NULL, uart_clk) |
647 | _REGISTER_CLOCK("mxs-auart.1", NULL, uart_clk) | 648 | _REGISTER_CLOCK("mxs-auart.1", NULL, uart_clk) |
648 | _REGISTER_CLOCK("mxs-auart.2", NULL, uart_clk) | 649 | _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 3fa651d2c994..4d1329d59287 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; | |||
21 | #define mx23_add_auart0() mx23_add_auart(0) | 21 | #define mx23_add_auart0() mx23_add_auart(0) |
22 | #define mx23_add_auart1() mx23_add_auart(1) | 22 | #define mx23_add_auart1() mx23_add_auart(1) |
23 | 23 | ||
24 | extern const struct mxs_gpmi_nand_data mx23_gpmi_nand_data __initconst; | ||
25 | #define mx23_add_gpmi_nand(pdata) \ | ||
26 | mxs_add_gpmi_nand(pdata, &mx23_gpmi_nand_data) | ||
27 | |||
24 | extern const struct mxs_mxs_mmc_data mx23_mxs_mmc_data[] __initconst; | 28 | extern const struct mxs_mxs_mmc_data mx23_mxs_mmc_data[] __initconst; |
25 | #define mx23_add_mxs_mmc(id, pdata) \ | 29 | #define mx23_add_mxs_mmc(id, pdata) \ |
26 | mxs_add_mxs_mmc(&mx23_mxs_mmc_data[id], pdata) | 30 | 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 4f50094e293d..9dbeae130842 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; | |||
34 | #define mx28_add_flexcan0(pdata) mx28_add_flexcan(0, pdata) | 34 | #define mx28_add_flexcan0(pdata) mx28_add_flexcan(0, pdata) |
35 | #define mx28_add_flexcan1(pdata) mx28_add_flexcan(1, pdata) | 35 | #define mx28_add_flexcan1(pdata) mx28_add_flexcan(1, pdata) |
36 | 36 | ||
37 | extern const struct mxs_gpmi_nand_data mx28_gpmi_nand_data __initconst; | ||
38 | #define mx28_add_gpmi_nand(pdata) \ | ||
39 | mxs_add_gpmi_nand(pdata, &mx28_gpmi_nand_data) | ||
40 | |||
37 | extern const struct mxs_mxs_i2c_data mx28_mxs_i2c_data[] __initconst; | 41 | extern const struct mxs_mxs_i2c_data mx28_mxs_i2c_data[] __initconst; |
38 | #define mx28_add_mxs_i2c(id) mxs_add_mxs_i2c(&mx28_mxs_i2c_data[id]) | 42 | #define mx28_add_mxs_i2c(id) mxs_add_mxs_i2c(&mx28_mxs_i2c_data[id]) |
39 | 43 | ||
diff --git a/arch/arm/mach-mxs/devices/Kconfig b/arch/arm/mach-mxs/devices/Kconfig index 18b6bf526a27..b8913df4cfa2 100644 --- a/arch/arm/mach-mxs/devices/Kconfig +++ b/arch/arm/mach-mxs/devices/Kconfig | |||
@@ -12,6 +12,9 @@ config MXS_HAVE_PLATFORM_FLEXCAN | |||
12 | select HAVE_CAN_FLEXCAN if CAN | 12 | select HAVE_CAN_FLEXCAN if CAN |
13 | bool | 13 | bool |
14 | 14 | ||
15 | config MXS_HAVE_PLATFORM_GPMI_NAND | ||
16 | bool | ||
17 | |||
15 | config MXS_HAVE_PLATFORM_MXS_I2C | 18 | config MXS_HAVE_PLATFORM_MXS_I2C |
16 | bool | 19 | bool |
17 | 20 | ||
diff --git a/arch/arm/mach-mxs/devices/Makefile b/arch/arm/mach-mxs/devices/Makefile index f52e3e53baec..c8f5c9541a30 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 | |||
3 | obj-y += platform-dma.o | 3 | obj-y += platform-dma.o |
4 | obj-$(CONFIG_MXS_HAVE_PLATFORM_FEC) += platform-fec.o | 4 | obj-$(CONFIG_MXS_HAVE_PLATFORM_FEC) += platform-fec.o |
5 | obj-$(CONFIG_MXS_HAVE_PLATFORM_FLEXCAN) += platform-flexcan.o | 5 | obj-$(CONFIG_MXS_HAVE_PLATFORM_FLEXCAN) += platform-flexcan.o |
6 | obj-$(CONFIG_MXS_HAVE_PLATFORM_GPMI_NAND) += platform-gpmi-nand.o | ||
6 | obj-$(CONFIG_MXS_HAVE_PLATFORM_MXS_I2C) += platform-mxs-i2c.o | 7 | obj-$(CONFIG_MXS_HAVE_PLATFORM_MXS_I2C) += platform-mxs-i2c.o |
7 | obj-$(CONFIG_MXS_HAVE_PLATFORM_MXS_MMC) += platform-mxs-mmc.o | 8 | obj-$(CONFIG_MXS_HAVE_PLATFORM_MXS_MMC) += platform-mxs-mmc.o |
8 | obj-$(CONFIG_MXS_HAVE_PLATFORM_MXS_PWM) += platform-mxs-pwm.o | 9 | 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 000000000000..3e22df5944a8 --- /dev/null +++ b/arch/arm/mach-mxs/devices/platform-gpmi-nand.c | |||
@@ -0,0 +1,81 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
17 | */ | ||
18 | #include <asm/sizes.h> | ||
19 | #include <mach/mx23.h> | ||
20 | #include <mach/mx28.h> | ||
21 | #include <mach/devices-common.h> | ||
22 | #include <linux/dma-mapping.h> | ||
23 | |||
24 | #ifdef CONFIG_SOC_IMX23 | ||
25 | const struct mxs_gpmi_nand_data mx23_gpmi_nand_data __initconst = { | ||
26 | .devid = "imx23-gpmi-nand", | ||
27 | .res = { | ||
28 | /* GPMI */ | ||
29 | DEFINE_RES_MEM_NAMED(MX23_GPMI_BASE_ADDR, SZ_8K, | ||
30 | GPMI_NAND_GPMI_REGS_ADDR_RES_NAME), | ||
31 | DEFINE_RES_IRQ_NAMED(MX23_INT_GPMI_ATTENTION, | ||
32 | GPMI_NAND_GPMI_INTERRUPT_RES_NAME), | ||
33 | /* BCH */ | ||
34 | DEFINE_RES_MEM_NAMED(MX23_BCH_BASE_ADDR, SZ_8K, | ||
35 | GPMI_NAND_BCH_REGS_ADDR_RES_NAME), | ||
36 | DEFINE_RES_IRQ_NAMED(MX23_INT_BCH, | ||
37 | GPMI_NAND_BCH_INTERRUPT_RES_NAME), | ||
38 | /* DMA */ | ||
39 | DEFINE_RES_NAMED(MX23_DMA_GPMI0, | ||
40 | MX23_DMA_GPMI3 - MX23_DMA_GPMI0 + 1, | ||
41 | GPMI_NAND_DMA_CHANNELS_RES_NAME, | ||
42 | IORESOURCE_DMA), | ||
43 | DEFINE_RES_IRQ_NAMED(MX23_INT_GPMI_DMA, | ||
44 | GPMI_NAND_DMA_INTERRUPT_RES_NAME), | ||
45 | }, | ||
46 | }; | ||
47 | #endif | ||
48 | |||
49 | #ifdef CONFIG_SOC_IMX28 | ||
50 | const struct mxs_gpmi_nand_data mx28_gpmi_nand_data __initconst = { | ||
51 | .devid = "imx28-gpmi-nand", | ||
52 | .res = { | ||
53 | /* GPMI */ | ||
54 | DEFINE_RES_MEM_NAMED(MX28_GPMI_BASE_ADDR, SZ_8K, | ||
55 | GPMI_NAND_GPMI_REGS_ADDR_RES_NAME), | ||
56 | DEFINE_RES_IRQ_NAMED(MX28_INT_GPMI, | ||
57 | GPMI_NAND_GPMI_INTERRUPT_RES_NAME), | ||
58 | /* BCH */ | ||
59 | DEFINE_RES_MEM_NAMED(MX28_BCH_BASE_ADDR, SZ_8K, | ||
60 | GPMI_NAND_BCH_REGS_ADDR_RES_NAME), | ||
61 | DEFINE_RES_IRQ_NAMED(MX28_INT_BCH, | ||
62 | GPMI_NAND_BCH_INTERRUPT_RES_NAME), | ||
63 | /* DMA */ | ||
64 | DEFINE_RES_NAMED(MX28_DMA_GPMI0, | ||
65 | MX28_DMA_GPMI7 - MX28_DMA_GPMI0 + 1, | ||
66 | GPMI_NAND_DMA_CHANNELS_RES_NAME, | ||
67 | IORESOURCE_DMA), | ||
68 | DEFINE_RES_IRQ_NAMED(MX28_INT_GPMI_DMA, | ||
69 | GPMI_NAND_DMA_INTERRUPT_RES_NAME), | ||
70 | }, | ||
71 | }; | ||
72 | #endif | ||
73 | |||
74 | struct platform_device *__init | ||
75 | mxs_add_gpmi_nand(const struct gpmi_nand_platform_data *pdata, | ||
76 | const struct mxs_gpmi_nand_data *data) | ||
77 | { | ||
78 | return mxs_add_platform_device_dmamask(data->devid, -1, | ||
79 | data->res, GPMI_NAND_RES_SIZE, | ||
80 | pdata, sizeof(*pdata), DMA_BIT_MASK(32)); | ||
81 | } | ||
diff --git a/arch/arm/mach-mxs/include/mach/devices-common.h b/arch/arm/mach-mxs/include/mach/devices-common.h index dc369c1239fc..f2e383955d88 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( | |||
66 | const struct mxs_flexcan_data *data, | 66 | const struct mxs_flexcan_data *data, |
67 | const struct flexcan_platform_data *pdata); | 67 | const struct flexcan_platform_data *pdata); |
68 | 68 | ||
69 | /* gpmi-nand */ | ||
70 | #include <linux/mtd/gpmi-nand.h> | ||
71 | struct mxs_gpmi_nand_data { | ||
72 | const char *devid; | ||
73 | const struct resource res[GPMI_NAND_RES_SIZE]; | ||
74 | }; | ||
75 | struct platform_device *__init | ||
76 | mxs_add_gpmi_nand(const struct gpmi_nand_platform_data *pdata, | ||
77 | const struct mxs_gpmi_nand_data *data); | ||
78 | |||
69 | /* i2c */ | 79 | /* i2c */ |
70 | struct mxs_mxs_i2c_data { | 80 | struct mxs_mxs_i2c_data { |
71 | int id; | 81 | int id; |