diff options
author | Luca Santini <luca.santini@spesonline.com> | 2008-09-12 05:07:16 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-09-12 05:07:16 -0400 |
commit | 4018ffcfdf84faf17fbadcd29ea5eced26f9d9cb (patch) | |
tree | 26dd5ddd95bceb393a2d13d8f8bada5a704818fd /arch/sh/boards/board-edosk7760.c | |
parent | 2641dc92b3c7f979c7e4820cff2e765664358982 (diff) |
sh: edosk7760 physmap-flash support.
Signed-off-by: Luca Santini <luca.santini@spesonline.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boards/board-edosk7760.c')
-rw-r--r-- | arch/sh/boards/board-edosk7760.c | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/arch/sh/boards/board-edosk7760.c b/arch/sh/boards/board-edosk7760.c index 7cc5e1143522..4890ba7961ae 100644 --- a/arch/sh/boards/board-edosk7760.c +++ b/arch/sh/boards/board-edosk7760.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/smc91x.h> | 24 | #include <linux/smc91x.h> |
25 | #include <linux/interrupt.h> | 25 | #include <linux/interrupt.h> |
26 | #include <linux/i2c.h> | 26 | #include <linux/i2c.h> |
27 | #include <linux/mtd/physmap.h> | ||
27 | #include <asm/machvec.h> | 28 | #include <asm/machvec.h> |
28 | #include <asm/io.h> | 29 | #include <asm/io.h> |
29 | #include <asm/addrspace.h> | 30 | #include <asm/addrspace.h> |
@@ -40,6 +41,52 @@ | |||
40 | 41 | ||
41 | #define ETHERNET_IRQ 5 | 42 | #define ETHERNET_IRQ 5 |
42 | 43 | ||
44 | /* NOR flash */ | ||
45 | static struct mtd_partition edosk7760_nor_flash_partitions[] = { | ||
46 | { | ||
47 | .name = "bootloader", | ||
48 | .offset = 0, | ||
49 | .size = (1 * 1024 * 1024), /*1MB*/ | ||
50 | .mask_flags = MTD_WRITEABLE, /* Read-only */ | ||
51 | }, { | ||
52 | .name = "kernel", | ||
53 | .offset = MTDPART_OFS_APPEND, | ||
54 | .size = (2 * 1024 * 1024), /*2MB*/ | ||
55 | }, { | ||
56 | .name = "fs", | ||
57 | .offset = MTDPART_OFS_APPEND, | ||
58 | .size = (26 * 1024 * 1024), | ||
59 | }, { | ||
60 | .name = "other", | ||
61 | .offset = MTDPART_OFS_APPEND, | ||
62 | .size = MTDPART_SIZ_FULL, | ||
63 | }, | ||
64 | }; | ||
65 | |||
66 | static struct physmap_flash_data edosk7760_nor_flash_data = { | ||
67 | .width = 4, | ||
68 | .parts = edosk7760_nor_flash_partitions, | ||
69 | .nr_parts = ARRAY_SIZE(edosk7760_nor_flash_partitions), | ||
70 | }; | ||
71 | |||
72 | static struct resource edosk7760_nor_flash_resources[] = { | ||
73 | [0] = { | ||
74 | .name = "NOR Flash", | ||
75 | .start = 0x00000000, | ||
76 | .end = (32 * 1024 * 1024) -1, /* 32MB*/ | ||
77 | .flags = IORESOURCE_MEM, | ||
78 | } | ||
79 | }; | ||
80 | |||
81 | static struct platform_device edosk7760_nor_flash_device = { | ||
82 | .name = "physmap-flash", | ||
83 | .resource = edosk7760_nor_flash_resources, | ||
84 | .num_resources = ARRAY_SIZE(edosk7760_nor_flash_resources), | ||
85 | .dev = { | ||
86 | .platform_data = &edosk7760_nor_flash_data, | ||
87 | }, | ||
88 | }; | ||
89 | |||
43 | /* i2c initialization functions */ | 90 | /* i2c initialization functions */ |
44 | static struct sh7760_i2c_platdata i2c_pd = { | 91 | static struct sh7760_i2c_platdata i2c_pd = { |
45 | .speed_khz = 400, | 92 | .speed_khz = 400, |
@@ -121,9 +168,10 @@ static struct platform_device smc91x_dev = { | |||
121 | 168 | ||
122 | /* platform init code */ | 169 | /* platform init code */ |
123 | static struct platform_device *edosk7760_devices[] __initdata = { | 170 | static struct platform_device *edosk7760_devices[] __initdata = { |
171 | &smc91x_dev, | ||
172 | &edosk7760_nor_flash_device, | ||
124 | &sh7760_i2c0_dev, | 173 | &sh7760_i2c0_dev, |
125 | &sh7760_i2c1_dev, | 174 | &sh7760_i2c1_dev, |
126 | &smc91x_dev, | ||
127 | }; | 175 | }; |
128 | 176 | ||
129 | static int __init init_edosk7760_devices(void) | 177 | static int __init init_edosk7760_devices(void) |