2
0

collie.c 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 "hw.h"
  12. #include "sysbus.h"
  13. #include "boards.h"
  14. #include "devices.h"
  15. #include "strongarm.h"
  16. #include "arm-misc.h"
  17. #include "flash.h"
  18. #include "blockdev.h"
  19. #include "exec-memory.h"
  20. static struct arm_boot_info collie_binfo = {
  21. .loader_start = SA_SDCS0,
  22. .ram_size = 0x20000000,
  23. };
  24. static void collie_init(ram_addr_t ram_size,
  25. const char *boot_device,
  26. const char *kernel_filename, const char *kernel_cmdline,
  27. const char *initrd_filename, const char *cpu_model)
  28. {
  29. StrongARMState *s;
  30. DriveInfo *dinfo;
  31. MemoryRegion *sysmem = get_system_memory();
  32. if (!cpu_model) {
  33. cpu_model = "sa1110";
  34. }
  35. s = sa1110_init(sysmem, collie_binfo.ram_size, cpu_model);
  36. dinfo = drive_get(IF_PFLASH, 0, 0);
  37. pflash_cfi01_register(SA_CS0, NULL, "collie.fl1", 0x02000000,
  38. dinfo ? dinfo->bdrv : NULL, (64 * 1024),
  39. 512, 4, 0x00, 0x00, 0x00, 0x00, 0);
  40. dinfo = drive_get(IF_PFLASH, 0, 1);
  41. pflash_cfi01_register(SA_CS1, NULL, "collie.fl2", 0x02000000,
  42. dinfo ? dinfo->bdrv : NULL, (64 * 1024),
  43. 512, 4, 0x00, 0x00, 0x00, 0x00, 0);
  44. sysbus_create_simple("scoop", 0x40800000, NULL);
  45. collie_binfo.kernel_filename = kernel_filename;
  46. collie_binfo.kernel_cmdline = kernel_cmdline;
  47. collie_binfo.initrd_filename = initrd_filename;
  48. collie_binfo.board_id = 0x208;
  49. arm_load_kernel(s->cpu, &collie_binfo);
  50. }
  51. static QEMUMachine collie_machine = {
  52. .name = "collie",
  53. .desc = "Collie PDA (SA-1110)",
  54. .init = collie_init,
  55. };
  56. static void collie_machine_init(void)
  57. {
  58. qemu_register_machine(&collie_machine);
  59. }
  60. machine_init(collie_machine_init)