Skip to content

Commit

Permalink
RealView: Allow access to the secure flash memory block on PB1176
Browse files Browse the repository at this point in the history
This patch adds a Kconfig option for specifying whether Linux will only
be run in secure mode on the RealView PB1176 platform. Enabling it will
make the secure flash memory block (64MB @ 0x3c000000) available to
Linux.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
  • Loading branch information
Catalin Marinas committed May 30, 2009
1 parent 1b504bb commit af60774
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
9 changes: 9 additions & 0 deletions arch/arm/mach-realview/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ config MACH_REALVIEW_PB1176
help
Include support for the ARM(R) RealView ARM1176 Platform Baseboard.

config REALVIEW_PB1176_SECURE_FLASH
bool "Allow access to the secure flash memory block"
depends on MACH_REALVIEW_PB1176
default n
help
Select this option if Linux will only run in secure mode on the
RealView PB1176 platform and access to the secure flash memory
block (64MB @ 0x3c000000) is required.

config MACH_REALVIEW_PBA8
bool "Support RealView/PB-A8 platform"
select CPU_V7
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-realview/include/mach/board-pb1176.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
#define REALVIEW_PB1176_SDRAM67_BASE 0x70000000 /* SDRAM banks 6 and 7 */
#define REALVIEW_PB1176_FLASH_BASE 0x30000000
#define REALVIEW_PB1176_FLASH_SIZE SZ_64M
#define REALVIEW_PB1176_SEC_FLASH_BASE 0x3C000000 /* Secure flash */
#define REALVIEW_PB1176_SEC_FLASH_SIZE SZ_64M

#define REALVIEW_PB1176_TIMER0_1_BASE 0x10104000 /* Timer 0 and 1 */
#define REALVIEW_PB1176_TIMER2_3_BASE 0x10105000 /* Timer 2 and 3 */
Expand Down
23 changes: 18 additions & 5 deletions arch/arm/mach-realview/realview_pb1176.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,23 @@ static struct amba_device *amba_devs[] __initdata = {
/*
* RealView PB1176 platform devices
*/
static struct resource realview_pb1176_flash_resource = {
.start = REALVIEW_PB1176_FLASH_BASE,
.end = REALVIEW_PB1176_FLASH_BASE + REALVIEW_PB1176_FLASH_SIZE - 1,
.flags = IORESOURCE_MEM,
static struct resource realview_pb1176_flash_resources[] = {
[0] = {
.start = REALVIEW_PB1176_FLASH_BASE,
.end = REALVIEW_PB1176_FLASH_BASE + REALVIEW_PB1176_FLASH_SIZE - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = REALVIEW_PB1176_SEC_FLASH_BASE,
.end = REALVIEW_PB1176_SEC_FLASH_BASE + REALVIEW_PB1176_SEC_FLASH_SIZE - 1,
.flags = IORESOURCE_MEM,
},
};
#ifdef CONFIG_REALVIEW_PB1176_SECURE_FLASH
#define PB1176_FLASH_BLOCKS 2
#else
#define PB1176_FLASH_BLOCKS 1
#endif

static struct resource realview_pb1176_smsc911x_resources[] = {
[0] = {
Expand Down Expand Up @@ -271,7 +283,8 @@ static void __init realview_pb1176_init(void)
l2x0_init(__io_address(REALVIEW_PB1176_L220_BASE), 0x00730000, 0xfe000fff);
#endif

realview_flash_register(&realview_pb1176_flash_resource, 1);
realview_flash_register(realview_pb1176_flash_resources,
PB1176_FLASH_BLOCKS);
realview_eth_register(NULL, realview_pb1176_smsc911x_resources);
platform_device_register(&realview_i2c_device);
realview_usb_register(realview_pb1176_isp1761_resources);
Expand Down

0 comments on commit af60774

Please sign in to comment.