2 * Dummy board with just RAM and CPU for use as an ISS.
4 * Copyright (c) 2007 CodeSourcery.
6 * This code is licensed under the GPL
14 #define KERNEL_LOAD_ADDR 0x10000
18 static void dummy_m68k_init(ram_addr_t ram_size
,
19 const char *boot_device
,
20 const char *kernel_filename
, const char *kernel_cmdline
,
21 const char *initrd_filename
, const char *cpu_model
)
26 target_phys_addr_t entry
;
30 env
= cpu_init(cpu_model
);
32 fprintf(stderr
, "Unable to find m68k CPU definition\n");
36 /* Initialize CPU registers. */
39 /* RAM at address zero */
40 cpu_register_physical_memory(0, ram_size
,
41 qemu_ram_alloc(NULL
, "dummy_m68k.ram", ram_size
) | IO_MEM_RAM
);
44 if (kernel_filename
) {
45 kernel_size
= load_elf(kernel_filename
, NULL
, NULL
, &elf_entry
,
46 NULL
, NULL
, 1, ELF_MACHINE
, 0);
48 if (kernel_size
< 0) {
49 kernel_size
= load_uimage(kernel_filename
, &entry
, NULL
, NULL
);
51 if (kernel_size
< 0) {
52 kernel_size
= load_image_targphys(kernel_filename
,
54 ram_size
- KERNEL_LOAD_ADDR
);
55 entry
= KERNEL_LOAD_ADDR
;
57 if (kernel_size
< 0) {
58 fprintf(stderr
, "qemu: could not load kernel '%s'\n",
68 static QEMUMachine dummy_m68k_machine
= {
70 .desc
= "Dummy board",
71 .init
= dummy_m68k_init
,
74 static void dummy_m68k_machine_init(void)
76 qemu_register_machine(&dummy_m68k_machine
);
79 machine_init(dummy_m68k_machine_init
);