[ARM] 4271/1: iop32x: fix ep80219 detection (support iq80219 platforms)

An iq80219 is a board with an iq31244 layout and an 80219 processor. It
breaks the current assumption that all 80219 processors run on ep80219
platforms. This patch adds the "force_ep80219" option to the kernel to
override boot loaders that have passed in the iq31244 id, and adds the
MACHINE_START definition for ep80219.

[ patch assumes that EP80219 has been added to mach-types ]

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by Dan Williams and committed by Russell King 094f1275 5455a51e

+55 -8
+4
arch/arm/mach-iop32x/Kconfig
··· 4 5 comment "IOP32x Platform Types" 6 7 config MACH_GLANTANK 8 bool "Enable support for the IO-Data GLAN Tank" 9 help ··· 22 23 config ARCH_IQ31244 24 bool "Enable support for EP80219/IQ31244" 25 help 26 Say Y here if you want to run your kernel on the Intel EP80219 27 evaluation kit for the Intel 80219 processor (a IOP321 variant)
··· 4 5 comment "IOP32x Platform Types" 6 7 + config MACH_EP80219 8 + bool 9 + 10 config MACH_GLANTANK 11 bool "Enable support for the IO-Data GLAN Tank" 12 help ··· 19 20 config ARCH_IQ31244 21 bool "Enable support for EP80219/IQ31244" 22 + select MACH_EP80219 23 help 24 Say Y here if you want to run your kernel on the Intel EP80219 25 evaluation kit for the Intel 80219 processor (a IOP321 variant)
+51 -8
arch/arm/mach-iop32x/iq31244.c
··· 39 #include <asm/arch/time.h> 40 41 /* 42 - * The EP80219 and IQ31244 use the same machine ID. To find out 43 - * which of the two we're running on, we look at the processor ID. 44 */ 45 static int is_80219(void) 46 { 47 extern int processor_id; 48 return !!((processor_id & 0xffffffe0) == 0x69052e20); 49 } 50 51 ··· 67 */ 68 static void __init iq31244_timer_init(void) 69 { 70 - if (is_80219()) { 71 /* 33.333 MHz crystal. */ 72 iop_init_time(200000000); 73 } else { ··· 178 179 static int __init iq31244_pci_init(void) 180 { 181 - if (machine_is_iq31244()) { 182 if (is_80219()) { 183 - pci_common_init(&ep80219_pci); 184 - } else { 185 - pci_common_init(&iq31244_pci); 186 } 187 } 188 189 return 0; ··· 296 platform_device_register(&iq31244_flash_device); 297 platform_device_register(&iq31244_serial_device); 298 299 - if (is_80219()) 300 pm_power_off = ep80219_power_off; 301 } 302 303 MACHINE_START(IQ31244, "Intel IQ31244") 304 /* Maintainer: Intel Corp. */ 305 .phys_io = IQ31244_UART, 306 .io_pg_offst = ((IQ31244_UART) >> 18) & 0xfffc,
··· 39 #include <asm/arch/time.h> 40 41 /* 42 + * Until March of 2007 iq31244 platforms and ep80219 platforms shared the 43 + * same machine id, and the processor type was used to select board type. 44 + * However this assumption breaks for an iq80219 board which is an iop219 45 + * processor on an iq31244 board. The force_ep80219 flag has been added 46 + * for old boot loaders using the iq31244 machine id for an ep80219 platform. 47 */ 48 + static int force_ep80219; 49 + 50 static int is_80219(void) 51 { 52 extern int processor_id; 53 return !!((processor_id & 0xffffffe0) == 0x69052e20); 54 + } 55 + 56 + static int is_ep80219(void) 57 + { 58 + if (machine_is_ep80219() || force_ep80219) 59 + return 1; 60 + else 61 + return 0; 62 } 63 64 ··· 54 */ 55 static void __init iq31244_timer_init(void) 56 { 57 + if (is_ep80219()) { 58 /* 33.333 MHz crystal. */ 59 iop_init_time(200000000); 60 } else { ··· 165 166 static int __init iq31244_pci_init(void) 167 { 168 + if (is_ep80219()) 169 + pci_common_init(&ep80219_pci); 170 + else if (machine_is_iq31244()) { 171 if (is_80219()) { 172 + printk("note: iq31244 board type has been selected\n"); 173 + printk("note: to select ep80219 operation:\n"); 174 + printk("\t1/ specify \"force_ep80219\" on the kernel" 175 + " command line\n"); 176 + printk("\t2/ update boot loader to pass" 177 + " the ep80219 id: %d\n", MACH_TYPE_EP80219); 178 } 179 + pci_common_init(&iq31244_pci); 180 } 181 182 return 0; ··· 277 platform_device_register(&iq31244_flash_device); 278 platform_device_register(&iq31244_serial_device); 279 280 + if (is_ep80219()) 281 pm_power_off = ep80219_power_off; 282 } 283 284 + static int __init force_ep80219_setup(char *str) 285 + { 286 + force_ep80219 = 1; 287 + return 1; 288 + } 289 + 290 + __setup("force_ep80219", force_ep80219_setup); 291 + 292 MACHINE_START(IQ31244, "Intel IQ31244") 293 + /* Maintainer: Intel Corp. */ 294 + .phys_io = IQ31244_UART, 295 + .io_pg_offst = ((IQ31244_UART) >> 18) & 0xfffc, 296 + .boot_params = 0xa0000100, 297 + .map_io = iq31244_map_io, 298 + .init_irq = iop32x_init_irq, 299 + .timer = &iq31244_timer, 300 + .init_machine = iq31244_init_machine, 301 + MACHINE_END 302 + 303 + /* There should have been an ep80219 machine identifier from the beginning. 304 + * Boot roms older than March 2007 do not know the ep80219 machine id. Pass 305 + * "force_ep80219" on the kernel command line, otherwise iq31244 operation 306 + * will be selected. 307 + */ 308 + MACHINE_START(EP80219, "Intel EP80219") 309 /* Maintainer: Intel Corp. */ 310 .phys_io = IQ31244_UART, 311 .io_pg_offst = ((IQ31244_UART) >> 18) & 0xfffc,