arm-misc.h 2.3 KB

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