diff options
author | Dan Williams <dan.j.williams@intel.com> | 2008-03-26 22:12:38 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2008-03-26 15:33:41 -0400 |
commit | c34002c102880bfac5b449b41e5313dcda186db8 (patch) | |
tree | b868da85842d52df7f0ceeef243b7dae7671f645 | |
parent | 97c46048ce73c27fd2734299f07a8c06c8156a2e (diff) |
iop: unconditionally initialize the ATU on platforms known to be 'hosts'
Platforms like iq80321 and iq80331 which may be host-bus-adapters
require 'iop3xx_init_atu=y' to be specified on the kernel command line.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
-rw-r--r-- | arch/arm/mach-iop32x/Kconfig | 8 | ||||
-rw-r--r-- | arch/arm/mach-iop32x/iq31244.c | 11 | ||||
-rw-r--r-- | arch/arm/mach-iop32x/iq80321.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-iop33x/Kconfig | 8 | ||||
-rw-r--r-- | arch/arm/mach-iop33x/iq80331.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-iop33x/iq80332.c | 2 | ||||
-rw-r--r-- | arch/arm/plat-iop/pci.c | 33 | ||||
-rw-r--r-- | include/asm-arm/hardware/iop3xx.h | 9 | ||||
-rw-r--r-- | include/asm-arm/mach/pci.h | 1 |
9 files changed, 36 insertions, 40 deletions
diff --git a/arch/arm/mach-iop32x/Kconfig b/arch/arm/mach-iop32x/Kconfig index dbe07c9472ed..5e8c6f7dfabb 100644 --- a/arch/arm/mach-iop32x/Kconfig +++ b/arch/arm/mach-iop32x/Kconfig | |||
@@ -34,14 +34,6 @@ config MACH_N2100 | |||
34 | Say Y here if you want to run your kernel on the Thecus n2100 | 34 | Say Y here if you want to run your kernel on the Thecus n2100 |
35 | NAS appliance. | 35 | NAS appliance. |
36 | 36 | ||
37 | config IOP3XX_ATU | ||
38 | bool "Enable the PCI Controller" | ||
39 | default y | ||
40 | help | ||
41 | Say Y here if you want the IOP to initialize its PCI Controller. | ||
42 | Say N if the IOP is an add in card, the host system owns the PCI | ||
43 | bus in this case. | ||
44 | |||
45 | config MACH_EM7210 | 37 | config MACH_EM7210 |
46 | bool "Enable support for the Lanner EM7210" | 38 | bool "Enable support for the Lanner EM7210" |
47 | help | 39 | help |
diff --git a/arch/arm/mach-iop32x/iq31244.c b/arch/arm/mach-iop32x/iq31244.c index 98cfa1cd6bdb..4a89823bcebb 100644 --- a/arch/arm/mach-iop32x/iq31244.c +++ b/arch/arm/mach-iop32x/iq31244.c | |||
@@ -178,10 +178,9 @@ static struct hw_pci iq31244_pci __initdata = { | |||
178 | 178 | ||
179 | static int __init iq31244_pci_init(void) | 179 | static int __init iq31244_pci_init(void) |
180 | { | 180 | { |
181 | if (is_ep80219()) { | 181 | if (is_ep80219()) |
182 | if (iop3xx_get_init_atu() == IOP3XX_INIT_ATU_ENABLE) | 182 | pci_common_init(&ep80219_pci); |
183 | pci_common_init(&ep80219_pci); | 183 | else if (machine_is_iq31244()) { |
184 | } else if (machine_is_iq31244()) { | ||
185 | if (is_80219()) { | 184 | if (is_80219()) { |
186 | printk("note: iq31244 board type has been selected\n"); | 185 | printk("note: iq31244 board type has been selected\n"); |
187 | printk("note: to select ep80219 operation:\n"); | 186 | printk("note: to select ep80219 operation:\n"); |
@@ -190,9 +189,7 @@ static int __init iq31244_pci_init(void) | |||
190 | printk("\t2/ update boot loader to pass" | 189 | printk("\t2/ update boot loader to pass" |
191 | " the ep80219 id: %d\n", MACH_TYPE_EP80219); | 190 | " the ep80219 id: %d\n", MACH_TYPE_EP80219); |
192 | } | 191 | } |
193 | 192 | pci_common_init(&iq31244_pci); | |
194 | if (iop3xx_get_init_atu() == IOP3XX_INIT_ATU_ENABLE) | ||
195 | pci_common_init(&iq31244_pci); | ||
196 | } | 193 | } |
197 | 194 | ||
198 | return 0; | 195 | return 0; |
diff --git a/arch/arm/mach-iop32x/iq80321.c b/arch/arm/mach-iop32x/iq80321.c index 18ad29f213b2..1da3c911edd3 100644 --- a/arch/arm/mach-iop32x/iq80321.c +++ b/arch/arm/mach-iop32x/iq80321.c | |||
@@ -106,7 +106,7 @@ static struct hw_pci iq80321_pci __initdata = { | |||
106 | .swizzle = pci_std_swizzle, | 106 | .swizzle = pci_std_swizzle, |
107 | .nr_controllers = 1, | 107 | .nr_controllers = 1, |
108 | .setup = iop3xx_pci_setup, | 108 | .setup = iop3xx_pci_setup, |
109 | .preinit = iop3xx_pci_preinit, | 109 | .preinit = iop3xx_pci_preinit_cond, |
110 | .scan = iop3xx_pci_scan_bus, | 110 | .scan = iop3xx_pci_scan_bus, |
111 | .map_irq = iq80321_pci_map_irq, | 111 | .map_irq = iq80321_pci_map_irq, |
112 | }; | 112 | }; |
diff --git a/arch/arm/mach-iop33x/Kconfig b/arch/arm/mach-iop33x/Kconfig index 45598e096898..9aa016bb18f9 100644 --- a/arch/arm/mach-iop33x/Kconfig +++ b/arch/arm/mach-iop33x/Kconfig | |||
@@ -16,14 +16,6 @@ config MACH_IQ80332 | |||
16 | Say Y here if you want to run your kernel on the Intel IQ80332 | 16 | Say Y here if you want to run your kernel on the Intel IQ80332 |
17 | evaluation kit for the IOP332 chipset. | 17 | evaluation kit for the IOP332 chipset. |
18 | 18 | ||
19 | config IOP3XX_ATU | ||
20 | bool "Enable the PCI Controller" | ||
21 | default y | ||
22 | help | ||
23 | Say Y here if you want the IOP to initialize its PCI Controller. | ||
24 | Say N if the IOP is an add in card, the host system owns the PCI | ||
25 | bus in this case. | ||
26 | |||
27 | endmenu | 19 | endmenu |
28 | 20 | ||
29 | endif | 21 | endif |
diff --git a/arch/arm/mach-iop33x/iq80331.c b/arch/arm/mach-iop33x/iq80331.c index 433188ebff2a..de39fd778579 100644 --- a/arch/arm/mach-iop33x/iq80331.c +++ b/arch/arm/mach-iop33x/iq80331.c | |||
@@ -89,7 +89,7 @@ static struct hw_pci iq80331_pci __initdata = { | |||
89 | .swizzle = pci_std_swizzle, | 89 | .swizzle = pci_std_swizzle, |
90 | .nr_controllers = 1, | 90 | .nr_controllers = 1, |
91 | .setup = iop3xx_pci_setup, | 91 | .setup = iop3xx_pci_setup, |
92 | .preinit = iop3xx_pci_preinit, | 92 | .preinit = iop3xx_pci_preinit_cond, |
93 | .scan = iop3xx_pci_scan_bus, | 93 | .scan = iop3xx_pci_scan_bus, |
94 | .map_irq = iq80331_pci_map_irq, | 94 | .map_irq = iq80331_pci_map_irq, |
95 | }; | 95 | }; |
diff --git a/arch/arm/mach-iop33x/iq80332.c b/arch/arm/mach-iop33x/iq80332.c index 416c09564cc6..4904fd78445f 100644 --- a/arch/arm/mach-iop33x/iq80332.c +++ b/arch/arm/mach-iop33x/iq80332.c | |||
@@ -89,7 +89,7 @@ static struct hw_pci iq80332_pci __initdata = { | |||
89 | .swizzle = pci_std_swizzle, | 89 | .swizzle = pci_std_swizzle, |
90 | .nr_controllers = 1, | 90 | .nr_controllers = 1, |
91 | .setup = iop3xx_pci_setup, | 91 | .setup = iop3xx_pci_setup, |
92 | .preinit = iop3xx_pci_preinit, | 92 | .preinit = iop3xx_pci_preinit_cond, |
93 | .scan = iop3xx_pci_scan_bus, | 93 | .scan = iop3xx_pci_scan_bus, |
94 | .map_irq = iq80332_pci_map_irq, | 94 | .map_irq = iq80332_pci_map_irq, |
95 | }; | 95 | }; |
diff --git a/arch/arm/plat-iop/pci.c b/arch/arm/plat-iop/pci.c index 6ed374fa4087..d9bc15a69e5d 100644 --- a/arch/arm/plat-iop/pci.c +++ b/arch/arm/plat-iop/pci.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <asm/hardware.h> | 24 | #include <asm/hardware.h> |
25 | #include <asm/mach/pci.h> | 25 | #include <asm/mach/pci.h> |
26 | #include <asm/hardware/iop3xx.h> | 26 | #include <asm/hardware/iop3xx.h> |
27 | #include <asm/mach-types.h> | ||
27 | 28 | ||
28 | // #define DEBUG | 29 | // #define DEBUG |
29 | 30 | ||
@@ -325,13 +326,16 @@ void __init iop3xx_atu_disable(void) | |||
325 | /* Flag to determine whether the ATU is initialized and the PCI bus scanned */ | 326 | /* Flag to determine whether the ATU is initialized and the PCI bus scanned */ |
326 | int init_atu; | 327 | int init_atu; |
327 | 328 | ||
328 | void __init iop3xx_pci_preinit(void) | 329 | int iop3xx_get_init_atu(void) { |
329 | { | 330 | /* check if default has been overridden */ |
330 | if (iop3xx_get_init_atu() == IOP3XX_INIT_ATU_ENABLE) { | 331 | if (init_atu != IOP3XX_INIT_ATU_DEFAULT) |
331 | iop3xx_atu_disable(); | 332 | return init_atu; |
332 | iop3xx_atu_setup(); | 333 | else |
333 | } | 334 | return IOP3XX_INIT_ATU_DISABLE; |
335 | } | ||
334 | 336 | ||
337 | static void __init iop3xx_atu_debug(void) | ||
338 | { | ||
335 | DBG("PCI: Intel IOP3xx PCI init.\n"); | 339 | DBG("PCI: Intel IOP3xx PCI init.\n"); |
336 | DBG("PCI: Outbound memory window 0: PCI 0x%08x%08x\n", | 340 | DBG("PCI: Outbound memory window 0: PCI 0x%08x%08x\n", |
337 | *IOP3XX_OUMWTVR0, *IOP3XX_OMWTVR0); | 341 | *IOP3XX_OUMWTVR0, *IOP3XX_OMWTVR0); |
@@ -358,6 +362,23 @@ void __init iop3xx_pci_preinit(void) | |||
358 | hook_fault_code(16+6, iop3xx_pci_abort, SIGBUS, "imprecise external abort"); | 362 | hook_fault_code(16+6, iop3xx_pci_abort, SIGBUS, "imprecise external abort"); |
359 | } | 363 | } |
360 | 364 | ||
365 | /* for platforms that might be host-bus-adapters */ | ||
366 | void __init iop3xx_pci_preinit_cond(void) | ||
367 | { | ||
368 | if (iop3xx_get_init_atu() == IOP3XX_INIT_ATU_ENABLE) { | ||
369 | iop3xx_atu_disable(); | ||
370 | iop3xx_atu_setup(); | ||
371 | iop3xx_atu_debug(); | ||
372 | } | ||
373 | } | ||
374 | |||
375 | void __init iop3xx_pci_preinit(void) | ||
376 | { | ||
377 | iop3xx_atu_disable(); | ||
378 | iop3xx_atu_setup(); | ||
379 | iop3xx_atu_debug(); | ||
380 | } | ||
381 | |||
361 | /* allow init_atu to be user overridden */ | 382 | /* allow init_atu to be user overridden */ |
362 | static int __init iop3xx_init_atu_setup(char *str) | 383 | static int __init iop3xx_init_atu_setup(char *str) |
363 | { | 384 | { |
diff --git a/include/asm-arm/hardware/iop3xx.h b/include/asm-arm/hardware/iop3xx.h index ede377ec9147..18f6937f5010 100644 --- a/include/asm-arm/hardware/iop3xx.h +++ b/include/asm-arm/hardware/iop3xx.h | |||
@@ -29,6 +29,7 @@ extern void gpio_line_config(int line, int direction); | |||
29 | extern int gpio_line_get(int line); | 29 | extern int gpio_line_get(int line); |
30 | extern void gpio_line_set(int line, int value); | 30 | extern void gpio_line_set(int line, int value); |
31 | extern int init_atu; | 31 | extern int init_atu; |
32 | extern int iop3xx_get_init_atu(void); | ||
32 | #endif | 33 | #endif |
33 | 34 | ||
34 | 35 | ||
@@ -112,14 +113,6 @@ extern int init_atu; | |||
112 | #define IOP3XX_INIT_ATU_DISABLE -1 | 113 | #define IOP3XX_INIT_ATU_DISABLE -1 |
113 | #define IOP3XX_INIT_ATU_ENABLE 1 | 114 | #define IOP3XX_INIT_ATU_ENABLE 1 |
114 | 115 | ||
115 | #ifdef CONFIG_IOP3XX_ATU | ||
116 | #define iop3xx_get_init_atu(x) (init_atu == IOP3XX_INIT_ATU_DEFAULT ?\ | ||
117 | IOP3XX_INIT_ATU_ENABLE : init_atu) | ||
118 | #else | ||
119 | #define iop3xx_get_init_atu(x) (init_atu == IOP3XX_INIT_ATU_DEFAULT ?\ | ||
120 | IOP3XX_INIT_ATU_DISABLE : init_atu) | ||
121 | #endif | ||
122 | |||
123 | /* Messaging Unit */ | 116 | /* Messaging Unit */ |
124 | #define IOP3XX_IMR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0310) | 117 | #define IOP3XX_IMR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0310) |
125 | #define IOP3XX_IMR1 (volatile u32 *)IOP3XX_REG_ADDR(0x0314) | 118 | #define IOP3XX_IMR1 (volatile u32 *)IOP3XX_REG_ADDR(0x0314) |
diff --git a/include/asm-arm/mach/pci.h b/include/asm-arm/mach/pci.h index 24621c49a0c7..9d4f6b5ea419 100644 --- a/include/asm-arm/mach/pci.h +++ b/include/asm-arm/mach/pci.h | |||
@@ -55,6 +55,7 @@ void pci_common_init(struct hw_pci *); | |||
55 | extern int iop3xx_pci_setup(int nr, struct pci_sys_data *); | 55 | extern int iop3xx_pci_setup(int nr, struct pci_sys_data *); |
56 | extern struct pci_bus *iop3xx_pci_scan_bus(int nr, struct pci_sys_data *); | 56 | extern struct pci_bus *iop3xx_pci_scan_bus(int nr, struct pci_sys_data *); |
57 | extern void iop3xx_pci_preinit(void); | 57 | extern void iop3xx_pci_preinit(void); |
58 | extern void iop3xx_pci_preinit_cond(void); | ||
58 | 59 | ||
59 | extern int dc21285_setup(int nr, struct pci_sys_data *); | 60 | extern int dc21285_setup(int nr, struct pci_sys_data *); |
60 | extern struct pci_bus *dc21285_scan_bus(int nr, struct pci_sys_data *); | 61 | extern struct pci_bus *dc21285_scan_bus(int nr, struct pci_sys_data *); |