]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/mips/txx9/generic/setup.c
[MIPS] TXx9: Add some pci options
[linux-2.6-omap-h63xx.git] / arch / mips / txx9 / generic / setup.c
index 517828e1ec92d54af91f4ed7fbefac2d9c442466..4fbd7baa7037284b442eb5dad961fb94e4ccf5f0 100644 (file)
 #include <linux/module.h>
 #include <linux/clk.h>
 #include <linux/err.h>
+#include <linux/gpio.h>
 #include <asm/bootinfo.h>
+#include <asm/time.h>
 #include <asm/txx9/generic.h>
+#include <asm/txx9/pci.h>
 #ifdef CONFIG_CPU_TX49XX
 #include <asm/txx9/tx4938.h>
 #endif
@@ -30,6 +33,7 @@ struct resource txx9_ce_res[8];
 static char txx9_ce_res_name[8][4];    /* "CEn" */
 
 /* pcode, internal register */
+unsigned int txx9_pcode;
 char txx9_pcode_str[8];
 static struct resource txx9_reg_res = {
        .name = txx9_pcode_str,
@@ -59,15 +63,16 @@ unsigned int txx9_master_clock;
 unsigned int txx9_cpu_clock;
 unsigned int txx9_gbus_clock;
 
+int txx9_ccfg_toeon __initdata = 1;
 
 /* Minimum CLK support */
 
 struct clk *clk_get(struct device *dev, const char *id)
 {
        if (!strcmp(id, "spi-baseclk"))
-               return (struct clk *)(txx9_gbus_clock / 2 / 4);
+               return (struct clk *)((unsigned long)txx9_gbus_clock / 2 / 4);
        if (!strcmp(id, "imbus_clk"))
-               return (struct clk *)(txx9_gbus_clock / 2);
+               return (struct clk *)((unsigned long)txx9_gbus_clock / 2);
        return ERR_PTR(-ENOENT);
 }
 EXPORT_SYMBOL(clk_get);
@@ -94,6 +99,22 @@ void clk_put(struct clk *clk)
 }
 EXPORT_SYMBOL(clk_put);
 
+/* GPIO support */
+
+#ifdef CONFIG_GENERIC_GPIO
+int gpio_to_irq(unsigned gpio)
+{
+       return -EINVAL;
+}
+EXPORT_SYMBOL(gpio_to_irq);
+
+int irq_to_gpio(unsigned irq)
+{
+       return -EINVAL;
+}
+EXPORT_SYMBOL(irq_to_gpio);
+#endif
+
 extern struct txx9_board_vec jmr3927_vec;
 extern struct txx9_board_vec rbtx4927_vec;
 extern struct txx9_board_vec rbtx4937_vec;
@@ -107,6 +128,12 @@ void __init prom_init_cmdline(void)
        int argc = (int)fw_arg0;
        char **argv = (char **)fw_arg1;
        int i;                  /* Always ignore the "-c" at argv[0] */
+#ifdef CONFIG_64BIT
+       char *fixed_argv[32];
+       for (i = 0; i < argc; i++)
+               fixed_argv[i] = (char *)(long)(*((__s32 *)argv + i));
+       argv = fixed_argv;
+#endif
 
        /* ignore all built-in args if any f/w args given */
        if (argc > 1)
@@ -126,21 +153,25 @@ void __init prom_init(void)
 #endif
 #ifdef CONFIG_CPU_TX49XX
        switch (TX4938_REV_PCODE()) {
+#ifdef CONFIG_TOSHIBA_RBTX4927
        case 0x4927:
                txx9_board_vec = &rbtx4927_vec;
                break;
        case 0x4937:
                txx9_board_vec = &rbtx4937_vec;
                break;
+#endif
+#ifdef CONFIG_TOSHIBA_RBTX4938
        case 0x4938:
                txx9_board_vec = &rbtx4938_vec;
                break;
+#endif
        }
 #endif
 
        strcpy(txx9_system_type, txx9_board_vec->system);
 
-       return txx9_board_vec->prom_init();
+       txx9_board_vec->prom_init();
 }
 
 void __init prom_free_prom_memory(void)
@@ -160,6 +191,13 @@ char * __init prom_getcmdline(void)
 /* wrappers */
 void __init plat_mem_setup(void)
 {
+       ioport_resource.start = 0;
+       ioport_resource.end = ~0UL;     /* no limit */
+       iomem_resource.start = 0;
+       iomem_resource.end = ~0UL;      /* no limit */
+#ifdef CONFIG_PCI
+       pcibios_plat_setup = txx9_pcibios_setup;
+#endif
        txx9_board_vec->mem_setup();
 }
 
@@ -200,3 +238,13 @@ asmlinkage void plat_irq_dispatch(void)
        else
                spurious_interrupt();
 }
+
+/* see include/asm-mips/mach-tx39xx/mangle-port.h, for example. */
+#ifdef NEEDS_TXX9_SWIZZLE_ADDR_B
+static unsigned long __swizzle_addr_none(unsigned long port)
+{
+       return port;
+}
+unsigned long (*__swizzle_addr_b)(unsigned long port) = __swizzle_addr_none;
+EXPORT_SYMBOL(__swizzle_addr_b);
+#endif