diff options
author | Alexander Shiyan <shc_work@mail.ru> | 2012-11-17 08:57:19 -0500 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2012-11-21 12:57:44 -0500 |
commit | e377ca1e32f66378cc6d0562851bfc51126865ea (patch) | |
tree | 132588c9d007c6fbc47ca52e0c2b05f77181f5d0 /arch/arm/mach-clps711x/p720t.c | |
parent | 87c37b51ade7d1296ab99ed8f237637bed7779c7 (diff) |
ARM: clps711x: p720t: Special driver for handling NAND memory is removed
This patch provide migration to using "gpio-nand" driver instead of using
special driver for handling NAND memory.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/mach-clps711x/p720t.c')
-rw-r--r-- | arch/arm/mach-clps711x/p720t.c | 50 |
1 files changed, 48 insertions, 2 deletions
diff --git a/arch/arm/mach-clps711x/p720t.c b/arch/arm/mach-clps711x/p720t.c index 34c8ee9ebb5e..e25f10ed5606 100644 --- a/arch/arm/mach-clps711x/p720t.c +++ b/arch/arm/mach-clps711x/p720t.c | |||
@@ -26,6 +26,8 @@ | |||
26 | #include <linux/slab.h> | 26 | #include <linux/slab.h> |
27 | #include <linux/leds.h> | 27 | #include <linux/leds.h> |
28 | #include <linux/platform_device.h> | 28 | #include <linux/platform_device.h> |
29 | #include <linux/mtd/partitions.h> | ||
30 | #include <linux/mtd/nand-gpio.h> | ||
29 | 31 | ||
30 | #include <mach/hardware.h> | 32 | #include <mach/hardware.h> |
31 | #include <asm/pgtable.h> | 33 | #include <asm/pgtable.h> |
@@ -41,7 +43,50 @@ | |||
41 | 43 | ||
42 | #include "common.h" | 44 | #include "common.h" |
43 | 45 | ||
44 | #define GPIO_USERLED CLPS711X_GPIO(3, 0) | 46 | #define P720T_USERLED CLPS711X_GPIO(3, 0) |
47 | #define P720T_NAND_CLE CLPS711X_GPIO(4, 0) | ||
48 | #define P720T_NAND_ALE CLPS711X_GPIO(4, 1) | ||
49 | #define P720T_NAND_NCE CLPS711X_GPIO(4, 2) | ||
50 | |||
51 | #define P720T_NAND_BASE (CLPS711X_SDRAM1_BASE) | ||
52 | |||
53 | static struct resource p720t_nand_resource[] __initdata = { | ||
54 | DEFINE_RES_MEM(P720T_NAND_BASE, SZ_4), | ||
55 | }; | ||
56 | |||
57 | static struct mtd_partition p720t_nand_parts[] __initdata = { | ||
58 | { | ||
59 | .name = "Flash partition 1", | ||
60 | .offset = 0, | ||
61 | .size = SZ_2M, | ||
62 | }, | ||
63 | { | ||
64 | .name = "Flash partition 2", | ||
65 | .offset = MTDPART_OFS_APPEND, | ||
66 | .size = MTDPART_SIZ_FULL, | ||
67 | }, | ||
68 | }; | ||
69 | |||
70 | static struct gpio_nand_platdata p720t_nand_pdata __initdata = { | ||
71 | .gpio_rdy = -1, | ||
72 | .gpio_nce = P720T_NAND_NCE, | ||
73 | .gpio_ale = P720T_NAND_ALE, | ||
74 | .gpio_cle = P720T_NAND_CLE, | ||
75 | .gpio_nwp = -1, | ||
76 | .chip_delay = 15, | ||
77 | .parts = p720t_nand_parts, | ||
78 | .num_parts = ARRAY_SIZE(p720t_nand_parts), | ||
79 | }; | ||
80 | |||
81 | static struct platform_device p720t_nand_pdev __initdata = { | ||
82 | .name = "gpio-nand", | ||
83 | .id = -1, | ||
84 | .resource = p720t_nand_resource, | ||
85 | .num_resources = ARRAY_SIZE(p720t_nand_resource), | ||
86 | .dev = { | ||
87 | .platform_data = &p720t_nand_pdata, | ||
88 | }, | ||
89 | }; | ||
45 | 90 | ||
46 | static void p720t_lcd_power_set(struct plat_lcd_data *pd, unsigned int power) | 91 | static void p720t_lcd_power_set(struct plat_lcd_data *pd, unsigned int power) |
47 | { | 92 | { |
@@ -127,7 +172,7 @@ static struct gpio_led p720t_gpio_leds[] = { | |||
127 | { | 172 | { |
128 | .name = "User LED", | 173 | .name = "User LED", |
129 | .default_trigger = "heartbeat", | 174 | .default_trigger = "heartbeat", |
130 | .gpio = GPIO_USERLED, | 175 | .gpio = P720T_USERLED, |
131 | }, | 176 | }, |
132 | }; | 177 | }; |
133 | 178 | ||
@@ -138,6 +183,7 @@ static struct gpio_led_platform_data p720t_gpio_led_pdata __initdata = { | |||
138 | 183 | ||
139 | static void __init p720t_init(void) | 184 | static void __init p720t_init(void) |
140 | { | 185 | { |
186 | platform_device_register(&p720t_nand_pdev); | ||
141 | platform_device_register_data(&platform_bus, "platform-lcd", 0, | 187 | platform_device_register_data(&platform_bus, "platform-lcd", 0, |
142 | &p720t_lcd_power_pdata, | 188 | &p720t_lcd_power_pdata, |
143 | sizeof(p720t_lcd_power_pdata)); | 189 | sizeof(p720t_lcd_power_pdata)); |