1 |
dpavlin |
22 |
/* |
2 |
dpavlin |
34 |
* Copyright (C) 2003-2007 Anders Gavare. All rights reserved. |
3 |
dpavlin |
22 |
* |
4 |
|
|
* Redistribution and use in source and binary forms, with or without |
5 |
|
|
* modification, are permitted provided that the following conditions are met: |
6 |
|
|
* |
7 |
|
|
* 1. Redistributions of source code must retain the above copyright |
8 |
|
|
* notice, this list of conditions and the following disclaimer. |
9 |
|
|
* 2. Redistributions in binary form must reproduce the above copyright |
10 |
|
|
* notice, this list of conditions and the following disclaimer in the |
11 |
|
|
* documentation and/or other materials provided with the distribution. |
12 |
|
|
* 3. The name of the author may not be used to endorse or promote products |
13 |
|
|
* derived from this software without specific prior written permission. |
14 |
|
|
* |
15 |
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND |
16 |
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
17 |
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 |
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE |
19 |
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
20 |
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
21 |
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
22 |
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
23 |
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
24 |
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
25 |
|
|
* SUCH DAMAGE. |
26 |
|
|
* |
27 |
|
|
* |
28 |
dpavlin |
42 |
* $Id: machine_hpcmips.c,v 1.9 2007/06/15 18:08:10 debug Exp $ |
29 |
|
|
* |
30 |
|
|
* COMMENT: Handheld MIPS-based machines |
31 |
dpavlin |
22 |
*/ |
32 |
|
|
|
33 |
|
|
#include <stdio.h> |
34 |
|
|
#include <stdlib.h> |
35 |
|
|
#include <string.h> |
36 |
|
|
|
37 |
|
|
#include "cpu.h" |
38 |
|
|
#include "device.h" |
39 |
|
|
#include "devices.h" |
40 |
|
|
#include "machine.h" |
41 |
|
|
#include "memory.h" |
42 |
|
|
#include "misc.h" |
43 |
|
|
|
44 |
|
|
#include "hpc_bootinfo.h" |
45 |
|
|
#include "vripreg.h" |
46 |
|
|
|
47 |
|
|
|
48 |
|
|
MACHINE_SETUP(hpcmips) |
49 |
|
|
{ |
50 |
|
|
char tmpstr[1000]; |
51 |
|
|
struct hpc_bootinfo hpc_bootinfo; |
52 |
|
|
int hpc_platid_flags = 0, hpc_platid_cpu_submodel = 0, |
53 |
|
|
hpc_platid_cpu_model = 0, hpc_platid_cpu_series = 0, |
54 |
|
|
hpc_platid_cpu_arch = 0, |
55 |
|
|
hpc_platid_submodel = 0, hpc_platid_model = 0, |
56 |
|
|
hpc_platid_series = 0, hpc_platid_vendor = 0; |
57 |
|
|
uint64_t hpc_fb_addr = 0; |
58 |
|
|
int hpc_fb_bits = 0, hpc_fb_encoding = 0; |
59 |
|
|
int hpc_fb_xsize = 0; |
60 |
|
|
int hpc_fb_ysize = 0; |
61 |
|
|
int hpc_fb_xsize_mem = 0; |
62 |
|
|
int hpc_fb_ysize_mem = 0; |
63 |
|
|
|
64 |
|
|
cpu->byte_order = EMUL_LITTLE_ENDIAN; |
65 |
|
|
memset(&hpc_bootinfo, 0, sizeof(hpc_bootinfo)); |
66 |
|
|
|
67 |
|
|
/* |
68 |
|
|
* NOTE: See http://forums.projectmayo.com/viewtopic.php?topic=2743& |
69 |
|
|
* forum=23 for info on framebuffer addresses. |
70 |
|
|
*/ |
71 |
|
|
|
72 |
|
|
switch (machine->machine_subtype) { |
73 |
|
|
|
74 |
|
|
case MACHINE_HPCMIPS_CASIO_BE300: |
75 |
|
|
/* 166MHz VR4131 */ |
76 |
|
|
machine->machine_name = "Casio Cassiopeia BE-300"; |
77 |
|
|
hpc_fb_addr = 0x0a200000; |
78 |
|
|
hpc_fb_xsize = 240; |
79 |
|
|
hpc_fb_ysize = 320; |
80 |
|
|
hpc_fb_xsize_mem = 256; |
81 |
|
|
hpc_fb_ysize_mem = 320; |
82 |
|
|
hpc_fb_bits = 15; |
83 |
|
|
hpc_fb_encoding = BIFB_D16_0000; |
84 |
|
|
|
85 |
|
|
/* TODO: irq? */ |
86 |
|
|
snprintf(tmpstr, sizeof(tmpstr), "ns16550 irq=0 addr=0x" |
87 |
dpavlin |
42 |
"0a008680 addr_mult=4 in_use=%i", !machine->x11_md.in_use); |
88 |
dpavlin |
22 |
machine->main_console_handle = (size_t) |
89 |
|
|
device_add(machine, tmpstr); |
90 |
|
|
|
91 |
dpavlin |
34 |
dev_vr41xx_init(machine, machine->memory, 4131); |
92 |
dpavlin |
22 |
|
93 |
|
|
hpc_platid_cpu_arch = 1; /* MIPS */ |
94 |
|
|
hpc_platid_cpu_series = 1; /* VR */ |
95 |
|
|
hpc_platid_cpu_model = 1; /* VR41XX */ |
96 |
|
|
hpc_platid_cpu_submodel = 6; /* VR4131 */ |
97 |
|
|
hpc_platid_vendor = 3; /* Casio */ |
98 |
|
|
hpc_platid_series = 1; /* CASSIOPEIAE */ |
99 |
|
|
hpc_platid_model = 2; /* EXXX */ |
100 |
|
|
hpc_platid_submodel = 3; /* E500 */ |
101 |
|
|
/* TODO: Don't use model number for E500, it's a BE300! */ |
102 |
|
|
break; |
103 |
|
|
|
104 |
|
|
case MACHINE_HPCMIPS_CASIO_E105: |
105 |
|
|
/* 131MHz VR4121 */ |
106 |
|
|
machine->machine_name = "Casio Cassiopeia E-105"; |
107 |
|
|
hpc_fb_addr = 0x0a200000; /* TODO? */ |
108 |
|
|
hpc_fb_xsize = 240; |
109 |
|
|
hpc_fb_ysize = 320; |
110 |
|
|
hpc_fb_xsize_mem = 256; |
111 |
|
|
hpc_fb_ysize_mem = 320; |
112 |
|
|
hpc_fb_bits = 16; |
113 |
|
|
hpc_fb_encoding = BIFB_D16_0000; |
114 |
|
|
|
115 |
|
|
/* TODO: irq? */ |
116 |
|
|
snprintf(tmpstr, sizeof(tmpstr), "ns16550 irq=0 addr=0x" |
117 |
dpavlin |
42 |
"0a008680 addr_mult=4 in_use=%i", !machine->x11_md.in_use); |
118 |
dpavlin |
22 |
machine->main_console_handle = (size_t) |
119 |
|
|
device_add(machine, tmpstr); |
120 |
|
|
|
121 |
dpavlin |
34 |
dev_vr41xx_init(machine, machine->memory, 4121); |
122 |
dpavlin |
22 |
|
123 |
|
|
hpc_platid_cpu_arch = 1; /* MIPS */ |
124 |
|
|
hpc_platid_cpu_series = 1; /* VR */ |
125 |
|
|
hpc_platid_cpu_model = 1; /* VR41XX */ |
126 |
|
|
hpc_platid_cpu_submodel = 3; /* VR4121 */ |
127 |
|
|
hpc_platid_vendor = 3; /* Casio */ |
128 |
|
|
hpc_platid_series = 1; /* CASSIOPEIAE */ |
129 |
|
|
hpc_platid_model = 2; /* EXXX */ |
130 |
|
|
hpc_platid_submodel = 2; /* E105 */ |
131 |
|
|
break; |
132 |
|
|
|
133 |
|
|
case MACHINE_HPCMIPS_NEC_MOBILEPRO_770: |
134 |
|
|
/* 131 MHz VR4121 */ |
135 |
|
|
machine->machine_name = "NEC MobilePro 770"; |
136 |
|
|
hpc_fb_addr = 0xa000000; |
137 |
|
|
hpc_fb_xsize = 640; |
138 |
|
|
hpc_fb_ysize = 240; |
139 |
|
|
hpc_fb_xsize_mem = 800; |
140 |
|
|
hpc_fb_ysize_mem = 240; |
141 |
|
|
hpc_fb_bits = 16; |
142 |
|
|
hpc_fb_encoding = BIFB_D16_0000; |
143 |
|
|
|
144 |
dpavlin |
34 |
dev_vr41xx_init(machine, machine->memory, 4121); |
145 |
dpavlin |
22 |
|
146 |
|
|
hpc_platid_cpu_arch = 1; /* MIPS */ |
147 |
|
|
hpc_platid_cpu_series = 1; /* VR */ |
148 |
|
|
hpc_platid_cpu_model = 1; /* VR41XX */ |
149 |
|
|
hpc_platid_cpu_submodel = 3; /* VR4121 */ |
150 |
|
|
hpc_platid_vendor = 1; /* NEC */ |
151 |
|
|
hpc_platid_series = 2; /* NEC MCR */ |
152 |
|
|
hpc_platid_model = 2; /* MCR 5XX */ |
153 |
|
|
hpc_platid_submodel = 4; /* MCR 520A */ |
154 |
|
|
break; |
155 |
|
|
|
156 |
|
|
case MACHINE_HPCMIPS_NEC_MOBILEPRO_780: |
157 |
|
|
/* 166 (or 168) MHz VR4121 */ |
158 |
|
|
machine->machine_name = "NEC MobilePro 780"; |
159 |
|
|
hpc_fb_addr = 0xa180100; |
160 |
|
|
hpc_fb_xsize = 640; |
161 |
|
|
hpc_fb_ysize = 240; |
162 |
|
|
hpc_fb_xsize_mem = 640; |
163 |
|
|
hpc_fb_ysize_mem = 240; |
164 |
|
|
hpc_fb_bits = 16; |
165 |
|
|
hpc_fb_encoding = BIFB_D16_0000; |
166 |
|
|
|
167 |
dpavlin |
34 |
dev_vr41xx_init(machine, machine->memory, 4121); |
168 |
dpavlin |
22 |
|
169 |
|
|
hpc_platid_cpu_arch = 1; /* MIPS */ |
170 |
|
|
hpc_platid_cpu_series = 1; /* VR */ |
171 |
|
|
hpc_platid_cpu_model = 1; /* VR41XX */ |
172 |
|
|
hpc_platid_cpu_submodel = 3; /* VR4121 */ |
173 |
|
|
hpc_platid_vendor = 1; /* NEC */ |
174 |
|
|
hpc_platid_series = 2; /* NEC MCR */ |
175 |
|
|
hpc_platid_model = 2; /* MCR 5XX */ |
176 |
|
|
hpc_platid_submodel = 8; /* MCR 530A */ |
177 |
|
|
break; |
178 |
|
|
|
179 |
|
|
case MACHINE_HPCMIPS_NEC_MOBILEPRO_800: |
180 |
|
|
/* 131 MHz VR4121 */ |
181 |
|
|
machine->machine_name = "NEC MobilePro 800"; |
182 |
|
|
hpc_fb_addr = 0xa000000; |
183 |
|
|
hpc_fb_xsize = 800; |
184 |
|
|
hpc_fb_ysize = 600; |
185 |
|
|
hpc_fb_xsize_mem = 800; |
186 |
|
|
hpc_fb_ysize_mem = 600; |
187 |
|
|
hpc_fb_bits = 16; |
188 |
|
|
hpc_fb_encoding = BIFB_D16_0000; |
189 |
|
|
|
190 |
dpavlin |
34 |
dev_vr41xx_init(machine, machine->memory, 4121); |
191 |
dpavlin |
22 |
|
192 |
|
|
hpc_platid_cpu_arch = 1; /* MIPS */ |
193 |
|
|
hpc_platid_cpu_series = 1; /* VR */ |
194 |
|
|
hpc_platid_cpu_model = 1; /* VR41XX */ |
195 |
|
|
hpc_platid_cpu_submodel = 3; /* VR4121 */ |
196 |
|
|
hpc_platid_vendor = 1; /* NEC */ |
197 |
|
|
hpc_platid_series = 2; /* NEC MCR */ |
198 |
|
|
hpc_platid_model = 3; /* MCR 7XX */ |
199 |
|
|
hpc_platid_submodel = 2; /* MCR 700A */ |
200 |
|
|
break; |
201 |
|
|
|
202 |
|
|
case MACHINE_HPCMIPS_NEC_MOBILEPRO_880: |
203 |
|
|
/* 168 MHz VR4121 */ |
204 |
|
|
machine->machine_name = "NEC MobilePro 880"; |
205 |
|
|
hpc_fb_addr = 0xa0ea600; |
206 |
|
|
hpc_fb_xsize = 800; |
207 |
|
|
hpc_fb_ysize = 600; |
208 |
|
|
hpc_fb_xsize_mem = 800; |
209 |
|
|
hpc_fb_ysize_mem = 600; |
210 |
|
|
hpc_fb_bits = 16; |
211 |
|
|
hpc_fb_encoding = BIFB_D16_0000; |
212 |
|
|
|
213 |
dpavlin |
34 |
dev_vr41xx_init(machine, machine->memory, 4121); |
214 |
dpavlin |
22 |
|
215 |
|
|
hpc_platid_cpu_arch = 1; /* MIPS */ |
216 |
|
|
hpc_platid_cpu_series = 1; /* VR */ |
217 |
|
|
hpc_platid_cpu_model = 1; /* VR41XX */ |
218 |
|
|
hpc_platid_cpu_submodel = 3; /* VR4121 */ |
219 |
|
|
hpc_platid_vendor = 1; /* NEC */ |
220 |
|
|
hpc_platid_series = 2; /* NEC MCR */ |
221 |
|
|
hpc_platid_model = 3; /* MCR 7XX */ |
222 |
|
|
hpc_platid_submodel = 4; /* MCR 730A */ |
223 |
|
|
break; |
224 |
|
|
|
225 |
|
|
case MACHINE_HPCMIPS_AGENDA_VR3: |
226 |
|
|
/* 66 MHz VR4181 */ |
227 |
|
|
machine->machine_name = "Agenda VR3"; |
228 |
|
|
/* TODO: */ |
229 |
|
|
hpc_fb_addr = 0x1000; |
230 |
|
|
hpc_fb_xsize = 160; |
231 |
|
|
hpc_fb_ysize = 240; |
232 |
|
|
hpc_fb_xsize_mem = 160; |
233 |
|
|
hpc_fb_ysize_mem = 240; |
234 |
|
|
hpc_fb_bits = 4; |
235 |
|
|
hpc_fb_encoding = BIFB_D4_M2L_F; |
236 |
|
|
|
237 |
dpavlin |
34 |
dev_vr41xx_init(machine, machine->memory, 4181); |
238 |
dpavlin |
22 |
|
239 |
|
|
/* TODO: Hm... irq 17 according to linux, but |
240 |
|
|
VRIP_INTR_SIU (=9) here? */ |
241 |
|
|
{ |
242 |
|
|
int x; |
243 |
|
|
snprintf(tmpstr, sizeof(tmpstr), |
244 |
|
|
"ns16550 irq=%i addr=0x0c000010", 8+VRIP_INTR_SIU); |
245 |
|
|
x = (size_t)device_add(machine, tmpstr); |
246 |
|
|
|
247 |
dpavlin |
42 |
if (!machine->x11_md.in_use) |
248 |
dpavlin |
22 |
machine->main_console_handle = x; |
249 |
|
|
} |
250 |
|
|
|
251 |
|
|
hpc_platid_cpu_arch = 1; /* MIPS */ |
252 |
|
|
hpc_platid_cpu_series = 1; /* VR */ |
253 |
|
|
hpc_platid_cpu_model = 1; /* VR41XX */ |
254 |
|
|
hpc_platid_cpu_submodel = 4; /* VR4181 */ |
255 |
|
|
hpc_platid_vendor = 15; /* Agenda */ |
256 |
|
|
hpc_platid_series = 1; /* VR */ |
257 |
|
|
hpc_platid_model = 1; /* VR3 */ |
258 |
|
|
hpc_platid_submodel = 0; /* - */ |
259 |
|
|
|
260 |
|
|
dev_ram_init(machine, 0x0f000000, 0x01000000, |
261 |
|
|
DEV_RAM_MIRROR | DEV_RAM_MIGHT_POINT_TO_DEVICES, 0x0); |
262 |
|
|
break; |
263 |
|
|
|
264 |
|
|
case MACHINE_HPCMIPS_IBM_WORKPAD_Z50: |
265 |
|
|
/* 131 MHz VR4121 */ |
266 |
|
|
machine->machine_name = "IBM Workpad Z50"; |
267 |
|
|
/* TODO: */ |
268 |
|
|
hpc_fb_addr = 0xa000000; |
269 |
|
|
hpc_fb_xsize = 640; |
270 |
|
|
hpc_fb_ysize = 480; |
271 |
|
|
hpc_fb_xsize_mem = 640; |
272 |
|
|
hpc_fb_ysize_mem = 480; |
273 |
|
|
hpc_fb_bits = 16; |
274 |
|
|
hpc_fb_encoding = BIFB_D16_0000; |
275 |
|
|
|
276 |
dpavlin |
34 |
dev_vr41xx_init(machine, machine->memory, 4121); |
277 |
dpavlin |
22 |
|
278 |
|
|
hpc_platid_cpu_arch = 1; /* MIPS */ |
279 |
|
|
hpc_platid_cpu_series = 1; /* VR */ |
280 |
|
|
hpc_platid_cpu_model = 1; /* VR41XX */ |
281 |
|
|
hpc_platid_cpu_submodel = 3; /* VR4121 */ |
282 |
|
|
hpc_platid_vendor = 9; /* IBM */ |
283 |
|
|
hpc_platid_series = 1; /* WorkPad */ |
284 |
|
|
hpc_platid_model = 1; /* Z50 */ |
285 |
|
|
hpc_platid_submodel = 0; /* 0 */ |
286 |
|
|
break; |
287 |
|
|
|
288 |
|
|
default:printf("Unimplemented hpcmips machine number.\n"); |
289 |
|
|
exit(1); |
290 |
|
|
} |
291 |
|
|
|
292 |
|
|
store_32bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.platid_cpu, |
293 |
|
|
(hpc_platid_cpu_arch << 26) + (hpc_platid_cpu_series << 20) |
294 |
|
|
+ (hpc_platid_cpu_model << 14) + (hpc_platid_cpu_submodel << 8) |
295 |
|
|
+ hpc_platid_flags); |
296 |
|
|
store_32bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo. |
297 |
|
|
platid_machine, (hpc_platid_vendor << 22) + (hpc_platid_series<<16) |
298 |
|
|
+ (hpc_platid_model << 8) + hpc_platid_submodel); |
299 |
|
|
|
300 |
|
|
if (hpc_fb_addr != 0) { |
301 |
|
|
dev_fb_init(machine, machine->memory, hpc_fb_addr, VFB_HPC, |
302 |
|
|
hpc_fb_xsize, hpc_fb_ysize, |
303 |
|
|
hpc_fb_xsize_mem, hpc_fb_ysize_mem, |
304 |
|
|
hpc_fb_bits, machine->machine_name); |
305 |
|
|
|
306 |
|
|
/* NetBSD/hpcmips uses framebuffer at physical |
307 |
|
|
address 0x8.......: */ |
308 |
|
|
dev_ram_init(machine, 0x80000000, 0x20000000, |
309 |
|
|
DEV_RAM_MIRROR | DEV_RAM_MIGHT_POINT_TO_DEVICES, 0x0); |
310 |
|
|
} |
311 |
|
|
|
312 |
|
|
if (!machine->prom_emulation) |
313 |
|
|
return; |
314 |
|
|
|
315 |
|
|
|
316 |
|
|
/* NetBSD/hpcmips and possibly others expects the following: */ |
317 |
|
|
|
318 |
|
|
cpu->cd.mips.gpr[MIPS_GPR_A0] = 1; /* argc */ |
319 |
|
|
cpu->cd.mips.gpr[MIPS_GPR_A1] = machine->physical_ram_in_mb * 1048576 |
320 |
|
|
+ 0xffffffff80000000ULL - 512; /* argv */ |
321 |
|
|
cpu->cd.mips.gpr[MIPS_GPR_A2] = machine->physical_ram_in_mb * 1048576 |
322 |
|
|
+ 0xffffffff80000000ULL - 256; /* ptr to hpc_bootinfo */ |
323 |
|
|
|
324 |
|
|
machine->bootstr = machine->boot_kernel_filename; |
325 |
|
|
store_32bit_word(cpu, 0x80000000ULL + (machine->physical_ram_in_mb << |
326 |
|
|
20) - 512, 0x80000000ULL + (machine->physical_ram_in_mb << 20) |
327 |
|
|
- 512 + 16); |
328 |
|
|
store_32bit_word(cpu, 0x80000000ULL + (machine->physical_ram_in_mb << |
329 |
|
|
20) - 512 + 4, 0); |
330 |
|
|
store_string(cpu, 0x80000000ULL + (machine->physical_ram_in_mb << |
331 |
|
|
20) - 512 + 16, machine->bootstr); |
332 |
|
|
|
333 |
|
|
/* Special case for the Agenda VR3: */ |
334 |
|
|
if (machine->machine_subtype == MACHINE_HPCMIPS_AGENDA_VR3) { |
335 |
|
|
const int tmplen = 1000; |
336 |
|
|
char *tmp = malloc(tmplen); |
337 |
|
|
|
338 |
|
|
cpu->cd.mips.gpr[MIPS_GPR_A0] = 2; /* argc */ |
339 |
|
|
|
340 |
|
|
store_32bit_word(cpu, 0x80000000 + machine->physical_ram_in_mb |
341 |
|
|
* 1048576-512 + 4, 0x80000000 + machine->physical_ram_in_mb |
342 |
|
|
* 1048576 - 512 + 64); |
343 |
|
|
store_32bit_word(cpu, 0x80000000 + machine->physical_ram_in_mb |
344 |
|
|
* 1048576 - 512 + 8, 0); |
345 |
|
|
|
346 |
|
|
snprintf(tmp, tmplen, "root=/dev/rom video=vr4181fb:xres:160,y" |
347 |
|
|
"res:240,bpp:4,gray,hpck:3084,inv ether=0,0x03fe0300,eth0"); |
348 |
|
|
tmp[tmplen-1] = '\0'; |
349 |
|
|
|
350 |
dpavlin |
42 |
if (!machine->x11_md.in_use) |
351 |
dpavlin |
22 |
snprintf(tmp+strlen(tmp), tmplen-strlen(tmp), |
352 |
|
|
" console=ttyS0,115200"); |
353 |
|
|
tmp[tmplen-1] = '\0'; |
354 |
|
|
|
355 |
|
|
if (machine->boot_string_argument[0]) |
356 |
|
|
snprintf(tmp+strlen(tmp), tmplen-strlen(tmp), " %s", |
357 |
|
|
machine->boot_string_argument); |
358 |
|
|
tmp[tmplen-1] = '\0'; |
359 |
|
|
|
360 |
|
|
store_string(cpu, 0x80000000 + machine->physical_ram_in_mb |
361 |
|
|
* 1048576 - 512 + 64, tmp); |
362 |
|
|
|
363 |
|
|
machine->bootarg = tmp; |
364 |
|
|
} else if (machine->boot_string_argument[0]) { |
365 |
|
|
cpu->cd.mips.gpr[MIPS_GPR_A0] ++; /* argc */ |
366 |
|
|
|
367 |
|
|
store_32bit_word(cpu, 0x80000000 + machine->physical_ram_in_mb |
368 |
|
|
* 1048576-512 + 4, 0x80000000 + machine->physical_ram_in_mb |
369 |
|
|
* 1048576 - 512 + 64); |
370 |
|
|
store_32bit_word(cpu, 0x80000000 + machine->physical_ram_in_mb |
371 |
|
|
* 1048576 - 512 + 8, 0); |
372 |
|
|
|
373 |
|
|
store_string(cpu, 0x80000000 + machine->physical_ram_in_mb * |
374 |
|
|
1048576 - 512 + 64, machine->boot_string_argument); |
375 |
|
|
|
376 |
|
|
machine->bootarg = machine->boot_string_argument; |
377 |
|
|
} |
378 |
|
|
|
379 |
|
|
store_16bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.length, |
380 |
|
|
sizeof(hpc_bootinfo)); |
381 |
|
|
store_32bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.magic, |
382 |
|
|
HPC_BOOTINFO_MAGIC); |
383 |
|
|
store_32bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.fb_addr, |
384 |
|
|
0x80000000 + hpc_fb_addr); |
385 |
|
|
store_16bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo. |
386 |
|
|
fb_line_bytes, hpc_fb_xsize_mem * (((hpc_fb_bits-1)|7)+1) / 8); |
387 |
|
|
store_16bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.fb_width, |
388 |
|
|
hpc_fb_xsize); |
389 |
|
|
store_16bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.fb_height, |
390 |
|
|
hpc_fb_ysize); |
391 |
|
|
store_16bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.fb_type, |
392 |
|
|
hpc_fb_encoding); |
393 |
|
|
store_16bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.bi_cnuse, |
394 |
|
|
BI_CNUSE_BUILTIN); /* _BUILTIN or _SERIAL */ |
395 |
|
|
|
396 |
|
|
/* printf("hpc_bootinfo.platid_cpu = 0x%08x\n", |
397 |
|
|
hpc_bootinfo.platid_cpu); |
398 |
|
|
printf("hpc_bootinfo.platid_machine = 0x%08x\n", |
399 |
|
|
hpc_bootinfo.platid_machine); */ |
400 |
|
|
store_32bit_word_in_host(cpu,(unsigned char *)&hpc_bootinfo.timezone,0); |
401 |
|
|
store_buf(cpu, 0x80000000 + machine->physical_ram_in_mb * |
402 |
|
|
1048576 - 256, (char *)&hpc_bootinfo, sizeof(hpc_bootinfo)); |
403 |
|
|
} |
404 |
|
|
|
405 |
|
|
|
406 |
|
|
MACHINE_DEFAULT_CPU(hpcmips) |
407 |
|
|
{ |
408 |
|
|
switch (machine->machine_subtype) { |
409 |
|
|
case MACHINE_HPCMIPS_CASIO_BE300: |
410 |
|
|
machine->cpu_name = strdup("VR4131"); |
411 |
|
|
break; |
412 |
|
|
case MACHINE_HPCMIPS_CASIO_E105: |
413 |
|
|
machine->cpu_name = strdup("VR4121"); |
414 |
|
|
break; |
415 |
|
|
case MACHINE_HPCMIPS_NEC_MOBILEPRO_770: |
416 |
|
|
case MACHINE_HPCMIPS_NEC_MOBILEPRO_780: |
417 |
|
|
case MACHINE_HPCMIPS_NEC_MOBILEPRO_800: |
418 |
|
|
case MACHINE_HPCMIPS_NEC_MOBILEPRO_880: |
419 |
|
|
machine->cpu_name = strdup("VR4121"); |
420 |
|
|
break; |
421 |
|
|
case MACHINE_HPCMIPS_AGENDA_VR3: |
422 |
|
|
machine->cpu_name = strdup("VR4181"); |
423 |
|
|
break; |
424 |
|
|
case MACHINE_HPCMIPS_IBM_WORKPAD_Z50: |
425 |
|
|
machine->cpu_name = strdup("VR4121"); |
426 |
|
|
break; |
427 |
|
|
default:printf("Unimplemented HPCMIPS model?\n"); |
428 |
|
|
exit(1); |
429 |
|
|
} |
430 |
|
|
} |
431 |
|
|
|
432 |
|
|
|
433 |
|
|
MACHINE_DEFAULT_RAM(hpcmips) |
434 |
|
|
{ |
435 |
|
|
/* Most have 32 MB by default. */ |
436 |
|
|
machine->physical_ram_in_mb = 32; |
437 |
|
|
|
438 |
|
|
switch (machine->machine_subtype) { |
439 |
|
|
case MACHINE_HPCMIPS_CASIO_BE300: |
440 |
|
|
machine->physical_ram_in_mb = 16; |
441 |
|
|
break; |
442 |
|
|
case MACHINE_HPCMIPS_CASIO_E105: |
443 |
|
|
machine->physical_ram_in_mb = 32; |
444 |
|
|
break; |
445 |
|
|
case MACHINE_HPCMIPS_AGENDA_VR3: |
446 |
|
|
machine->physical_ram_in_mb = 16; |
447 |
|
|
break; |
448 |
|
|
} |
449 |
|
|
} |
450 |
|
|
|
451 |
|
|
|
452 |
|
|
MACHINE_REGISTER(hpcmips) |
453 |
|
|
{ |
454 |
dpavlin |
26 |
MR_DEFAULT(hpcmips, "Handhelp MIPS (HPCmips)", |
455 |
|
|
ARCH_MIPS, MACHINE_HPCMIPS); |
456 |
|
|
|
457 |
|
|
machine_entry_add_alias(me, "hpcmips"); |
458 |
|
|
|
459 |
|
|
machine_entry_add_subtype(me, "Casio Cassiopeia BE-300", |
460 |
|
|
MACHINE_HPCMIPS_CASIO_BE300, "be-300", "be300", NULL); |
461 |
|
|
|
462 |
|
|
machine_entry_add_subtype(me, "Casio Cassiopeia E-105", |
463 |
|
|
MACHINE_HPCMIPS_CASIO_E105, "e-105", "e105", NULL); |
464 |
|
|
|
465 |
|
|
machine_entry_add_subtype(me, "Agenda VR3", MACHINE_HPCMIPS_AGENDA_VR3, |
466 |
|
|
"agenda", "vr3", NULL); |
467 |
|
|
|
468 |
|
|
machine_entry_add_subtype(me, "IBM WorkPad Z50", |
469 |
|
|
MACHINE_HPCMIPS_IBM_WORKPAD_Z50, "workpad", "z50", NULL); |
470 |
|
|
|
471 |
|
|
machine_entry_add_subtype(me, "NEC MobilePro 770", |
472 |
|
|
MACHINE_HPCMIPS_NEC_MOBILEPRO_770, "mobilepro770", NULL); |
473 |
|
|
|
474 |
|
|
machine_entry_add_subtype(me, "NEC MobilePro 780", |
475 |
|
|
MACHINE_HPCMIPS_NEC_MOBILEPRO_780, "mobilepro780", NULL); |
476 |
|
|
|
477 |
|
|
machine_entry_add_subtype(me, "NEC MobilePro 800", |
478 |
|
|
MACHINE_HPCMIPS_NEC_MOBILEPRO_800, "mobilepro800", NULL); |
479 |
|
|
|
480 |
|
|
machine_entry_add_subtype(me, "NEC MobilePro 880", |
481 |
|
|
MACHINE_HPCMIPS_NEC_MOBILEPRO_880, "mobilepro880", NULL); |
482 |
|
|
|
483 |
dpavlin |
22 |
me->set_default_ram = machine_default_ram_hpcmips; |
484 |
|
|
} |
485 |
|
|
|