From: Paul Mundt Date: Mon, 9 May 2005 19:06:34 +0000 (-0700) Subject: ARM: OMAP: Move OMAP1 specific board files to omap1 subdirectory X-Git-Tag: v2.6.13-omap1~198 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=aa0d21f73181d10eba243c4243db05e15f638337;p=linux-2.6-omap-h63xx.git ARM: OMAP: Move OMAP1 specific board files to omap1 subdirectory Sync with linux-omap tree. Moves OMAP1 specific board files to omap1 subdirectory. Signed-off-by: Tony Lindgren --- diff --git a/arch/arm/mach-omap/board-generic.c b/arch/arm/mach-omap/omap1/board-generic.c similarity index 86% rename from arch/arm/mach-omap/board-generic.c rename to arch/arm/mach-omap/omap1/board-generic.c index 2102a2cd101..61178f69b7a 100644 --- a/arch/arm/mach-omap/board-generic.c +++ b/arch/arm/mach-omap/omap1/board-generic.c @@ -27,7 +27,7 @@ #include #include -#include "common.h" +#include "../common.h" static int __initdata generic_serial_ports[OMAP_MAX_NR_PORTS] = {1, 1, 1}; @@ -62,6 +62,8 @@ static struct omap_board_config_kernel generic_config[] = { static void __init omap_generic_init(void) { + const struct omap_uart_config *uart_conf; + /* * Make sure the serial ports are muxed on at this point. * You have to mux them off in device drivers later on @@ -77,6 +79,18 @@ static void __init omap_generic_init(void) generic_config[0].data = &generic1610_usb_config; } #endif + + uart_conf = omap_get_config(OMAP_TAG_UART, struct omap_uart_config); + if (uart_conf != NULL) { + unsigned int enabled_ports, i; + + enabled_ports = uart_conf->enabled_uarts; + for (i = 0; i < 3; i++) { + if (!(enabled_ports & (1 << i))) + generic_serial_ports[i] = 0; + } + } + omap_board_config = generic_config; omap_board_config_size = ARRAY_SIZE(generic_config); omap_serial_init(generic_serial_ports); @@ -84,7 +98,7 @@ static void __init omap_generic_init(void) static void __init omap_generic_map_io(void) { - omap_map_io(); + omap_map_common_io(); } MACHINE_START(OMAP_GENERIC, "Generic OMAP1510/1610/1710") diff --git a/arch/arm/mach-omap/board-h2.c b/arch/arm/mach-omap/omap1/board-h2.c similarity index 92% rename from arch/arm/mach-omap/board-h2.c rename to arch/arm/mach-omap/omap1/board-h2.c index 1f067830d1f..a327211dcfc 100644 --- a/arch/arm/mach-omap/board-h2.c +++ b/arch/arm/mach-omap/omap1/board-h2.c @@ -36,7 +36,7 @@ #include #include -#include "common.h" +#include "../common.h" extern int omap_gpio_init(void); @@ -81,8 +81,7 @@ static struct flash_platform_data h2_flash_data = { }; static struct resource h2_flash_resource = { - .start = OMAP_CS2B_PHYS, - .end = OMAP_CS2B_PHYS + OMAP_CS2B_SIZE - 1, + /* This is on CS3, wherever it's mapped */ .flags = IORESOURCE_MEM, }; @@ -130,7 +129,7 @@ static void __init h2_init_smc91x(void) omap_set_gpio_edge_ctrl(0, OMAP_GPIO_FALLING_EDGE); } -void h2_init_irq(void) +static void __init h2_init_irq(void) { omap_init_irq(); omap_gpio_init(); @@ -165,6 +164,12 @@ static struct omap_board_config_kernel h2_config[] = { static void __init h2_init(void) { + /* NOTE: revC boards support NAND-boot, which can put NOR on CS2B + * and NAND (either 16bit or 8bit) on CS3. + */ + h2_flash_resource.end = h2_flash_resource.start = omap_cs3_phys(); + h2_flash_resource.end += SZ_32M - 1; + platform_add_devices(h2_devices, ARRAY_SIZE(h2_devices)); omap_board_config = h2_config; omap_board_config_size = ARRAY_SIZE(h2_config); @@ -172,7 +177,7 @@ static void __init h2_init(void) static void __init h2_map_io(void) { - omap_map_io(); + omap_map_common_io(); omap_serial_init(h2_serial_ports); } diff --git a/arch/arm/mach-omap/board-h3.c b/arch/arm/mach-omap/omap1/board-h3.c similarity index 90% rename from arch/arm/mach-omap/board-h3.c rename to arch/arm/mach-omap/omap1/board-h3.c index 486a5a006c9..1aeee6d1082 100644 --- a/arch/arm/mach-omap/board-h3.c +++ b/arch/arm/mach-omap/omap1/board-h3.c @@ -38,7 +38,7 @@ #include #include -#include "common.h" +#include "../common.h" extern int omap_gpio_init(void); @@ -83,8 +83,7 @@ static struct flash_platform_data h3_flash_data = { }; static struct resource h3_flash_resource = { - .start = OMAP_CS2B_PHYS, - .end = OMAP_CS2B_PHYS + OMAP_CS2B_SIZE - 1, + /* This is on CS3, wherever it's mapped */ .flags = IORESOURCE_MEM, }; @@ -162,13 +161,24 @@ static struct omap_usb_config h3_usb_config __initdata = { .pins[1] = 3, }; +static struct omap_mmc_config h3_mmc_config __initdata_or_module = { + .mmc_blocks = 1, + .mmc1_power_pin = -1, /* tps65010 GPIO4 */ + .mmc1_switch_pin = OMAP_MPUIO(1), +}; + static struct omap_board_config_kernel h3_config[] = { { OMAP_TAG_USB, &h3_usb_config }, + { OMAP_TAG_MMC, &h3_mmc_config }, }; static void __init h3_init(void) { + h3_flash_resource.end = h3_flash_resource.start = omap_cs3_phys(); + h3_flash_resource.end += OMAP_CS3_SIZE - 1; (void) platform_add_devices(devices, ARRAY_SIZE(devices)); + omap_board_config = h3_config; + omap_board_config_size = ARRAY_SIZE(h3_config); } static void __init h3_init_smc91x(void) @@ -190,7 +200,7 @@ void h3_init_irq(void) static void __init h3_map_io(void) { - omap_map_io(); + omap_map_common_io(); omap_serial_init(h3_serial_ports); } diff --git a/arch/arm/mach-omap/board-innovator.c b/arch/arm/mach-omap/omap1/board-innovator.c similarity index 98% rename from arch/arm/mach-omap/board-innovator.c rename to arch/arm/mach-omap/omap1/board-innovator.c index 57cf4da88d5..b9ed9b6df7e 100644 --- a/arch/arm/mach-omap/board-innovator.c +++ b/arch/arm/mach-omap/omap1/board-innovator.c @@ -34,7 +34,7 @@ #include #include -#include "common.h" +#include "../common.h" static int __initdata innovator_serial_ports[OMAP_MAX_NR_PORTS] = {1, 1, 1}; @@ -174,7 +174,7 @@ static void __init innovator_init_smc91x(void) printk("Error requesting gpio 0 for smc91x irq\n"); return; } - omap_set_gpio_edge_ctrl(0, OMAP_GPIO_RISING_EDGE); + omap_set_gpio_edge_ctrl(0, OMAP_GPIO_FALLING_EDGE); } } @@ -252,7 +252,7 @@ static void __init innovator_init(void) static void __init innovator_map_io(void) { - omap_map_io(); + omap_map_common_io(); #ifdef CONFIG_ARCH_OMAP1510 if (cpu_is_omap1510()) { diff --git a/arch/arm/mach-omap/board-netstar.c b/arch/arm/mach-omap/omap1/board-netstar.c similarity index 99% rename from arch/arm/mach-omap/board-netstar.c rename to arch/arm/mach-omap/omap1/board-netstar.c index 54acbd215c4..e1048be509e 100644 --- a/arch/arm/mach-omap/board-netstar.c +++ b/arch/arm/mach-omap/omap1/board-netstar.c @@ -100,7 +100,7 @@ static int __initdata omap_serial_ports[OMAP_MAX_NR_PORTS] = {1, 1, 1}; static void __init netstar_map_io(void) { - omap_map_io(); + omap_map_common_io(); omap_serial_init(omap_serial_ports); } diff --git a/arch/arm/mach-omap/board-osk.c b/arch/arm/mach-omap/omap1/board-osk.c similarity index 74% rename from arch/arm/mach-omap/board-osk.c rename to arch/arm/mach-omap/omap1/board-osk.c index a951fc82459..ae6dce5cc6c 100644 --- a/arch/arm/mach-omap/board-osk.c +++ b/arch/arm/mach-omap/omap1/board-osk.c @@ -29,26 +29,74 @@ #include #include #include +#include +#include #include #include #include #include +#include #include #include #include #include -#include "common.h" +#include "../common.h" -static struct map_desc osk5912_io_desc[] __initdata = { -{ OMAP_OSK_NOR_FLASH_BASE, OMAP_OSK_NOR_FLASH_START, OMAP_OSK_NOR_FLASH_SIZE, - MT_DEVICE }, -}; static int __initdata osk_serial_ports[OMAP_MAX_NR_PORTS] = {1, 0, 0}; +static struct mtd_partition osk_partitions[] = { + /* bootloader (U-Boot, etc) in first sector */ + { + .name = "bootloader", + .offset = 0, + .size = SZ_128K, + .mask_flags = MTD_WRITEABLE, /* force read-only */ + }, + /* bootloader params in the next sector */ + { + .name = "params", + .offset = MTDPART_OFS_APPEND, + .size = SZ_128K, + .mask_flags = 0, + }, { + .name = "kernel", + .offset = MTDPART_OFS_APPEND, + .size = SZ_2M, + .mask_flags = 0 + }, { + .name = "filesystem", + .offset = MTDPART_OFS_APPEND, + .size = MTDPART_SIZ_FULL, + .mask_flags = 0 + } +}; + +static struct flash_platform_data osk_flash_data = { + .map_name = "cfi_probe", + .width = 2, + .parts = osk_partitions, + .nr_parts = ARRAY_SIZE(osk_partitions), +}; + +static struct resource osk_flash_resource = { + /* this is on CS3, wherever it's mapped */ + .flags = IORESOURCE_MEM, +}; + +static struct platform_device osk5912_flash_device = { + .name = "omapflash", + .id = 0, + .dev = { + .platform_data = &osk_flash_data, + }, + .num_resources = 1, + .resource = &osk_flash_resource, +}; + static struct resource osk5912_smc91x_resources[] = { [0] = { .start = OMAP_OSK_ETHR_START, /* Physical */ @@ -88,6 +136,7 @@ static struct platform_device osk5912_cf_device = { }; static struct platform_device *osk5912_devices[] __initdata = { + &osk5912_flash_device, &osk5912_smc91x_device, &osk5912_cf_device, }; @@ -115,7 +164,7 @@ static void __init osk_init_cf(void) omap_set_gpio_edge_ctrl(62, OMAP_GPIO_FALLING_EDGE); } -void osk_init_irq(void) +static void __init osk_init_irq(void) { omap_init_irq(); omap_gpio_init(); @@ -145,6 +194,8 @@ static struct omap_board_config_kernel osk_config[] = { static void __init osk_init(void) { + osk_flash_resource.end = osk_flash_resource.start = omap_cs3_phys(); + osk_flash_resource.end += SZ_32M - 1; platform_add_devices(osk5912_devices, ARRAY_SIZE(osk5912_devices)); omap_board_config = osk_config; omap_board_config_size = ARRAY_SIZE(osk_config); @@ -153,8 +204,7 @@ static void __init osk_init(void) static void __init osk_map_io(void) { - omap_map_io(); - iotable_init(osk5912_io_desc, ARRAY_SIZE(osk5912_io_desc)); + omap_map_common_io(); omap_serial_init(osk_serial_ports); } diff --git a/arch/arm/mach-omap/board-perseus2.c b/arch/arm/mach-omap/omap1/board-perseus2.c similarity index 98% rename from arch/arm/mach-omap/board-perseus2.c rename to arch/arm/mach-omap/omap1/board-perseus2.c index 64515aeb49c..e3e5cae302f 100644 --- a/arch/arm/mach-omap/board-perseus2.c +++ b/arch/arm/mach-omap/omap1/board-perseus2.c @@ -28,7 +28,7 @@ #include #include -#include "common.h" +#include "../common.h" static struct resource smc91x_resources[] = { [0] = { @@ -140,7 +140,7 @@ static struct map_desc omap_perseus2_io_desc[] __initdata = { static void __init omap_perseus2_map_io(void) { - omap_map_io(); + omap_map_common_io(); iotable_init(omap_perseus2_io_desc, ARRAY_SIZE(omap_perseus2_io_desc)); diff --git a/arch/arm/mach-omap/board-voiceblue.c b/arch/arm/mach-omap/omap1/board-voiceblue.c similarity index 79% rename from arch/arm/mach-omap/board-voiceblue.c rename to arch/arm/mach-omap/omap1/board-voiceblue.c index f1a5bffac66..4759eb9290e 100644 --- a/arch/arm/mach-omap/board-voiceblue.c +++ b/arch/arm/mach-omap/omap1/board-voiceblue.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -32,7 +33,7 @@ #include #include -#include "common.h" +#include "../common.h" extern void omap_init_time(void); extern int omap_gpio_init(void); @@ -87,6 +88,27 @@ static int __init ext_uart_init(void) } arch_initcall(ext_uart_init); +static struct flash_platform_data voiceblue_flash_data = { + .map_name = "cfi_probe", + .width = 2, +}; + +static struct resource voiceblue_flash_resource = { + .start = OMAP_CS0_PHYS, + .end = OMAP_CS0_PHYS + SZ_32M - 1, + .flags = IORESOURCE_MEM, +}; + +static struct platform_device voiceblue_flash_device = { + .name = "omapflash", + .id = 0, + .dev = { + .platform_data = &voiceblue_flash_data, + }, + .num_resources = 1, + .resource = &voiceblue_flash_resource, +}; + static struct resource voiceblue_smc91x_resources[] = { [0] = { .start = OMAP_CS2_PHYS + 0x300, @@ -108,6 +130,7 @@ static struct platform_device voiceblue_smc91x_device = { }; static struct platform_device *voiceblue_devices[] __initdata = { + &voiceblue_flash_device, &voiceblue_smc91x_device, }; @@ -120,8 +143,18 @@ static struct omap_usb_config voiceblue_usb_config __initdata = { .pins[2] = 6, }; +static struct omap_mmc_config voiceblue_mmc_config = { + .mmc_blocks = 1, + .mmc1_power_pin = 2, + .mmc1_switch_pin = -1, +}; + +static struct omap_boot_reason_config voiceblue_boot_reason; + static struct omap_board_config_kernel voiceblue_config[] = { { OMAP_TAG_USB, &voiceblue_usb_config }, + { OMAP_TAG_MMC, &voiceblue_mmc_config }, + { OMAP_TAG_BOOT_REASON, &voiceblue_boot_reason }, }; static void __init voiceblue_init_irq(void) @@ -132,11 +165,10 @@ static void __init voiceblue_init_irq(void) static void __init voiceblue_init(void) { - /* There is a good chance board is going up, so enable Power LED - * (it is connected through invertor) */ - omap_writeb(0x00, OMAP_LPG1_LCR); /* Watchdog */ omap_request_gpio(0); + /* INIT button */ + omap_request_gpio(1); /* smc91x reset */ omap_request_gpio(7); omap_set_gpio_direction(7, 0); @@ -164,13 +196,18 @@ static void __init voiceblue_init(void) platform_add_devices(voiceblue_devices, ARRAY_SIZE(voiceblue_devices)); omap_board_config = voiceblue_config; omap_board_config_size = ARRAY_SIZE(voiceblue_config); + + /* There is a good chance board is going up, so enable power LED + * (it is connected through invertor) */ + omap_writeb(0x00, OMAP_LPG1_LCR); + omap_writeb(0x00, OMAP_LPG1_PMR); /* Disable clock */ } static int __initdata omap_serial_ports[OMAP_MAX_NR_PORTS] = {1, 1, 1}; static void __init voiceblue_map_io(void) { - omap_map_io(); + omap_map_common_io(); omap_serial_init(omap_serial_ports); } @@ -185,9 +222,9 @@ static int panic_event(struct notifier_block *this, unsigned long event, if (test_and_set_bit(MACHINE_PANICED, &machine_state)) return NOTIFY_DONE; - /* Flash Power LED - * (TODO: Enable clock right way (enabled in bootloader already)) */ + /* Flash power LED */ omap_writeb(0x78, OMAP_LPG1_LCR); + omap_writeb(0x01, OMAP_LPG1_PMR); /* Enable clock */ return NOTIFY_DONE; } @@ -196,15 +233,21 @@ static struct notifier_block panic_block = { .notifier_call = panic_event, }; -static int __init setup_notifier(void) +static int __init voiceblue_setup(void) { /* Setup panic notifier */ notifier_chain_register(&panic_notifier_list, &panic_block); + /* This information should come from bootloader. We do it here for + * now... Pushing "init" button (hangs on GPIO1) during power on + * resets device to factory defaults */ + omap_set_gpio_direction(1, 1); + sprintf(voiceblue_boot_reason.reason_str, "poweron%s", + omap_get_gpio_datain(1) ? "" : "-R"); + return 0; } - -postcore_initcall(setup_notifier); +postcore_initcall(voiceblue_setup); static int wdt_gpio_state;