2 * Dummy board with just RAM and CPU for use as an ISS.
4 * Copyright (c) 2007 CodeSourcery.
6 * This code is licenced under the GPL
15 #define KERNEL_LOAD_ADDR 0x10000
19 static void dummy_m68k_init(ram_addr_t ram_size
,
20 const char *boot_device
,
21 const char *kernel_filename
, const char *kernel_cmdline
,
22 const char *initrd_filename
, const char *cpu_model
)
27 target_phys_addr_t entry
;
31 env
= cpu_init(cpu_model
);
33 fprintf(stderr
, "Unable to find m68k CPU definition\n");
37 /* Initialize CPU registers. */
40 /* RAM at address zero */
41 cpu_register_physical_memory(0, ram_size
,
42 qemu_ram_alloc(NULL
, "dummy_m68k.ram", ram_size
) | IO_MEM_RAM
);
45 if (kernel_filename
) {
46 kernel_size
= load_elf(kernel_filename
, NULL
, NULL
, &elf_entry
,
47 NULL
, NULL
, 1, ELF_MACHINE
, 0);
49 if (kernel_size
< 0) {
50 kernel_size
= load_uimage(kernel_filename
, &entry
, NULL
, NULL
);
52 if (kernel_size
< 0) {
53 kernel_size
= load_image_targphys(kernel_filename
,
55 ram_size
- KERNEL_LOAD_ADDR
);
56 entry
= KERNEL_LOAD_ADDR
;
58 if (kernel_size
< 0) {
59 fprintf(stderr
, "qemu: could not load kernel '%s'\n",
69 static QEMUMachine dummy_m68k_machine
= {
71 .desc
= "Dummy board",
72 .init
= dummy_m68k_init
,
75 static void dummy_m68k_machine_init(void)
77 qemu_register_machine(&dummy_m68k_machine
);
80 machine_init(dummy_m68k_machine_init
);