1 |
/* |
/* |
2 |
* Copyright (C) 2003-2006 Anders Gavare. All rights reserved. |
* Copyright (C) 2003-2007 Anders Gavare. All rights reserved. |
3 |
* |
* |
4 |
* Redistribution and use in source and binary forms, with or without |
* Redistribution and use in source and binary forms, with or without |
5 |
* modification, are permitted provided that the following conditions are met: |
* modification, are permitted provided that the following conditions are met: |
25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: machine_cobalt.c,v 1.4 2006/08/12 19:31:36 debug Exp $ |
* $Id: machine_cobalt.c,v 1.12 2007/06/15 18:08:10 debug Exp $ |
29 |
|
* |
30 |
|
* COMMENT: Cobalt (MIPS-based) |
31 |
*/ |
*/ |
32 |
|
|
33 |
#include <stdio.h> |
#include <stdio.h> |
34 |
|
#include <stdlib.h> |
35 |
#include <string.h> |
#include <string.h> |
36 |
|
|
37 |
|
#include "bus_isa.h" |
38 |
#include "bus_pci.h" |
#include "bus_pci.h" |
39 |
#include "cpu.h" |
#include "cpu.h" |
40 |
#include "device.h" |
#include "device.h" |
41 |
#include "devices.h" |
#include "devices.h" |
42 |
#include "machine.h" |
#include "machine.h" |
|
#include "machine_interrupts.h" |
|
43 |
#include "memory.h" |
#include "memory.h" |
44 |
#include "misc.h" |
#include "misc.h" |
45 |
|
|
46 |
|
|
47 |
MACHINE_SETUP(cobalt) |
MACHINE_SETUP(cobalt) |
48 |
{ |
{ |
49 |
char tmpstr[500]; |
char tmpstr[500], tmpstr2[500]; |
50 |
struct pci_data *pci_data; |
struct pci_data *pci_data; |
51 |
struct memory *mem = machine->memory; |
struct memory *mem = machine->memory; |
52 |
|
|
53 |
cpu->byte_order = EMUL_LITTLE_ENDIAN; |
cpu->byte_order = EMUL_LITTLE_ENDIAN; |
54 |
machine->machine_name = "Cobalt"; |
machine->machine_name = "Cobalt"; |
|
machine->stable = 1; |
|
55 |
|
|
56 |
/* |
/* |
57 |
* Interrupts seem to be the following: |
* Interrupts seem to be the following: |
67 |
* interrupts at ISA interrupt 9.) |
* interrupts at ISA interrupt 9.) |
68 |
*/ |
*/ |
69 |
|
|
70 |
/* ISA interrupt controllers: */ |
/* ISA bus at MIPS irq 6: */ |
71 |
snprintf(tmpstr, sizeof(tmpstr), "8259 irq=24 addr=0x10000020"); |
snprintf(tmpstr, sizeof(tmpstr), "%s.cpu[%i].6", |
72 |
machine->isa_pic_data.pic1 = device_add(machine, tmpstr); |
machine->path, machine->bootstrap_cpu); |
73 |
snprintf(tmpstr, sizeof(tmpstr), "8259 irq=24 addr=0x100000a0"); |
bus_isa_init(machine, tmpstr, 0, 0x10000000, 0x14000000 /* TODO */); |
74 |
machine->isa_pic_data.pic2 = device_add(machine, tmpstr); |
|
75 |
machine->md_interrupt = isa8_interrupt; |
snprintf(tmpstr, sizeof(tmpstr), "ns16550 irq=%s.cpu[%i].5" |
76 |
machine->isa_pic_data.native_irq = 6; |
" addr=0x1c800000 name2=tty0 in_use=1", |
77 |
|
machine->path, machine->bootstrap_cpu); |
78 |
dev_mc146818_init(machine, mem, 0x10000070, 0, MC146818_PC_CMOS, 4); |
machine->main_console_handle = (size_t) device_add(machine, tmpstr); |
79 |
|
|
|
machine->main_console_handle = (size_t) device_add(machine, |
|
|
"ns16550 irq=5 addr=0x1c800000 name2=tty0 in_use=1"); |
|
|
|
|
|
/* TODO: bus_isa_init() ? */ |
|
|
|
|
|
#if 0 |
|
|
device_add(machine, |
|
|
"ns16550 irq=0 addr=0x1f000010 name2=tty1 in_use=0"); |
|
|
#endif |
|
80 |
|
|
81 |
/* |
/* |
82 |
* According to NetBSD/cobalt: |
* According to NetBSD/cobalt: |
92 |
* VP) ATA33 cr |
* VP) ATA33 cr |
93 |
* tlp1 at pci0 dev 12 function 0: DECchip 21143 Ethernet, pass 4.1 |
* tlp1 at pci0 dev 12 function 0: DECchip 21143 Ethernet, pass 4.1 |
94 |
* |
* |
95 |
* The PCI controller interrupts at ISA interrupt 9. |
* The PCI controller interrupts at ISA interrupt 9. (TODO?) |
96 |
*/ |
*/ |
97 |
pci_data = dev_gt_init(machine, mem, 0x14000000, 2, 8 + 9, 11); |
snprintf(tmpstr, sizeof(tmpstr), "%s.cpu[%i].2", |
98 |
bus_pci_add(machine, pci_data, mem, 0, 7, 0, "dec21143"); |
machine->path, machine->bootstrap_cpu); |
99 |
|
snprintf(tmpstr2, sizeof(tmpstr2), "%s.cpu[%i].6", |
100 |
|
machine->path, machine->bootstrap_cpu); |
101 |
|
pci_data = dev_gt_init(machine, mem, 0x14000000, tmpstr, |
102 |
|
tmpstr2, 11); |
103 |
|
/* bus_pci_add(machine, pci_data, mem, 0, 7, 0, "dec21143"); */ |
104 |
/* bus_pci_add(machine, pci_data, mem, 0, 8, 0, "symbios_860"); |
/* bus_pci_add(machine, pci_data, mem, 0, 8, 0, "symbios_860"); |
105 |
PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_860 */ |
PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_860 */ |
106 |
bus_pci_add(machine, pci_data, mem, 0, 9, 0, "vt82c586_isa"); |
bus_pci_add(machine, pci_data, mem, 0, 9, 0, "vt82c586_isa"); |
107 |
bus_pci_add(machine, pci_data, mem, 0, 9, 1, "vt82c586_ide"); |
bus_pci_add(machine, pci_data, mem, 0, 9, 1, "vt82c586_ide"); |
108 |
bus_pci_add(machine, pci_data, mem, 0, 12, 0, "dec21143"); |
/* bus_pci_add(machine, pci_data, mem, 0, 12, 0, "dec21143"); */ |
109 |
|
|
110 |
if (!machine->prom_emulation) |
if (!machine->prom_emulation) |
111 |
return; |
return; |