aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-ixp4xx/common.c
diff options
context:
space:
mode:
authorDeepak Saxena <dsaxena@plexity.net>2006-01-05 20:59:29 +0000
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-01-05 20:59:29 +0000
commit54e269ead6e672325866037b0617a72edd1396b9 (patch)
tree3076c2e0187657daed3054d511b62dc33a4c8f8b /arch/arm/mach-ixp4xx/common.c
parent2b9ac7c15c0c5c9d6057b9e297dabaebd208ffe8 (diff)
[ARM] 3226/1: IXP4xx runtime expansion bus window size configuration
Patch from Deepak Saxena The expansion bus on the IXP46x NPU can be configured for either 32MiB or 16MiB windows and changing the configuration causes the base address for each chip select for each region to change. Because of this, we cannot hardcode the physical base as we currently do. This patch checks the expansion bus configuration registers at runtime to determine the appropriate window size. Note that this requires that the bootloader already configured the device sizes appropriately, but I feel that is valid assumption to make as the bootloader must configure and access the flash window, the output display (LCD, LEDs, etc) window, and other expansion bus devices. Signed-off-by: Deepak Saxena <dsaxena@plexity.net> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-ixp4xx/common.c')
-rw-r--r--arch/arm/mach-ixp4xx/common.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index 9f33cb21e7f3..6b393691d0e8 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -332,11 +332,27 @@ static struct platform_device *ixp46x_devices[] __initdata = {
&ixp46x_i2c_controller
};
+unsigned long ixp4xx_exp_bus_size;
+
void __init ixp4xx_sys_init(void)
{
+ ixp4xx_exp_bus_size = SZ_16M;
+
if (cpu_is_ixp46x()) {
+ int region;
+
platform_add_devices(ixp46x_devices,
ARRAY_SIZE(ixp46x_devices));
+
+ for (region = 0; region < 7; region++) {
+ if((*(IXP4XX_EXP_REG(0x4 * region)) & 0x200)) {
+ ixp4xx_exp_bus_size = SZ_32M;
+ break;
+ }
+ }
}
+
+ printk("IXP4xx: Using %uMiB expansion bus window size\n",
+ ixp4xx_exp_bus_size >> 20);
}