aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx2/pcm038.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-mx2/pcm038.c')
-rw-r--r--arch/arm/mach-mx2/pcm038.c37
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
39static struct platdata_mtd_ram pcm038_sram_data = {
40 .bankwidth = 2,
41};
42
43static struct resource pcm038_sram_resource = {
44 .start = CS1_BASE_ADDR,
45 .end = CS1_BASE_ADDR + 512 * 1024 - 1,
46 .flags = IORESOURCE_MEM,
47};
48
49static 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)
164static struct platform_device *platform_devices[] __initdata = { 190static 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. */
198static 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
169static void __init pcm038_init(void) 205static 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]);