diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/mips/au1000/mtx-1 |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'arch/mips/au1000/mtx-1')
-rw-r--r-- | arch/mips/au1000/mtx-1/Makefile | 10 | ||||
-rw-r--r-- | arch/mips/au1000/mtx-1/board_setup.c | 89 | ||||
-rw-r--r-- | arch/mips/au1000/mtx-1/init.c | 71 | ||||
-rw-r--r-- | arch/mips/au1000/mtx-1/irqmap.c | 58 |
4 files changed, 228 insertions, 0 deletions
diff --git a/arch/mips/au1000/mtx-1/Makefile b/arch/mips/au1000/mtx-1/Makefile new file mode 100644 index 000000000000..764bf9f7e281 --- /dev/null +++ b/arch/mips/au1000/mtx-1/Makefile | |||
@@ -0,0 +1,10 @@ | |||
1 | # | ||
2 | # Copyright 2003 MontaVista Software Inc. | ||
3 | # Author: MontaVista Software, Inc. | ||
4 | # ppopov@mvista.com or source@mvista.com | ||
5 | # Bruno Randolf <bruno.randolf@4g-systems.biz> | ||
6 | # | ||
7 | # Makefile for 4G Systems MTX-1 board. | ||
8 | # | ||
9 | |||
10 | lib-y := init.o board_setup.o irqmap.o | ||
diff --git a/arch/mips/au1000/mtx-1/board_setup.c b/arch/mips/au1000/mtx-1/board_setup.c new file mode 100644 index 000000000000..638de7bb43f0 --- /dev/null +++ b/arch/mips/au1000/mtx-1/board_setup.c | |||
@@ -0,0 +1,89 @@ | |||
1 | /* | ||
2 | * | ||
3 | * BRIEF MODULE DESCRIPTION | ||
4 | * 4G Systems MTX-1 board setup. | ||
5 | * | ||
6 | * Copyright 2003 MontaVista Software Inc. | ||
7 | * Author: MontaVista Software, Inc. | ||
8 | * ppopov@mvista.com or source@mvista.com | ||
9 | * Bruno Randolf <bruno.randolf@4g-systems.biz> | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify it | ||
12 | * under the terms of the GNU General Public License as published by the | ||
13 | * Free Software Foundation; either version 2 of the License, or (at your | ||
14 | * option) any later version. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
19 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
21 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
22 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
23 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | * You should have received a copy of the GNU General Public License along | ||
28 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
29 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
30 | */ | ||
31 | #include <linux/config.h> | ||
32 | #include <linux/init.h> | ||
33 | #include <linux/sched.h> | ||
34 | #include <linux/ioport.h> | ||
35 | #include <linux/mm.h> | ||
36 | #include <linux/console.h> | ||
37 | #include <linux/delay.h> | ||
38 | |||
39 | #include <asm/cpu.h> | ||
40 | #include <asm/bootinfo.h> | ||
41 | #include <asm/irq.h> | ||
42 | #include <asm/mipsregs.h> | ||
43 | #include <asm/reboot.h> | ||
44 | #include <asm/pgtable.h> | ||
45 | #include <asm/mach-au1x00/au1000.h> | ||
46 | |||
47 | void board_reset (void) | ||
48 | { | ||
49 | /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */ | ||
50 | au_writel(0x00000000, 0xAE00001C); | ||
51 | } | ||
52 | |||
53 | void __init board_setup(void) | ||
54 | { | ||
55 | #if defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1X00_USB_DEVICE) | ||
56 | #ifdef CONFIG_AU1X00_USB_DEVICE | ||
57 | // 2nd USB port is USB device | ||
58 | au_writel(au_readl(SYS_PINFUNC) & (u32)(~0x8000), SYS_PINFUNC); | ||
59 | #endif | ||
60 | // enable USB power switch | ||
61 | au_writel( au_readl(GPIO2_DIR) | 0x10, GPIO2_DIR ); | ||
62 | au_writel( 0x100000, GPIO2_OUTPUT ); | ||
63 | #endif // defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1X00_USB_DEVICE) | ||
64 | |||
65 | #ifdef CONFIG_PCI | ||
66 | #if defined(__MIPSEB__) | ||
67 | au_writel(0xf | (2<<6) | (1<<4), Au1500_PCI_CFG); | ||
68 | #else | ||
69 | au_writel(0xf, Au1500_PCI_CFG); | ||
70 | #endif | ||
71 | #endif | ||
72 | |||
73 | // initialize sys_pinfunc: | ||
74 | // disable second ethernet port (SYS_PF_NI2) | ||
75 | // set U3/GPIO23 to GPIO23 (SYS_PF_U3) | ||
76 | au_writel( SYS_PF_NI2 | SYS_PF_U3, SYS_PINFUNC ); | ||
77 | |||
78 | // initialize GPIO | ||
79 | au_writel( 0xFFFFFFFF, SYS_TRIOUTCLR ); | ||
80 | au_writel( 0x00000001, SYS_OUTPUTCLR ); // set M66EN (PCI 66MHz) to OFF | ||
81 | au_writel( 0x00000008, SYS_OUTPUTSET ); // set PCI CLKRUN# to OFF | ||
82 | au_writel( 0x00000020, SYS_OUTPUTCLR ); // set eth PHY TX_ER to OFF | ||
83 | |||
84 | // enable LED and set it to green | ||
85 | au_writel( au_readl(GPIO2_DIR) | 0x1800, GPIO2_DIR ); | ||
86 | au_writel( 0x18000800, GPIO2_OUTPUT ); | ||
87 | |||
88 | printk("4G Systems MTX-1 Board\n"); | ||
89 | } | ||
diff --git a/arch/mips/au1000/mtx-1/init.c b/arch/mips/au1000/mtx-1/init.c new file mode 100644 index 000000000000..02e7dbcff727 --- /dev/null +++ b/arch/mips/au1000/mtx-1/init.c | |||
@@ -0,0 +1,71 @@ | |||
1 | /* | ||
2 | * | ||
3 | * BRIEF MODULE DESCRIPTION | ||
4 | * 4G Systems MTX-1 board setup | ||
5 | * | ||
6 | * Copyright 2003 MontaVista Software Inc. | ||
7 | * Author: MontaVista Software, Inc. | ||
8 | * ppopov@mvista.com or source@mvista.com | ||
9 | * Bruno Randolf <bruno.randolf@4g-systems.biz> | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify it | ||
12 | * under the terms of the GNU General Public License as published by the | ||
13 | * Free Software Foundation; either version 2 of the License, or (at your | ||
14 | * option) any later version. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
19 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
21 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
22 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
23 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | * You should have received a copy of the GNU General Public License along | ||
28 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
29 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
30 | */ | ||
31 | #include <linux/string.h> | ||
32 | #include <linux/kernel.h> | ||
33 | #include <linux/sched.h> | ||
34 | #include <linux/init.h> | ||
35 | #include <linux/mm.h> | ||
36 | #include <linux/sched.h> | ||
37 | #include <linux/bootmem.h> | ||
38 | #include <asm/addrspace.h> | ||
39 | #include <asm/bootinfo.h> | ||
40 | |||
41 | int prom_argc; | ||
42 | char **prom_argv, **prom_envp; | ||
43 | extern void __init prom_init_cmdline(void); | ||
44 | extern char *prom_getenv(char *envname); | ||
45 | |||
46 | const char *get_system_type(void) | ||
47 | { | ||
48 | return "MTX-1"; | ||
49 | } | ||
50 | |||
51 | void __init prom_init(void) | ||
52 | { | ||
53 | unsigned char *memsize_str; | ||
54 | unsigned long memsize; | ||
55 | |||
56 | prom_argc = fw_arg0; | ||
57 | prom_argv = (char **) fw_arg1; | ||
58 | prom_envp = (char **) fw_arg2; | ||
59 | |||
60 | mips_machgroup = MACH_GROUP_ALCHEMY; | ||
61 | mips_machtype = MACH_MTX1; /* set the platform # */ | ||
62 | |||
63 | prom_init_cmdline(); | ||
64 | |||
65 | memsize_str = prom_getenv("memsize"); | ||
66 | if (!memsize_str) | ||
67 | memsize = 0x04000000; | ||
68 | else | ||
69 | memsize = simple_strtol(memsize_str, NULL, 0); | ||
70 | add_memory_region(0, memsize, BOOT_MEM_RAM); | ||
71 | } | ||
diff --git a/arch/mips/au1000/mtx-1/irqmap.c b/arch/mips/au1000/mtx-1/irqmap.c new file mode 100644 index 000000000000..ddcb9d089dc1 --- /dev/null +++ b/arch/mips/au1000/mtx-1/irqmap.c | |||
@@ -0,0 +1,58 @@ | |||
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 | #include <linux/errno.h> | ||
29 | #include <linux/init.h> | ||
30 | #include <linux/irq.h> | ||
31 | #include <linux/kernel_stat.h> | ||
32 | #include <linux/module.h> | ||
33 | #include <linux/signal.h> | ||
34 | #include <linux/sched.h> | ||
35 | #include <linux/types.h> | ||
36 | #include <linux/interrupt.h> | ||
37 | #include <linux/ioport.h> | ||
38 | #include <linux/timex.h> | ||
39 | #include <linux/slab.h> | ||
40 | #include <linux/random.h> | ||
41 | #include <linux/delay.h> | ||
42 | #include <linux/bitops.h> | ||
43 | |||
44 | #include <asm/bootinfo.h> | ||
45 | #include <asm/io.h> | ||
46 | #include <asm/mipsregs.h> | ||
47 | #include <asm/system.h> | ||
48 | #include <asm/mach-au1x00/au1000.h> | ||
49 | |||
50 | au1xxx_irq_map_t au1xxx_irq_map[] = { | ||
51 | { AU1500_GPIO_204, INTC_INT_HIGH_LEVEL, 0}, | ||
52 | { AU1500_GPIO_201, INTC_INT_LOW_LEVEL, 0 }, | ||
53 | { AU1500_GPIO_202, INTC_INT_LOW_LEVEL, 0 }, | ||
54 | { AU1500_GPIO_203, INTC_INT_LOW_LEVEL, 0 }, | ||
55 | { AU1500_GPIO_205, INTC_INT_LOW_LEVEL, 0 }, | ||
56 | }; | ||
57 | |||
58 | int au1xxx_nr_irqs = sizeof(au1xxx_irq_map)/sizeof(au1xxx_irq_map_t); | ||