arm-misc.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * Misc ARM declarations
  3. *
  4. * Copyright (c) 2006 CodeSourcery.
  5. * Written by Paul Brook
  6. *
  7. * This code is licensed under the LGPL.
  8. *
  9. */
  10. #ifndef ARM_MISC_H
  11. #define ARM_MISC_H 1
  12. #include "exec/memory.h"
  13. #include "hw/irq.h"
  14. /* The CPU is also modeled as an interrupt controller. */
  15. #define ARM_PIC_CPU_IRQ 0
  16. #define ARM_PIC_CPU_FIQ 1
  17. qemu_irq *arm_pic_init_cpu(ARMCPU *cpu);
  18. /* armv7m.c */
  19. qemu_irq *armv7m_init(MemoryRegion *address_space_mem,
  20. int flash_size, int sram_size,
  21. const char *kernel_filename, const char *cpu_model);
  22. /* arm_boot.c */
  23. struct arm_boot_info {
  24. uint64_t ram_size;
  25. const char *kernel_filename;
  26. const char *kernel_cmdline;
  27. const char *initrd_filename;
  28. const char *dtb_filename;
  29. hwaddr loader_start;
  30. /* multicore boards that use the default secondary core boot functions
  31. * need to put the address of the secondary boot code, the boot reg,
  32. * and the GIC address in the next 3 values, respectively. boards that
  33. * have their own boot functions can use these values as they want.
  34. */
  35. hwaddr smp_loader_start;
  36. hwaddr smp_bootreg_addr;
  37. hwaddr gic_cpu_if_addr;
  38. int nb_cpus;
  39. int board_id;
  40. int (*atag_board)(const struct arm_boot_info *info, void *p);
  41. /* multicore boards that use the default secondary core boot functions
  42. * can ignore these two function calls. If the default functions won't
  43. * work, then write_secondary_boot() should write a suitable blob of
  44. * code mimicking the secondary CPU startup process used by the board's
  45. * boot loader/boot ROM code, and secondary_cpu_reset_hook() should
  46. * perform any necessary CPU reset handling and set the PC for the
  47. * secondary CPUs to point at this boot blob.
  48. */
  49. void (*write_secondary_boot)(ARMCPU *cpu,
  50. const struct arm_boot_info *info);
  51. void (*secondary_cpu_reset_hook)(ARMCPU *cpu,
  52. const struct arm_boot_info *info);
  53. /* Used internally by arm_boot.c */
  54. int is_linux;
  55. hwaddr initrd_start;
  56. hwaddr initrd_size;
  57. hwaddr entry;
  58. };
  59. void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info);
  60. /* Multiplication factor to convert from system clock ticks to qemu timer
  61. ticks. */
  62. extern int system_clock_scale;
  63. #endif /* !ARM_MISC_H */