aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-clps711x/cdb89712.c
diff options
context:
space:
mode:
authorAlexander Shiyan <shc_work@mail.ru>2012-11-17 08:57:12 -0500
committerOlof Johansson <olof@lixom.net>2012-11-21 12:57:41 -0500
commit86449336dd3c6e0edf97b971db2daa88917c1d7e (patch)
tree47059fc28b556d62909eebd18ef28235e690956b /arch/arm/mach-clps711x/cdb89712.c
parentea7d1bc97d91e9b83436a6188cde987aab79aacf (diff)
ARM: clps711x: cdb89712: Special driver for handling memory is removed
This patch provide migration to using "physmap-flash" and "mtd-ram" drivers instead of using special driver for handling 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/cdb89712.c')
-rw-r--r--arch/arm/mach-clps711x/cdb89712.c84
1 files changed, 84 insertions, 0 deletions
diff --git a/arch/arm/mach-clps711x/cdb89712.c b/arch/arm/mach-clps711x/cdb89712.c
index 235e6256775f..24f573b5715d 100644
--- a/arch/arm/mach-clps711x/cdb89712.c
+++ b/arch/arm/mach-clps711x/cdb89712.c
@@ -26,6 +26,10 @@
26#include <linux/interrupt.h> 26#include <linux/interrupt.h>
27#include <linux/platform_device.h> 27#include <linux/platform_device.h>
28 28
29#include <linux/mtd/physmap.h>
30#include <linux/mtd/plat-ram.h>
31#include <linux/mtd/partitions.h>
32
29#include <mach/hardware.h> 33#include <mach/hardware.h>
30#include <asm/pgtable.h> 34#include <asm/pgtable.h>
31#include <asm/page.h> 35#include <asm/page.h>
@@ -44,8 +48,88 @@ static struct resource cdb89712_cs8900_resource[] __initdata = {
44 DEFINE_RES_IRQ(CDB89712_CS8900_IRQ), 48 DEFINE_RES_IRQ(CDB89712_CS8900_IRQ),
45}; 49};
46 50
51static struct mtd_partition cdb89712_flash_partitions[] __initdata = {
52 {
53 .name = "Flash",
54 .offset = 0,
55 .size = MTDPART_SIZ_FULL,
56 },
57};
58
59static struct physmap_flash_data cdb89712_flash_pdata __initdata = {
60 .width = 4,
61 .probe_type = "map_rom",
62 .parts = cdb89712_flash_partitions,
63 .nr_parts = ARRAY_SIZE(cdb89712_flash_partitions),
64};
65
66static struct resource cdb89712_flash_resources[] __initdata = {
67 DEFINE_RES_MEM(CS0_PHYS_BASE, SZ_8M),
68};
69
70static struct platform_device cdb89712_flash_pdev __initdata = {
71 .name = "physmap-flash",
72 .id = 0,
73 .resource = cdb89712_flash_resources,
74 .num_resources = ARRAY_SIZE(cdb89712_flash_resources),
75 .dev = {
76 .platform_data = &cdb89712_flash_pdata,
77 },
78};
79
80static struct mtd_partition cdb89712_bootrom_partitions[] __initdata = {
81 {
82 .name = "BootROM",
83 .offset = 0,
84 .size = MTDPART_SIZ_FULL,
85 },
86};
87
88static struct physmap_flash_data cdb89712_bootrom_pdata __initdata = {
89 .width = 4,
90 .probe_type = "map_rom",
91 .parts = cdb89712_bootrom_partitions,
92 .nr_parts = ARRAY_SIZE(cdb89712_bootrom_partitions),
93};
94
95static struct resource cdb89712_bootrom_resources[] __initdata = {
96 DEFINE_RES_NAMED(CS7_PHYS_BASE, SZ_128, "BOOTROM", IORESOURCE_MEM |
97 IORESOURCE_CACHEABLE | IORESOURCE_READONLY),
98};
99
100static struct platform_device cdb89712_bootrom_pdev __initdata = {
101 .name = "physmap-flash",
102 .id = 1,
103 .resource = cdb89712_bootrom_resources,
104 .num_resources = ARRAY_SIZE(cdb89712_bootrom_resources),
105 .dev = {
106 .platform_data = &cdb89712_bootrom_pdata,
107 },
108};
109
110static struct platdata_mtd_ram cdb89712_sram_pdata __initdata = {
111 .bankwidth = 4,
112};
113
114static struct resource cdb89712_sram_resources[] __initdata = {
115 DEFINE_RES_MEM(CLPS711X_SRAM_BASE, CLPS711X_SRAM_SIZE),
116};
117
118static struct platform_device cdb89712_sram_pdev __initdata = {
119 .name = "mtd-ram",
120 .id = 0,
121 .resource = cdb89712_sram_resources,
122 .num_resources = ARRAY_SIZE(cdb89712_sram_resources),
123 .dev = {
124 .platform_data = &cdb89712_sram_pdata,
125 },
126};
127
47static void __init cdb89712_init(void) 128static void __init cdb89712_init(void)
48{ 129{
130 platform_device_register(&cdb89712_flash_pdev);
131 platform_device_register(&cdb89712_bootrom_pdev);
132 platform_device_register(&cdb89712_sram_pdev);
49 platform_device_register_simple("cs89x0", 0, cdb89712_cs8900_resource, 133 platform_device_register_simple("cs89x0", 0, cdb89712_cs8900_resource,
50 ARRAY_SIZE(cdb89712_cs8900_resource)); 134 ARRAY_SIZE(cdb89712_cs8900_resource));
51} 135}