Commit aa0d21f7 authored by Paul Mundt's avatar Paul Mundt Committed by Tony Lindgren

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: default avatarTony Lindgren <tony@atomide.com>
parent 82f2348e
......@@ -27,7 +27,7 @@
#include <asm/arch/usb.h>
#include <asm/arch/board.h>
#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")
......
......@@ -36,7 +36,7 @@
#include <asm/arch/tc.h>
#include <asm/arch/usb.h>
#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);
}
......
......@@ -38,7 +38,7 @@
#include <asm/arch/tc.h>
#include <asm/arch/usb.h>
#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);
}
......
......@@ -34,7 +34,7 @@
#include <asm/arch/tc.h>
#include <asm/arch/usb.h>
#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()) {
......
......@@ -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);
}
......
......@@ -29,26 +29,74 @@
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <asm/hardware.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/mach/flash.h>
#include <asm/arch/gpio.h>
#include <asm/arch/usb.h>
#include <asm/arch/mux.h>
#include <asm/arch/tc.h>
#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);
}
......
......@@ -28,7 +28,7 @@
#include <asm/arch/mux.h>
#include <asm/arch/fpga.h>
#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));
......
......@@ -25,6 +25,7 @@
#include <asm/hardware.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/flash.h>
#include <asm/mach/map.h>
#include <asm/arch/gpio.h>
......@@ -32,7 +33,7 @@
#include <asm/arch/mux.h>
#include <asm/arch/usb.h>
#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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment