aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2011-09-06 02:50:20 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-10-17 04:13:41 -0400
commit0ec5a95bbb8ba0b95506693a6bc0de72f1b5d969 (patch)
treefe8e7ba6b5a96517d148dbbc667cc993f6f11d17
parent2b034922af2caa19df86f0c502e76cb6f6e910f9 (diff)
ARM: 6217/4: mach-realview: expose PB1176 ROM using physmap and map_rom
This exposes the PB1176 ROM if you compile in the MTD physmap mapping and also the map_rom chiptype. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--arch/arm/mach-realview/include/mach/board-pb1176.h1
-rw-r--r--arch/arm/mach-realview/realview_pb1176.c45
2 files changed, 38 insertions, 8 deletions
diff --git a/arch/arm/mach-realview/include/mach/board-pb1176.h b/arch/arm/mach-realview/include/mach/board-pb1176.h
index 002ab5d8c11..2a15fef9473 100644
--- a/arch/arm/mach-realview/include/mach/board-pb1176.h
+++ b/arch/arm/mach-realview/include/mach/board-pb1176.h
@@ -70,6 +70,7 @@
70 70
71#define REALVIEW_DC1176_GIC_CPU_BASE 0x10120000 /* GIC CPU interface, on devchip */ 71#define REALVIEW_DC1176_GIC_CPU_BASE 0x10120000 /* GIC CPU interface, on devchip */
72#define REALVIEW_DC1176_GIC_DIST_BASE 0x10121000 /* GIC distributor, on devchip */ 72#define REALVIEW_DC1176_GIC_DIST_BASE 0x10121000 /* GIC distributor, on devchip */
73#define REALVIEW_DC1176_ROM_BASE 0x10200000 /* 16KiB NRAM preudo-ROM, on devchip */
73#define REALVIEW_PB1176_GIC_CPU_BASE 0x10040000 /* GIC CPU interface, on FPGA */ 74#define REALVIEW_PB1176_GIC_CPU_BASE 0x10040000 /* GIC CPU interface, on FPGA */
74#define REALVIEW_PB1176_GIC_DIST_BASE 0x10041000 /* GIC distributor, on FPGA */ 75#define REALVIEW_PB1176_GIC_DIST_BASE 0x10041000 /* GIC distributor, on FPGA */
75#define REALVIEW_PB1176_L220_BASE 0x10110000 /* L220 registers */ 76#define REALVIEW_PB1176_L220_BASE 0x10110000 /* L220 registers */
diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c
index de6b9fa8937..865d440fcf5 100644
--- a/arch/arm/mach-realview/realview_pb1176.c
+++ b/arch/arm/mach-realview/realview_pb1176.c
@@ -26,6 +26,8 @@
26#include <linux/amba/pl061.h> 26#include <linux/amba/pl061.h>
27#include <linux/amba/mmci.h> 27#include <linux/amba/mmci.h>
28#include <linux/amba/pl022.h> 28#include <linux/amba/pl022.h>
29#include <linux/mtd/physmap.h>
30#include <linux/mtd/partitions.h>
29#include <linux/io.h> 31#include <linux/io.h>
30 32
31#include <mach/hardware.h> 33#include <mach/hardware.h>
@@ -204,22 +206,48 @@ static struct amba_device *amba_devs[] __initdata = {
204 * RealView PB1176 platform devices 206 * RealView PB1176 platform devices
205 */ 207 */
206static struct resource realview_pb1176_flash_resources[] = { 208static struct resource realview_pb1176_flash_resources[] = {
207 [0] = { 209 {
208 .start = REALVIEW_PB1176_FLASH_BASE, 210 .start = REALVIEW_PB1176_FLASH_BASE,
209 .end = REALVIEW_PB1176_FLASH_BASE + REALVIEW_PB1176_FLASH_SIZE - 1, 211 .end = REALVIEW_PB1176_FLASH_BASE + REALVIEW_PB1176_FLASH_SIZE - 1,
210 .flags = IORESOURCE_MEM, 212 .flags = IORESOURCE_MEM,
211 }, 213 },
212 [1] = { 214#ifdef CONFIG_REALVIEW_PB1176_SECURE_FLASH
215 {
213 .start = REALVIEW_PB1176_SEC_FLASH_BASE, 216 .start = REALVIEW_PB1176_SEC_FLASH_BASE,
214 .end = REALVIEW_PB1176_SEC_FLASH_BASE + REALVIEW_PB1176_SEC_FLASH_SIZE - 1, 217 .end = REALVIEW_PB1176_SEC_FLASH_BASE + REALVIEW_PB1176_SEC_FLASH_SIZE - 1,
215 .flags = IORESOURCE_MEM, 218 .flags = IORESOURCE_MEM,
216 }, 219 },
217};
218#ifdef CONFIG_REALVIEW_PB1176_SECURE_FLASH
219#define PB1176_FLASH_BLOCKS 2
220#else
221#define PB1176_FLASH_BLOCKS 1
222#endif 220#endif
221};
222
223static struct physmap_flash_data pb1176_rom_pdata = {
224 .probe_type = "map_rom",
225 .width = 4,
226 .nr_parts = 0,
227};
228
229static struct resource pb1176_rom_resources[] = {
230 /*
231 * This exposes the PB1176 DevChip ROM as an MTD ROM mapping.
232 * The reference manual states that this is actually a pseudo-ROM
233 * programmed in NVRAM.
234 */
235 {
236 .start = REALVIEW_DC1176_ROM_BASE,
237 .end = REALVIEW_DC1176_ROM_BASE + SZ_16K - 1,
238 .flags = IORESOURCE_MEM,
239 }
240};
241
242static struct platform_device pb1176_rom_device = {
243 .name = "physmap-flash",
244 .id = -1,
245 .num_resources = ARRAY_SIZE(pb1176_rom_resources),
246 .resource = pb1176_rom_resources,
247 .dev = {
248 .platform_data = &pb1176_rom_pdata,
249 },
250};
223 251
224static struct resource realview_pb1176_smsc911x_resources[] = { 252static struct resource realview_pb1176_smsc911x_resources[] = {
225 [0] = { 253 [0] = {
@@ -337,7 +365,8 @@ static void __init realview_pb1176_init(void)
337#endif 365#endif
338 366
339 realview_flash_register(realview_pb1176_flash_resources, 367 realview_flash_register(realview_pb1176_flash_resources,
340 PB1176_FLASH_BLOCKS); 368 ARRAY_SIZE(realview_pb1176_flash_resources));
369 platform_device_register(&pb1176_rom_device);
341 realview_eth_register(NULL, realview_pb1176_smsc911x_resources); 370 realview_eth_register(NULL, realview_pb1176_smsc911x_resources);
342 platform_device_register(&realview_i2c_device); 371 platform_device_register(&realview_i2c_device);
343 realview_usb_register(realview_pb1176_isp1761_resources); 372 realview_usb_register(realview_pb1176_isp1761_resources);