7e8413f637994205370c6307f75f0c17f4d0519d
[openwrt.git] / target / linux / aruba-2.6 / files / arch / mips / aruba / setup.c
1 /**************************************************************************
2 *
3 * BRIEF MODULE DESCRIPTION
4 * setup routines for IDT EB434 boards
5 *
6 * Copyright 2004 IDT Inc. (rischelp@idt.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 **************************************************************************
30 * May 2004 rkt, neb
31 *
32 * Initial Release
33 *
34 *
35 *
36 **************************************************************************
37 */
38
39 #include <linux/init.h>
40 #include <linux/module.h>
41 #include <linux/mm.h>
42 #include <linux/sched.h>
43 #include <linux/irq.h>
44 #include <asm/bootinfo.h>
45 #include <asm/io.h>
46 #include <linux/ioport.h>
47 #include <asm/mipsregs.h>
48 #include <asm/pgtable.h>
49 #include <asm/reboot.h>
50 #include <asm/addrspace.h> /* for KSEG1ADDR() */
51 #include <asm/idt-boards/rc32434/rc32434.h>
52 #include <linux/pm.h>
53
54 extern char *__init prom_getcmdline(void);
55
56 extern void (*board_time_init) (void);
57 extern void aruba_time_init(void);
58 extern void aruba_reset(void);
59
60 #define epldMask ((volatile unsigned char *)0xB900000d)
61
62 static void aruba_machine_restart(char *command)
63 {
64 switch (mips_machtype) {
65 case MACH_ARUBA_AP70:
66 *(volatile u32 *)KSEG1ADDR(0x18008000) = 0x80000001;
67 break;
68 case MACH_ARUBA_AP65:
69 case MACH_ARUBA_AP60:
70 default:
71 /* Reset*/
72 *((volatile u32 *)KSEG1ADDR(0x1c003020)) = 0x00080350; // reset everything in sight
73 udelay(100);
74 *((volatile u32 *)KSEG1ADDR(0x1c003020)) = 0; // reset everything in sight
75 udelay(100);
76 *((volatile u32 *)KSEG1ADDR(0x1c003020)) = 0x3; // cold reset the cpu & system
77 break;
78 }
79 }
80
81 static void aruba_machine_halt(void)
82 {
83 for (;;) continue;
84 }
85
86 extern char * getenv(char *e);
87 extern void unlock_ap60_70_flash(void);
88
89 void __init plat_mem_setup(void)
90 {
91 board_time_init = aruba_time_init;
92
93 _machine_restart = aruba_machine_restart;
94 _machine_halt = aruba_machine_halt;
95 pm_power_off = aruba_machine_halt;
96
97 set_io_port_base(KSEG1);
98
99 /* Enable PCI interrupts in EPLD Mask register */
100 *epldMask = 0x0;
101 *(epldMask + 1) = 0x0;
102
103 write_c0_wired(0);
104 unlock_ap60_70_flash();
105
106 printk("BOARD - %s\n",getenv("boardname"));
107 }
108
109 int page_is_ram(unsigned long pagenr)
110 {
111 return 1;
112 }
113
114 const char *get_system_type(void)
115 {
116 switch (mips_machtype) {
117 case MACH_ARUBA_AP70:
118 return "Aruba AP70";
119 case MACH_ARUBA_AP65:
120 return "Aruba AP65";
121 case MACH_ARUBA_AP60:
122 return "Aruba AP60/AP61";
123 default:
124 return "Aruba UNKNOWN";
125 }
126 }
127
128 EXPORT_SYMBOL(get_system_type);
This page took 0.045905 seconds and 3 git commands to generate.