| board1.patch | | Files affected: | arch/arm/mach-s3c2410/cpu.c | 30 29 + 1 - 0 ! | arch/arm/mach-s3c2410/cpu.h | 16 16 + 0 - 0 ! | arch/arm/mach-s3c2410/mach-bast.c | 4 2 + 2 - 0 ! | arch/arm/mach-s3c2410/mach-h1940.c | 5 3 + 2 - 0 ! | arch/arm/mach-s3c2410/mach-smdk2410.c | 4 2 + 2 - 0 ! | arch/arm/mach-s3c2410/mach-vr1000.c | 5 3 + 2 - 0 ! | arch/arm/mach-s3c2410/s3c2410.c | 24 0 + 24 - 0 ! | arch/arm/mach-s3c2410/s3c2410.h | 15 1 + 14 - 0 ! | arch/arm/mach-s3c2410/s3c2440.c | 5 0 + 5 - 0 ! | 9 files changed, 56 insertions(+), 52 deletions(-) | | Ben Dooks, Tue, 19 Oct 2004 00:55:15 +0100 diff -urN -X ../dontdiff linux-2.6.9-rc4-patched/arch/arm/mach-s3c2410/cpu.c linux-2.6.9-rc4-s3c2440v1/arch/arm/mach-s3c2410/cpu.c --- linux-2.6.9-rc4-patched/arch/arm/mach-s3c2410/cpu.c 2004-10-19 00:01:20.000000000 +0100 +++ linux-2.6.9-rc4-s3c2440v1/arch/arm/mach-s3c2410/cpu.c 2004-10-18 23:53:59.000000000 +0100 @@ -112,6 +112,17 @@ return NULL; } +/* board information */ + +static struct s3c24xx_board *board; + +void s3c24xx_set_board(struct s3c24xx_board *b) +{ + board = b; +} + +/* cpu information */ + static struct cpu_table *cpu; void __init s3c24xx_init_io(struct map_desc *mach_desc, int size) @@ -141,12 +152,29 @@ static int __init s3c_arch_init(void) { + int ret; + // do the correct init for cpu if (cpu == NULL) panic("s3c_arch_init: NULL cpu\n"); - return (cpu->init)(); + ret = (cpu->init)(); + if (ret != 0) + return ret; + + if (board != NULL) { + ret = platform_add_devices(board->devices, board->devices_count); + if (ret) { + printk(KERN_ERR "s3c24xx: failed to add board devices (%d)\n", ret); + } + + /* mask any error, we may not need all these board + * devices */ + ret = 0; + } + + return ret; } arch_initcall(s3c_arch_init); diff -urN -X ../dontdiff linux-2.6.9-rc4-patched/arch/arm/mach-s3c2410/cpu.h linux-2.6.9-rc4-s3c2440v1/arch/arm/mach-s3c2410/cpu.h --- linux-2.6.9-rc4-patched/arch/arm/mach-s3c2410/cpu.h 2004-10-19 00:01:20.000000000 +0100 +++ linux-2.6.9-rc4-s3c2440v1/arch/arm/mach-s3c2410/cpu.h 2004-10-18 23:51:54.000000000 +0100 @@ -11,6 +11,7 @@ * * Modifications: * 24-Aug-2004 BJD Start of generic S3C24XX support + * 18-Oct-2004 BJD Moved board struct into this file */ #define IODESC_ENT(x) { S3C2410_VA_##x, S3C2410_PA_##x, S3C2410_SZ_##x, MT_DEVICE } @@ -38,3 +39,18 @@ #endif extern void s3c24xx_init_io(struct map_desc *mach_desc, int size); + +/* the board structure is used at first initialsation time + * to get info such as the devices to register for this + * board. This is done because platfrom_add_devices() cannot + * be called from the map_io entry. +*/ + +struct s3c24xx_board { + struct platform_device **devices; + unsigned int devices_count; +}; + +extern void s3c24xx_set_board(struct s3c24xx_board *board); + + diff -urN -X ../dontdiff linux-2.6.9-rc4-patched/arch/arm/mach-s3c2410/mach-bast.c linux-2.6.9-rc4-s3c2440v1/arch/arm/mach-s3c2410/mach-bast.c --- linux-2.6.9-rc4-patched/arch/arm/mach-s3c2410/mach-bast.c 2004-10-17 21:15:11.000000000 +0100 +++ linux-2.6.9-rc4-s3c2440v1/arch/arm/mach-s3c2410/mach-bast.c 2004-10-18 23:49:37.000000000 +0100 @@ -207,7 +207,7 @@ &bast_device_nor }; -static struct s3c2410_board bast_board __initdata = { +static struct s3c24xx_board bast_board __initdata = { .devices = bast_devices, .devices_count = ARRAY_SIZE(bast_devices) }; @@ -216,7 +216,7 @@ { s3c24xx_init_io(bast_iodesc, ARRAY_SIZE(bast_iodesc)); s3c2410_init_uarts(bast_uartcfgs, ARRAY_SIZE(bast_uartcfgs)); - s3c2410_set_board(&bast_board); + s3c24xx_set_board(&bast_board); usb_simtec_init(); } diff -urN -X ../dontdiff linux-2.6.9-rc4-patched/arch/arm/mach-s3c2410/mach-h1940.c linux-2.6.9-rc4-s3c2440v1/arch/arm/mach-s3c2410/mach-h1940.c --- linux-2.6.9-rc4-patched/arch/arm/mach-s3c2410/mach-h1940.c 2004-10-19 00:01:20.000000000 +0100 +++ linux-2.6.9-rc4-s3c2440v1/arch/arm/mach-s3c2410/mach-h1940.c 2004-10-18 23:55:02.000000000 +0100 @@ -18,6 +18,7 @@ * 17-Feb-2003 BJD Copied to mach-ipaq.c * 21-Aug-2004 BJD Added struct s3c2410_board * 04-Sep-2004 BJD Changed uart init, renamed ipaq_ -> h1940_ + * 18-Oct-2004 BJD Updated new board structure name */ #include @@ -92,7 +93,7 @@ &s3c_device_iis, }; -static struct s3c2410_board h1940_board __initdata = { +static struct s3c24xx_board h1940_board __initdata = { .devices = h1940_devices, .devices_count = ARRAY_SIZE(h1940_devices) }; @@ -101,7 +102,7 @@ { s3c24xx_init_io(h1940_iodesc, ARRAY_SIZE(h1940_iodesc)); s3c2410_init_uarts(h1940_uartcfgs, ARRAY_SIZE(h1940_uartcfgs)); - s3c2410_set_board(&h1940_board); + s3c24xx_set_board(&h1940_board); } void __init h1940_init_irq(void) diff -urN -X ../dontdiff linux-2.6.9-rc4-patched/arch/arm/mach-s3c2410/mach-smdk2410.c linux-2.6.9-rc4-s3c2440v1/arch/arm/mach-s3c2410/mach-smdk2410.c --- linux-2.6.9-rc4-patched/arch/arm/mach-s3c2410/mach-smdk2410.c 2004-10-17 21:15:11.000000000 +0100 +++ linux-2.6.9-rc4-s3c2440v1/arch/arm/mach-s3c2410/mach-smdk2410.c 2004-10-18 23:51:15.000000000 +0100 @@ -96,7 +96,7 @@ &s3c_device_iis, }; -static struct s3c2410_board smdk2410_board __initdata = { +static struct s3c24xx_board smdk2410_board __initdata = { .devices = smdk2410_devices, .devices_count = ARRAY_SIZE(smdk2410_devices) }; @@ -105,7 +105,7 @@ { s3c24xx_init_io(smdk2410_iodesc, ARRAY_SIZE(smdk2410_iodesc)); s3c2410_init_uarts(smdk2410_uartcfgs, ARRAY_SIZE(smdk2410_uartcfgs)); - s3c2410_set_board(&smdk2410_board); + s3c24xx_set_board(&smdk2410_board); } void __init smdk2410_init_irq(void) diff -urN -X ../dontdiff linux-2.6.9-rc4-patched/arch/arm/mach-s3c2410/mach-vr1000.c linux-2.6.9-rc4-s3c2440v1/arch/arm/mach-s3c2410/mach-vr1000.c --- linux-2.6.9-rc4-patched/arch/arm/mach-s3c2410/mach-vr1000.c 2004-10-17 21:15:11.000000000 +0100 +++ linux-2.6.9-rc4-s3c2440v1/arch/arm/mach-s3c2410/mach-vr1000.c 2004-10-18 23:50:51.000000000 +0100 @@ -16,6 +16,7 @@ * 21-Aug-2004 BJD Added struct s3c2410_board * 06-Aug-2004 BJD Fixed call to time initialisation * 05-Apr-2004 BJD Copied to make mach-vr1000.c + * 18-Oct-2004 BJD Updated board struct */ #include @@ -151,7 +152,7 @@ &s3c_device_iis, }; -static struct s3c2410_board vr1000_board __initdata = { +static struct s3c24xx_board vr1000_board __initdata = { .devices = vr1000_devices, .devices_count = ARRAY_SIZE(vr1000_devices) }; @@ -161,7 +162,7 @@ { s3c24xx_init_io(vr1000_iodesc, ARRAY_SIZE(vr1000_iodesc)); s3c2410_init_uarts(vr1000_uartcfgs, ARRAY_SIZE(vr1000_uartcfgs)); - s3c2410_set_board(&vr1000_board); + s3c24xx_set_board(&vr1000_board); usb_simtec_init(); } diff -urN -X ../dontdiff linux-2.6.9-rc4-patched/arch/arm/mach-s3c2410/s3c2410.c linux-2.6.9-rc4-s3c2440v1/arch/arm/mach-s3c2410/s3c2410.c --- linux-2.6.9-rc4-patched/arch/arm/mach-s3c2410/s3c2410.c 2004-10-19 00:01:20.000000000 +0100 +++ linux-2.6.9-rc4-s3c2440v1/arch/arm/mach-s3c2410/s3c2410.c 2004-10-18 23:52:16.000000000 +0100 @@ -191,13 +191,6 @@ print_mhz(s3c24xx_pclk)); } -static struct s3c2410_board *board; - -void s3c2410_set_board(struct s3c2410_board *b) -{ - board = b; -} - int __init s3c2410_init(void) { int ret; @@ -205,22 +198,5 @@ printk("S3C2410: Initialising architecture\n"); ret = platform_add_devices(uart_devices, ARRAY_SIZE(uart_devices)); - if (ret) - return ret; - - if (board != NULL) { - if (board->devices != NULL) { - ret = platform_add_devices(board->devices, - board->devices_count); - - if (ret) { - printk(KERN_ERR "s3c2410: failed to add board devices (%d)\n", ret); - } - } - - /* not adding board devices may not be fatal */ - ret = 0; - } - return ret; } diff -urN -X ../dontdiff linux-2.6.9-rc4-patched/arch/arm/mach-s3c2410/s3c2410.h linux-2.6.9-rc4-s3c2440v1/arch/arm/mach-s3c2410/s3c2410.h --- linux-2.6.9-rc4-patched/arch/arm/mach-s3c2410/s3c2410.h 2004-10-19 00:01:20.000000000 +0100 +++ linux-2.6.9-rc4-s3c2440v1/arch/arm/mach-s3c2410/s3c2410.h 2004-10-18 23:49:20.000000000 +0100 @@ -13,6 +13,7 @@ * 18-Aug-2004 BJD Created initial version * 20-Aug-2004 BJD Added s3c2410_board struct * 04-Sep-2004 BJD Added s3c2410_init_uarts() call + * 17-Oct-2004 BJD Moved board out to cpu */ struct s3c2410_uartcfg; @@ -25,18 +26,4 @@ extern void s3c2410_init_time(void); -/* the board structure is used at first initialsation time - * to get info such as the devices to register for this - * board. This is done because platfrom_add_devices() cannot - * be called from the map_io entry. - * -*/ - -struct s3c2410_board { - struct platform_device **devices; - unsigned int devices_count; -}; - -extern void s3c2410_set_board(struct s3c2410_board *board); - extern void s3c2410_init_uarts(struct s3c2410_uartcfg *cfg, int no); diff -urN -X ../dontdiff linux-2.6.9-rc4-patched/arch/arm/mach-s3c2410/s3c2440.c linux-2.6.9-rc4-s3c2440v1/arch/arm/mach-s3c2410/s3c2440.c --- linux-2.6.9-rc4-patched/arch/arm/mach-s3c2410/s3c2440.c 2004-10-19 00:01:20.000000000 +0100 +++ linux-2.6.9-rc4-s3c2440v1/arch/arm/mach-s3c2410/s3c2440.c 2004-10-18 23:52:08.000000000 +0100 @@ -178,11 +178,6 @@ printk("S3C2440: Initialising architecture\n"); ret = platform_add_devices(uart_devices, ARRAY_SIZE(uart_devices)); - if (ret) - return ret; - - // todo: board specific inits? - return ret; }