aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ixp4xx
diff options
context:
space:
mode:
authorDeepak Saxena <dsaxena@plexity.net>2006-01-05 15:59:29 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-01-05 15:59:29 -0500
commit54e269ead6e672325866037b0617a72edd1396b9 (patch)
tree3076c2e0187657daed3054d511b62dc33a4c8f8b /arch/arm/mach-ixp4xx
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')
-rw-r--r--arch/arm/mach-ixp4xx/common.c16
-rw-r--r--arch/arm/mach-ixp4xx/coyote-setup.c10
-rw-r--r--arch/arm/mach-ixp4xx/gtwx5715-setup.c15
-rw-r--r--arch/arm/mach-ixp4xx/ixdp425-setup.c13
-rw-r--r--arch/arm/mach-ixp4xx/nas100d-setup.c6
5 files changed, 41 insertions, 19 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
335unsigned long ixp4xx_exp_bus_size;
336
335void __init ixp4xx_sys_init(void) 337void __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
diff --git a/arch/arm/mach-ixp4xx/coyote-setup.c b/arch/arm/mach-ixp4xx/coyote-setup.c
index 050c92768913..679594a73981 100644
--- a/arch/arm/mach-ixp4xx/coyote-setup.c
+++ b/arch/arm/mach-ixp4xx/coyote-setup.c
@@ -14,6 +14,7 @@
14#include <linux/serial.h> 14#include <linux/serial.h>
15#include <linux/tty.h> 15#include <linux/tty.h>
16#include <linux/serial_8250.h> 16#include <linux/serial_8250.h>
17#include <linux/slab.h>
17 18
18#include <asm/types.h> 19#include <asm/types.h>
19#include <asm/setup.h> 20#include <asm/setup.h>
@@ -30,8 +31,6 @@ static struct flash_platform_data coyote_flash_data = {
30}; 31};
31 32
32static struct resource coyote_flash_resource = { 33static struct resource coyote_flash_resource = {
33 .start = COYOTE_FLASH_BASE,
34 .end = COYOTE_FLASH_BASE + COYOTE_FLASH_SIZE - 1,
35 .flags = IORESOURCE_MEM, 34 .flags = IORESOURCE_MEM,
36}; 35};
37 36
@@ -81,6 +80,11 @@ static struct platform_device *coyote_devices[] __initdata = {
81 80
82static void __init coyote_init(void) 81static void __init coyote_init(void)
83{ 82{
83 ixp4xx_sys_init();
84
85 coyote_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
86 coyote_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1;
87
84 *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; 88 *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
85 *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; 89 *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
86 90
@@ -91,8 +95,6 @@ static void __init coyote_init(void)
91 coyote_uart_data[0].irq = IRQ_IXP4XX_UART1; 95 coyote_uart_data[0].irq = IRQ_IXP4XX_UART1;
92 } 96 }
93 97
94
95 ixp4xx_sys_init();
96 platform_add_devices(coyote_devices, ARRAY_SIZE(coyote_devices)); 98 platform_add_devices(coyote_devices, ARRAY_SIZE(coyote_devices));
97} 99}
98 100
diff --git a/arch/arm/mach-ixp4xx/gtwx5715-setup.c b/arch/arm/mach-ixp4xx/gtwx5715-setup.c
index 29a6d02fa851..038670489970 100644
--- a/arch/arm/mach-ixp4xx/gtwx5715-setup.c
+++ b/arch/arm/mach-ixp4xx/gtwx5715-setup.c
@@ -27,6 +27,7 @@
27#include <linux/serial.h> 27#include <linux/serial.h>
28#include <linux/tty.h> 28#include <linux/tty.h>
29#include <linux/serial_8250.h> 29#include <linux/serial_8250.h>
30#include <linux/slab.h>
30 31
31#include <asm/types.h> 32#include <asm/types.h>
32#include <asm/setup.h> 33#include <asm/setup.h>
@@ -106,11 +107,9 @@ static struct flash_platform_data gtwx5715_flash_data = {
106 .width = 2, 107 .width = 2,
107}; 108};
108 109
109static struct resource gtwx5715_flash_resource = { 110static struct gtw5715_flash_resource = {
110 .start = GTWX5715_FLASH_BASE,
111 .end = GTWX5715_FLASH_BASE + GTWX5715_FLASH_SIZE - 1,
112 .flags = IORESOURCE_MEM, 111 .flags = IORESOURCE_MEM,
113}; 112}
114 113
115static struct platform_device gtwx5715_flash = { 114static struct platform_device gtwx5715_flash = {
116 .name = "IXP4XX-Flash", 115 .name = "IXP4XX-Flash",
@@ -129,6 +128,14 @@ static struct platform_device *gtwx5715_devices[] __initdata = {
129 128
130static void __init gtwx5715_init(void) 129static void __init gtwx5715_init(void)
131{ 130{
131 ixp4xx_sys_init();
132
133 if (!flash_resource)
134 printk(KERN_ERR "Could not allocate flash resource\n");
135
136 gtwx5715_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
137 gtwx5715_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_8M - 1;
138
132 platform_add_devices(gtwx5715_devices, ARRAY_SIZE(gtwx5715_devices)); 139 platform_add_devices(gtwx5715_devices, ARRAY_SIZE(gtwx5715_devices));
133} 140}
134 141
diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c b/arch/arm/mach-ixp4xx/ixdp425-setup.c
index 3a22d84e1047..c2e105c89c95 100644
--- a/arch/arm/mach-ixp4xx/ixdp425-setup.c
+++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c
@@ -14,6 +14,7 @@
14#include <linux/serial.h> 14#include <linux/serial.h>
15#include <linux/tty.h> 15#include <linux/tty.h>
16#include <linux/serial_8250.h> 16#include <linux/serial_8250.h>
17#include <linux/slab.h>
17 18
18#include <asm/types.h> 19#include <asm/types.h>
19#include <asm/setup.h> 20#include <asm/setup.h>
@@ -30,8 +31,6 @@ static struct flash_platform_data ixdp425_flash_data = {
30}; 31};
31 32
32static struct resource ixdp425_flash_resource = { 33static struct resource ixdp425_flash_resource = {
33 .start = IXDP425_FLASH_BASE,
34 .end = IXDP425_FLASH_BASE + IXDP425_FLASH_SIZE - 1,
35 .flags = IORESOURCE_MEM, 34 .flags = IORESOURCE_MEM,
36}; 35};
37 36
@@ -108,17 +107,13 @@ static struct platform_device *ixdp425_devices[] __initdata = {
108 &ixdp425_uart 107 &ixdp425_uart
109}; 108};
110 109
111
112static void __init ixdp425_init(void) 110static void __init ixdp425_init(void)
113{ 111{
114 ixp4xx_sys_init(); 112 ixp4xx_sys_init();
115 113
116 /* 114 ixdp425_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
117 * IXP465 has 32MB window 115 ixdp425_flash_resource.end =
118 */ 116 IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
119 if (machine_is_ixdp465()) {
120 ixdp425_flash_resource.end += IXDP425_FLASH_SIZE;
121 }
122 117
123 platform_add_devices(ixdp425_devices, ARRAY_SIZE(ixdp425_devices)); 118 platform_add_devices(ixdp425_devices, ARRAY_SIZE(ixdp425_devices));
124} 119}
diff --git a/arch/arm/mach-ixp4xx/nas100d-setup.c b/arch/arm/mach-ixp4xx/nas100d-setup.c
index bde9648e7afc..49998a8bd4e8 100644
--- a/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ b/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -26,8 +26,6 @@ static struct flash_platform_data nas100d_flash_data = {
26}; 26};
27 27
28static struct resource nas100d_flash_resource = { 28static struct resource nas100d_flash_resource = {
29 .start = NAS100D_FLASH_BASE,
30 .end = NAS100D_FLASH_BASE + NAS100D_FLASH_SIZE,
31 .flags = IORESOURCE_MEM, 29 .flags = IORESOURCE_MEM,
32}; 30};
33 31
@@ -115,6 +113,10 @@ static void __init nas100d_init(void)
115{ 113{
116 ixp4xx_sys_init(); 114 ixp4xx_sys_init();
117 115
116 nas100d_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
117 nas100d_flash_resource.end =
118 IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
119
118 pm_power_off = nas100d_power_off; 120 pm_power_off = nas100d_power_off;
119 121
120 platform_add_devices(nas100d_devices, ARRAY_SIZE(nas100d_devices)); 122 platform_add_devices(nas100d_devices, ARRAY_SIZE(nas100d_devices));