aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/alchemy/devboards/Makefile2
-rw-r--r--arch/mips/alchemy/devboards/db1x00/Makefile2
-rw-r--r--arch/mips/alchemy/devboards/db1x00/board_setup.c4
-rw-r--r--arch/mips/alchemy/devboards/db1x00/platform.c84
-rw-r--r--arch/mips/alchemy/devboards/pb1100/Makefile2
-rw-r--r--arch/mips/alchemy/devboards/pb1100/board_setup.c1
-rw-r--r--arch/mips/alchemy/devboards/pb1100/platform.c43
-rw-r--r--arch/mips/alchemy/devboards/pb1200/platform.c55
-rw-r--r--arch/mips/alchemy/devboards/pb1500/Makefile2
-rw-r--r--arch/mips/alchemy/devboards/pb1500/board_setup.c4
-rw-r--r--arch/mips/alchemy/devboards/pb1500/platform.c42
-rw-r--r--arch/mips/alchemy/devboards/pb1550/Makefile2
-rw-r--r--arch/mips/alchemy/devboards/pb1550/board_setup.c8
-rw-r--r--arch/mips/alchemy/devboards/pb1550/platform.c63
-rw-r--r--arch/mips/alchemy/devboards/platform.c89
-rw-r--r--arch/mips/alchemy/devboards/platform.h18
-rw-r--r--arch/mips/include/asm/mach-db1x00/db1200.h15
-rw-r--r--arch/mips/include/asm/mach-db1x00/db1x00.h8
-rw-r--r--arch/mips/include/asm/mach-pb1x00/pb1100.h36
-rw-r--r--arch/mips/include/asm/mach-pb1x00/pb1200.h14
-rw-r--r--arch/mips/include/asm/mach-pb1x00/pb1500.h36
-rw-r--r--arch/mips/include/asm/mach-pb1x00/pb1550.h7
22 files changed, 412 insertions, 125 deletions
diff --git a/arch/mips/alchemy/devboards/Makefile b/arch/mips/alchemy/devboards/Makefile
index adc6717d7688..cfda9721142b 100644
--- a/arch/mips/alchemy/devboards/Makefile
+++ b/arch/mips/alchemy/devboards/Makefile
@@ -2,7 +2,7 @@
2# Alchemy Develboards 2# Alchemy Develboards
3# 3#
4 4
5obj-y += prom.o bcsr.o 5obj-y += prom.o bcsr.o platform.o
6obj-$(CONFIG_PM) += pm.o 6obj-$(CONFIG_PM) += pm.o
7obj-$(CONFIG_MIPS_PB1000) += pb1000/ 7obj-$(CONFIG_MIPS_PB1000) += pb1000/
8obj-$(CONFIG_MIPS_PB1100) += pb1100/ 8obj-$(CONFIG_MIPS_PB1100) += pb1100/
diff --git a/arch/mips/alchemy/devboards/db1x00/Makefile b/arch/mips/alchemy/devboards/db1x00/Makefile
index ce48d58920d0..613c0c0c8be9 100644
--- a/arch/mips/alchemy/devboards/db1x00/Makefile
+++ b/arch/mips/alchemy/devboards/db1x00/Makefile
@@ -5,4 +5,4 @@
5# Makefile for the Alchemy Semiconductor DBAu1xx0 boards. 5# Makefile for the Alchemy Semiconductor DBAu1xx0 boards.
6# 6#
7 7
8obj-y := board_setup.o 8obj-y := board_setup.o platform.o
diff --git a/arch/mips/alchemy/devboards/db1x00/board_setup.c b/arch/mips/alchemy/devboards/db1x00/board_setup.c
index 9a619aeeaf60..3b228a282b07 100644
--- a/arch/mips/alchemy/devboards/db1x00/board_setup.c
+++ b/arch/mips/alchemy/devboards/db1x00/board_setup.c
@@ -187,8 +187,12 @@ static int __init db1x00_init_irq(void)
187#if defined(CONFIG_MIPS_MIRAGE) 187#if defined(CONFIG_MIPS_MIRAGE)
188 set_irq_type(AU1000_GPIO_7, IRQF_TRIGGER_RISING); /* TS pendown */ 188 set_irq_type(AU1000_GPIO_7, IRQF_TRIGGER_RISING); /* TS pendown */
189#elif defined(CONFIG_MIPS_DB1550) 189#elif defined(CONFIG_MIPS_DB1550)
190 set_irq_type(AU1000_GPIO_0, IRQF_TRIGGER_LOW); /* CD0# */
191 set_irq_type(AU1000_GPIO_1, IRQF_TRIGGER_LOW); /* CD1# */
190 set_irq_type(AU1000_GPIO_3, IRQF_TRIGGER_LOW); /* CARD0# */ 192 set_irq_type(AU1000_GPIO_3, IRQF_TRIGGER_LOW); /* CARD0# */
191 set_irq_type(AU1000_GPIO_5, IRQF_TRIGGER_LOW); /* CARD1# */ 193 set_irq_type(AU1000_GPIO_5, IRQF_TRIGGER_LOW); /* CARD1# */
194 set_irq_type(AU1000_GPIO_21, IRQF_TRIGGER_LOW); /* STSCHG0# */
195 set_irq_type(AU1000_GPIO_22, IRQF_TRIGGER_LOW); /* STSCHG1# */
192#else 196#else
193 set_irq_type(AU1000_GPIO_0, IRQF_TRIGGER_LOW); /* CD0# */ 197 set_irq_type(AU1000_GPIO_0, IRQF_TRIGGER_LOW); /* CD0# */
194 set_irq_type(AU1000_GPIO_3, IRQF_TRIGGER_LOW); /* CD1# */ 198 set_irq_type(AU1000_GPIO_3, IRQF_TRIGGER_LOW); /* CD1# */
diff --git a/arch/mips/alchemy/devboards/db1x00/platform.c b/arch/mips/alchemy/devboards/db1x00/platform.c
new file mode 100644
index 000000000000..b762b790512a
--- /dev/null
+++ b/arch/mips/alchemy/devboards/db1x00/platform.c
@@ -0,0 +1,84 @@
1/*
2 * DBAu1xxx board platform device registration
3 *
4 * Copyright (C) 2009 Manuel Lauss
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include <linux/init.h>
22#include <linux/platform_device.h>
23
24#include <asm/mach-au1x00/au1xxx.h>
25#include "../platform.h"
26
27#if defined(CONFIG_MIPS_DB1000) || defined(CONFIG_MIPS_DB1100) || \
28 defined(CONFIG_MIPS_DB1500) || defined(CONFIG_MIPS_DB1550)
29#define DB1XXX_HAS_PCMCIA
30#endif
31
32/* DB1xxx PCMCIA interrupt sources:
33 * CD0/1 GPIO0/3
34 * STSCHG0/1 GPIO1/4
35 * CARD0/1 GPIO2/5
36 * Db1550: 0/1, 21/22, 3/5
37 */
38#ifndef CONFIG_MIPS_DB1550
39/* Db1000, Db1100, Db1500 */
40#define DB1XXX_PCMCIA_CD0 AU1000_GPIO_0
41#define DB1XXX_PCMCIA_STSCHG0 AU1000_GPIO_1
42#define DB1XXX_PCMCIA_CARD0 AU1000_GPIO_2
43#define DB1XXX_PCMCIA_CD1 AU1000_GPIO_3
44#define DB1XXX_PCMCIA_STSCHG1 AU1000_GPIO_4
45#define DB1XXX_PCMCIA_CARD1 AU1000_GPIO_5
46#else
47#define DB1XXX_PCMCIA_CD0 AU1000_GPIO_0
48#define DB1XXX_PCMCIA_STSCHG0 AU1500_GPIO_21
49#define DB1XXX_PCMCIA_CARD0 AU1000_GPIO_3
50#define DB1XXX_PCMCIA_CD1 AU1000_GPIO_1
51#define DB1XXX_PCMCIA_STSCHG1 AU1500_GPIO_22
52#define DB1XXX_PCMCIA_CARD1 AU1000_GPIO_5
53#endif
54
55static int __init db1xxx_dev_init(void)
56{
57#ifdef DB1XXX_HAS_PCMCIA
58 db1x_register_pcmcia_socket(PCMCIA_ATTR_PSEUDO_PHYS,
59 PCMCIA_ATTR_PSEUDO_PHYS + 0x00040000 - 1,
60 PCMCIA_MEM_PSEUDO_PHYS,
61 PCMCIA_MEM_PSEUDO_PHYS + 0x00040000 - 1,
62 PCMCIA_IO_PSEUDO_PHYS,
63 PCMCIA_IO_PSEUDO_PHYS + 0x00001000 - 1,
64 DB1XXX_PCMCIA_CARD0,
65 DB1XXX_PCMCIA_CD0,
66 /*DB1XXX_PCMCIA_STSCHG0*/0,
67 0,
68 0);
69
70 db1x_register_pcmcia_socket(PCMCIA_ATTR_PSEUDO_PHYS + 0x00400000,
71 PCMCIA_ATTR_PSEUDO_PHYS + 0x00440000 - 1,
72 PCMCIA_MEM_PSEUDO_PHYS + 0x00400000,
73 PCMCIA_MEM_PSEUDO_PHYS + 0x00440000 - 1,
74 PCMCIA_IO_PSEUDO_PHYS + 0x00400000,
75 PCMCIA_IO_PSEUDO_PHYS + 0x00401000 - 1,
76 DB1XXX_PCMCIA_CARD1,
77 DB1XXX_PCMCIA_CD1,
78 /*DB1XXX_PCMCIA_STSCHG1*/0,
79 0,
80 1);
81#endif
82 return 0;
83}
84device_initcall(db1xxx_dev_init);
diff --git a/arch/mips/alchemy/devboards/pb1100/Makefile b/arch/mips/alchemy/devboards/pb1100/Makefile
index c586dd7e91dc..7e3756c83fe5 100644
--- a/arch/mips/alchemy/devboards/pb1100/Makefile
+++ b/arch/mips/alchemy/devboards/pb1100/Makefile
@@ -5,4 +5,4 @@
5# Makefile for the Alchemy Semiconductor Pb1100 board. 5# Makefile for the Alchemy Semiconductor Pb1100 board.
6# 6#
7 7
8obj-y := board_setup.o 8obj-y := board_setup.o platform.o
diff --git a/arch/mips/alchemy/devboards/pb1100/board_setup.c b/arch/mips/alchemy/devboards/pb1100/board_setup.c
index aad424a5f45e..b282d93d1445 100644
--- a/arch/mips/alchemy/devboards/pb1100/board_setup.c
+++ b/arch/mips/alchemy/devboards/pb1100/board_setup.c
@@ -29,7 +29,6 @@
29#include <linux/interrupt.h> 29#include <linux/interrupt.h>
30 30
31#include <asm/mach-au1x00/au1000.h> 31#include <asm/mach-au1x00/au1000.h>
32#include <asm/mach-pb1x00/pb1100.h>
33#include <asm/mach-db1x00/bcsr.h> 32#include <asm/mach-db1x00/bcsr.h>
34 33
35#include <prom.h> 34#include <prom.h>
diff --git a/arch/mips/alchemy/devboards/pb1100/platform.c b/arch/mips/alchemy/devboards/pb1100/platform.c
new file mode 100644
index 000000000000..8487da55a10c
--- /dev/null
+++ b/arch/mips/alchemy/devboards/pb1100/platform.c
@@ -0,0 +1,43 @@
1/*
2 * Pb1100 board platform device registration
3 *
4 * Copyright (C) 2009 Manuel Lauss
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include <linux/init.h>
22
23#include <asm/mach-au1x00/au1000.h>
24
25#include "../platform.h"
26
27static int __init pb1100_dev_init(void)
28{
29 /* PCMCIA. single socket, identical to Pb1500 */
30 db1x_register_pcmcia_socket(PCMCIA_ATTR_PSEUDO_PHYS,
31 PCMCIA_ATTR_PSEUDO_PHYS + 0x00040000 - 1,
32 PCMCIA_MEM_PSEUDO_PHYS,
33 PCMCIA_MEM_PSEUDO_PHYS + 0x00040000 - 1,
34 PCMCIA_IO_PSEUDO_PHYS,
35 PCMCIA_IO_PSEUDO_PHYS + 0x00001000 - 1,
36 AU1000_GPIO_11, /* card */
37 AU1000_GPIO_9, /* insert */
38 /*AU1000_GPIO_10*/0, /* stschg */
39 0, /* eject */
40 0); /* id */
41 return 0;
42}
43device_initcall(pb1100_dev_init);
diff --git a/arch/mips/alchemy/devboards/pb1200/platform.c b/arch/mips/alchemy/devboards/pb1200/platform.c
index dfdaabf77909..c8b7ae3f3253 100644
--- a/arch/mips/alchemy/devboards/pb1200/platform.c
+++ b/arch/mips/alchemy/devboards/pb1200/platform.c
@@ -28,6 +28,8 @@
28#include <asm/mach-au1x00/au1100_mmc.h> 28#include <asm/mach-au1x00/au1100_mmc.h>
29#include <asm/mach-db1x00/bcsr.h> 29#include <asm/mach-db1x00/bcsr.h>
30 30
31#include "../platform.h"
32
31static int mmc_activity; 33static int mmc_activity;
32 34
33static void pb1200mmc0_set_power(void *mmc_host, int state) 35static void pb1200mmc0_set_power(void *mmc_host, int state)
@@ -170,8 +172,57 @@ static struct platform_device *board_platform_devices[] __initdata = {
170 172
171static int __init board_register_devices(void) 173static int __init board_register_devices(void)
172{ 174{
175#ifdef CONFIG_MIPS_PB1200
176 db1x_register_pcmcia_socket(PCMCIA_ATTR_PSEUDO_PHYS,
177 PCMCIA_ATTR_PSEUDO_PHYS + 0x00040000 - 1,
178 PCMCIA_MEM_PSEUDO_PHYS,
179 PCMCIA_MEM_PSEUDO_PHYS + 0x00040000 - 1,
180 PCMCIA_IO_PSEUDO_PHYS,
181 PCMCIA_IO_PSEUDO_PHYS + 0x00001000 - 1,
182 PB1200_PC0_INT,
183 PB1200_PC0_INSERT_INT,
184 /*PB1200_PC0_STSCHG_INT*/0,
185 PB1200_PC0_EJECT_INT,
186 0);
187
188 db1x_register_pcmcia_socket(PCMCIA_ATTR_PSEUDO_PHYS + 0x00800000,
189 PCMCIA_ATTR_PSEUDO_PHYS + 0x00840000 - 1,
190 PCMCIA_MEM_PSEUDO_PHYS + 0x00800000,
191 PCMCIA_MEM_PSEUDO_PHYS + 0x00840000 - 1,
192 PCMCIA_IO_PSEUDO_PHYS + 0x00800000,
193 PCMCIA_IO_PSEUDO_PHYS + 0x00801000 - 1,
194 PB1200_PC1_INT,
195 PB1200_PC1_INSERT_INT,
196 /*PB1200_PC1_STSCHG_INT*/0,
197 PB1200_PC1_EJECT_INT,
198 1);
199#else
200 db1x_register_pcmcia_socket(PCMCIA_ATTR_PSEUDO_PHYS,
201 PCMCIA_ATTR_PSEUDO_PHYS + 0x00040000 - 1,
202 PCMCIA_MEM_PSEUDO_PHYS,
203 PCMCIA_MEM_PSEUDO_PHYS + 0x00040000 - 1,
204 PCMCIA_IO_PSEUDO_PHYS,
205 PCMCIA_IO_PSEUDO_PHYS + 0x00001000 - 1,
206 DB1200_PC0_INT,
207 DB1200_PC0_INSERT_INT,
208 /*DB1200_PC0_STSCHG_INT*/0,
209 DB1200_PC0_EJECT_INT,
210 0);
211
212 db1x_register_pcmcia_socket(PCMCIA_ATTR_PSEUDO_PHYS + 0x00400000,
213 PCMCIA_ATTR_PSEUDO_PHYS + 0x00440000 - 1,
214 PCMCIA_MEM_PSEUDO_PHYS + 0x00400000,
215 PCMCIA_MEM_PSEUDO_PHYS + 0x00440000 - 1,
216 PCMCIA_IO_PSEUDO_PHYS + 0x00400000,
217 PCMCIA_IO_PSEUDO_PHYS + 0x00401000 - 1,
218 DB1200_PC1_INT,
219 DB1200_PC1_INSERT_INT,
220 /*DB1200_PC1_STSCHG_INT*/0,
221 DB1200_PC1_EJECT_INT,
222 1);
223#endif
224
173 return platform_add_devices(board_platform_devices, 225 return platform_add_devices(board_platform_devices,
174 ARRAY_SIZE(board_platform_devices)); 226 ARRAY_SIZE(board_platform_devices));
175} 227}
176 228device_initcall(board_register_devices);
177arch_initcall(board_register_devices);
diff --git a/arch/mips/alchemy/devboards/pb1500/Makefile b/arch/mips/alchemy/devboards/pb1500/Makefile
index 173b419a7479..e83b151b5b63 100644
--- a/arch/mips/alchemy/devboards/pb1500/Makefile
+++ b/arch/mips/alchemy/devboards/pb1500/Makefile
@@ -5,4 +5,4 @@
5# Makefile for the Alchemy Semiconductor Pb1500 board. 5# Makefile for the Alchemy Semiconductor Pb1500 board.
6# 6#
7 7
8obj-y := board_setup.o 8obj-y := board_setup.o platform.o
diff --git a/arch/mips/alchemy/devboards/pb1500/board_setup.c b/arch/mips/alchemy/devboards/pb1500/board_setup.c
index bf8e14906ea4..a148802fa427 100644
--- a/arch/mips/alchemy/devboards/pb1500/board_setup.c
+++ b/arch/mips/alchemy/devboards/pb1500/board_setup.c
@@ -29,7 +29,6 @@
29#include <linux/interrupt.h> 29#include <linux/interrupt.h>
30 30
31#include <asm/mach-au1x00/au1000.h> 31#include <asm/mach-au1x00/au1000.h>
32#include <asm/mach-pb1x00/pb1500.h>
33#include <asm/mach-db1x00/bcsr.h> 32#include <asm/mach-db1x00/bcsr.h>
34 33
35#include <prom.h> 34#include <prom.h>
@@ -156,6 +155,9 @@ void __init board_setup(void)
156 155
157static int __init pb1500_init_irq(void) 156static int __init pb1500_init_irq(void)
158{ 157{
158 set_irq_type(AU1000_GPIO_9, IRQF_TRIGGER_LOW); /* CD0# */
159 set_irq_type(AU1000_GPIO_10, IRQF_TRIGGER_LOW); /* CARD0 */
160 set_irq_type(AU1000_GPIO_11, IRQF_TRIGGER_LOW); /* STSCHG0# */
159 set_irq_type(AU1500_GPIO_204, IRQF_TRIGGER_HIGH); 161 set_irq_type(AU1500_GPIO_204, IRQF_TRIGGER_HIGH);
160 set_irq_type(AU1500_GPIO_201, IRQF_TRIGGER_LOW); 162 set_irq_type(AU1500_GPIO_201, IRQF_TRIGGER_LOW);
161 set_irq_type(AU1500_GPIO_202, IRQF_TRIGGER_LOW); 163 set_irq_type(AU1500_GPIO_202, IRQF_TRIGGER_LOW);
diff --git a/arch/mips/alchemy/devboards/pb1500/platform.c b/arch/mips/alchemy/devboards/pb1500/platform.c
new file mode 100644
index 000000000000..6c00cbe529a2
--- /dev/null
+++ b/arch/mips/alchemy/devboards/pb1500/platform.c
@@ -0,0 +1,42 @@
1/*
2 * Pb1500 board platform device registration
3 *
4 * Copyright (C) 2009 Manuel Lauss
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include <linux/init.h>
22#include <asm/mach-au1x00/au1000.h>
23
24#include "../platform.h"
25
26static int __init pb1500_dev_init(void)
27{
28 /* PCMCIA. single socket, identical to Pb1500 */
29 db1x_register_pcmcia_socket(PCMCIA_ATTR_PSEUDO_PHYS,
30 PCMCIA_ATTR_PSEUDO_PHYS + 0x00040000 - 1,
31 PCMCIA_MEM_PSEUDO_PHYS,
32 PCMCIA_MEM_PSEUDO_PHYS + 0x00040000 - 1,
33 PCMCIA_IO_PSEUDO_PHYS,
34 PCMCIA_IO_PSEUDO_PHYS + 0x00001000 - 1,
35 AU1000_GPIO_11, /* card */
36 AU1000_GPIO_9, /* insert */
37 /*AU1000_GPIO_10*/0, /* stschg */
38 0, /* eject */
39 0); /* id */
40 return 0;
41}
42device_initcall(pb1500_dev_init);
diff --git a/arch/mips/alchemy/devboards/pb1550/Makefile b/arch/mips/alchemy/devboards/pb1550/Makefile
index cff95bcdb2ca..9661b6ec5dd3 100644
--- a/arch/mips/alchemy/devboards/pb1550/Makefile
+++ b/arch/mips/alchemy/devboards/pb1550/Makefile
@@ -5,4 +5,4 @@
5# Makefile for the Alchemy Semiconductor Pb1550 board. 5# Makefile for the Alchemy Semiconductor Pb1550 board.
6# 6#
7 7
8obj-y := board_setup.o 8obj-y := board_setup.o platform.o
diff --git a/arch/mips/alchemy/devboards/pb1550/board_setup.c b/arch/mips/alchemy/devboards/pb1550/board_setup.c
index 64f1ff9e0131..64a6fc4f1751 100644
--- a/arch/mips/alchemy/devboards/pb1550/board_setup.c
+++ b/arch/mips/alchemy/devboards/pb1550/board_setup.c
@@ -33,6 +33,7 @@
33#include <asm/mach-au1x00/au1000.h> 33#include <asm/mach-au1x00/au1000.h>
34#include <asm/mach-pb1x00/pb1550.h> 34#include <asm/mach-pb1x00/pb1550.h>
35#include <asm/mach-db1x00/bcsr.h> 35#include <asm/mach-db1x00/bcsr.h>
36#include <asm/mach-au1x00/gpio.h>
36 37
37#include <prom.h> 38#include <prom.h>
38 39
@@ -70,6 +71,8 @@ void __init board_setup(void)
70 } 71 }
71#endif 72#endif
72 73
74 alchemy_gpio2_enable();
75
73 /* 76 /*
74 * Enable PSC1 SYNC for AC'97. Normaly done in audio driver, 77 * Enable PSC1 SYNC for AC'97. Normaly done in audio driver,
75 * but it is board specific code, so put it here. 78 * but it is board specific code, so put it here.
@@ -88,6 +91,11 @@ static int __init pb1550_init_irq(void)
88{ 91{
89 set_irq_type(AU1000_GPIO_0, IRQF_TRIGGER_LOW); 92 set_irq_type(AU1000_GPIO_0, IRQF_TRIGGER_LOW);
90 set_irq_type(AU1000_GPIO_1, IRQF_TRIGGER_LOW); 93 set_irq_type(AU1000_GPIO_1, IRQF_TRIGGER_LOW);
94 set_irq_type(AU1500_GPIO_201_205, IRQF_TRIGGER_HIGH);
95
96 /* enable both PCMCIA card irqs in the shared line */
97 alchemy_gpio2_enable_int(201);
98 alchemy_gpio2_enable_int(202);
91 99
92 return 0; 100 return 0;
93} 101}
diff --git a/arch/mips/alchemy/devboards/pb1550/platform.c b/arch/mips/alchemy/devboards/pb1550/platform.c
new file mode 100644
index 000000000000..aa5016c2e868
--- /dev/null
+++ b/arch/mips/alchemy/devboards/pb1550/platform.c
@@ -0,0 +1,63 @@
1/*
2 * Pb1550 board platform device registration
3 *
4 * Copyright (C) 2009 Manuel Lauss
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include <linux/init.h>
22
23#include <asm/mach-au1x00/au1000.h>
24#include <asm/mach-pb1x00/pb1550.h>
25
26#include "../platform.h"
27
28static int __init pb1550_dev_init(void)
29{
30 /* Pb1550, like all others, also has statuschange irqs; however they're
31 * wired up on one of the Au1550's shared GPIO201_205 line, which also
32 * services the PCMCIA card interrupts. So we ignore statuschange and
33 * use the GPIO201_205 exclusively for card interrupts, since a) pcmcia
34 * drivers are used to shared irqs and b) statuschange isn't really use-
35 * ful anyway.
36 */
37 db1x_register_pcmcia_socket(PCMCIA_ATTR_PSEUDO_PHYS,
38 PCMCIA_ATTR_PSEUDO_PHYS + 0x00040000 - 1,
39 PCMCIA_MEM_PSEUDO_PHYS,
40 PCMCIA_MEM_PSEUDO_PHYS + 0x00040000 - 1,
41 PCMCIA_IO_PSEUDO_PHYS,
42 PCMCIA_IO_PSEUDO_PHYS + 0x00001000 - 1,
43 AU1500_GPIO_201_205,
44 AU1000_GPIO_0,
45 0,
46 0,
47 0);
48
49 db1x_register_pcmcia_socket(PCMCIA_ATTR_PSEUDO_PHYS + 0x00800000,
50 PCMCIA_ATTR_PSEUDO_PHYS + 0x00840000 - 1,
51 PCMCIA_MEM_PSEUDO_PHYS + 0x00800000,
52 PCMCIA_MEM_PSEUDO_PHYS + 0x00840000 - 1,
53 PCMCIA_IO_PSEUDO_PHYS + 0x00800000,
54 PCMCIA_IO_PSEUDO_PHYS + 0x00801000 - 1,
55 AU1500_GPIO_201_205,
56 AU1000_GPIO_1,
57 0,
58 0,
59 1);
60
61 return 0;
62}
63device_initcall(pb1550_dev_init);
diff --git a/arch/mips/alchemy/devboards/platform.c b/arch/mips/alchemy/devboards/platform.c
new file mode 100644
index 000000000000..48c537cc8efb
--- /dev/null
+++ b/arch/mips/alchemy/devboards/platform.c
@@ -0,0 +1,89 @@
1/*
2 * devoard misc stuff.
3 */
4
5#include <linux/init.h>
6#include <linux/slab.h>
7#include <linux/platform_device.h>
8
9/* register a pcmcia socket */
10int __init db1x_register_pcmcia_socket(unsigned long pseudo_attr_start,
11 unsigned long pseudo_attr_end,
12 unsigned long pseudo_mem_start,
13 unsigned long pseudo_mem_end,
14 unsigned long pseudo_io_start,
15 unsigned long pseudo_io_end,
16 int card_irq,
17 int cd_irq,
18 int stschg_irq,
19 int eject_irq,
20 int id)
21{
22 int cnt, i, ret;
23 struct resource *sr;
24 struct platform_device *pd;
25
26 cnt = 5;
27 if (eject_irq)
28 cnt++;
29 if (stschg_irq)
30 cnt++;
31
32 sr = kzalloc(sizeof(struct resource) * cnt, GFP_KERNEL);
33 if (!sr)
34 return -ENOMEM;
35
36 pd = platform_device_alloc("db1xxx_pcmcia", id);
37 if (!pd) {
38 ret = -ENOMEM;
39 goto out;
40 }
41
42 sr[0].name = "pseudo-attr";
43 sr[0].flags = IORESOURCE_MEM;
44 sr[0].start = pseudo_attr_start;
45 sr[0].end = pseudo_attr_end;
46
47 sr[1].name = "pseudo-mem";
48 sr[1].flags = IORESOURCE_MEM;
49 sr[1].start = pseudo_mem_start;
50 sr[1].end = pseudo_mem_end;
51
52 sr[2].name = "pseudo-io";
53 sr[2].flags = IORESOURCE_MEM;
54 sr[2].start = pseudo_io_start;
55 sr[2].end = pseudo_io_end;
56
57 sr[3].name = "insert";
58 sr[3].flags = IORESOURCE_IRQ;
59 sr[3].start = sr[3].end = cd_irq;
60
61 sr[4].name = "card";
62 sr[4].flags = IORESOURCE_IRQ;
63 sr[4].start = sr[4].end = card_irq;
64
65 i = 5;
66 if (stschg_irq) {
67 sr[i].name = "insert";
68 sr[i].flags = IORESOURCE_IRQ;
69 sr[i].start = sr[i].end = cd_irq;
70 i++;
71 }
72 if (eject_irq) {
73 sr[i].name = "eject";
74 sr[i].flags = IORESOURCE_IRQ;
75 sr[i].start = sr[i].end = eject_irq;
76 }
77
78 pd->resource = sr;
79 pd->num_resources = cnt;
80
81 ret = platform_device_add(pd);
82 if (!ret)
83 return 0;
84
85 platform_device_put(pd);
86out:
87 kfree(sr);
88 return ret;
89}
diff --git a/arch/mips/alchemy/devboards/platform.h b/arch/mips/alchemy/devboards/platform.h
new file mode 100644
index 000000000000..55ecf7e9258f
--- /dev/null
+++ b/arch/mips/alchemy/devboards/platform.h
@@ -0,0 +1,18 @@
1#ifndef _DEVBOARD_PLATFORM_H_
2#define _DEVBOARD_PLATFORM_H_
3
4#include <linux/init.h>
5
6int __init db1x_register_pcmcia_socket(unsigned long pseudo_attr_start,
7 unsigned long pseudo_attr_len,
8 unsigned long pseudo_mem_start,
9 unsigned long pseudo_mem_end,
10 unsigned long pseudo_io_start,
11 unsigned long pseudo_io_end,
12 int card_irq,
13 int cd_irq,
14 int stschg_irq,
15 int eject_irq,
16 int id);
17
18#endif
diff --git a/arch/mips/include/asm/mach-db1x00/db1200.h b/arch/mips/include/asm/mach-db1x00/db1200.h
index b7f18e1af50c..52b1d84a92c7 100644
--- a/arch/mips/include/asm/mach-db1x00/db1200.h
+++ b/arch/mips/include/asm/mach-db1x00/db1200.h
@@ -103,21 +103,6 @@ enum external_pb1200_ints {
103 DB1200_INT_END = DB1200_INT_BEGIN + 15, 103 DB1200_INT_END = DB1200_INT_BEGIN + 15,
104}; 104};
105 105
106
107/*
108 * DBAu1200 specific PCMCIA defines for drivers/pcmcia/au1000_db1x00.c
109 */
110#define PCMCIA_MAX_SOCK 1
111#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1)
112
113/* VPP/VCC */
114#define SET_VCC_VPP(VCC, VPP, SLOT) \
115 ((((VCC) << 2) | ((VPP) << 0)) << ((SLOT) * 8))
116
117#define BOARD_PC0_INT DB1200_PC0_INT
118#define BOARD_PC1_INT DB1200_PC1_INT
119#define BOARD_CARD_INSERTED(SOCKET) (bcsr_read(BCSR_SIGSTAT) & (1 << (8 + (2 * SOCKET))))
120
121/* NAND chip select */ 106/* NAND chip select */
122#define NAND_CS 1 107#define NAND_CS 1
123 108
diff --git a/arch/mips/include/asm/mach-db1x00/db1x00.h b/arch/mips/include/asm/mach-db1x00/db1x00.h
index cfa64297da08..a919dac525a1 100644
--- a/arch/mips/include/asm/mach-db1x00/db1x00.h
+++ b/arch/mips/include/asm/mach-db1x00/db1x00.h
@@ -45,14 +45,6 @@
45 45
46#endif 46#endif
47 47
48/* PCMCIA DBAu1x00 specific defines */
49#define PCMCIA_MAX_SOCK 1
50#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1)
51
52/* VPP/VCC */
53#define SET_VCC_VPP(VCC, VPP, SLOT)\
54 ((((VCC) << 2) | ((VPP) << 0)) << ((SLOT) * 8))
55
56/* 48/*
57 * NAND defines 49 * NAND defines
58 * 50 *
diff --git a/arch/mips/include/asm/mach-pb1x00/pb1100.h b/arch/mips/include/asm/mach-pb1x00/pb1100.h
deleted file mode 100644
index f2bf73a11fb2..000000000000
--- a/arch/mips/include/asm/mach-pb1x00/pb1100.h
+++ /dev/null
@@ -1,36 +0,0 @@
1/*
2 * Alchemy Semi Pb1100 Referrence Board
3 *
4 * Copyright 2001, 2008 MontaVista Software Inc.
5 * Author: MontaVista Software, Inc. <source@mvista.com>
6 *
7 * ########################################################################
8 *
9 * This program is free software; you can distribute it and/or modify it
10 * under the terms of the GNU General Public License (Version 2) as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 * for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
21 *
22 * ########################################################################
23 *
24 *
25 */
26#ifndef __ASM_PB1100_H
27#define __ASM_PB1100_H
28
29/* PCMCIA Pb1100 specific defines */
30#define PCMCIA_MAX_SOCK 0
31#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1)
32
33/* VPP/VCC */
34#define SET_VCC_VPP(VCC, VPP) (((VCC) << 2) | ((VPP) << 0))
35
36#endif /* __ASM_PB1100_H */
diff --git a/arch/mips/include/asm/mach-pb1x00/pb1200.h b/arch/mips/include/asm/mach-pb1x00/pb1200.h
index 2458eb436a0c..962eb55dc880 100644
--- a/arch/mips/include/asm/mach-pb1x00/pb1200.h
+++ b/arch/mips/include/asm/mach-pb1x00/pb1200.h
@@ -135,20 +135,6 @@ enum external_pb1200_ints {
135 PB1200_INT_END = PB1200_INT_BEGIN + 15 135 PB1200_INT_END = PB1200_INT_BEGIN + 15
136}; 136};
137 137
138/*
139 * Pb1200 specific PCMCIA defines for drivers/pcmcia/au1000_db1x00.c
140 */
141#define PCMCIA_MAX_SOCK 1
142#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1)
143
144/* VPP/VCC */
145#define SET_VCC_VPP(VCC, VPP, SLOT) \
146 ((((VCC) << 2) | ((VPP) << 0)) << ((SLOT) * 8))
147
148#define BOARD_PC0_INT PB1200_PC0_INT
149#define BOARD_PC1_INT PB1200_PC1_INT
150#define BOARD_CARD_INSERTED(SOCKET) (bcsr_read(BCSR_SIGSTAT & (1 << (8 + (2 * SOCKET))))
151
152/* NAND chip select */ 138/* NAND chip select */
153#define NAND_CS 1 139#define NAND_CS 1
154 140
diff --git a/arch/mips/include/asm/mach-pb1x00/pb1500.h b/arch/mips/include/asm/mach-pb1x00/pb1500.h
deleted file mode 100644
index 82431a7ab942..000000000000
--- a/arch/mips/include/asm/mach-pb1x00/pb1500.h
+++ /dev/null
@@ -1,36 +0,0 @@
1/*
2 * Alchemy Semi Pb1500 Referrence Board
3 *
4 * Copyright 2001, 2008 MontaVista Software Inc.
5 * Author: MontaVista Software, Inc. <source@mvista.com>
6 *
7 * ########################################################################
8 *
9 * This program is free software; you can distribute it and/or modify it
10 * under the terms of the GNU General Public License (Version 2) as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 * for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
21 *
22 * ########################################################################
23 *
24 *
25 */
26#ifndef __ASM_PB1500_H
27#define __ASM_PB1500_H
28
29/* PCMCIA Pb1500 specific defines */
30#define PCMCIA_MAX_SOCK 0
31#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1)
32
33/* VPP/VCC */
34#define SET_VCC_VPP(VCC, VPP) (((VCC) << 2) | ((VPP) << 0))
35
36#endif /* __ASM_PB1500_H */
diff --git a/arch/mips/include/asm/mach-pb1x00/pb1550.h b/arch/mips/include/asm/mach-pb1x00/pb1550.h
index 306d584abbd4..58796410bd6e 100644
--- a/arch/mips/include/asm/mach-pb1x00/pb1550.h
+++ b/arch/mips/include/asm/mach-pb1x00/pb1550.h
@@ -40,13 +40,6 @@
40#define SMBUS_PSC_BASE PSC2_BASE_ADDR 40#define SMBUS_PSC_BASE PSC2_BASE_ADDR
41#define I2S_PSC_BASE PSC3_BASE_ADDR 41#define I2S_PSC_BASE PSC3_BASE_ADDR
42 42
43#define PCMCIA_MAX_SOCK 1
44#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK + 1)
45
46/* VPP/VCC */
47#define SET_VCC_VPP(VCC, VPP, SLOT) \
48 ((((VCC) << 2) | ((VPP) << 0)) << ((SLOT) * 8))
49
50#if defined(CONFIG_MTD_PB1550_BOOT) && defined(CONFIG_MTD_PB1550_USER) 43#if defined(CONFIG_MTD_PB1550_BOOT) && defined(CONFIG_MTD_PB1550_USER)
51#define PB1550_BOTH_BANKS 44#define PB1550_BOTH_BANKS
52#elif defined(CONFIG_MTD_PB1550_BOOT) && !defined(CONFIG_MTD_PB1550_USER) 45#elif defined(CONFIG_MTD_PB1550_BOOT) && !defined(CONFIG_MTD_PB1550_USER)