diff options
author | Alexander Shiyan <shc_work@mail.ru> | 2012-11-17 08:57:21 -0500 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2012-11-21 12:57:45 -0500 |
commit | 96754a1f8684792dc6cc5d4e886c511b255ef9be (patch) | |
tree | 595ca2e1b75f186b80d7b2db7f5b4f38c9bba17b | |
parent | 94760bf2523b4b5d3938e85ea0964ca7cd59a42b (diff) |
ARM: clps711x: edb7211: Add support for NOR-Flash
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Olof Johansson <olof@lixom.net>
-rw-r--r-- | arch/arm/mach-clps711x/edb7211.c | 45 | ||||
-rw-r--r-- | arch/arm/mach-clps711x/include/mach/hardware.h | 4 |
2 files changed, 35 insertions, 14 deletions
diff --git a/arch/arm/mach-clps711x/edb7211.c b/arch/arm/mach-clps711x/edb7211.c index d5832b3557a1..71aa5cf2c0d3 100644 --- a/arch/arm/mach-clps711x/edb7211.c +++ b/arch/arm/mach-clps711x/edb7211.c | |||
@@ -16,6 +16,9 @@ | |||
16 | #include <linux/backlight.h> | 16 | #include <linux/backlight.h> |
17 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
18 | 18 | ||
19 | #include <linux/mtd/physmap.h> | ||
20 | #include <linux/mtd/partitions.h> | ||
21 | |||
19 | #include <asm/setup.h> | 22 | #include <asm/setup.h> |
20 | #include <asm/mach/map.h> | 23 | #include <asm/mach/map.h> |
21 | #include <asm/mach/arch.h> | 24 | #include <asm/mach/arch.h> |
@@ -33,6 +36,8 @@ | |||
33 | #define EDB7211_LCDEN CLPS711X_GPIO(3, 2) | 36 | #define EDB7211_LCDEN CLPS711X_GPIO(3, 2) |
34 | #define EDB7211_LCDBL CLPS711X_GPIO(3, 3) | 37 | #define EDB7211_LCDBL CLPS711X_GPIO(3, 3) |
35 | 38 | ||
39 | #define EDB7211_FLASH0_BASE (CS0_PHYS_BASE) | ||
40 | #define EDB7211_FLASH1_BASE (CS1_PHYS_BASE) | ||
36 | #define EDB7211_CS8900_BASE (CS2_PHYS_BASE + 0x300) | 41 | #define EDB7211_CS8900_BASE (CS2_PHYS_BASE + 0x300) |
37 | #define EDB7211_CS8900_IRQ (IRQ_EINT3) | 42 | #define EDB7211_CS8900_IRQ (IRQ_EINT3) |
38 | 43 | ||
@@ -41,6 +46,35 @@ static struct resource edb7211_cs8900_resource[] __initdata = { | |||
41 | DEFINE_RES_IRQ(EDB7211_CS8900_IRQ), | 46 | DEFINE_RES_IRQ(EDB7211_CS8900_IRQ), |
42 | }; | 47 | }; |
43 | 48 | ||
49 | static struct mtd_partition edb7211_flash_partitions[] __initdata = { | ||
50 | { | ||
51 | .name = "Flash", | ||
52 | .offset = 0, | ||
53 | .size = MTDPART_SIZ_FULL, | ||
54 | }, | ||
55 | }; | ||
56 | |||
57 | static struct physmap_flash_data edb7211_flash_pdata __initdata = { | ||
58 | .width = 4, | ||
59 | .parts = edb7211_flash_partitions, | ||
60 | .nr_parts = ARRAY_SIZE(edb7211_flash_partitions), | ||
61 | }; | ||
62 | |||
63 | static struct resource edb7211_flash_resources[] __initdata = { | ||
64 | DEFINE_RES_MEM(EDB7211_FLASH0_BASE, SZ_8M), | ||
65 | DEFINE_RES_MEM(EDB7211_FLASH1_BASE, SZ_8M), | ||
66 | }; | ||
67 | |||
68 | static struct platform_device edb7211_flash_pdev __initdata = { | ||
69 | .name = "physmap-flash", | ||
70 | .id = 0, | ||
71 | .resource = edb7211_flash_resources, | ||
72 | .num_resources = ARRAY_SIZE(edb7211_flash_resources), | ||
73 | .dev = { | ||
74 | .platform_data = &edb7211_flash_pdata, | ||
75 | }, | ||
76 | }; | ||
77 | |||
44 | static void edb7211_lcd_power_set(struct plat_lcd_data *pd, unsigned int power) | 78 | static void edb7211_lcd_power_set(struct plat_lcd_data *pd, unsigned int power) |
45 | { | 79 | { |
46 | if (power) { | 80 | if (power) { |
@@ -82,16 +116,6 @@ static struct map_desc edb7211_io_desc[] __initdata = { | |||
82 | .pfn = __phys_to_pfn(EP7211_PHYS_EXTKBD), | 116 | .pfn = __phys_to_pfn(EP7211_PHYS_EXTKBD), |
83 | .length = SZ_1M, | 117 | .length = SZ_1M, |
84 | .type = MT_DEVICE, | 118 | .type = MT_DEVICE, |
85 | }, { /* Flash bank 0 */ | ||
86 | .virtual = IO_ADDRESS(EP7211_PHYS_FLASH1), | ||
87 | .pfn = __phys_to_pfn(EP7211_PHYS_FLASH1), | ||
88 | .length = SZ_8M, | ||
89 | .type = MT_DEVICE, | ||
90 | }, { /* Flash bank 1 */ | ||
91 | .virtual = IO_ADDRESS(EP7211_PHYS_FLASH2), | ||
92 | .pfn = __phys_to_pfn(EP7211_PHYS_FLASH2), | ||
93 | .length = SZ_8M, | ||
94 | .type = MT_DEVICE, | ||
95 | }, | 119 | }, |
96 | }; | 120 | }; |
97 | 121 | ||
@@ -129,6 +153,7 @@ static void __init edb7211_init(void) | |||
129 | { | 153 | { |
130 | gpio_request_array(edb7211_gpios, ARRAY_SIZE(edb7211_gpios)); | 154 | gpio_request_array(edb7211_gpios, ARRAY_SIZE(edb7211_gpios)); |
131 | 155 | ||
156 | platform_device_register(&edb7211_flash_pdev); | ||
132 | platform_device_register_data(&platform_bus, "platform-lcd", 0, | 157 | platform_device_register_data(&platform_bus, "platform-lcd", 0, |
133 | &edb7211_lcd_power_pdata, | 158 | &edb7211_lcd_power_pdata, |
134 | sizeof(edb7211_lcd_power_pdata)); | 159 | sizeof(edb7211_lcd_power_pdata)); |
diff --git a/arch/arm/mach-clps711x/include/mach/hardware.h b/arch/arm/mach-clps711x/include/mach/hardware.h index 1ebf7b9e69fc..2f23dd5d73e4 100644 --- a/arch/arm/mach-clps711x/include/mach/hardware.h +++ b/arch/arm/mach-clps711x/include/mach/hardware.h | |||
@@ -75,10 +75,6 @@ | |||
75 | /* The extra 8 lines of the keyboard matrix are wired to chip select 3 */ | 75 | /* The extra 8 lines of the keyboard matrix are wired to chip select 3 */ |
76 | #define EP7211_PHYS_EXTKBD CS3_PHYS_BASE | 76 | #define EP7211_PHYS_EXTKBD CS3_PHYS_BASE |
77 | 77 | ||
78 | /* The two flash banks are wired to chip selects 0 and 1 */ | ||
79 | #define EP7211_PHYS_FLASH1 CS0_PHYS_BASE | ||
80 | #define EP7211_PHYS_FLASH2 CS1_PHYS_BASE | ||
81 | |||
82 | #endif /* CONFIG_ARCH_EDB7211 */ | 78 | #endif /* CONFIG_ARCH_EDB7211 */ |
83 | 79 | ||
84 | #endif | 80 | #endif |