sh.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef QEMU_SH_H
  2. #define QEMU_SH_H
  3. /* Definitions for SH board emulation. */
  4. #include "sh_intc.h"
  5. #define A7ADDR(x) ((x) & 0x1fffffff)
  6. #define P4ADDR(x) ((x) | 0xe0000000)
  7. /* sh7750.c */
  8. struct SH7750State;
  9. struct MemoryRegion;
  10. struct SH7750State *sh7750_init(CPUSH4State * cpu, struct MemoryRegion *sysmem);
  11. typedef struct {
  12. /* The callback will be triggered if any of the designated lines change */
  13. uint16_t portamask_trigger;
  14. uint16_t portbmask_trigger;
  15. /* Return 0 if no action was taken */
  16. int (*port_change_cb) (uint16_t porta, uint16_t portb,
  17. uint16_t * periph_pdtra,
  18. uint16_t * periph_portdira,
  19. uint16_t * periph_pdtrb,
  20. uint16_t * periph_portdirb);
  21. } sh7750_io_device;
  22. int sh7750_register_io_device(struct SH7750State *s,
  23. sh7750_io_device * device);
  24. /* sh_timer.c */
  25. #define TMU012_FEAT_TOCR (1 << 0)
  26. #define TMU012_FEAT_3CHAN (1 << 1)
  27. #define TMU012_FEAT_EXTCLK (1 << 2)
  28. void tmu012_init(struct MemoryRegion *sysmem, target_phys_addr_t base,
  29. int feat, uint32_t freq,
  30. qemu_irq ch0_irq, qemu_irq ch1_irq,
  31. qemu_irq ch2_irq0, qemu_irq ch2_irq1);
  32. /* sh_serial.c */
  33. #define SH_SERIAL_FEAT_SCIF (1 << 0)
  34. void sh_serial_init(MemoryRegion *sysmem,
  35. target_phys_addr_t base, int feat,
  36. uint32_t freq, CharDriverState *chr,
  37. qemu_irq eri_source,
  38. qemu_irq rxi_source,
  39. qemu_irq txi_source,
  40. qemu_irq tei_source,
  41. qemu_irq bri_source);
  42. /* sh7750.c */
  43. qemu_irq sh7750_irl(struct SH7750State *s);
  44. /* tc58128.c */
  45. int tc58128_init(struct SH7750State *s, const char *zone1, const char *zone2);
  46. #endif