2 * Arnewsh 5206 ColdFire system emulation.
4 * Copyright (c) 2007 CodeSourcery.
6 * This code is licenced under the GPL
16 #define KERNEL_LOAD_ADDR 0x10000
17 #define AN5206_MBAR_ADDR 0x10000000
18 #define AN5206_RAMBAR_ADDR 0x20000000
20 /* Stub functions for hardware that doesn't exist. */
21 void pic_info(Monitor *mon)
25 void irq_info(Monitor *mon)
31 static void an5206_init(ram_addr_t ram_size,
32 const char *boot_device,
33 const char *kernel_filename, const char *kernel_cmdline,
34 const char *initrd_filename, const char *cpu_model)
39 target_phys_addr_t entry;
43 env = cpu_init(cpu_model);
45 hw_error("Unable to find m68k CPU definition\n");
48 /* Initialize CPU registers. */
50 /* TODO: allow changing MBAR and RAMBAR. */
51 env->mbar = AN5206_MBAR_ADDR | 1;
52 env->rambar0 = AN5206_RAMBAR_ADDR | 1;
54 /* DRAM at address zero */
55 cpu_register_physical_memory(0, ram_size,
56 qemu_ram_alloc(NULL, "an5206.ram", ram_size) | IO_MEM_RAM);
59 cpu_register_physical_memory(AN5206_RAMBAR_ADDR, 512,
60 qemu_ram_alloc(NULL, "an5206.sram", 512) | IO_MEM_RAM);
62 mcf5206_init(AN5206_MBAR_ADDR, env);
65 if (!kernel_filename) {
66 fprintf(stderr, "Kernel image must be specified\n");
70 kernel_size = load_elf(kernel_filename, NULL, NULL, &elf_entry,
71 NULL, NULL, 1, ELF_MACHINE, 0);
73 if (kernel_size < 0) {
74 kernel_size = load_uimage(kernel_filename, &entry, NULL, NULL);
76 if (kernel_size < 0) {
77 kernel_size = load_image_targphys(kernel_filename, KERNEL_LOAD_ADDR,
78 ram_size - KERNEL_LOAD_ADDR);
79 entry = KERNEL_LOAD_ADDR;
81 if (kernel_size < 0) {
82 fprintf(stderr, "qemu: could not load kernel '%s'\n", kernel_filename);
89 static QEMUMachine an5206_machine = {
91 .desc = "Arnewsh 5206",
95 static void an5206_machine_init(void)
97 qemu_register_machine(&an5206_machine);
100 machine_init(an5206_machine_init);