linux-user, configure: fix (again) syscall_nr.h dependencies cleanup
[qemu.git] / hw / arm / collie.c
blob4992084a3f6e4eeb23d7b51cbe86cbe4898d6fe1
1 /*
2 * SA-1110-based Sharp Zaurus SL-5500 platform.
4 * Copyright (C) 2011 Dmitry Eremin-Solenikov
6 * This code is licensed under GNU GPL v2.
8 * Contributions after 2012-01-13 are licensed under the terms of the
9 * GNU GPL, version 2 or (at your option) any later version.
11 #include "qemu/osdep.h"
12 #include "qemu/units.h"
13 #include "qemu/cutils.h"
14 #include "hw/sysbus.h"
15 #include "hw/boards.h"
16 #include "strongarm.h"
17 #include "hw/arm/boot.h"
18 #include "hw/block/flash.h"
19 #include "exec/address-spaces.h"
20 #include "cpu.h"
22 static struct arm_boot_info collie_binfo = {
23 .loader_start = SA_SDCS0,
24 .ram_size = 0x20000000,
27 static void collie_init(MachineState *machine)
29 StrongARMState *s;
30 DriveInfo *dinfo;
31 MachineClass *mc = MACHINE_GET_CLASS(machine);
33 if (machine->ram_size != mc->default_ram_size) {
34 char *sz = size_to_str(mc->default_ram_size);
35 error_report("Invalid RAM size, should be %s", sz);
36 g_free(sz);
37 exit(EXIT_FAILURE);
40 s = sa1110_init(machine->cpu_type);
42 memory_region_add_subregion(get_system_memory(), SA_SDCS0, machine->ram);
44 dinfo = drive_get(IF_PFLASH, 0, 0);
45 pflash_cfi01_register(SA_CS0, "collie.fl1", 0x02000000,
46 dinfo ? blk_by_legacy_dinfo(dinfo) : NULL,
47 64 * KiB, 4, 0x00, 0x00, 0x00, 0x00, 0);
49 dinfo = drive_get(IF_PFLASH, 0, 1);
50 pflash_cfi01_register(SA_CS1, "collie.fl2", 0x02000000,
51 dinfo ? blk_by_legacy_dinfo(dinfo) : NULL,
52 64 * KiB, 4, 0x00, 0x00, 0x00, 0x00, 0);
54 sysbus_create_simple("scoop", 0x40800000, NULL);
56 collie_binfo.board_id = 0x208;
57 arm_load_kernel(s->cpu, machine, &collie_binfo);
60 static void collie_machine_init(MachineClass *mc)
62 mc->desc = "Sharp SL-5500 (Collie) PDA (SA-1110)";
63 mc->init = collie_init;
64 mc->ignore_memory_transaction_failures = true;
65 mc->default_cpu_type = ARM_CPU_TYPE_NAME("sa1110");
66 mc->default_ram_size = 0x20000000;
67 mc->default_ram_id = "strongarm.sdram";
70 DEFINE_MACHINE("collie", collie_machine_init)