commandline mtd partition parsing is ugly, convert aruba to platform_device
[openwrt.git] / target / linux / aruba-2.6 / files / arch / mips / aruba / prom.c
1 /**************************************************************************
2 *
3 * BRIEF MODULE DESCRIPTION
4 * prom interface routines
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/autoconf.h>
40 #include <linux/init.h>
41 #include <linux/mm.h>
42 #include <linux/module.h>
43 #include <linux/string.h>
44 #include <linux/console.h>
45 #include <asm/bootinfo.h>
46 #include <linux/bootmem.h>
47 #include <linux/ioport.h>
48 #include <linux/serial.h>
49 #include <linux/serialP.h>
50 #include <asm/serial.h>
51 #include <linux/ioport.h>
52
53 unsigned int idt_cpu_freq;
54 EXPORT_SYMBOL(idt_cpu_freq);
55
56 unsigned int arch_has_pci=0;
57
58 /* Kernel Boot parameters */
59 static unsigned char bootparm[] =
60 "root=/dev/mtdblock1 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,9600 init=/etc/preinit";
61
62 extern unsigned long mips_machgroup;
63 extern unsigned long mips_machtype;
64
65 extern void setup_serial_port(void);
66 extern char * getenv(char *e);
67
68 /* IDT 79EB434 memory map -- we really should be auto sizing it */
69 #define RAM_SIZE 32*1024*1024
70
71 char *__init prom_getcmdline(void)
72 {
73 return &(arcs_cmdline[0]);
74 }
75
76 void __init prom_init(void)
77 {
78 char *boardname;
79 sprintf(arcs_cmdline, "%s", bootparm);
80
81 /* set our arch type */
82 mips_machgroup = MACH_GROUP_ARUBA;
83 mips_machtype = MACH_ARUBA_UNKNOWN;
84
85 boardname=getenv("boardname");
86
87 if (!strcmp(boardname,"Muscat")) {
88 mips_machtype = MACH_ARUBA_AP70;
89 idt_cpu_freq = 133000000;
90 arch_has_pci=1;
91 } else if (!strcmp(boardname,"Mataro")) {
92 mips_machtype = MACH_ARUBA_AP65;
93 idt_cpu_freq = 110000000;
94 } else if (!strcmp(boardname,"Merlot")) {
95 mips_machtype = MACH_ARUBA_AP60;
96 idt_cpu_freq = 90000000;
97 }
98
99 /* turn on the console */
100 setup_serial_port();
101
102 /*
103 * give all RAM to boot allocator,
104 * except where the kernel was loaded
105 */
106 add_memory_region(0,RAM_SIZE,BOOT_MEM_RAM);
107 }
108
109 void prom_free_prom_memory(void)
110 {
111 printk("stubbed prom_free_prom_memory()\n");
112 }
This page took 0.051436 seconds and 5 git commands to generate.