aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/alchemy/db1x00
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2008-09-16 13:12:16 -0400
committerRalf Baechle <ralf@linux-mips.org>2008-10-11 11:18:50 -0400
commite8c7c482347574ecdd45c43e32c332d5fc2ece61 (patch)
treec741aa6cdb4e897df9f9476d83a816a7a2b058dd /arch/mips/alchemy/db1x00
parent8d2d91e86b4153cc2305ec86fe908048f459ff7f (diff)
MIPS: Alchemy: rename directory
It's more than the au1000 these days. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/alchemy/db1x00')
-rw-r--r--arch/mips/alchemy/db1x00/Makefile8
-rw-r--r--arch/mips/alchemy/db1x00/board_setup.c108
-rw-r--r--arch/mips/alchemy/db1x00/init.c62
-rw-r--r--arch/mips/alchemy/db1x00/irqmap.c86
4 files changed, 264 insertions, 0 deletions
diff --git a/arch/mips/alchemy/db1x00/Makefile b/arch/mips/alchemy/db1x00/Makefile
new file mode 100644
index 000000000000..274db3b55d82
--- /dev/null
+++ b/arch/mips/alchemy/db1x00/Makefile
@@ -0,0 +1,8 @@
1#
2# Copyright 2000, 2008 MontaVista Software Inc.
3# Author: MontaVista Software, Inc. <source@mvista.com>
4#
5# Makefile for the Alchemy Semiconductor DBAu1xx0 boards.
6#
7
8lib-y := init.o board_setup.o irqmap.o
diff --git a/arch/mips/alchemy/db1x00/board_setup.c b/arch/mips/alchemy/db1x00/board_setup.c
new file mode 100644
index 000000000000..9e5ccbbfcedd
--- /dev/null
+++ b/arch/mips/alchemy/db1x00/board_setup.c
@@ -0,0 +1,108 @@
1/*
2 *
3 * BRIEF MODULE DESCRIPTION
4 * Alchemy Db1x00 board setup.
5 *
6 * Copyright 2000, 2008 MontaVista Software Inc.
7 * Author: MontaVista Software, Inc. <source@mvista.com>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
17 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
20 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 *
25 * You should have received a copy of the GNU General Public License along
26 * with this program; if not, write to the Free Software Foundation, Inc.,
27 * 675 Mass Ave, Cambridge, MA 02139, USA.
28 */
29
30#include <linux/init.h>
31
32#include <asm/mach-au1x00/au1000.h>
33#include <asm/mach-db1x00/db1x00.h>
34
35static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
36
37void board_reset(void)
38{
39 /* Hit BCSR.SW_RESET[RESET] */
40 bcsr->swreset = 0x0000;
41}
42
43void __init board_setup(void)
44{
45 u32 pin_func = 0;
46
47 /* Not valid for Au1550 */
48#if defined(CONFIG_IRDA) && \
49 (defined(CONFIG_SOC_AU1000) || defined(CONFIG_SOC_AU1100))
50 /* Set IRFIRSEL instead of GPIO15 */
51 pin_func = au_readl(SYS_PINFUNC) | SYS_PF_IRF;
52 au_writel(pin_func, SYS_PINFUNC);
53 /* Power off until the driver is in use */
54 bcsr->resets &= ~BCSR_RESETS_IRDA_MODE_MASK;
55 bcsr->resets |= BCSR_RESETS_IRDA_MODE_OFF;
56 au_sync();
57#endif
58 bcsr->pcmcia = 0x0000; /* turn off PCMCIA power */
59
60#ifdef CONFIG_MIPS_MIRAGE
61 /* Enable GPIO[31:0] inputs */
62 au_writel(0, SYS_PININPUTEN);
63
64 /* GPIO[20] is output, tristate the other input primary GPIOs */
65 au_writel(~(1 << 20), SYS_TRIOUTCLR);
66
67 /* Set GPIO[210:208] instead of SSI_0 */
68 pin_func = au_readl(SYS_PINFUNC) | SYS_PF_S0;
69
70 /* Set GPIO[215:211] for LEDs */
71 pin_func |= 5 << 2;
72
73 /* Set GPIO[214:213] for more LEDs */
74 pin_func |= 5 << 12;
75
76 /* Set GPIO[207:200] instead of PCMCIA/LCD */
77 pin_func |= SYS_PF_LCD | SYS_PF_PC;
78 au_writel(pin_func, SYS_PINFUNC);
79
80 /*
81 * Enable speaker amplifier. This should
82 * be part of the audio driver.
83 */
84 au_writel(au_readl(GPIO2_DIR) | 0x200, GPIO2_DIR);
85 au_writel(0x02000200, GPIO2_OUTPUT);
86#endif
87
88 au_sync();
89
90#ifdef CONFIG_MIPS_DB1000
91 printk(KERN_INFO "AMD Alchemy Au1000/Db1000 Board\n");
92#endif
93#ifdef CONFIG_MIPS_DB1500
94 printk(KERN_INFO "AMD Alchemy Au1500/Db1500 Board\n");
95#endif
96#ifdef CONFIG_MIPS_DB1100
97 printk(KERN_INFO "AMD Alchemy Au1100/Db1100 Board\n");
98#endif
99#ifdef CONFIG_MIPS_BOSPORUS
100 printk(KERN_INFO "AMD Alchemy Bosporus Board\n");
101#endif
102#ifdef CONFIG_MIPS_MIRAGE
103 printk(KERN_INFO "AMD Alchemy Mirage Board\n");
104#endif
105#ifdef CONFIG_MIPS_DB1550
106 printk(KERN_INFO "AMD Alchemy Au1550/Db1550 Board\n");
107#endif
108}
diff --git a/arch/mips/alchemy/db1x00/init.c b/arch/mips/alchemy/db1x00/init.c
new file mode 100644
index 000000000000..847413514964
--- /dev/null
+++ b/arch/mips/alchemy/db1x00/init.c
@@ -0,0 +1,62 @@
1/*
2 * BRIEF MODULE DESCRIPTION
3 * PB1000 board setup
4 *
5 * Copyright 2001, 2008 MontaVista Software Inc.
6 * Author: MontaVista Software, Inc. <source@mvista.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/kernel.h>
31
32#include <asm/bootinfo.h>
33
34#include <prom.h>
35
36const char *get_system_type(void)
37{
38#ifdef CONFIG_MIPS_BOSPORUS
39 return "Alchemy Bosporus Gateway Reference";
40#else
41 return "Alchemy Db1x00";
42#endif
43}
44
45void __init prom_init(void)
46{
47 unsigned char *memsize_str;
48 unsigned long memsize;
49
50 prom_argc = fw_arg0;
51 prom_argv = (char **)fw_arg1;
52 prom_envp = (char **)fw_arg2;
53
54 prom_init_cmdline();
55
56 memsize_str = prom_getenv("memsize");
57 if (!memsize_str)
58 memsize = 0x04000000;
59 else
60 strict_strtol(memsize_str, 0, &memsize);
61 add_memory_region(0, memsize, BOOT_MEM_RAM);
62}
diff --git a/arch/mips/alchemy/db1x00/irqmap.c b/arch/mips/alchemy/db1x00/irqmap.c
new file mode 100644
index 000000000000..94c090e8bf7a
--- /dev/null
+++ b/arch/mips/alchemy/db1x00/irqmap.c
@@ -0,0 +1,86 @@
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
31#include <asm/mach-au1x00/au1000.h>
32
33#ifdef CONFIG_MIPS_DB1500
34char irq_tab_alchemy[][5] __initdata = {
35 [12] = { -1, INTA, INTX, INTX, INTX }, /* IDSEL 12 - HPT371 */
36 [13] = { -1, INTA, INTB, INTC, INTD }, /* IDSEL 13 - PCI slot */
37};
38#endif
39
40#ifdef CONFIG_MIPS_BOSPORUS
41char irq_tab_alchemy[][5] __initdata = {
42 [11] = { -1, INTA, INTB, INTX, INTX }, /* IDSEL 11 - miniPCI */
43 [12] = { -1, INTA, INTX, INTX, INTX }, /* IDSEL 12 - SN1741 */
44 [13] = { -1, INTA, INTB, INTC, INTD }, /* IDSEL 13 - PCI slot */
45};
46#endif
47
48#ifdef CONFIG_MIPS_MIRAGE
49char irq_tab_alchemy[][5] __initdata = {
50 [11] = { -1, INTD, INTX, INTX, INTX }, /* IDSEL 11 - SMI VGX */
51 [12] = { -1, INTX, INTX, INTC, INTX }, /* IDSEL 12 - PNX1300 */
52 [13] = { -1, INTA, INTB, INTX, INTX }, /* IDSEL 13 - miniPCI */
53};
54#endif
55
56#ifdef CONFIG_MIPS_DB1550
57char irq_tab_alchemy[][5] __initdata = {
58 [11] = { -1, INTC, INTX, INTX, INTX }, /* IDSEL 11 - on-board HPT371 */
59 [12] = { -1, INTB, INTC, INTD, INTA }, /* IDSEL 12 - PCI slot 2 (left) */
60 [13] = { -1, INTA, INTB, INTC, INTD }, /* IDSEL 13 - PCI slot 1 (right) */
61};
62#endif
63
64
65struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
66
67#ifndef CONFIG_MIPS_MIRAGE
68#ifdef CONFIG_MIPS_DB1550
69 { AU1000_GPIO_3, INTC_INT_LOW_LEVEL, 0 }, /* PCMCIA Card 0 IRQ# */
70 { AU1000_GPIO_5, INTC_INT_LOW_LEVEL, 0 }, /* PCMCIA Card 1 IRQ# */
71#else
72 { AU1000_GPIO_0, INTC_INT_LOW_LEVEL, 0 }, /* PCMCIA Card 0 Fully_Interted# */
73 { AU1000_GPIO_1, INTC_INT_LOW_LEVEL, 0 }, /* PCMCIA Card 0 STSCHG# */
74 { AU1000_GPIO_2, INTC_INT_LOW_LEVEL, 0 }, /* PCMCIA Card 0 IRQ# */
75
76 { AU1000_GPIO_3, INTC_INT_LOW_LEVEL, 0 }, /* PCMCIA Card 1 Fully_Interted# */
77 { AU1000_GPIO_4, INTC_INT_LOW_LEVEL, 0 }, /* PCMCIA Card 1 STSCHG# */
78 { AU1000_GPIO_5, INTC_INT_LOW_LEVEL, 0 }, /* PCMCIA Card 1 IRQ# */
79#endif
80#else
81 { AU1000_GPIO_7, INTC_INT_RISE_EDGE, 0 }, /* touchscreen pen down */
82#endif
83
84};
85
86int __initdata au1xxx_nr_irqs = ARRAY_SIZE(au1xxx_irq_map);