25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: machine_sgi.c,v 1.18 2007/03/24 06:40:16 debug Exp $ |
* $Id: machine_sgi.c,v 1.22 2007/06/15 18:08:10 debug Exp $ |
29 |
* |
* |
30 |
* Machine descriptions for Silicon Graphics' MIPS-based machines. |
* COMMENT: Silicon Graphics' MIPS-based machines |
31 |
* |
* |
32 |
* http://obsolete.majix.org/computers/sgi/iptable.shtml contains a |
* http://obsolete.majix.org/computers/sgi/iptable.shtml contains a |
33 |
* pretty detailed list of IP ("Inhouse Processor") model numbers. |
* pretty detailed list of IP ("Inhouse Processor") model numbers. |
70 |
|
|
71 |
struct pci_data *pci_data = NULL; |
struct pci_data *pci_data = NULL; |
72 |
|
|
73 |
machine->machine_name = malloc(MACHINE_NAME_MAXBUF); |
CHECK_ALLOCATION(machine->machine_name = malloc(MACHINE_NAME_MAXBUF)); |
|
if (machine->machine_name == NULL) { |
|
|
fprintf(stderr, "out of memory\n"); |
|
|
exit(1); |
|
|
} |
|
74 |
|
|
75 |
cpu->byte_order = EMUL_BIG_ENDIAN; |
cpu->byte_order = EMUL_BIG_ENDIAN; |
76 |
snprintf(machine->machine_name, MACHINE_NAME_MAXBUF, |
snprintf(machine->machine_name, MACHINE_NAME_MAXBUF, |
96 |
} |
} |
97 |
|
|
98 |
net_generate_unique_mac(machine, macaddr); |
net_generate_unique_mac(machine, macaddr); |
99 |
eaddr_string = malloc(ETHERNET_STRING_MAXLEN); |
CHECK_ALLOCATION(eaddr_string = malloc(ETHERNET_STRING_MAXLEN)); |
100 |
|
|
101 |
switch (machine->machine_subtype) { |
switch (machine->machine_subtype) { |
102 |
|
|
120 |
" (Everest IP19)", MACHINE_NAME_MAXBUF); |
" (Everest IP19)", MACHINE_NAME_MAXBUF); |
121 |
machine->main_console_handle = (size_t)device_add(machine, |
machine->main_console_handle = (size_t)device_add(machine, |
122 |
"z8530 addr=0x1fbd9830 irq=0 addr_mult=4"); |
"z8530 addr=0x1fbd9830 irq=0 addr_mult=4"); |
123 |
dev_scc_init(machine, mem, 0x10086000, 0, machine->use_x11, |
dev_scc_init(machine, mem, 0x10086000, 0, machine->x11_md.in_use, |
124 |
0, 8); /* serial? irix? */ |
0, 8); /* serial? irix? */ |
125 |
|
|
126 |
device_add(machine, "sgi_ip19 addr=0x18000000"); |
device_add(machine, "sgi_ip19 addr=0x18000000"); |
183 |
"z8530 addr=0x1fb80d00 irq=0 addr_mult=4"); |
"z8530 addr=0x1fb80d00 irq=0 addr_mult=4"); |
184 |
|
|
185 |
/* WDSC SCSI controller: */ |
/* WDSC SCSI controller: */ |
186 |
dev_wdsc_init(machine, mem, 0x1fb8011f, 0, 0); |
/* dev_wdsc_init(machine, mem, 0x1fb8011f, 0, 0); */ |
187 |
|
|
188 |
/* Return memory read errors so that hpc1 |
/* Return memory read errors so that hpc1 |
189 |
and hpc2 are not detected: */ |
and hpc2 are not detected: */ |
272 |
fatal("TODO: legacy rewrite\n"); |
fatal("TODO: legacy rewrite\n"); |
273 |
abort(); |
abort(); |
274 |
// j = dev_pckbc_init(machine, mem, 0x1fbd9840, PCKBC_8242, |
// j = dev_pckbc_init(machine, mem, 0x1fbd9840, PCKBC_8242, |
275 |
// 0, 0, machine->use_x11, 0); /* TODO: irq numbers */ |
// 0, 0, machine->x11_md.in_use, 0); /* TODO: irq numbers */ |
276 |
j = 0; |
j = 0; |
277 |
|
|
278 |
if (machine->use_x11) |
if (machine->x11_md.in_use) |
279 |
machine->main_console_handle = j; |
machine->main_console_handle = j; |
280 |
|
|
281 |
/* sq0: Ethernet. TODO: This should have irq_nr = 8 + 3 */ |
/* sq0: Ethernet. TODO: This should have irq_nr = 8 + 3 */ |
282 |
/* dev_sq_init... */ |
/* dev_sq_init... */ |
283 |
|
|
284 |
/* wdsc0: SCSI */ |
/* wdsc0: SCSI */ |
285 |
dev_wdsc_init(machine, mem, 0x1fbc4000, 0, 8 + 1); |
/* dev_wdsc_init(machine, mem, 0x1fbc4000, 0, 8 + 1); */ |
286 |
|
|
287 |
/* wdsc1: SCSI TODO: irq nr */ |
/* wdsc1: SCSI TODO: irq nr */ |
288 |
dev_wdsc_init(machine, mem, 0x1fbcc000, 1, 8 + 1); |
/* dev_wdsc_init(machine, mem, 0x1fbcc000, 1, 8 + 1); */ |
289 |
|
|
290 |
/* dsclock0: TODO: possibly irq 8 + 33 */ |
/* dsclock0: TODO: possibly irq 8 + 33 */ |
291 |
|
|
309 |
|
|
310 |
/* serial? irix? */ |
/* serial? irix? */ |
311 |
dev_scc_init(machine, mem, |
dev_scc_init(machine, mem, |
312 |
0x400086000ULL, 0, machine->use_x11, 0, 8); |
0x400086000ULL, 0, machine->x11_md.in_use, 0, 8); |
313 |
|
|
314 |
/* NOTE: ip19! (perhaps not really the same */ |
/* NOTE: ip19! (perhaps not really the same */ |
315 |
device_add(machine, "sgi_ip19 addr=0x18000000"); |
device_add(machine, "sgi_ip19 addr=0x18000000"); |
394 |
|
|
395 |
/* TODO: irq! */ |
/* TODO: irq! */ |
396 |
snprintf(tmpstr, sizeof(tmpstr), "ns16550 irq=0 addr=" |
snprintf(tmpstr, sizeof(tmpstr), "ns16550 irq=0 addr=" |
397 |
"0x1f620170 name2=tty0 in_use=%i", machine->use_x11? 0 : 1); |
"0x1f620170 name2=tty0 in_use=%i", machine->x11_md.in_use? 0 : 1); |
398 |
machine->main_console_handle = (size_t)device_add(machine, |
machine->main_console_handle = (size_t)device_add(machine, |
399 |
tmpstr); |
tmpstr); |
400 |
snprintf(tmpstr, sizeof(tmpstr), "ns16550 irq=0 addr=" |
snprintf(tmpstr, sizeof(tmpstr), "ns16550 irq=0 addr=" |
408 |
|
|
409 |
case 32: |
case 32: |
410 |
strlcat(machine->machine_name, " (O2)", MACHINE_NAME_MAXBUF); |
strlcat(machine->machine_name, " (O2)", MACHINE_NAME_MAXBUF); |
|
machine->stable = 1; |
|
411 |
|
|
412 |
/* TODO: Find out where the phys ram is actually located. */ |
/* TODO: Find out where the phys ram is actually located. */ |
413 |
dev_ram_init(machine, 0x07ffff00ULL, 256, |
dev_ram_init(machine, 0x07ffff00ULL, 256, |
429 |
snprintf(tmpstr, sizeof(tmpstr), "%s.cpu[%i].2", |
snprintf(tmpstr, sizeof(tmpstr), "%s.cpu[%i].2", |
430 |
machine->path, machine->bootstrap_cpu); |
machine->path, machine->bootstrap_cpu); |
431 |
dev_crime_init(machine, mem, 0x14000000, tmpstr, |
dev_crime_init(machine, mem, 0x14000000, tmpstr, |
432 |
machine->use_x11); /* crime0 */ |
machine->x11_md.in_use); /* crime0 */ |
433 |
dev_sgi_mte_init(mem, 0x15000000); /* mte ??? */ |
dev_sgi_mte_init(mem, 0x15000000); /* mte ??? */ |
434 |
dev_sgi_gbe_init(machine, mem, 0x16000000); /* gbe? */ |
dev_sgi_gbe_init(machine, mem, 0x16000000); /* gbe? */ |
435 |
|
|
473 |
* intr 7 = MACE_PCI_BRIDGE |
* intr 7 = MACE_PCI_BRIDGE |
474 |
*/ |
*/ |
475 |
|
|
|
if (eaddr_string == NULL) { |
|
|
fprintf(stderr, "out of memory\n"); |
|
|
exit(1); |
|
|
} |
|
476 |
snprintf(eaddr_string, ETHERNET_STRING_MAXLEN, |
snprintf(eaddr_string, ETHERNET_STRING_MAXLEN, |
477 |
"eaddr=%02x:%02x:%02x:%02x:%02x:%02x", |
"eaddr=%02x:%02x:%02x:%02x:%02x:%02x", |
478 |
macaddr[0], macaddr[1], macaddr[2], |
macaddr[0], macaddr[1], macaddr[2], |
489 |
"ns16550 irq=%s.cpu[%i].2.crime.0x%x.mace.%i addr=" |
"ns16550 irq=%s.cpu[%i].2.crime.0x%x.mace.%i addr=" |
490 |
"0x1f390000 addr_mult=0x100 in_use=%i name2=tty0", |
"0x1f390000 addr_mult=0x100 in_use=%i name2=tty0", |
491 |
machine->path, machine->bootstrap_cpu, |
machine->path, machine->bootstrap_cpu, |
492 |
MACE_PERIPH_SERIAL, 20, machine->use_x11? 0 : 1); |
MACE_PERIPH_SERIAL, 20, machine->x11_md.in_use? 0 : 1); |
493 |
j = (size_t)device_add(machine, tmpstr); |
j = (size_t)device_add(machine, tmpstr); |
494 |
snprintf(tmpstr, sizeof(tmpstr), |
snprintf(tmpstr, sizeof(tmpstr), |
495 |
"ns16550 irq=%s.cpu[%i].2.crime.0x%x.mace.%i addr=" |
"ns16550 irq=%s.cpu[%i].2.crime.0x%x.mace.%i addr=" |
505 |
#if 0 |
#if 0 |
506 |
fatal("TODO: legacy SGI rewrite\n"); |
fatal("TODO: legacy SGI rewrite\n"); |
507 |
abort(); |
abort(); |
508 |
if (machine->use_x11) { |
if (machine->x11_md.in_use) { |
509 |
i = dev_pckbc_init(machine, mem, 0x1f320000, |
i = dev_pckbc_init(machine, mem, 0x1f320000, |
510 |
PCKBC_8242, 0x200 + MACE_PERIPH_MISC, |
PCKBC_8242, 0x200 + MACE_PERIPH_MISC, |
511 |
0x800 + MACE_PERIPH_MISC, machine->use_x11, 0); |
0x800 + MACE_PERIPH_MISC, machine->x11_md.in_use, 0); |
512 |
/* keyb+mouse (mace irq numbers) */ |
/* keyb+mouse (mace irq numbers) */ |
513 |
machine->main_console_handle = i; |
machine->main_console_handle = i; |
514 |
} |
} |