2
0

collie.c 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * SA-1110-based Sharp Zaurus SL-5500 platform.
  3. *
  4. * Copyright (C) 2011 Dmitry Eremin-Solenikov
  5. *
  6. * This code is licensed under GNU GPL v2.
  7. *
  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.
  10. */
  11. #include "qemu/osdep.h"
  12. #include "qemu/units.h"
  13. #include "hw/sysbus.h"
  14. #include "hw/boards.h"
  15. #include "strongarm.h"
  16. #include "hw/arm/boot.h"
  17. #include "hw/block/flash.h"
  18. #include "exec/address-spaces.h"
  19. #include "cpu.h"
  20. static struct arm_boot_info collie_binfo = {
  21. .loader_start = SA_SDCS0,
  22. .ram_size = 0x20000000,
  23. };
  24. static void collie_init(MachineState *machine)
  25. {
  26. StrongARMState *s;
  27. DriveInfo *dinfo;
  28. MemoryRegion *sdram = g_new(MemoryRegion, 1);
  29. s = sa1110_init(machine->cpu_type);
  30. memory_region_allocate_system_memory(sdram, NULL, "strongarm.sdram",
  31. collie_binfo.ram_size);
  32. memory_region_add_subregion(get_system_memory(), SA_SDCS0, sdram);
  33. dinfo = drive_get(IF_PFLASH, 0, 0);
  34. pflash_cfi01_register(SA_CS0, "collie.fl1", 0x02000000,
  35. dinfo ? blk_by_legacy_dinfo(dinfo) : NULL,
  36. 64 * KiB, 4, 0x00, 0x00, 0x00, 0x00, 0);
  37. dinfo = drive_get(IF_PFLASH, 0, 1);
  38. pflash_cfi01_register(SA_CS1, "collie.fl2", 0x02000000,
  39. dinfo ? blk_by_legacy_dinfo(dinfo) : NULL,
  40. 64 * KiB, 4, 0x00, 0x00, 0x00, 0x00, 0);
  41. sysbus_create_simple("scoop", 0x40800000, NULL);
  42. collie_binfo.board_id = 0x208;
  43. arm_load_kernel(s->cpu, machine, &collie_binfo);
  44. }
  45. static void collie_machine_init(MachineClass *mc)
  46. {
  47. mc->desc = "Sharp SL-5500 (Collie) PDA (SA-1110)";
  48. mc->init = collie_init;
  49. mc->ignore_memory_transaction_failures = true;
  50. mc->default_cpu_type = ARM_CPU_TYPE_NAME("sa1110");
  51. }
  52. DEFINE_MACHINE("collie", collie_machine_init)