1 /*
2 * Copyright (C) 2000 RidgeRun, Inc.
3 * Author: RidgeRun, Inc.
4 * glonnon@ridgerun.com, skranz@ridgerun.com, stevej@ridgerun.com
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 *
11 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
12 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
14 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
15 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
16 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
17 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
18 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
19 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
20 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21 *
22 * You should have received a copy of the GNU General Public License along
23 * with this program; if not, write to the Free Software Foundation, Inc.,
24 * 675 Mass Ave, Cambridge, MA 02139, USA.
25 *
26 */
27 #include <linux/init.h>
28 #include <linux/kernel.h>
29 #include <linux/types.h>
30 #include <linux/mm.h>
31 #include <linux/swap.h>
32 #include <linux/ioport.h>
33 #include <linux/sched.h>
34 #include <linux/interrupt.h>
35 #include <linux/pci.h>
36 #include <linux/timex.h>
37 #include <asm/bootinfo.h>
38 #include <asm/page.h>
39 #include <asm/bootinfo.h>
40 #include <asm/io.h>
41 #include <asm/irq.h>
42 #include <asm/pci.h>
43 #include <asm/processor.h>
44 #include <asm/ptrace.h>
45 #include <asm/time.h>
46 #include <asm/reboot.h>
47 #include <asm/mc146818rtc.h>
48 #include <asm/traps.h>
49 #include <linux/version.h>
50 #include <linux/bootmem.h>
51
52 unsigned long gt64120_base = KSEG1ADDR(0x14000000);
53
54 extern struct rtc_ops no_rtc_ops;
55
56 /* These functions are used for rebooting or halting the machine*/
57 extern void galileo_machine_restart(char *command);
58 extern void galileo_machine_halt(void);
59 extern void galileo_machine_power_off(void);
60 /*
61 *This structure holds pointers to the pci configuration space accesses
62 *and interrupts allocating routine for device over the PCI
63 */
64 extern struct pci_ops galileo_pci_ops;
65
66 char arcs_cmdline[CL_SIZE] = {
67 "console=ttyS0,115200 "
68 "root=/dev/nfs rw nfsroot=192.168.1.1:/mnt/disk2/fs.gal "
69 "ip=192.168.1.211:192.168.1.1:::gt::"
70 };
71
prom_free_prom_memory(void)72 void prom_free_prom_memory(void)
73 {
74 }
75
galileo_rtc_read_data(unsigned long addr)76 static unsigned char galileo_rtc_read_data(unsigned long addr)
77 {
78 return 0;
79 }
80
galileo_rtc_write_data(unsigned char data,unsigned long addr)81 static void galileo_rtc_write_data(unsigned char data, unsigned long addr)
82 {
83 }
84
galileo_rtc_bcd_mode(void)85 static int galileo_rtc_bcd_mode(void)
86 {
87 return 0;
88 }
89
90 struct rtc_ops galileo_rtc_ops = {
91 &galileo_rtc_read_data,
92 &galileo_rtc_write_data,
93 &galileo_rtc_bcd_mode
94 };
95
96
97 /*
98 * Initializes basic routines and structures pointers, memory size (as
99 * given by the bios and saves the command line.
100 */
101 extern void gt64120_time_init(void);
102
ev64120_setup(void)103 void ev64120_setup(void)
104 {
105 _machine_restart = galileo_machine_restart;
106 _machine_halt = galileo_machine_halt;
107 _machine_power_off = galileo_machine_power_off;
108
109 rtc_ops = &galileo_rtc_ops;
110
111 board_time_init = gt64120_time_init;
112 set_io_port_base(KSEG1);
113 }
114
get_system_type(void)115 const char *get_system_type(void)
116 {
117 return "Galileo EV64120A";
118 }
119
120 /*
121 * SetUpBootInfo -
122 *
123 * This function is called at very first stages of kernel startup.
124 * It specifies for the kernel the evaluation board that the linux
125 * is running on. Then it saves the eprom parameters that holds the
126 * command line, memory size etc...
127 *
128 * Inputs :
129 * argc - nothing
130 * argv - holds a pointer to the eprom parameters
131 * envp - nothing
132 */
133
SetUpBootInfo(int argc,char ** argv,char ** envp)134 void SetUpBootInfo(int argc, char **argv, char **envp)
135 {
136 mips_machgroup = MACH_GROUP_GALILEO;
137 mips_machtype = MACH_EV64120A;
138 }
139
prom_init(int a,char ** b,char ** c,int * d)140 void __init prom_init(int a, char **b, char **c, int *d)
141 {
142 mips_machgroup = MACH_GROUP_GALILEO;
143 add_memory_region(0, 32 << 20, BOOT_MEM_RAM);
144 }
145