diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /arch/mips/alchemy/mtx-1/board_setup.c | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'arch/mips/alchemy/mtx-1/board_setup.c')
-rw-r--r-- | arch/mips/alchemy/mtx-1/board_setup.c | 49 |
1 files changed, 38 insertions, 11 deletions
diff --git a/arch/mips/alchemy/mtx-1/board_setup.c b/arch/mips/alchemy/mtx-1/board_setup.c index 45b61c9b82b9..a9f0336e1f1f 100644 --- a/arch/mips/alchemy/mtx-1/board_setup.c +++ b/arch/mips/alchemy/mtx-1/board_setup.c | |||
@@ -30,32 +30,43 @@ | |||
30 | 30 | ||
31 | #include <linux/gpio.h> | 31 | #include <linux/gpio.h> |
32 | #include <linux/init.h> | 32 | #include <linux/init.h> |
33 | #include <linux/interrupt.h> | ||
34 | #include <linux/pm.h> | ||
33 | 35 | ||
36 | #include <asm/reboot.h> | ||
34 | #include <asm/mach-au1x00/au1000.h> | 37 | #include <asm/mach-au1x00/au1000.h> |
35 | 38 | ||
36 | #include <prom.h> | 39 | #include <prom.h> |
37 | 40 | ||
41 | char irq_tab_alchemy[][5] __initdata = { | ||
42 | [0] = { -1, AU1500_PCI_INTA, AU1500_PCI_INTA, 0xff, 0xff }, /* IDSEL 00 - AdapterA-Slot0 (top) */ | ||
43 | [1] = { -1, AU1500_PCI_INTB, AU1500_PCI_INTA, 0xff, 0xff }, /* IDSEL 01 - AdapterA-Slot1 (bottom) */ | ||
44 | [2] = { -1, AU1500_PCI_INTC, AU1500_PCI_INTD, 0xff, 0xff }, /* IDSEL 02 - AdapterB-Slot0 (top) */ | ||
45 | [3] = { -1, AU1500_PCI_INTD, AU1500_PCI_INTC, 0xff, 0xff }, /* IDSEL 03 - AdapterB-Slot1 (bottom) */ | ||
46 | [4] = { -1, AU1500_PCI_INTA, AU1500_PCI_INTB, 0xff, 0xff }, /* IDSEL 04 - AdapterC-Slot0 (top) */ | ||
47 | [5] = { -1, AU1500_PCI_INTB, AU1500_PCI_INTA, 0xff, 0xff }, /* IDSEL 05 - AdapterC-Slot1 (bottom) */ | ||
48 | [6] = { -1, AU1500_PCI_INTC, AU1500_PCI_INTD, 0xff, 0xff }, /* IDSEL 06 - AdapterD-Slot0 (top) */ | ||
49 | [7] = { -1, AU1500_PCI_INTD, AU1500_PCI_INTC, 0xff, 0xff }, /* IDSEL 07 - AdapterD-Slot1 (bottom) */ | ||
50 | }; | ||
51 | |||
38 | extern int (*board_pci_idsel)(unsigned int devsel, int assert); | 52 | extern int (*board_pci_idsel)(unsigned int devsel, int assert); |
39 | int mtx1_pci_idsel(unsigned int devsel, int assert); | 53 | int mtx1_pci_idsel(unsigned int devsel, int assert); |
40 | 54 | ||
41 | void board_reset(void) | 55 | static void mtx1_reset(char *c) |
42 | { | 56 | { |
43 | /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */ | 57 | /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */ |
44 | au_writel(0x00000000, 0xAE00001C); | 58 | au_writel(0x00000000, 0xAE00001C); |
45 | } | 59 | } |
46 | 60 | ||
47 | void __init board_setup(void) | 61 | static void mtx1_power_off(void) |
48 | { | 62 | { |
49 | #ifdef CONFIG_SERIAL_8250_CONSOLE | 63 | printk(KERN_ALERT "It's now safe to remove power\n"); |
50 | char *argptr; | 64 | while (1) |
51 | argptr = prom_getcmdline(); | 65 | asm volatile (".set mips3 ; wait ; .set mips1"); |
52 | argptr = strstr(argptr, "console="); | 66 | } |
53 | if (argptr == NULL) { | ||
54 | argptr = prom_getcmdline(); | ||
55 | strcat(argptr, " console=ttyS0,115200"); | ||
56 | } | ||
57 | #endif | ||
58 | 67 | ||
68 | void __init board_setup(void) | ||
69 | { | ||
59 | alchemy_gpio2_enable(); | 70 | alchemy_gpio2_enable(); |
60 | 71 | ||
61 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | 72 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) |
@@ -86,6 +97,10 @@ void __init board_setup(void) | |||
86 | alchemy_gpio_direction_output(211, 1); /* green on */ | 97 | alchemy_gpio_direction_output(211, 1); /* green on */ |
87 | alchemy_gpio_direction_output(212, 0); /* red off */ | 98 | alchemy_gpio_direction_output(212, 0); /* red off */ |
88 | 99 | ||
100 | pm_power_off = mtx1_power_off; | ||
101 | _machine_halt = mtx1_power_off; | ||
102 | _machine_restart = mtx1_reset; | ||
103 | |||
89 | printk(KERN_INFO "4G Systems MTX-1 Board\n"); | 104 | printk(KERN_INFO "4G Systems MTX-1 Board\n"); |
90 | } | 105 | } |
91 | 106 | ||
@@ -109,3 +124,15 @@ mtx1_pci_idsel(unsigned int devsel, int assert) | |||
109 | au_sync_udelay(1); | 124 | au_sync_udelay(1); |
110 | return 1; | 125 | return 1; |
111 | } | 126 | } |
127 | |||
128 | static int __init mtx1_init_irq(void) | ||
129 | { | ||
130 | set_irq_type(AU1500_GPIO204_INT, IRQF_TRIGGER_HIGH); | ||
131 | set_irq_type(AU1500_GPIO201_INT, IRQF_TRIGGER_LOW); | ||
132 | set_irq_type(AU1500_GPIO202_INT, IRQF_TRIGGER_LOW); | ||
133 | set_irq_type(AU1500_GPIO203_INT, IRQF_TRIGGER_LOW); | ||
134 | set_irq_type(AU1500_GPIO205_INT, IRQF_TRIGGER_LOW); | ||
135 | |||
136 | return 0; | ||
137 | } | ||
138 | arch_initcall(mtx1_init_irq); | ||