1 |
/* |
/* |
2 |
* Copyright (C) 2005-2006 Anders Gavare. All rights reserved. |
* Copyright (C) 2005-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_bebox.c,v 1.3 2006/06/24 10:19:19 debug Exp $ |
* $Id: machine_bebox.c,v 1.14 2007/06/15 18:08:10 debug Exp $ |
29 |
|
* |
30 |
|
* COMMENT: BeBox |
31 |
* |
* |
32 |
* Experimental machine for running NetBSD/bebox (see |
* Experimental machine for running NetBSD/bebox (see |
33 |
* http://www.netbsd.org/Ports/bebox/ for more info.) |
* http://www.netbsd.org/ports/bebox/ for more info.) |
34 |
*/ |
*/ |
35 |
|
|
36 |
#include <stdio.h> |
#include <stdio.h> |
37 |
|
#include <stdlib.h> |
38 |
#include <string.h> |
#include <string.h> |
39 |
|
|
40 |
#include "bus_isa.h" |
#include "bus_isa.h" |
43 |
#include "device.h" |
#include "device.h" |
44 |
#include "devices.h" |
#include "devices.h" |
45 |
#include "machine.h" |
#include "machine.h" |
|
#include "machine_interrupts.h" |
|
46 |
#include "memory.h" |
#include "memory.h" |
47 |
#include "misc.h" |
#include "misc.h" |
48 |
|
|
49 |
|
|
50 |
MACHINE_SETUP(bebox) |
MACHINE_SETUP(bebox) |
51 |
{ |
{ |
52 |
struct pci_data *pci_data; |
char tmpstr[300]; |
53 |
|
|
54 |
machine->machine_name = "BeBox"; |
machine->machine_name = "BeBox"; |
55 |
|
if (machine->emulated_hz == 0) |
56 |
|
machine->emulated_hz = 33000000; |
57 |
|
|
58 |
machine->md_int.bebox_data = device_add(machine, "bebox"); |
snprintf(tmpstr, sizeof(tmpstr), "bebox irq=%s.cpu[%i]", |
59 |
machine->isa_pic_data.native_irq = 5; |
machine->path, machine->bootstrap_cpu); |
60 |
machine->md_interrupt = isa32_interrupt; |
device_add(machine, tmpstr); |
61 |
|
|
62 |
pci_data = dev_eagle_init(machine, machine->memory, |
snprintf(tmpstr, sizeof(tmpstr), "eagle irq=%s.cpu[%i]", |
63 |
32 /* isa irq base */, 0 /* pci irq: TODO */); |
machine->path, machine->bootstrap_cpu); |
64 |
|
device_add(machine, tmpstr); |
|
bus_isa_init(machine, BUS_ISA_IDE0 | BUS_ISA_VGA, |
|
|
0x80000000, 0xc0000000, 32, 48); |
|
65 |
|
|
66 |
if (!machine->prom_emulation) |
if (!machine->prom_emulation) |
67 |
return; |
return; |
94 |
store_32bit_word(cpu, cpu->cd.ppc.gpr[6] + 12, 20); /* next */ |
store_32bit_word(cpu, cpu->cd.ppc.gpr[6] + 12, 20); /* next */ |
95 |
store_32bit_word(cpu, cpu->cd.ppc.gpr[6] + 16, 1); /* console */ |
store_32bit_word(cpu, cpu->cd.ppc.gpr[6] + 16, 1); /* console */ |
96 |
store_buf(cpu, cpu->cd.ppc.gpr[6] + 20, |
store_buf(cpu, cpu->cd.ppc.gpr[6] + 20, |
97 |
machine->use_x11? "vga" : "com", 4); |
machine->x11_md.in_use? "vga" : "com", 4); |
98 |
store_32bit_word(cpu, cpu->cd.ppc.gpr[6] + 24, 0x3f8);/* addr */ |
store_32bit_word(cpu, cpu->cd.ppc.gpr[6] + 24, 0x3f8);/* addr */ |
99 |
store_32bit_word(cpu, cpu->cd.ppc.gpr[6] + 28, 9600);/* speed */ |
store_32bit_word(cpu, cpu->cd.ppc.gpr[6] + 28, 9600);/* speed */ |
100 |
|
|
101 |
store_32bit_word(cpu, cpu->cd.ppc.gpr[6] + 32, 0); /* next */ |
store_32bit_word(cpu, cpu->cd.ppc.gpr[6] + 32, 0); /* next */ |
102 |
store_32bit_word(cpu, cpu->cd.ppc.gpr[6] + 36, 2); /* clock */ |
store_32bit_word(cpu, cpu->cd.ppc.gpr[6] + 36, 2); /* clock */ |
103 |
store_32bit_word(cpu, cpu->cd.ppc.gpr[6] + 40, 100); |
store_32bit_word(cpu, cpu->cd.ppc.gpr[6] + 40, |
104 |
|
(machine->emulated_hz / 4)); |
105 |
} |
} |
106 |
|
|
107 |
|
|