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.2 2006/02/02 19:30:14 debug Exp $ |
* $Id: machine_cobalt.c,v 1.10 2007/04/29 13:44:14 debug Exp $ |
29 |
*/ |
*/ |
30 |
|
|
31 |
#include <stdio.h> |
#include <stdio.h> |
32 |
|
#include <stdlib.h> |
33 |
#include <string.h> |
#include <string.h> |
34 |
|
|
35 |
|
#include "bus_isa.h" |
36 |
#include "bus_pci.h" |
#include "bus_pci.h" |
37 |
#include "cpu.h" |
#include "cpu.h" |
38 |
#include "device.h" |
#include "device.h" |
39 |
#include "devices.h" |
#include "devices.h" |
40 |
#include "machine.h" |
#include "machine.h" |
|
#include "machine_interrupts.h" |
|
41 |
#include "memory.h" |
#include "memory.h" |
42 |
#include "misc.h" |
#include "misc.h" |
43 |
|
|
44 |
|
|
45 |
MACHINE_SETUP(cobalt) |
MACHINE_SETUP(cobalt) |
46 |
{ |
{ |
47 |
char tmpstr[500]; |
char tmpstr[500], tmpstr2[500]; |
48 |
struct pci_data *pci_data; |
struct pci_data *pci_data; |
49 |
struct memory *mem = machine->memory; |
struct memory *mem = machine->memory; |
50 |
|
|
66 |
* interrupts at ISA interrupt 9.) |
* interrupts at ISA interrupt 9.) |
67 |
*/ |
*/ |
68 |
|
|
69 |
/* ISA interrupt controllers: */ |
/* ISA bus at MIPS irq 6: */ |
70 |
snprintf(tmpstr, sizeof(tmpstr), "8259 irq=24 addr=0x10000020"); |
snprintf(tmpstr, sizeof(tmpstr), "%s.cpu[%i].6", |
71 |
machine->isa_pic_data.pic1 = device_add(machine, tmpstr); |
machine->path, machine->bootstrap_cpu); |
72 |
snprintf(tmpstr, sizeof(tmpstr), "8259 irq=24 addr=0x100000a0"); |
bus_isa_init(machine, tmpstr, 0, 0x10000000, 0x14000000 /* TODO */); |
73 |
machine->isa_pic_data.pic2 = device_add(machine, tmpstr); |
|
74 |
machine->md_interrupt = isa8_interrupt; |
snprintf(tmpstr, sizeof(tmpstr), "ns16550 irq=%s.cpu[%i].5" |
75 |
machine->isa_pic_data.native_irq = 6; |
" addr=0x1c800000 name2=tty0 in_use=1", |
76 |
|
machine->path, machine->bootstrap_cpu); |
77 |
dev_mc146818_init(machine, mem, 0x10000070, 0, MC146818_PC_CMOS, 4); |
machine->main_console_handle = (size_t) device_add(machine, tmpstr); |
78 |
|
|
|
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 |
|
79 |
|
|
80 |
/* |
/* |
81 |
* According to NetBSD/cobalt: |
* According to NetBSD/cobalt: |
91 |
* VP) ATA33 cr |
* VP) ATA33 cr |
92 |
* 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 |
93 |
* |
* |
94 |
* The PCI controller interrupts at ISA interrupt 9. |
* The PCI controller interrupts at ISA interrupt 9. (TODO?) |
95 |
*/ |
*/ |
96 |
pci_data = dev_gt_init(machine, mem, 0x14000000, 2, 8 + 9, 11); |
snprintf(tmpstr, sizeof(tmpstr), "%s.cpu[%i].2", |
97 |
bus_pci_add(machine, pci_data, mem, 0, 7, 0, "dec21143"); |
machine->path, machine->bootstrap_cpu); |
98 |
|
snprintf(tmpstr2, sizeof(tmpstr2), "%s.cpu[%i].6", |
99 |
|
machine->path, machine->bootstrap_cpu); |
100 |
|
pci_data = dev_gt_init(machine, mem, 0x14000000, tmpstr, |
101 |
|
tmpstr2, 11); |
102 |
|
/* bus_pci_add(machine, pci_data, mem, 0, 7, 0, "dec21143"); */ |
103 |
/* bus_pci_add(machine, pci_data, mem, 0, 8, 0, "symbios_860"); |
/* bus_pci_add(machine, pci_data, mem, 0, 8, 0, "symbios_860"); |
104 |
PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_860 */ |
PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_860 */ |
105 |
bus_pci_add(machine, pci_data, mem, 0, 9, 0, "vt82c586_isa"); |
bus_pci_add(machine, pci_data, mem, 0, 9, 0, "vt82c586_isa"); |
106 |
bus_pci_add(machine, pci_data, mem, 0, 9, 1, "vt82c586_ide"); |
bus_pci_add(machine, pci_data, mem, 0, 9, 1, "vt82c586_ide"); |
107 |
bus_pci_add(machine, pci_data, mem, 0, 12, 0, "dec21143"); |
/* bus_pci_add(machine, pci_data, mem, 0, 12, 0, "dec21143"); */ |
108 |
|
|
109 |
if (!machine->prom_emulation) |
if (!machine->prom_emulation) |
110 |
return; |
return; |
133 |
} |
} |
134 |
|
|
135 |
|
|
136 |
|
MACHINE_DEFAULT_RAM(cobalt) |
137 |
|
{ |
138 |
|
machine->physical_ram_in_mb = 64; |
139 |
|
} |
140 |
|
|
141 |
|
|
142 |
MACHINE_REGISTER(cobalt) |
MACHINE_REGISTER(cobalt) |
143 |
{ |
{ |
144 |
MR_DEFAULT(cobalt, "Cobalt", ARCH_MIPS, MACHINE_COBALT, 1, 0); |
MR_DEFAULT(cobalt, "Cobalt", ARCH_MIPS, MACHINE_COBALT); |
145 |
me->aliases[0] = "cobalt"; |
|
146 |
machine_entry_add(me, ARCH_MIPS); |
machine_entry_add_alias(me, "cobalt"); |
147 |
} |
} |
148 |
|
|