ARM: 5718/1: Sane busids for RealView board components
[safe/jmp/linux-2.6] / arch / arm / mach-realview / core.c
index 27b48be..5a5e1f7 100644 (file)
@@ -28,7 +28,8 @@
 #include <linux/clocksource.h>
 #include <linux/clockchips.h>
 #include <linux/io.h>
-#include <linux/smc911x.h>
+#include <linux/smsc911x.h>
+#include <linux/ata_platform.h>
 
 #include <asm/clkdev.h>
 #include <asm/system.h>
@@ -47,6 +48,9 @@
 
 #include <asm/hardware/gic.h>
 
+#include <mach/platform.h>
+#include <mach/irqs.h>
+
 #include "core.h"
 #include "clock.h"
 
@@ -127,14 +131,15 @@ int realview_flash_register(struct resource *res, u32 num)
        return platform_device_register(&realview_flash_device);
 }
 
-static struct smc911x_platdata realview_smc911x_platdata = {
-       .flags          = SMC911X_USE_32BIT,
-       .irq_flags      = IRQF_SHARED,
-       .irq_polarity   = 1,
+static struct smsc911x_platform_config smsc911x_config = {
+       .flags          = SMSC911X_USE_32BIT,
+       .irq_polarity   = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH,
+       .irq_type       = SMSC911X_IRQ_TYPE_PUSH_PULL,
+       .phy_interface  = PHY_INTERFACE_MODE_MII,
 };
 
 static struct platform_device realview_eth_device = {
-       .name           = "smc911x",
+       .name           = "smsc911x",
        .id             = 0,
        .num_resources  = 2,
 };
@@ -144,12 +149,50 @@ int realview_eth_register(const char *name, struct resource *res)
        if (name)
                realview_eth_device.name = name;
        realview_eth_device.resource = res;
-       if (strcmp(realview_eth_device.name, "smc911x") == 0)
-               realview_eth_device.dev.platform_data = &realview_smc911x_platdata;
+       if (strcmp(realview_eth_device.name, "smsc911x") == 0)
+               realview_eth_device.dev.platform_data = &smsc911x_config;
 
        return platform_device_register(&realview_eth_device);
 }
 
+struct platform_device realview_usb_device = {
+       .name                   = "isp1760",
+       .num_resources          = 2,
+};
+
+int realview_usb_register(struct resource *res)
+{
+       realview_usb_device.resource = res;
+       return platform_device_register(&realview_usb_device);
+}
+
+static struct pata_platform_info pata_platform_data = {
+       .ioport_shift           = 1,
+};
+
+static struct resource pata_resources[] = {
+       [0] = {
+               .start          = REALVIEW_CF_BASE,
+               .end            = REALVIEW_CF_BASE + 0xff,
+               .flags          = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start          = REALVIEW_CF_BASE + 0x100,
+               .end            = REALVIEW_CF_BASE + SZ_4K - 1,
+               .flags          = IORESOURCE_MEM,
+       },
+};
+
+struct platform_device realview_cf_device = {
+       .name                   = "pata_platform",
+       .id                     = -1,
+       .num_resources          = ARRAY_SIZE(pata_resources),
+       .resource               = pata_resources,
+       .dev                    = {
+               .platform_data  = &pata_platform_data,
+       },
+};
+
 static struct resource realview_i2c_resource = {
        .start          = REALVIEW_I2C_BASE,
        .end            = REALVIEW_I2C_BASE + SZ_4K - 1,
@@ -165,8 +208,7 @@ struct platform_device realview_i2c_device = {
 
 static struct i2c_board_info realview_i2c_board_info[] = {
        {
-               I2C_BOARD_INFO("rtc-ds1307", 0xd0 >> 1),
-               .type = "ds1338",
+               I2C_BOARD_INFO("ds1338", 0xd0 >> 1),
        },
 };
 
@@ -179,6 +221,9 @@ arch_initcall(realview_i2c_init);
 
 #define REALVIEW_SYSMCI        (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_MCI_OFFSET)
 
+/*
+ * This is only used if GPIOLIB support is disabled
+ */
 static unsigned int realview_mmc_status(struct device *dev)
 {
        struct amba_device *adev = container_of(dev, struct amba_device, dev);
@@ -195,11 +240,15 @@ static unsigned int realview_mmc_status(struct device *dev)
 struct mmc_platform_data realview_mmc0_plat_data = {
        .ocr_mask       = MMC_VDD_32_33|MMC_VDD_33_34,
        .status         = realview_mmc_status,
+       .gpio_wp        = 17,
+       .gpio_cd        = 16,
 };
 
 struct mmc_platform_data realview_mmc1_plat_data = {
        .ocr_mask       = MMC_VDD_32_33|MMC_VDD_33_34,
        .status         = realview_mmc_status,
+       .gpio_wp        = 19,
+       .gpio_cd        = 18,
 };
 
 /*
@@ -247,31 +296,31 @@ static struct clk ref24_clk = {
 
 static struct clk_lookup lookups[] = {
        {       /* UART0 */
-               .dev_id         = "dev:f1",
+               .dev_id         = "dev:uart0",
                .clk            = &ref24_clk,
        }, {    /* UART1 */
-               .dev_id         = "dev:f2",
+               .dev_id         = "dev:uart1",
                .clk            = &ref24_clk,
        }, {    /* UART2 */
-               .dev_id         = "dev:f3",
+               .dev_id         = "dev:uart2",
                .clk            = &ref24_clk,
        }, {    /* UART3 */
-               .dev_id         = "fpga:09",
+               .dev_id         = "fpga:uart3",
                .clk            = &ref24_clk,
        }, {    /* KMI0 */
-               .dev_id         = "fpga:06",
+               .dev_id         = "fpga:kmi0",
                .clk            = &ref24_clk,
        }, {    /* KMI1 */
-               .dev_id         = "fpga:07",
+               .dev_id         = "fpga:kmi1",
                .clk            = &ref24_clk,
        }, {    /* MMC0 */
-               .dev_id         = "fpga:05",
+               .dev_id         = "fpga:mmc0",
                .clk            = &ref24_clk,
        }, {    /* EB:CLCD */
-               .dev_id         = "dev:20",
+               .dev_id         = "dev:clcd",
                .clk            = &oscvco_clk,
        }, {    /* PB:CLCD */
-               .dev_id         = "issp:20",
+               .dev_id         = "issp:clcd",
                .clk            = &oscvco_clk,
        }
 };
@@ -538,21 +587,22 @@ void realview_leds_event(led_event_t ledevt)
 {
        unsigned long flags;
        u32 val;
+       u32 led = 1 << smp_processor_id();
 
        local_irq_save(flags);
        val = readl(VA_LEDS_BASE);
 
        switch (ledevt) {
        case led_idle_start:
-               val = val & ~REALVIEW_SYS_LED0;
+               val = val & ~led;
                break;
 
        case led_idle_end:
-               val = val | REALVIEW_SYS_LED0;
+               val = val | led;
                break;
 
        case led_timer:
-               val = val ^ REALVIEW_SYS_LED1;
+               val = val ^ REALVIEW_SYS_LED7;
                break;
 
        case led_halted:
@@ -675,7 +725,7 @@ static struct irqaction realview_timer_irq = {
        .handler        = realview_timer_interrupt,
 };
 
-static cycle_t realview_get_cycles(void)
+static cycle_t realview_get_cycles(struct clocksource *cs)
 {
        return ~readl(timer3_va_base + TIMER_VALUE);
 }
@@ -710,14 +760,6 @@ void __init realview_timer_init(unsigned int timer_irq)
 {
        u32 val;
 
-#ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
-       /*
-        * The dummy clock device has to be registered before the main device
-        * so that the latter will broadcast the clock events
-        */
-       local_timer_setup();
-#endif
-
        /* 
         * set clock frequency: 
         *      REALVIEW_REFCLK is 32KHz