2 * Copyright 2002 Momentum Computer Inc.
3 * Author: Matthew Dharm <mdharm@momenco.com>
5 * Based on Ocelot Linux port, which is
6 * Copyright 2001 MontaVista Software Inc.
7 * Author: jsun@mvista.com or jsun@junsun.net
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
14 #include <linux/config.h>
15 #include <linux/init.h>
17 #include <linux/sched.h>
18 #include <linux/bootmem.h>
20 #include <asm/addrspace.h>
21 #include <asm/bootinfo.h>
24 #include "ocelot_pld.h"
27 int (*open) (char*, int, int);
29 int (*read) (int, void*, int);
30 int (*write) (int, void*, int);
31 off_t (*lseek) (int, off_t, int);
32 int (*printf) (const char*, ...);
33 void (*cacheflush) (void);
34 char* (*gets) (char*);
37 struct callvectors* debug_vectors;
38 char arcs_cmdline[CL_SIZE];
40 extern unsigned long gt64240_base;
41 extern unsigned long bus_clock;
43 #ifdef CONFIG_GALILEO_GT64240_ETH
44 extern unsigned char prom_mac_addr_base[6];
47 const char *get_system_type(void)
49 return "Momentum Ocelot";
52 /* [jsun@junsun.net] PMON passes arguments in C main() style */
53 void __init prom_init(int argc, char **arg, char** env, struct callvectors *cv)
58 /* save the PROM vectors for debugging use */
61 /* arg[0] is "g", the rest is boot parameters */
62 arcs_cmdline[0] = '\0';
63 for (i = 1; i < argc; i++) {
64 if (strlen(arcs_cmdline) + strlen(arg[i] + 1)
65 >= sizeof(arcs_cmdline))
67 strcat(arcs_cmdline, arg[i]);
68 strcat(arcs_cmdline, " ");
71 mips_machgroup = MACH_GROUP_MOMENCO;
72 mips_machtype = MACH_MOMENCO_OCELOT_G;
74 #ifdef CONFIG_GALILEO_GT64240_ETH
75 /* get the base MAC address for on-board ethernet ports */
76 memcpy(prom_mac_addr_base, (void*)0xfc807cf2, 6);
80 if (strncmp("gtbase", *env, strlen("gtbase")) == 0) {
81 gt64240_base = simple_strtol(*env + strlen("gtbase="),
84 if (strncmp("busclock", *env, strlen("busclock")) == 0) {
85 bus_clock = simple_strtol(*env + strlen("busclock="),
91 debug_vectors->printf("Booting Linux kernel...\n");
94 void __init prom_free_prom_memory(void)
98 void __init prom_fixup_mem_map(unsigned long start, unsigned long end)