diff options
author | Deepak Saxena <dsaxena@plexity.net> | 2006-01-05 15:59:29 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-01-05 15:59:29 -0500 |
commit | 54e269ead6e672325866037b0617a72edd1396b9 (patch) | |
tree | 3076c2e0187657daed3054d511b62dc33a4c8f8b /arch/arm/mach-ixp4xx/common.c | |
parent | 2b9ac7c15c0c5c9d6057b9e297dabaebd208ffe8 (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.c | 16 |
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 = { | |||
332 | &ixp46x_i2c_controller | 332 | &ixp46x_i2c_controller |
333 | }; | 333 | }; |
334 | 334 | ||
335 | unsigned long ixp4xx_exp_bus_size; | ||
336 | |||
335 | void __init ixp4xx_sys_init(void) | 337 | void __init ixp4xx_sys_init(void) |
336 | { | 338 | { |
339 | ixp4xx_exp_bus_size = SZ_16M; | ||
340 | |||
337 | if (cpu_is_ixp46x()) { | 341 | if (cpu_is_ixp46x()) { |
342 | int region; | ||
343 | |||
338 | platform_add_devices(ixp46x_devices, | 344 | platform_add_devices(ixp46x_devices, |
339 | ARRAY_SIZE(ixp46x_devices)); | 345 | ARRAY_SIZE(ixp46x_devices)); |
346 | |||
347 | for (region = 0; region < 7; region++) { | ||
348 | if((*(IXP4XX_EXP_REG(0x4 * region)) & 0x200)) { | ||
349 | ixp4xx_exp_bus_size = SZ_32M; | ||
350 | break; | ||
351 | } | ||
352 | } | ||
340 | } | 353 | } |
354 | |||
355 | printk("IXP4xx: Using %uMiB expansion bus window size\n", | ||
356 | ixp4xx_exp_bus_size >> 20); | ||
341 | } | 357 | } |
342 | 358 | ||