blob: 8677b6d3ada7923243831b05da2be8630dba906c [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * Copyright 2001 MontaVista Software Inc.
3 * Author: jsun@mvista.com or jsun@junsun.net
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10#include <linux/init.h>
11#include <linux/mm.h>
12#include <linux/sched.h>
13#include <linux/bootmem.h>
14
15#include <asm/addrspace.h>
16#include <asm/bootinfo.h>
17#include <asm/pmon.h>
18
19struct callvectors* debug_vectors;
20
21extern unsigned long gt64120_base;
22
23const char *get_system_type(void)
24{
25 return "Momentum Ocelot";
26}
27
28/* [jsun@junsun.net] PMON passes arguments in C main() style */
29void __init prom_init(void)
30{
31 int argc = fw_arg0;
32 char **arg = (char **) fw_arg1;
33 char **env = (char **) fw_arg2;
34 struct callvectors *cv = (struct callvectors *) fw_arg3;
35 uint32_t tmp;
36 int i;
37
38 /* save the PROM vectors for debugging use */
39 debug_vectors = cv;
40
41 /* arg[0] is "g", the rest is boot parameters */
42 arcs_cmdline[0] = '\0';
43 for (i = 1; i < argc; i++) {
44 if (strlen(arcs_cmdline) + strlen(arg[i] + 1)
45 >= sizeof(arcs_cmdline))
46 break;
47 strcat(arcs_cmdline, arg[i]);
48 strcat(arcs_cmdline, " ");
49 }
50
51 mips_machgroup = MACH_GROUP_MOMENCO;
52 mips_machtype = MACH_MOMENCO_OCELOT;
53
54 while (*env) {
55 if (strncmp("gtbase", *env, 6) == 0) {
56 gt64120_base = simple_strtol(*env + strlen("gtbase="),
57 NULL, 16);
58 break;
59 }
60 *env++;
61 }
62
63 debug_vectors->printf("Booting Linux kernel...\n");
64
65 /* All the boards have at least 64MiB. If there's more, we
66 detect and register it later */
67 add_memory_region(0, 64 << 20, BOOT_MEM_RAM);
68}
69
70unsigned long __init prom_free_prom_memory(void)
71{
72 return 0;
73}