diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2008-11-23 11:31:46 -0500 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2008-12-16 08:57:54 -0500 |
commit | 3620c0dccfd35cd39324508d8c962d10f9a44ead (patch) | |
tree | aae95d2640fb8d07435b472a4baf845f21d565f0 /arch/arm/mach-mx2/pcm038.c | |
parent | 4a7b98d7e7f1c05331bfa82e2427f896e57de35b (diff) |
pcm038: add driver for static ram
The pcm038 module (phyCORE-i.MX27) comes with a 512 KiB static RAM which
can be battery buffered. Add mtd_ram support and configure the chip select
line, to which the sram is attached.
Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx2/pcm038.c')
-rw-r--r-- | arch/arm/mach-mx2/pcm038.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/arch/arm/mach-mx2/pcm038.c b/arch/arm/mach-mx2/pcm038.c index 91a1e4bbccbc..0594644b4057 100644 --- a/arch/arm/mach-mx2/pcm038.c +++ b/arch/arm/mach-mx2/pcm038.c | |||
@@ -19,6 +19,7 @@ | |||
19 | 19 | ||
20 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
21 | #include <linux/mtd/physmap.h> | 21 | #include <linux/mtd/physmap.h> |
22 | #include <linux/mtd/plat-ram.h> | ||
22 | #include <asm/mach/arch.h> | 23 | #include <asm/mach/arch.h> |
23 | #include <asm/mach-types.h> | 24 | #include <asm/mach-types.h> |
24 | #include <mach/common.h> | 25 | #include <mach/common.h> |
@@ -31,6 +32,31 @@ | |||
31 | #include "devices.h" | 32 | #include "devices.h" |
32 | 33 | ||
33 | /* | 34 | /* |
35 | * Phytec's PCM038 comes with 2MiB battery buffered SRAM, | ||
36 | * 16 bit width | ||
37 | */ | ||
38 | |||
39 | static struct platdata_mtd_ram pcm038_sram_data = { | ||
40 | .bankwidth = 2, | ||
41 | }; | ||
42 | |||
43 | static struct resource pcm038_sram_resource = { | ||
44 | .start = CS1_BASE_ADDR, | ||
45 | .end = CS1_BASE_ADDR + 512 * 1024 - 1, | ||
46 | .flags = IORESOURCE_MEM, | ||
47 | }; | ||
48 | |||
49 | static struct platform_device pcm038_sram_mtd_device = { | ||
50 | .name = "mtd-ram", | ||
51 | .id = 0, | ||
52 | .dev = { | ||
53 | .platform_data = &pcm038_sram_data, | ||
54 | }, | ||
55 | .num_resources = 1, | ||
56 | .resource = &pcm038_sram_resource, | ||
57 | }; | ||
58 | |||
59 | /* | ||
34 | * Phytec's phyCORE-i.MX27 comes with 32MiB flash, | 60 | * Phytec's phyCORE-i.MX27 comes with 32MiB flash, |
35 | * 16 bit width | 61 | * 16 bit width |
36 | */ | 62 | */ |
@@ -164,11 +190,22 @@ static void gpio_fec_inactive(void) | |||
164 | static struct platform_device *platform_devices[] __initdata = { | 190 | static struct platform_device *platform_devices[] __initdata = { |
165 | &pcm038_nor_mtd_device, | 191 | &pcm038_nor_mtd_device, |
166 | &mxc_w1_master_device, | 192 | &mxc_w1_master_device, |
193 | &pcm038_sram_mtd_device, | ||
167 | }; | 194 | }; |
168 | 195 | ||
196 | /* On pcm038 there's a sram attached to CS1, we enable the chipselect here and | ||
197 | * setup other stuffs to access the sram. */ | ||
198 | static void __init pcm038_init_sram(void) | ||
199 | { | ||
200 | __raw_writel(0x0000d843, CSCR_U(1)); | ||
201 | __raw_writel(0x22252521, CSCR_L(1)); | ||
202 | __raw_writel(0x22220a00, CSCR_A(1)); | ||
203 | } | ||
204 | |||
169 | static void __init pcm038_init(void) | 205 | static void __init pcm038_init(void) |
170 | { | 206 | { |
171 | gpio_fec_active(); | 207 | gpio_fec_active(); |
208 | pcm038_init_sram(); | ||
172 | 209 | ||
173 | mxc_register_device(&mxc_uart_device0, &uart_pdata[0]); | 210 | mxc_register_device(&mxc_uart_device0, &uart_pdata[0]); |
174 | mxc_register_device(&mxc_uart_device1, &uart_pdata[1]); | 211 | mxc_register_device(&mxc_uart_device1, &uart_pdata[1]); |