]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - arch/mips/alchemy/xxs1500/board_setup.c
Merge branch 'oprofile-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[mv-sheeva.git] / arch / mips / alchemy / xxs1500 / board_setup.c
index cad14f8a7c2a2016091de658493646d483976dd4..47b42927607b2eb11d98a1cf8345515260538747 100644 (file)
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/delay.h>
+#include <linux/pm.h>
 
+#include <asm/reboot.h>
 #include <asm/mach-au1x00/au1000.h>
 
 #include <prom.h>
 
-void board_reset(void)
+static void xxs1500_reset(char *c)
 {
        /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */
        au_writel(0x00000000, 0xAE00001C);
 }
 
+static void xxs1500_power_off(void)
+{
+       printk(KERN_ALERT "It's now safe to remove power\n");
+       while (1)
+               asm volatile (".set mips3 ; wait ; .set mips1");
+}
+
 void __init board_setup(void)
 {
        u32 pin_func;
 
-#ifdef CONFIG_SERIAL_8250_CONSOLE
-       char *argptr;
-       argptr = prom_getcmdline();
-       argptr = strstr(argptr, "console=");
-       if (argptr == NULL) {
-               argptr = prom_getcmdline();
-               strcat(argptr, " console=ttyS0,115200");
-       }
-#endif
+       pm_power_off = xxs1500_power_off;
+       _machine_halt = xxs1500_power_off;
+       _machine_restart = xxs1500_reset;
 
        alchemy_gpio1_input_enable();
        alchemy_gpio2_enable();
@@ -69,22 +72,6 @@ void __init board_setup(void)
        /* Enable DTR = USB power up */
        au_writel(0x01, UART3_ADDR + UART_MCR); /* UART_MCR_DTR is 0x01??? */
 
-#ifdef CONFIG_PCMCIA_XXS1500
-       /* GPIO 0, 1, and 4 are inputs */
-       alchemy_gpio_direction_input(0);
-       alchemy_gpio_direction_input(1);
-       alchemy_gpio_direction_input(4);
-
-       /* GPIO2 208/9/10/11 are inputs */
-       alchemy_gpio_direction_input(208);
-       alchemy_gpio_direction_input(209);
-       alchemy_gpio_direction_input(210);
-       alchemy_gpio_direction_input(211);
-
-       /* Turn off power */
-       alchemy_gpio_direction_output(214, 0);
-#endif
-
 #ifdef CONFIG_PCI
 #if defined(__MIPSEB__)
        au_writel(0xf | (2 << 6) | (1 << 4), Au1500_PCI_CFG);
@@ -96,19 +83,19 @@ void __init board_setup(void)
 
 static int __init xxs1500_init_irq(void)
 {
-       set_irq_type(AU1500_GPIO_204, IRQF_TRIGGER_HIGH);
-       set_irq_type(AU1500_GPIO_201, IRQF_TRIGGER_LOW);
-       set_irq_type(AU1500_GPIO_202, IRQF_TRIGGER_LOW);
-       set_irq_type(AU1500_GPIO_203, IRQF_TRIGGER_LOW);
-       set_irq_type(AU1500_GPIO_205, IRQF_TRIGGER_LOW);
-       set_irq_type(AU1500_GPIO_207, IRQF_TRIGGER_LOW);
-
-       set_irq_type(AU1000_GPIO_0, IRQF_TRIGGER_LOW);
-       set_irq_type(AU1000_GPIO_1, IRQF_TRIGGER_LOW);
-       set_irq_type(AU1000_GPIO_2, IRQF_TRIGGER_LOW);
-       set_irq_type(AU1000_GPIO_3, IRQF_TRIGGER_LOW);
-       set_irq_type(AU1000_GPIO_4, IRQF_TRIGGER_LOW); /* CF interrupt */
-       set_irq_type(AU1000_GPIO_5, IRQF_TRIGGER_LOW);
+       set_irq_type(AU1500_GPIO204_INT, IRQF_TRIGGER_HIGH);
+       set_irq_type(AU1500_GPIO201_INT, IRQF_TRIGGER_LOW);
+       set_irq_type(AU1500_GPIO202_INT, IRQF_TRIGGER_LOW);
+       set_irq_type(AU1500_GPIO203_INT, IRQF_TRIGGER_LOW);
+       set_irq_type(AU1500_GPIO205_INT, IRQF_TRIGGER_LOW);
+       set_irq_type(AU1500_GPIO207_INT, IRQF_TRIGGER_LOW);
+
+       set_irq_type(AU1500_GPIO0_INT, IRQF_TRIGGER_LOW);
+       set_irq_type(AU1500_GPIO1_INT, IRQF_TRIGGER_LOW);
+       set_irq_type(AU1500_GPIO2_INT, IRQF_TRIGGER_LOW);
+       set_irq_type(AU1500_GPIO3_INT, IRQF_TRIGGER_LOW);
+       set_irq_type(AU1500_GPIO4_INT, IRQF_TRIGGER_LOW); /* CF irq */
+       set_irq_type(AU1500_GPIO5_INT, IRQF_TRIGGER_LOW);
 
        return 0;
 }