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 | |
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')
-rw-r--r-- | arch/mips/alchemy/mtx-1/Makefile | 2 | ||||
-rw-r--r-- | arch/mips/alchemy/mtx-1/board_setup.c | 49 | ||||
-rw-r--r-- | arch/mips/alchemy/mtx-1/init.c | 6 | ||||
-rw-r--r-- | arch/mips/alchemy/mtx-1/irqmap.c | 56 |
4 files changed, 45 insertions, 68 deletions
diff --git a/arch/mips/alchemy/mtx-1/Makefile b/arch/mips/alchemy/mtx-1/Makefile index 7c67b3d33bec..4a53815b3c6c 100644 --- a/arch/mips/alchemy/mtx-1/Makefile +++ b/arch/mips/alchemy/mtx-1/Makefile | |||
@@ -6,7 +6,7 @@ | |||
6 | # Makefile for 4G Systems MTX-1 board. | 6 | # Makefile for 4G Systems MTX-1 board. |
7 | # | 7 | # |
8 | 8 | ||
9 | lib-y := init.o board_setup.o irqmap.o | 9 | lib-y := init.o board_setup.o |
10 | obj-y := platform.o | 10 | obj-y := platform.o |
11 | 11 | ||
12 | EXTRA_CFLAGS += -Werror | 12 | EXTRA_CFLAGS += -Werror |
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); | ||
diff --git a/arch/mips/alchemy/mtx-1/init.c b/arch/mips/alchemy/mtx-1/init.c index 5e871c8d9e96..f8d25575fa05 100644 --- a/arch/mips/alchemy/mtx-1/init.c +++ b/arch/mips/alchemy/mtx-1/init.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/init.h> | 32 | #include <linux/init.h> |
33 | 33 | ||
34 | #include <asm/bootinfo.h> | 34 | #include <asm/bootinfo.h> |
35 | #include <asm/mach-au1x00/au1000.h> | ||
35 | 36 | ||
36 | #include <prom.h> | 37 | #include <prom.h> |
37 | 38 | ||
@@ -58,3 +59,8 @@ void __init prom_init(void) | |||
58 | strict_strtoul(memsize_str, 0, &memsize); | 59 | strict_strtoul(memsize_str, 0, &memsize); |
59 | add_memory_region(0, memsize, BOOT_MEM_RAM); | 60 | add_memory_region(0, memsize, BOOT_MEM_RAM); |
60 | } | 61 | } |
62 | |||
63 | void prom_putchar(unsigned char c) | ||
64 | { | ||
65 | alchemy_uart_putchar(UART0_PHYS_ADDR, c); | ||
66 | } | ||
diff --git a/arch/mips/alchemy/mtx-1/irqmap.c b/arch/mips/alchemy/mtx-1/irqmap.c deleted file mode 100644 index f1ab12ab3433..000000000000 --- a/arch/mips/alchemy/mtx-1/irqmap.c +++ /dev/null | |||
@@ -1,56 +0,0 @@ | |||
1 | /* | ||
2 | * BRIEF MODULE DESCRIPTION | ||
3 | * Au1xxx irq map table | ||
4 | * | ||
5 | * Copyright 2003 Embedded Edge, LLC | ||
6 | * dan@embeddededge.com | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | * | ||
13 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
14 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
15 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
16 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
17 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
18 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
19 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
20 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
21 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
22 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
23 | * | ||
24 | * You should have received a copy of the GNU General Public License along | ||
25 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
26 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
27 | */ | ||
28 | |||
29 | #include <linux/init.h> | ||
30 | #include <linux/interrupt.h> | ||
31 | #include <asm/mach-au1x00/au1000.h> | ||
32 | |||
33 | char irq_tab_alchemy[][5] __initdata = { | ||
34 | [0] = { -1, INTA, INTA, INTX, INTX }, /* IDSEL 00 - AdapterA-Slot0 (top) */ | ||
35 | [1] = { -1, INTB, INTA, INTX, INTX }, /* IDSEL 01 - AdapterA-Slot1 (bottom) */ | ||
36 | [2] = { -1, INTC, INTD, INTX, INTX }, /* IDSEL 02 - AdapterB-Slot0 (top) */ | ||
37 | [3] = { -1, INTD, INTC, INTX, INTX }, /* IDSEL 03 - AdapterB-Slot1 (bottom) */ | ||
38 | [4] = { -1, INTA, INTB, INTX, INTX }, /* IDSEL 04 - AdapterC-Slot0 (top) */ | ||
39 | [5] = { -1, INTB, INTA, INTX, INTX }, /* IDSEL 05 - AdapterC-Slot1 (bottom) */ | ||
40 | [6] = { -1, INTC, INTD, INTX, INTX }, /* IDSEL 06 - AdapterD-Slot0 (top) */ | ||
41 | [7] = { -1, INTD, INTC, INTX, INTX }, /* IDSEL 07 - AdapterD-Slot1 (bottom) */ | ||
42 | }; | ||
43 | |||
44 | struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { | ||
45 | { AU1500_GPIO_204, IRQF_TRIGGER_HIGH, 0 }, | ||
46 | { AU1500_GPIO_201, IRQF_TRIGGER_LOW, 0 }, | ||
47 | { AU1500_GPIO_202, IRQF_TRIGGER_LOW, 0 }, | ||
48 | { AU1500_GPIO_203, IRQF_TRIGGER_LOW, 0 }, | ||
49 | { AU1500_GPIO_205, IRQF_TRIGGER_LOW, 0 }, | ||
50 | }; | ||
51 | |||
52 | |||
53 | void __init board_init_irq(void) | ||
54 | { | ||
55 | au1xxx_setup_irqmap(au1xxx_irq_map, ARRAY_SIZE(au1xxx_irq_map)); | ||
56 | } | ||