1 /**************************************************************************
3 * BRIEF MODULE DESCRIPTION
4 * setup routines for IDT EB434 boards
6 * Copyright 2004 IDT Inc. (rischelp@idt.com)
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.
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.
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.
29 **************************************************************************
36 **************************************************************************
39 #include <linux/init.h>
40 #include <linux/module.h>
42 #include <linux/sched.h>
43 #include <linux/irq.h>
44 #include <asm/bootinfo.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>
53 #include <linux/platform_device.h>
54 #include <linux/mtd/partitions.h>
55 #include <linux/mtd/physmap.h>
57 extern char *__init
prom_getcmdline(void);
59 extern void (*board_time_init
) (void);
60 extern void aruba_time_init(void);
61 extern void aruba_reset(void);
63 #define epldMask ((volatile unsigned char *)0xB900000d)
65 static void aruba_machine_restart(char *command
)
67 switch (mips_machtype
) {
69 *(volatile u32
*)KSEG1ADDR(0x18008000) = 0x80000001;
75 *((volatile u32
*)KSEG1ADDR(0x1c003020)) = 0x00080350; // reset everything in sight
77 *((volatile u32
*)KSEG1ADDR(0x1c003020)) = 0; // reset everything in sight
79 *((volatile u32
*)KSEG1ADDR(0x1c003020)) = 0x3; // cold reset the cpu & system
84 static void aruba_machine_halt(void)
89 extern char * getenv(char *e
);
91 extern void unlock_ap60_70_flash(void);
93 static struct resource aruba_flash_resource
= {
96 .flags
= IORESOURCE_MEM
,
99 static struct mtd_partition aruba_flash_parts
[] = {
117 static struct physmap_flash_data aruba_flash_data
= {
119 .parts
= aruba_flash_parts
,
120 .nr_parts
= ARRAY_SIZE(aruba_flash_parts
),
123 static struct platform_device aruba_flash_device
= {
124 .name
= "physmap-flash",
127 .platform_data
= &aruba_flash_data
,
130 .resource
= &aruba_flash_resource
,
133 static int aruba_setup_flash(void)
135 platform_device_register(&aruba_flash_device
);
140 arch_initcall (aruba_setup_flash
);
142 void __init
plat_mem_setup(void)
144 board_time_init
= aruba_time_init
;
146 _machine_restart
= aruba_machine_restart
;
147 _machine_halt
= aruba_machine_halt
;
148 pm_power_off
= aruba_machine_halt
;
150 set_io_port_base(KSEG1
);
152 /* Enable PCI interrupts in EPLD Mask register */
154 *(epldMask
+ 1) = 0x0;
157 unlock_ap60_70_flash();
159 printk("BOARD - %s\n",getenv("boardname"));
162 int page_is_ram(unsigned long pagenr
)
167 const char *get_system_type(void)
169 switch (mips_machtype
) {
170 case MACH_ARUBA_AP70
:
172 case MACH_ARUBA_AP65
:
174 case MACH_ARUBA_AP60
:
175 return "Aruba AP60/AP61";
177 return "Aruba UNKNOWN";
181 EXPORT_SYMBOL(get_system_type
);