]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-realview/core.c
Merge branch 'cpus4096-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-omap-h63xx.git] / arch / arm / mach-realview / core.c
index d80208a1f1fe593f1e36b996f78fe3b2041132b2..bd2aa4f16141d72895e655f63efe75cf6ffcd298 100644 (file)
@@ -28,7 +28,9 @@
 #include <linux/clocksource.h>
 #include <linux/clockchips.h>
 #include <linux/io.h>
+#include <linux/smc911x.h>
 
+#include <asm/clkdev.h>
 #include <asm/system.h>
 #include <mach/hardware.h>
 #include <asm/irq.h>
@@ -125,6 +127,12 @@ 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 platform_device realview_eth_device = {
        .name           = "smc911x",
        .id             = 0,
@@ -136,6 +144,8 @@ 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;
 
        return platform_device_register(&realview_eth_device);
 }
@@ -209,12 +219,59 @@ static void realview_oscvco_set(struct clk *clk, struct icst307_vco vco)
        writel(0, sys_lock);
 }
 
-struct clk realview_clcd_clk = {
-       .name   = "CLCDCLK",
+static struct clk oscvco_clk = {
        .params = &realview_oscvco_params,
        .setvco = realview_oscvco_set,
 };
 
+/*
+ * These are fixed clocks.
+ */
+static struct clk ref24_clk = {
+       .rate   = 24000000,
+};
+
+static struct clk_lookup lookups[] = {
+       {       /* UART0 */
+               .dev_id         = "dev:f1",
+               .clk            = &ref24_clk,
+       }, {    /* UART1 */
+               .dev_id         = "dev:f2",
+               .clk            = &ref24_clk,
+       }, {    /* UART2 */
+               .dev_id         = "dev:f3",
+               .clk            = &ref24_clk,
+       }, {    /* UART3 */
+               .dev_id         = "fpga:09",
+               .clk            = &ref24_clk,
+       }, {    /* KMI0 */
+               .dev_id         = "fpga:06",
+               .clk            = &ref24_clk,
+       }, {    /* KMI1 */
+               .dev_id         = "fpga:07",
+               .clk            = &ref24_clk,
+       }, {    /* MMC0 */
+               .dev_id         = "fpga:05",
+               .clk            = &ref24_clk,
+       }, {    /* EB:CLCD */
+               .dev_id         = "dev:20",
+               .clk            = &oscvco_clk,
+       }, {    /* PB:CLCD */
+               .dev_id         = "issp:20",
+               .clk            = &oscvco_clk,
+       }
+};
+
+static int __init clk_init(void)
+{
+       int i;
+
+       for (i = 0; i < ARRAY_SIZE(lookups); i++)
+               clkdev_add(&lookups[i]);
+       return 0;
+}
+arch_initcall(clk_init);
+
 /*
  * CLCD support.
  */
@@ -567,7 +624,7 @@ static struct clock_event_device timer0_clockevent =         {
        .set_mode       = timer_set_mode,
        .set_next_event = timer_set_next_event,
        .rating         = 300,
-       .cpumask        = CPU_MASK_ALL,
+       .cpumask        = cpu_all_mask,
 };
 
 static void __init realview_clockevents_init(unsigned int timer_irq)