Commit ca02f31955113212eb250a3c58c7ab26b1a2a8df
1 parent
8fc7cc58
Add dummy m68k board.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3567 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
4 changed files
with
71 additions
and
1 deletions
Makefile.target
@@ -508,7 +508,7 @@ VL_OBJS+= sh_timer.o ptimer.o sh_serial.o sh_intc.o | @@ -508,7 +508,7 @@ VL_OBJS+= sh_timer.o ptimer.o sh_serial.o sh_intc.o | ||
508 | endif | 508 | endif |
509 | ifeq ($(TARGET_BASE_ARCH), m68k) | 509 | ifeq ($(TARGET_BASE_ARCH), m68k) |
510 | VL_OBJS+= an5206.o mcf5206.o ptimer.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o | 510 | VL_OBJS+= an5206.o mcf5206.o ptimer.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o |
511 | -VL_OBJS+= m68k-semi.o | 511 | +VL_OBJS+= m68k-semi.o dummy_m68k.o |
512 | endif | 512 | endif |
513 | ifdef CONFIG_GDBSTUB | 513 | ifdef CONFIG_GDBSTUB |
514 | VL_OBJS+=gdbstub.o | 514 | VL_OBJS+=gdbstub.o |
hw/dummy_m68k.c
0 → 100644
1 | +/* | ||
2 | + * Dummy board with just RAM and CPU for use as an ISS. | ||
3 | + * | ||
4 | + * Copyright (c) 2007 CodeSourcery. | ||
5 | + * | ||
6 | + * This code is licenced under the GPL | ||
7 | + */ | ||
8 | + | ||
9 | +#include "vl.h" | ||
10 | + | ||
11 | +#define KERNEL_LOAD_ADDR 0x10000 | ||
12 | + | ||
13 | +/* Board init. */ | ||
14 | + | ||
15 | +static void dummy_m68k_init(int ram_size, int vga_ram_size, int boot_device, | ||
16 | + DisplayState *ds, const char **fd_filename, int snapshot, | ||
17 | + const char *kernel_filename, const char *kernel_cmdline, | ||
18 | + const char *initrd_filename, const char *cpu_model) | ||
19 | +{ | ||
20 | + CPUState *env; | ||
21 | + int kernel_size; | ||
22 | + uint64_t elf_entry; | ||
23 | + target_ulong entry; | ||
24 | + | ||
25 | + env = cpu_init(); | ||
26 | + if (!cpu_model) | ||
27 | + cpu_model = "cfv4e"; | ||
28 | + if (cpu_m68k_set_model(env, cpu_model)) { | ||
29 | + cpu_abort(env, "Unable to find m68k CPU definition\n"); | ||
30 | + } | ||
31 | + | ||
32 | + /* Initialize CPU registers. */ | ||
33 | + env->vbr = 0; | ||
34 | + | ||
35 | + /* RAM at address zero */ | ||
36 | + cpu_register_physical_memory(0, ram_size, | ||
37 | + qemu_ram_alloc(ram_size) | IO_MEM_RAM); | ||
38 | + | ||
39 | + /* Load kernel. */ | ||
40 | + if (kernel_filename) { | ||
41 | + kernel_size = load_elf(kernel_filename, 0, &elf_entry, NULL, NULL); | ||
42 | + entry = elf_entry; | ||
43 | + if (kernel_size < 0) { | ||
44 | + kernel_size = load_uboot(kernel_filename, &entry, NULL); | ||
45 | + } | ||
46 | + if (kernel_size < 0) { | ||
47 | + kernel_size = load_image(kernel_filename, | ||
48 | + phys_ram_base + KERNEL_LOAD_ADDR); | ||
49 | + entry = KERNEL_LOAD_ADDR; | ||
50 | + } | ||
51 | + if (kernel_size < 0) { | ||
52 | + fprintf(stderr, "qemu: could not load kernel '%s'\n", | ||
53 | + kernel_filename); | ||
54 | + exit(1); | ||
55 | + } | ||
56 | + } else { | ||
57 | + entry = 0; | ||
58 | + } | ||
59 | + env->pc = entry; | ||
60 | +} | ||
61 | + | ||
62 | +QEMUMachine dummy_m68k_machine = { | ||
63 | + "dummy", | ||
64 | + "Dummy board", | ||
65 | + dummy_m68k_init, | ||
66 | +}; |
vl.c
@@ -7400,6 +7400,7 @@ void register_machines(void) | @@ -7400,6 +7400,7 @@ void register_machines(void) | ||
7400 | #elif defined(TARGET_M68K) | 7400 | #elif defined(TARGET_M68K) |
7401 | qemu_register_machine(&mcf5208evb_machine); | 7401 | qemu_register_machine(&mcf5208evb_machine); |
7402 | qemu_register_machine(&an5206_machine); | 7402 | qemu_register_machine(&an5206_machine); |
7403 | + qemu_register_machine(&dummy_m68k_machine); | ||
7403 | #elif defined(TARGET_CRIS) | 7404 | #elif defined(TARGET_CRIS) |
7404 | qemu_register_machine(&bareetraxfs_machine); | 7405 | qemu_register_machine(&bareetraxfs_machine); |
7405 | #else | 7406 | #else |
vl.h
@@ -1719,6 +1719,9 @@ extern QEMUMachine an5206_machine; | @@ -1719,6 +1719,9 @@ extern QEMUMachine an5206_machine; | ||
1719 | /* mcf5208.c */ | 1719 | /* mcf5208.c */ |
1720 | extern QEMUMachine mcf5208evb_machine; | 1720 | extern QEMUMachine mcf5208evb_machine; |
1721 | 1721 | ||
1722 | +/* dummy_m68k.c */ | ||
1723 | +extern QEMUMachine dummy_m68k_machine; | ||
1724 | + | ||
1722 | #include "gdbstub.h" | 1725 | #include "gdbstub.h" |
1723 | 1726 | ||
1724 | #endif /* defined(QEMU_TOOL) */ | 1727 | #endif /* defined(QEMU_TOOL) */ |