25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: machine_qemu.c,v 1.4 2006/08/12 19:31:36 debug Exp $ |
* $Id: machine_qemu.c,v 1.5 2006/09/04 02:32:00 debug Exp $ |
29 |
* |
* |
30 |
* This file contains semi-bogus machine descriptions for experimental |
* This file contains semi-bogus machine descriptions for experimental |
31 |
* machines, mimicing those emulated by Fabrice Bellard's QEMU. |
* machines, mimicing those emulated by Fabrice Bellard's QEMU. |
47 |
#include "misc.h" |
#include "misc.h" |
48 |
|
|
49 |
|
|
50 |
|
/*****************************************************************************/ |
51 |
|
|
52 |
|
|
53 |
|
MACHINE_SETUP(qemu_arm) |
54 |
|
{ |
55 |
|
/* |
56 |
|
* The ARM machine in QEMU isn't really a bogus machine, I think. |
57 |
|
* It is supposed to emulate a specific ARM board. But for now, |
58 |
|
* treat it as "QEMU ARM". |
59 |
|
*/ |
60 |
|
|
61 |
|
machine->machine_name = "QEMU ARM"; |
62 |
|
cpu->byte_order = EMUL_LITTLE_ENDIAN; |
63 |
|
|
64 |
|
device_add(machine, "ns16550 addr=0x16000000"); |
65 |
|
|
66 |
|
if (!machine->prom_emulation) |
67 |
|
return; |
68 |
|
|
69 |
|
/* |
70 |
|
* QEMU's ARM emulation mode uses the following hardcoded addresses: |
71 |
|
* |
72 |
|
* 0x00000100 = kernel boot arguments |
73 |
|
* 0x00010000 = kernel load address |
74 |
|
* 0x00800000 = initrd load address |
75 |
|
* |
76 |
|
* QEMU's arm_boot.c puts these values at 0x100: |
77 |
|
* |
78 |
|
* TODO: Yuck. Don't hardcode these. |
79 |
|
*/ |
80 |
|
|
81 |
|
store_32bit_word(cpu, 0x100, 5); |
82 |
|
store_32bit_word(cpu, 0x104, 0x54410001); |
83 |
|
store_32bit_word(cpu, 0x108, 1); |
84 |
|
store_32bit_word(cpu, 0x10c, 0x1000); |
85 |
|
store_32bit_word(cpu, 0x110, 0); |
86 |
|
store_32bit_word(cpu, 0x114, 4); |
87 |
|
store_32bit_word(cpu, 0x118, 0x54410002); |
88 |
|
store_32bit_word(cpu, 0x11c, machine->physical_ram_in_mb * 1048576); |
89 |
|
store_32bit_word(cpu, 0x120, 0); |
90 |
|
/* TODO: 0x54410009 for the kernel command line args */ |
91 |
|
|
92 |
|
/* |
93 |
|
* board ids: |
94 |
|
* 0x25e for "AB", 0x183 for "PB". |
95 |
|
*/ |
96 |
|
|
97 |
|
cpu->cd.arm.r[0] = 0x5e; /* low byte of board id */ |
98 |
|
cpu->cd.arm.r[1] = 0x02; /* high byte of board id */ |
99 |
|
cpu->cd.arm.r[5] = 0x100; /* address of boot args */ |
100 |
|
cpu->cd.arm.r[6] = 0x10000; /* address of loaded kernel */ |
101 |
|
} |
102 |
|
|
103 |
|
|
104 |
|
MACHINE_DEFAULT_CPU(qemu_arm) |
105 |
|
{ |
106 |
|
/* TODO: ARM926EJ-S */ |
107 |
|
machine->cpu_name = strdup("ARM922T"); |
108 |
|
} |
109 |
|
|
110 |
|
|
111 |
|
MACHINE_DEFAULT_RAM(qemu_arm) |
112 |
|
{ |
113 |
|
machine->physical_ram_in_mb = 64; |
114 |
|
} |
115 |
|
|
116 |
|
|
117 |
|
MACHINE_REGISTER(qemu_arm) |
118 |
|
{ |
119 |
|
MR_DEFAULT(qemu_arm, "QEMU ARM", ARCH_ARM, MACHINE_QEMU_ARM); |
120 |
|
me->set_default_ram = machine_default_ram_qemu_arm; |
121 |
|
machine_entry_add_alias(me, "qemu_arm"); |
122 |
|
} |
123 |
|
|
124 |
|
|
125 |
|
/*****************************************************************************/ |
126 |
|
|
127 |
|
|
128 |
MACHINE_SETUP(qemu_mips) |
MACHINE_SETUP(qemu_mips) |
129 |
{ |
{ |
130 |
machine->machine_name = "QEMU MIPS"; |
machine->machine_name = "QEMU MIPS"; |
168 |
|
|
169 |
|
|
170 |
MACHINE_DEFAULT_RAM(qemu_mips) |
MACHINE_DEFAULT_RAM(qemu_mips) |
171 |
{ |
{ |
172 |
machine->physical_ram_in_mb = 64; |
machine->physical_ram_in_mb = 64; |
173 |
} |
} |
174 |
|
|