diff options
Diffstat (limited to 'arch/mips/alchemy/xxs1500/board_setup.c')
-rw-r--r-- | arch/mips/alchemy/xxs1500/board_setup.c | 60 |
1 files changed, 34 insertions, 26 deletions
diff --git a/arch/mips/alchemy/xxs1500/board_setup.c b/arch/mips/alchemy/xxs1500/board_setup.c index 4de2d48caed8..47b42927607b 100644 --- a/arch/mips/alchemy/xxs1500/board_setup.c +++ b/arch/mips/alchemy/xxs1500/board_setup.c | |||
@@ -25,31 +25,35 @@ | |||
25 | 25 | ||
26 | #include <linux/gpio.h> | 26 | #include <linux/gpio.h> |
27 | #include <linux/init.h> | 27 | #include <linux/init.h> |
28 | #include <linux/interrupt.h> | ||
28 | #include <linux/delay.h> | 29 | #include <linux/delay.h> |
30 | #include <linux/pm.h> | ||
29 | 31 | ||
32 | #include <asm/reboot.h> | ||
30 | #include <asm/mach-au1x00/au1000.h> | 33 | #include <asm/mach-au1x00/au1000.h> |
31 | 34 | ||
32 | #include <prom.h> | 35 | #include <prom.h> |
33 | 36 | ||
34 | void board_reset(void) | 37 | static void xxs1500_reset(char *c) |
35 | { | 38 | { |
36 | /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */ | 39 | /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */ |
37 | au_writel(0x00000000, 0xAE00001C); | 40 | au_writel(0x00000000, 0xAE00001C); |
38 | } | 41 | } |
39 | 42 | ||
43 | static void xxs1500_power_off(void) | ||
44 | { | ||
45 | printk(KERN_ALERT "It's now safe to remove power\n"); | ||
46 | while (1) | ||
47 | asm volatile (".set mips3 ; wait ; .set mips1"); | ||
48 | } | ||
49 | |||
40 | void __init board_setup(void) | 50 | void __init board_setup(void) |
41 | { | 51 | { |
42 | u32 pin_func; | 52 | u32 pin_func; |
43 | 53 | ||
44 | #ifdef CONFIG_SERIAL_8250_CONSOLE | 54 | pm_power_off = xxs1500_power_off; |
45 | char *argptr; | 55 | _machine_halt = xxs1500_power_off; |
46 | argptr = prom_getcmdline(); | 56 | _machine_restart = xxs1500_reset; |
47 | argptr = strstr(argptr, "console="); | ||
48 | if (argptr == NULL) { | ||
49 | argptr = prom_getcmdline(); | ||
50 | strcat(argptr, " console=ttyS0,115200"); | ||
51 | } | ||
52 | #endif | ||
53 | 57 | ||
54 | alchemy_gpio1_input_enable(); | 58 | alchemy_gpio1_input_enable(); |
55 | alchemy_gpio2_enable(); | 59 | alchemy_gpio2_enable(); |
@@ -68,22 +72,6 @@ void __init board_setup(void) | |||
68 | /* Enable DTR = USB power up */ | 72 | /* Enable DTR = USB power up */ |
69 | au_writel(0x01, UART3_ADDR + UART_MCR); /* UART_MCR_DTR is 0x01??? */ | 73 | au_writel(0x01, UART3_ADDR + UART_MCR); /* UART_MCR_DTR is 0x01??? */ |
70 | 74 | ||
71 | #ifdef CONFIG_PCMCIA_XXS1500 | ||
72 | /* GPIO 0, 1, and 4 are inputs */ | ||
73 | alchemy_gpio_direction_input(0); | ||
74 | alchemy_gpio_direction_input(1); | ||
75 | alchemy_gpio_direction_input(4); | ||
76 | |||
77 | /* GPIO2 208/9/10/11 are inputs */ | ||
78 | alchemy_gpio_direction_input(208); | ||
79 | alchemy_gpio_direction_input(209); | ||
80 | alchemy_gpio_direction_input(210); | ||
81 | alchemy_gpio_direction_input(211); | ||
82 | |||
83 | /* Turn off power */ | ||
84 | alchemy_gpio_direction_output(214, 0); | ||
85 | #endif | ||
86 | |||
87 | #ifdef CONFIG_PCI | 75 | #ifdef CONFIG_PCI |
88 | #if defined(__MIPSEB__) | 76 | #if defined(__MIPSEB__) |
89 | au_writel(0xf | (2 << 6) | (1 << 4), Au1500_PCI_CFG); | 77 | au_writel(0xf | (2 << 6) | (1 << 4), Au1500_PCI_CFG); |
@@ -92,3 +80,23 @@ void __init board_setup(void) | |||
92 | #endif | 80 | #endif |
93 | #endif | 81 | #endif |
94 | } | 82 | } |
83 | |||
84 | static int __init xxs1500_init_irq(void) | ||
85 | { | ||
86 | set_irq_type(AU1500_GPIO204_INT, IRQF_TRIGGER_HIGH); | ||
87 | set_irq_type(AU1500_GPIO201_INT, IRQF_TRIGGER_LOW); | ||
88 | set_irq_type(AU1500_GPIO202_INT, IRQF_TRIGGER_LOW); | ||
89 | set_irq_type(AU1500_GPIO203_INT, IRQF_TRIGGER_LOW); | ||
90 | set_irq_type(AU1500_GPIO205_INT, IRQF_TRIGGER_LOW); | ||
91 | set_irq_type(AU1500_GPIO207_INT, IRQF_TRIGGER_LOW); | ||
92 | |||
93 | set_irq_type(AU1500_GPIO0_INT, IRQF_TRIGGER_LOW); | ||
94 | set_irq_type(AU1500_GPIO1_INT, IRQF_TRIGGER_LOW); | ||
95 | set_irq_type(AU1500_GPIO2_INT, IRQF_TRIGGER_LOW); | ||
96 | set_irq_type(AU1500_GPIO3_INT, IRQF_TRIGGER_LOW); | ||
97 | set_irq_type(AU1500_GPIO4_INT, IRQF_TRIGGER_LOW); /* CF irq */ | ||
98 | set_irq_type(AU1500_GPIO5_INT, IRQF_TRIGGER_LOW); | ||
99 | |||
100 | return 0; | ||
101 | } | ||
102 | arch_initcall(xxs1500_init_irq); | ||