2 * Arnewsh 5206 ColdFire system emulation.
4 * Copyright (c) 2007 CodeSourcery.
6 * This code is licenced under the GPL
11 #define KERNEL_LOAD_ADDR 0x10000
12 #define AN5206_MBAR_ADDR 0x10000000
13 #define AN5206_RAMBAR_ADDR 0x20000000
15 /* Stub functions for hardware that doesn't exist. */
30 static void an5206_init(int ram_size
, int vga_ram_size
, int boot_device
,
31 DisplayState
*ds
, const char **fd_filename
, int snapshot
,
32 const char *kernel_filename
, const char *kernel_cmdline
,
33 const char *initrd_filename
, const char *cpu_model
)
43 if (cpu_m68k_set_model(env
, cpu_model
)) {
44 cpu_abort(env
, "Unable to find m68k CPU definition\n");
47 /* Initialize CPU registers. */
49 /* TODO: allow changing MBAR and RAMBAR. */
50 env
->mbar
= AN5206_MBAR_ADDR
| 1;
51 env
->rambar0
= AN5206_RAMBAR_ADDR
| 1;
53 /* DRAM at address zero */
54 cpu_register_physical_memory(0, ram_size
,
55 qemu_ram_alloc(ram_size
) | IO_MEM_RAM
);
58 cpu_register_physical_memory(AN5206_RAMBAR_ADDR
, 512,
59 qemu_ram_alloc(512) | IO_MEM_RAM
);
61 mcf5206_init(AN5206_MBAR_ADDR
, env
);
64 if (!kernel_filename
) {
65 fprintf(stderr
, "Kernel image must be specified\n");
69 kernel_size
= load_elf(kernel_filename
, 0, &elf_entry
, NULL
, NULL
);
71 if (kernel_size
< 0) {
72 kernel_size
= load_uboot(kernel_filename
, &entry
, NULL
);
74 if (kernel_size
< 0) {
75 kernel_size
= load_image(kernel_filename
,
76 phys_ram_base
+ KERNEL_LOAD_ADDR
);
77 entry
= KERNEL_LOAD_ADDR
;
79 if (kernel_size
< 0) {
80 fprintf(stderr
, "qemu: could not load kernel '%s'\n", kernel_filename
);
87 QEMUMachine an5206_machine
= {