machine_sgi.cc Source File

Back to the index.

machine_sgi.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2003-2009 Anders Gavare. All rights reserved.
3  *
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  * COMMENT: Silicon Graphics' MIPS-based machines
29  *
30  * http://obsolete.majix.org/computers/sgi/iptable.shtml contains a
31  * pretty detailed list of IP ("Inhouse Processor") model numbers.
32  *
33  * See also: http://hardware.majix.org/computers/sgi/iptable.shtml
34  */
35 
36 #include <stdio.h>
37 #include <stdlib.h>
38 #include <string.h>
39 
40 #include "arcbios.h"
41 #include "bus_pci.h"
42 #include "cpu.h"
43 #include "device.h"
44 #include "devices.h"
45 #include "diskimage.h"
46 #include "machine.h"
47 #include "memory.h"
48 #include "misc.h"
49 #include "net.h"
50 
51 #include "thirdparty/sgi_arcbios.h"
52 #include "thirdparty/crimereg.h"
53 
54 
55 #define ETHERNET_STRING_MAXLEN 40
56 #define MACHINE_NAME_MAXBUF 100
57 
58 
60 {
61  uint64_t sgi_ram_offset = 0;
62  int arc_wordlen = sizeof(uint32_t);
63  struct memory *mem = machine->memory;
64  char tmpstr[1000];
65  int i, j;
66  char *eaddr_string = strdup("eaddr=10:20:30:40:50:60"); /* bogus */
67  unsigned char macaddr[6];
68  char *machineName;
69 
70  struct pci_data *pci_data = NULL;
71 
72  CHECK_ALLOCATION(machineName = (char *) malloc(MACHINE_NAME_MAXBUF));
73  machine->machine_name = machineName;
74 
76  snprintf(machineName, MACHINE_NAME_MAXBUF,
77  "SGI-IP%i", machine->machine_subtype);
78 
79  sgi_ram_offset = 1048576 * machine->memory_offset_in_mb;
80 
81  /* Special cases for IP20,22,24,26 memory offset: */
82  if (machine->machine_subtype == 20 || machine->machine_subtype == 22 ||
84  dev_ram_init(machine, 0x00000000, 0x10000, DEV_RAM_MIRROR
85  | DEV_RAM_MIGHT_POINT_TO_DEVICES, sgi_ram_offset);
86  dev_ram_init(machine, 0x00050000, sgi_ram_offset-0x50000,
88  sgi_ram_offset + 0x50000);
89  }
90 
91  /* Special cases for IP28,30 memory offset: */
92  if (machine->machine_subtype == 28 || machine->machine_subtype == 30) {
93  /* TODO: length below should maybe not be 128MB? */
94  dev_ram_init(machine, 0x00000000, 128*1048576, DEV_RAM_MIRROR
95  | DEV_RAM_MIGHT_POINT_TO_DEVICES, sgi_ram_offset);
96  }
97 
99  CHECK_ALLOCATION(eaddr_string = (char *) malloc(ETHERNET_STRING_MAXLEN));
100 
101  switch (machine->machine_subtype) {
102 
103  case 10:
104  strlcat(machineName, " (4D/25)", MACHINE_NAME_MAXBUF);
105  /* TODO */
106  break;
107 
108  case 12:
109  strlcat(machineName, " (Iris Indigo IP12)", MACHINE_NAME_MAXBUF);
110 
111  /* TODO */
112  /* 33 MHz R3000, according to http://www.irisindigo.com/ */
113  /* "capable of addressing up to 96MB of memory." */
114 
115  break;
116 
117  case 19:
118  strlcat(machineName,
119  " (Everest IP19)", MACHINE_NAME_MAXBUF);
121  "z8530 addr=0x1fbd9830 irq=0 addr_mult=4");
122 
123  fatal("TODO ip19 interrupt rewrite\n");
124  abort();
125  //dev_scc_init(machine, mem, 0x10086000, 0,
126  // machine->x11_md.in_use, 0, 8); /* serial? irix? */
127 
128  device_add(machine, "sgi_ip19 addr=0x18000000");
129 
130  /* Irix' <everest_du_init+0x130> reads this device: */
131  device_add(machine, "random addr=0x10006000 len=16");
132 
133  /* Irix' get_mpconf() looks for this: (TODO) */
134  store_32bit_word(cpu, 0xa0000000 + 0x3000,
135  0xbaddeed2);
136 
137  /* Memory size, not 4096 byte pages, but 256 bytes?
138  (16 is size of kernel... approx) */
139  store_32bit_word(cpu, 0xa0000000 + 0x26d0, 30000);
140  /* (machine->physical_ram_in_mb - 16) * (1048576 / 256)); */
141 
142  break;
143 
144  case 20:
145  strlcat(machineName, " (Indigo)", MACHINE_NAME_MAXBUF);
146 
147  /*
148  * Guesses based on NetBSD 2.0 beta, 20040606.
149  *
150  * int0 at mainbus0 addr 0x1fb801c0: bus 1MHz, CPU 2MHz
151  * imc0 at mainbus0 addr 0x1fa00000: revision 0
152  * gio0 at imc0
153  * unknown GIO card (product 0x00 revision 0x00)
154  * at gio0 slot 0 addr 0x1f400000 not configured
155  * unknown GIO card (product 0x00 revision 0x00)
156  * at gio0 slot 1 addr 0x1f600000 not configured
157  * unknown GIO card (product 0x00 revision 0x00)
158  * at gio0 slot 2 addr 0x1f000000 not configured
159  * hpc0 at gio0 addr 0x1fb80000: SGI HPC1
160  * zsc0 at hpc0 offset 0xd10 (channels 0 and 1,
161  * channel 1 for console)
162  * zsc1 at hpc0 offset 0xd00 (2 channels)
163  * sq0 at hpc0 offset 0x100: SGI Seeq 80c03
164  * wdsc0 at hpc0 offset 0x11f
165  * dpclock0 at hpc0 offset 0xe00
166  */
167 
168  /* int0 at mainbus0 addr 0x1fb801c0 */
169 fatal("TODO: SGI legacy interrupt system rewrite!\n");
170 abort();
171 // machine->md_int.sgi_ip20_data = dev_sgi_ip20_init(cpu, mem,
172 // DEV_SGI_IP20_BASE);
173 
174  /* imc0 at mainbus0 addr 0x1fa00000: revision 0:
175  TODO (or in dev_sgi_ip20?) */
176 
178  "z8530 addr=0x1fbd9830 irq=0 addr_mult=4");
179 
180  /* This is the zsc0 reported by NetBSD: TODO: irqs */
182  "z8530 addr=0x1fb80d10 irq=0 addr_mult=4");
184  "z8530 addr=0x1fb80d00 irq=0 addr_mult=4");
185 
186  /* WDSC SCSI controller: */
187 /* dev_wdsc_init(machine, mem, 0x1fb8011f, 0, 0); */
188 
189  /* Return memory read errors so that hpc1
190  and hpc2 are not detected: */
191  device_add(machine, "unreadable addr=0x1fb00000 len=0x10000");
192  device_add(machine, "unreadable addr=0x1f980000 len=0x10000");
193 
194  /* Return nothing for gio slots 0, 1, and 2: */
195  device_add(machine, "unreadable addr=0x1f400000 len=0x1000");
196  device_add(machine, "unreadable addr=0x1f600000 len=0x1000");
197  device_add(machine, "unreadable addr=0x1f000000 len=0x1000");
198 
199  break;
200 
201  case 21:
202  strlcat(machineName, /* TODO */
203  " (uknown SGI-IP21 ?)", MACHINE_NAME_MAXBUF);
204  /* NOTE: Special case for arc_wordlen: */
205  arc_wordlen = sizeof(uint64_t);
206 
207  device_add(machine, "random addr=0x418000200, len=0x20000");
208 
209  break;
210 
211  case 22:
212  case 24:
213  if (machine->machine_subtype == 22) {
214  strlcat(machineName,
215  " (Indy, Indigo2, Challenge S; Full-house)",
217 fatal("TODO: SGI legacy interrupt system rewrite!\n");
218 abort();
219 // machine->md_int.sgi_ip22_data =
220 // dev_sgi_ip22_init(machine, mem, 0x1fbd9000, 0);
221  } else {
222  strlcat(machineName,
223  " (Indy, Indigo2, Challenge S; Guiness)",
225 fatal("TODO: SGI legacy interrupt system rewrite!\n");
226 abort();
227 // machine->md_int.sgi_ip22_data =
228 // dev_sgi_ip22_init(machine, mem, 0x1fbd9880, 1);
229  }
230 
231 /*
232 Why is this here? TODO
233  dev_ram_init(machine, 0x88000000ULL,
234  128 * 1048576, DEV_RAM_MIRROR, 0x08000000);
235 */
236 
237 fatal("TODO: Legacy rewrite\n");
238 abort();
239 // machine->md_interrupt = sgi_ip22_interrupt;
240 
241  /*
242  * According to NetBSD 1.6.2:
243  *
244  * imc0 at mainbus0 addr 0x1fa00000, Revision 0
245  * gio0 at imc0
246  * hpc0 at gio0 addr 0x1fb80000: SGI HPC3
247  * zsc0 at hpc0 offset 0x59830
248  * zstty0 at zsc0 channel 1 (console i/o)
249  * zstty1 at zsc0 channel 0
250  * sq0 at hpc0 offset 0x54000: SGI Seeq 80c03 (Ethernet)
251  * wdsc0 at hpc0 offset 0x44000: WD33C93 SCSI, rev=0, target 7
252  * scsibus2 at wdsc0: 8 targets, 8 luns per target
253  * dsclock0 at hpc0 offset 0x60000
254  *
255  * According to Linux/IP22:
256  * tty00 at 0xbfbd9830 (irq = 45) is a Zilog8530
257  * tty01 at 0xbfbd9838 (irq = 45) is a Zilog8530
258  *
259  * and according to NetBSD 2.0_BETA (20040606):
260  *
261  * haltwo0 at hpc0 offset 0x58000: HAL2 revision 0.0.0
262  * audio0 at haltwo0: half duplex
263  *
264  * IRQ numbers are of the form 8 + x, where x=0..31 for local0
265  * interrupts, and 32..63 for local1. + y*65 for "mappable".
266  */
267 
268  /* zsc0 serial console. 8 + 32 + 3 + 64*5 = 43+64*5 = 363 */
269  i = (size_t)device_add(machine,
270  "z8530 addr=0x1fbd9830 irq=363 addr_mult=4");
271 
272  /* Not supported by NetBSD 1.6.2, but by 2.0_BETA: */
273 fatal("TODO: legacy rewrite\n");
274 abort();
275 // j = dev_pckbc_init(machine, mem, 0x1fbd9840, PCKBC_8242,
276 // 0, 0, machine->x11_md.in_use, 0); /* TODO: irq numbers */
277 j = 0;
278 
279  if (machine->x11_md.in_use)
281 
282  /* sq0: Ethernet. TODO: This should have irq_nr = 8 + 3 */
283  /* dev_sq_init... */
284 
285  /* wdsc0: SCSI */
286 /* dev_wdsc_init(machine, mem, 0x1fbc4000, 0, 8 + 1); */
287 
288  /* wdsc1: SCSI TODO: irq nr */
289 /* dev_wdsc_init(machine, mem, 0x1fbcc000, 1, 8 + 1); */
290 
291  /* dsclock0: TODO: possibly irq 8 + 33 */
292 
293  /* Return memory read errors so that hpc1 and hpc2 are
294  not detected: */
295  device_add(machine, "unreadable addr=0x1fb00000, len=0x10000");
296  device_add(machine, "unreadable addr=0x1f980000, len=0x10000");
297 
298  /* Similarly for gio slots 0, 1, and 2: */
299  device_add(machine, "unreadable addr=0x1f400000, len=0x1000");
300  device_add(machine, "unreadable addr=0x1f600000, len=0x1000");
301  device_add(machine, "unreadable addr=0x1f000000, len=0x1000");
302 
303  break;
304 
305  case 25:
306  /* NOTE: Special case for arc_wordlen: */
307  arc_wordlen = sizeof(uint64_t);
308  strlcat(machineName, " (Everest IP25)", MACHINE_NAME_MAXBUF);
309 
310  /* serial? irix? */
311  fatal("TODO ip25 interrupt rewrite\n");
312  abort();
313  //dev_scc_init(machine, mem,
314  // 0x400086000ULL, 0, machine->x11_md.in_use, 0, 8);
315 
316  /* NOTE: ip19! (perhaps not really the same */
317  device_add(machine, "sgi_ip19 addr=0x18000000");
318 
319  /*
320  * Memory size, not 4096 byte pages, but 256
321  * bytes? (16 is size of kernel... approx)
322  */
323  store_32bit_word(cpu, 0xa0000000ULL + 0x26d0,
324  30000); /* (machine->physical_ram_in_mb - 16)
325  * (1048576 / 256)); */
326 
327  break;
328 
329  case 26:
330  /* NOTE: Special case for arc_wordlen: */
331  arc_wordlen = sizeof(uint64_t);
332  strlcat(machineName, " (uknown SGI-IP26 ?)",
333  MACHINE_NAME_MAXBUF); /* TODO */
335  "z8530 addr=0x1fbd9830 irq=0 addr_mult=4");
336  break;
337 
338  case 27:
339  strlcat(machineName, " (Origin 200/2000, Onyx2)",
341  arc_wordlen = sizeof(uint64_t);
342  /* 2 cpus per node */
343 
345  "z8530 addr=0x1fbd9830 irq=0 addr_mult=4");
346  break;
347 
348  case 28:
349  /* NOTE: Special case for arc_wordlen: */
350  arc_wordlen = sizeof(uint64_t);
351  strlcat(machineName, " (Impact Indigo2 ?)", MACHINE_NAME_MAXBUF);
352 
353  device_add(machine, "random addr=0x1fbe0000, len=1");
354 
355  /* Something at paddr 0x1880fb0000. */
356 
357  break;
358 
359  case 30:
360  /* NOTE: Special case for arc_wordlen: */
361  arc_wordlen = sizeof(uint64_t);
362  strlcat(machineName, " (Octane)",
364 
365 fatal("TODO: SGI legacy interrupt system rewrite!\n");
366 abort();
367 // machine->md_int.sgi_ip30_data =
368 // dev_sgi_ip30_init(machine, mem, 0x0ff00000);
369 
370 fatal("TODO: Legacy rewrite\n");
371 abort();
372 // machine->md_interrupt = sgi_ip30_interrupt;
373 
374  dev_ram_init(machine, 0xa0000000ULL, 128 * 1048576,
376  0x00000000);
377 
378  dev_ram_init(machine, 0x80000000ULL,
379  32 * 1048576, DEV_RAM_RAM, 0x00000000);
380 
381  /*
382  * Something at paddr=1f022004: TODO
383  * Something at paddr=813f0510 - paddr=813f0570 ?
384  * Something at paddr=813f04b8
385  * Something at paddr=f8000003c used by Linux/Octane
386  *
387  * 16550 serial port at paddr=1f620178, addr mul 1
388  * (Error messages are printed to this serial port by
389  * the PROM.)
390  *
391  * There seems to also be a serial port at 1f620170. The
392  * "symmon" program dumps something there, but it doesn't
393  * look like readable text. (TODO)
394  */
395 
396  /* TODO: irq! */
397  snprintf(tmpstr, sizeof(tmpstr), "ns16550 irq=0 addr="
398  "0x1f620170 name2=tty0 in_use=%i",
399  machine->x11_md.in_use? 0 : 1);
401  tmpstr);
402  snprintf(tmpstr, sizeof(tmpstr), "ns16550 irq=0 addr="
403  "0x1f620178 name2=tty1 in_use=0");
404  device_add(machine, tmpstr);
405 
406  /* MardiGras graphics: */
407  device_add(machine, "sgi_mardigras addr=0x1c000000");
408 
409  break;
410 
411  case 32:
412  strlcat(machineName, " (O2)", MACHINE_NAME_MAXBUF);
413 
414  /* TODO: Find out where the phys ram is actually located. */
415  dev_ram_init(machine, 0x07ffff00ULL, 256,
416  DEV_RAM_MIRROR, 0x03ffff00);
417  dev_ram_init(machine, 0x10000000ULL, 256,
418  DEV_RAM_MIRROR, 0x00000000);
419  dev_ram_init(machine, 0x11ffff00ULL, 256,
420  DEV_RAM_MIRROR, 0x01ffff00);
421  dev_ram_init(machine, 0x12000000ULL, 256,
422  DEV_RAM_MIRROR, 0x02000000);
423  dev_ram_init(machine, 0x17ffff00ULL, 256,
424  DEV_RAM_MIRROR, 0x03ffff00);
425  dev_ram_init(machine, 0x20000000ULL, 128 * 1048576,
426  DEV_RAM_MIRROR, 0x00000000);
427  dev_ram_init(machine, 0x40000000ULL, 128 * 1048576,
428  DEV_RAM_MIRROR, 0x10000000);
429 
430  /* Connect CRIME (Interrupt Controller) to MIPS irq 2: */
431  snprintf(tmpstr, sizeof(tmpstr), "%s.cpu[%i].2",
433  dev_crime_init(machine, mem, 0x14000000, tmpstr,
434  machine->x11_md.in_use); /* crime0 */
435  dev_sgi_mte_init(mem, 0x15000000); /* mte ??? */
436  dev_sgi_gbe_init(machine, mem, 0x16000000); /* gbe? */
437 
438  /*
439  * A combination of NetBSD and Linux info:
440  *
441  * 17000000 vice (Video Image Compression Engine)
442  * 1f000000 mace
443  * 1f080000 macepci
444  * 1f100000 vin1
445  * 1f180000 vin2
446  * 1f200000 vout
447  * 1f280000 enet (mec0, MAC-110 Ethernet)
448  * 1f300000 perif:
449  * 1f300000 audio
450  * 1f310000 isa
451  * 1f318000 (accessed by Irix'
452  * pciio_pio_write64)
453  * 1f320000 kbdms
454  * 1f330000 i2c
455  * 1f340000 ust
456  * 1f380000 isa ext
457  * 1f390000 com0 (serial)
458  * 1f398000 com1 (serial)
459  * 1f3a0000 mcclock0
460  */
461 
462  /*
463  * IRQ mapping is really ugly. TODO: fix
464  *
465  * com0 at mace0 offset 0x390000 intr 4 intrmask
466  * 0x3f00000: ns16550a, working fifo
467  * com1 at mace0 offset 0x398000 intr 4 intrmask
468  * 0xfc000000: ns16550a, working fifo
469  * pckbc0 at mace0 offset 0x320000 intr 5 intrmask 0x0
470  * mcclock0 at mace0 offset 0x3a0000 intrmask 0x0
471  * macepci0 at mace0 offset 0x80000 intr 7 intrmask 0x0: rev 1
472  *
473  * intr 4 = MACE_PERIPH_SERIAL
474  * intr 5 = MACE_PERIPH_MISC
475  * intr 7 = MACE_PCI_BRIDGE
476  */
477 
478  snprintf(eaddr_string, ETHERNET_STRING_MAXLEN,
479  "eaddr=%02x:%02x:%02x:%02x:%02x:%02x",
480  macaddr[0], macaddr[1], macaddr[2],
481  macaddr[3], macaddr[4], macaddr[5]);
482 
483  snprintf(tmpstr, sizeof(tmpstr), "%s.cpu[%i].2.crime.0x%x",
485  dev_sgi_mec_init(machine, mem, 0x1f280000,
486  tmpstr, macaddr);
487 
488  dev_sgi_ust_init(mem, 0x1f340000); /* ust? */
489 
490  snprintf(tmpstr, sizeof(tmpstr),
491  "ns16550 irq=%s.cpu[%i].2.crime.0x%x.mace.%i addr="
492  "0x1f390000 addr_mult=0x100 in_use=%i name2=tty0",
494  MACE_PERIPH_SERIAL, 20, machine->x11_md.in_use? 0 : 1);
495  j = (size_t)device_add(machine, tmpstr);
496  snprintf(tmpstr, sizeof(tmpstr),
497  "ns16550 irq=%s.cpu[%i].2.crime.0x%x.mace.%i addr="
498  "0x1f398000 addr_mult=0x100 in_use=%i name2=tty1",
500  MACE_PERIPH_SERIAL, 26, 0);
501  device_add(machine, tmpstr);
502 
504 
505  /* TODO: Once this works, it should be enabled
506  always, not just when using X! */
507 #if 0
508 fatal("TODO: legacy SGI rewrite\n");
509 abort();
510  if (machine->x11_md.in_use) {
511  i = dev_pckbc_init(machine, mem, 0x1f320000,
512  PCKBC_8242, 0x200 + MACE_PERIPH_MISC,
514  0);
515  /* keyb+mouse (mace irq numbers) */
517  }
518 #endif
519 
520  snprintf(tmpstr, sizeof(tmpstr),
521  "%s.cpu[%i].2.crime.0x%x.mace.%i",
523  MACE_PERIPH_MISC, 8);
524  dev_mc146818_init(machine, mem, 0x1f3a0000, tmpstr,
525  MC146818_SGI, 0x40); /* mcclock0 */
526 
527  /* TODO: _WHERE_ does the z8530 interrupt? */
528  snprintf(tmpstr, sizeof(tmpstr), "z8530 addr=0x1fbd9830 "
529  "irq=%s.cpu[%i].2 addr_mult=4",
531  machine->main_console_handle = (size_t)
532  device_add(machine, tmpstr);
533 
534  /*
535  * PCI devices: (according to NetBSD's GENERIC
536  * config file for sgimips)
537  *
538  * ne* at pci? dev ? function ?
539  * ahc0 at pci0 dev 1 function ?
540  * ahc1 at pci0 dev 2 function ?
541  */
542 
543  snprintf(tmpstr, sizeof(tmpstr),
544  "%s.cpu[%i].2.crime.0x%x", machine->path,
546  pci_data = dev_macepci_init(machine, mem, 0x1f080000,
547  tmpstr); /* macepci0 */
548  /* bus_pci_add(machine, pci_data, mem, 0, 0, 0,
549  "ne2000"); TODO */
550 
551  /* TODO: make this nicer */
560  bus_pci_add(machine, pci_data, mem, 0, 1, 0, "ahc");
561 
562  /* TODO: second ahc */
563  /* bus_pci_add(machine, pci_data, mem, 0, 2, 0, "ahc"); */
564 
565  /*
566  * An additional PCI IDE controller, for NetBSD/sgimips
567  * experiments: (Not found in a regular O2.)
568  */
569  bus_pci_add(machine, pci_data, mem, 0, 3, 0, "symphony_82c105");
570 
571  break;
572 
573  case 35:
574  strlcat(machineName, " (Origin 3000)", MACHINE_NAME_MAXBUF);
575  /* 4 cpus per node */
576 
578  "z8530 addr=0x1fbd9830 irq=0 addr_mult=4");
579  break;
580 
581  case 53:
582  strlcat(machineName, " (Origin 350)",
584 
585  /*
586  * According to http://kumba.drachentekh.net/xml/myguide.html
587  * Origin 350, Tezro IP53 R16000
588  */
589  break;
590 
591  default:
592  fatal("unimplemented SGI machine type IP%i\n",
594  exit(1);
595  }
596 
597  if (!machine->prom_emulation)
598  return;
599 
600  arcbios_init(machine, arc_wordlen == sizeof(uint64_t), sgi_ram_offset,
601  eaddr_string, macaddr);
602 }
603 
604 
606 {
607  if (machine->machine_subtype <= 12)
608  machine->cpu_name = strdup("R3000");
609  if (machine->cpu_name == NULL && machine->machine_subtype == 35)
610  machine->cpu_name = strdup("R12000");
611  if (machine->cpu_name == NULL && (machine->machine_subtype == 25 ||
612  machine->machine_subtype == 27 || machine->machine_subtype == 28 ||
614  machine->cpu_name = strdup("R10000");
615  if (machine->cpu_name == NULL && (machine->machine_subtype == 21 ||
616  machine->machine_subtype == 26))
617  machine->cpu_name = strdup("R8000");
618  if (machine->cpu_name == NULL && machine->machine_subtype == 24)
619  machine->cpu_name = strdup("R5000");
620 
621  /* Other SGIs should probably work with
622  R4000, R4400 or R5000 or similar: */
623  if (machine->cpu_name == NULL)
624  machine->cpu_name = strdup("R4400");
625 }
626 
627 
629 {
631 }
632 
633 
635 {
636  MR_DEFAULT(sgi, "SGI", ARCH_MIPS, MACHINE_SGI);
637 
638  me->set_default_ram = machine_default_ram_sgi;
639 
640  machine_entry_add_alias(me, "silicon graphics");
641  machine_entry_add_alias(me, "sgi");
642 
643  machine_entry_add_subtype(me, "IP12", 12, "ip12", NULL);
644 
645  machine_entry_add_subtype(me, "IP19", 19, "ip19", NULL);
646 
647  machine_entry_add_subtype(me, "IP20", 20, "ip20", NULL);
648 
649  machine_entry_add_subtype(me, "IP22", 22, "ip22", "indy", NULL);
650 
651  machine_entry_add_subtype(me, "IP24", 24, "ip24", NULL);
652 
653  machine_entry_add_subtype(me, "IP27", 27,
654  "ip27", "origin 200", "origin 2000", NULL);
655 
656  machine_entry_add_subtype(me, "IP28", 28, "ip28", NULL);
657 
658  machine_entry_add_subtype(me, "IP30", 30, "ip30", "octane", NULL);
659 
660  machine_entry_add_subtype(me, "IP32", 32, "ip32", "o2", NULL);
661 
662  machine_entry_add_subtype(me, "IP35", 35, "ip35", NULL);
663 }
664 
void dev_mc146818_init(struct machine *machine, struct memory *mem, uint64_t baseaddr, char *irq_path, int access_style, int addrdiv)
void fatal(const char *fmt,...)
Definition: main.cc:152
int prom_emulation
Definition: machine.h:149
char * cpu_name
Definition: machine.h:133
int main_console_handle
Definition: machine.h:128
int store_32bit_word(struct cpu *cpu, uint64_t addr, uint64_t data32)
Definition: memory.cc:783
int diskimage_exist(struct machine *machine, int id, int type)
Definition: diskimage.cc:106
#define DEV_RAM_RAM
Definition: devices.h:364
#define DISKIMAGE_SCSI
Definition: diskimage.h:40
void dev_sgi_ust_init(struct memory *mem, uint64_t baseaddr)
MACHINE_DEFAULT_CPU(sgi)
Definition: machine_sgi.cc:605
MACHINE_DEFAULT_RAM(sgi)
Definition: machine_sgi.cc:628
struct memory * memory
Definition: machine.h:126
void bus_pci_add(struct machine *machine, struct pci_data *pci_data, struct memory *mem, int bus, int device, int function, const char *name)
Definition: bus_pci.cc:217
struct pci_data * dev_macepci_init(struct machine *machine, struct memory *mem, uint64_t baseaddr, char *irq_path)
void * device_add(struct machine *machine, const char *name_and_params)
Definition: device.cc:252
int physical_ram_in_mb
Definition: machine.h:147
#define DEV_RAM_MIRROR
Definition: devices.h:365
MACHINE_SETUP(sgi)
Definition: machine_sgi.cc:59
#define CHECK_ALLOCATION(ptr)
Definition: misc.h:239
char * path
Definition: machine.h:108
#define MACE_PERIPH_MISC
Definition: crimereg.h:96
int bootstrap_cpu
Definition: machine.h:136
void dev_sgi_mec_init(struct machine *machine, struct memory *mem, uint64_t baseaddr, char *irq_path, unsigned char *macaddr)
void dev_sgi_mte_init(struct memory *mem, uint64_t baseaddr)
#define MACE_ETHERNET
Definition: crimereg.h:98
void dev_ram_init(struct machine *machine, uint64_t baseaddr, uint64_t length, int mode, uint64_t otheraddress, const char *name)
Definition: dev_ram.cc:134
void machine_entry_add_subtype(struct machine_entry *me, const char *name, int oldstyle_subtype,...)
Definition: machine.cc:717
void net_generate_unique_mac(struct machine *, unsigned char *macbuf)
Definition: net_misc.cc:88
void machine_entry_add_alias(struct machine_entry *me, const char *name)
Definition: machine.cc:697
struct x11_md x11_md
Definition: machine.h:179
#define MACHINE_NAME_MAXBUF
Definition: machine_sgi.cc:56
Definition: cpu.h:326
#define DEV_RAM_MIGHT_POINT_TO_DEVICES
Definition: devices.h:366
#define MC146818_SGI
Definition: devices.h:306
void dev_crime_init(struct machine *machine, struct memory *mem, uint64_t baseaddr, char *irq_path, int use_fb)
#define MACE_PERIPH_SERIAL
Definition: crimereg.h:97
#define MACHINE_SGI
Definition: machine.h:217
int in_use
Definition: machine.h:82
uint8_t byte_order
Definition: cpu.h:347
void dev_sgi_gbe_init(struct machine *machine, struct memory *mem, uint64_t baseaddr)
Definition: dev_sgi_gbe.cc:412
#define PCKBC_8242
Definition: devices.h:321
Definition: memory.h:75
MACHINE_REGISTER(sgi)
Definition: machine_sgi.cc:634
int memory_offset_in_mb
Definition: machine.h:148
int machine_subtype
Definition: machine.h:112
int dev_pckbc_init(struct machine *machine, struct memory *mem, uint64_t baseaddr, int type, char *keyboard_irqpath, char *mouse_irqpath, int in_use, int pc_style_flag)
Definition: dev_pckbc.cc:904
#define ETHERNET_STRING_MAXLEN
Definition: machine_sgi.cc:55
#define MR_DEFAULT(x, name, arch, type)
Definition: machine.h:370
const char * machine_name
Definition: machine.h:115
#define ARCH_MIPS
Definition: machine.h:203
void arcbios_init(struct machine *machine, int is64bit, uint64_t sgi_ram_offset, const char *primary_ether_string, uint8_t *primary_ether_macaddr)
Definition: arcbios.cc:2406
#define EMUL_BIG_ENDIAN
Definition: misc.h:165
#define MACE_PCI_BRIDGE
Definition: crimereg.h:94

Generated on Sun Sep 30 2018 16:05:18 for GXemul by doxygen 1.8.13