2
0

imx_avic.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * i.MX31 Vectored Interrupt Controller
  3. *
  4. * Note this is NOT the PL192 provided by ARM, but
  5. * a custom implementation by Freescale.
  6. *
  7. * Copyright (c) 2008 OKL
  8. * Copyright (c) 2011 NICTA Pty Ltd
  9. * Originally written by Hans Jiang
  10. * Updated by Jean-Christophe Dubois <jcd@tribudubois.net>
  11. *
  12. * This code is licensed under the GPL version 2 or later. See
  13. * the COPYING file in the top-level directory.
  14. *
  15. * TODO: implement vectors.
  16. */
  17. #ifndef IMX_AVIC_H
  18. #define IMX_AVIC_H
  19. #include "hw/sysbus.h"
  20. #include "qom/object.h"
  21. #define TYPE_IMX_AVIC "imx.avic"
  22. OBJECT_DECLARE_SIMPLE_TYPE(IMXAVICState, IMX_AVIC)
  23. #define IMX_AVIC_NUM_IRQS 64
  24. /* Interrupt Control Bits */
  25. #define ABFLAG (1<<25)
  26. #define ABFEN (1<<24)
  27. #define NIDIS (1<<22) /* Normal Interrupt disable */
  28. #define FIDIS (1<<21) /* Fast interrupt disable */
  29. #define NIAD (1<<20) /* Normal Interrupt Arbiter Rise ARM level */
  30. #define FIAD (1<<19) /* Fast Interrupt Arbiter Rise ARM level */
  31. #define NM (1<<18) /* Normal interrupt mode */
  32. #define PRIO_PER_WORD (sizeof(uint32_t) * 8 / 4)
  33. #define PRIO_WORDS (IMX_AVIC_NUM_IRQS/PRIO_PER_WORD)
  34. struct IMXAVICState {
  35. /*< private >*/
  36. SysBusDevice parent_obj;
  37. /*< public >*/
  38. MemoryRegion iomem;
  39. uint64_t pending;
  40. uint64_t enabled;
  41. uint64_t is_fiq;
  42. uint32_t intcntl;
  43. uint32_t intmask;
  44. qemu_irq irq;
  45. qemu_irq fiq;
  46. uint32_t prio[PRIO_WORDS]; /* Priorities are 4-bits each */
  47. };
  48. #endif /* IMX_AVIC_H */