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.11 2007/02/16 19:57:56 debug Exp $ |
29 |
* |
* |
30 |
* Experimental machine for running NetBSD/bebox (see |
* Experimental machine for running NetBSD/bebox (see |
31 |
* http://www.netbsd.org/Ports/bebox/ for more info.) |
* http://www.netbsd.org/Ports/bebox/ for more info.) |
32 |
*/ |
*/ |
33 |
|
|
34 |
#include <stdio.h> |
#include <stdio.h> |
35 |
|
#include <stdlib.h> |
36 |
#include <string.h> |
#include <string.h> |
37 |
|
|
38 |
#include "bus_isa.h" |
#include "bus_isa.h" |
41 |
#include "device.h" |
#include "device.h" |
42 |
#include "devices.h" |
#include "devices.h" |
43 |
#include "machine.h" |
#include "machine.h" |
|
#include "machine_interrupts.h" |
|
44 |
#include "memory.h" |
#include "memory.h" |
45 |
#include "misc.h" |
#include "misc.h" |
46 |
|
|
47 |
|
|
48 |
MACHINE_SETUP(bebox) |
MACHINE_SETUP(bebox) |
49 |
{ |
{ |
50 |
struct pci_data *pci_data; |
char tmpstr[300]; |
51 |
|
|
52 |
machine->machine_name = "BeBox"; |
machine->machine_name = "BeBox"; |
53 |
|
if (machine->emulated_hz == 0) |
54 |
|
machine->emulated_hz = 33000000; |
55 |
|
|
56 |
machine->md_int.bebox_data = device_add(machine, "bebox"); |
snprintf(tmpstr, sizeof(tmpstr), "bebox irq=%s.cpu[%i]", |
57 |
machine->isa_pic_data.native_irq = 5; |
machine->path, machine->bootstrap_cpu); |
58 |
machine->md_interrupt = isa32_interrupt; |
device_add(machine, tmpstr); |
59 |
|
|
60 |
pci_data = dev_eagle_init(machine, machine->memory, |
snprintf(tmpstr, sizeof(tmpstr), "eagle irq=%s.cpu[%i]", |
61 |
32 /* isa irq base */, 0 /* pci irq: TODO */); |
machine->path, machine->bootstrap_cpu); |
62 |
|
device_add(machine, tmpstr); |
|
bus_isa_init(machine, BUS_ISA_IDE0 | BUS_ISA_VGA, |
|
|
0x80000000, 0xc0000000, 32, 48); |
|
63 |
|
|
64 |
if (!machine->prom_emulation) |
if (!machine->prom_emulation) |
65 |
return; |
return; |
98 |
|
|
99 |
store_32bit_word(cpu, cpu->cd.ppc.gpr[6] + 32, 0); /* next */ |
store_32bit_word(cpu, cpu->cd.ppc.gpr[6] + 32, 0); /* next */ |
100 |
store_32bit_word(cpu, cpu->cd.ppc.gpr[6] + 36, 2); /* clock */ |
store_32bit_word(cpu, cpu->cd.ppc.gpr[6] + 36, 2); /* clock */ |
101 |
store_32bit_word(cpu, cpu->cd.ppc.gpr[6] + 40, 100); |
store_32bit_word(cpu, cpu->cd.ppc.gpr[6] + 40, |
102 |
|
(machine->emulated_hz / 4)); |
103 |
} |
} |
104 |
|
|
105 |
|
|