collie.c 1.9 KB

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