2
0

ppc-uic.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * "Universal" Interrupt Controller for PowerPPC 4xx embedded processors
  3. *
  4. * Copyright (c) 2007 Jocelyn Mayer
  5. *
  6. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7. * of this software and associated documentation files (the "Software"), to deal
  8. * in the Software without restriction, including without limitation the rights
  9. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10. * copies of the Software, and to permit persons to whom the Software is
  11. * furnished to do so, subject to the following conditions:
  12. *
  13. * The above copyright notice and this permission notice shall be included in
  14. * all copies or substantial portions of the Software.
  15. *
  16. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  19. * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22. * THE SOFTWARE.
  23. */
  24. #ifndef HW_INTC_PPC_UIC_H
  25. #define HW_INTC_PPC_UIC_H
  26. #include "hw/ppc/ppc4xx.h"
  27. #define TYPE_PPC_UIC "ppc-uic"
  28. OBJECT_DECLARE_SIMPLE_TYPE(PPCUIC, PPC_UIC)
  29. /*
  30. * QEMU interface:
  31. * QOM property "cpu": link to the PPC CPU
  32. * (no default, must be set)
  33. * QOM property "dcr-base": base of the bank of DCR registers for the UIC
  34. * (default 0x30)
  35. * QOM property "use-vectors": true if the UIC has vector registers
  36. * (default true)
  37. * unnamed GPIO inputs 0..UIC_MAX_IRQ: input IRQ lines
  38. * sysbus IRQs:
  39. * 0 (PPCUIC_OUTPUT_INT): output INT line to the CPU
  40. * 1 (PPCUIC_OUTPUT_CINT): output CINT line to the CPU
  41. */
  42. #define UIC_MAX_IRQ 32
  43. /* Symbolic constants for the sysbus IRQ outputs */
  44. enum {
  45. PPCUIC_OUTPUT_INT = 0,
  46. PPCUIC_OUTPUT_CINT = 1,
  47. PPCUIC_OUTPUT_NB,
  48. };
  49. struct PPCUIC {
  50. /*< private >*/
  51. Ppc4xxDcrDeviceState parent_obj;
  52. /*< public >*/
  53. qemu_irq output_int;
  54. qemu_irq output_cint;
  55. /* properties */
  56. uint32_t dcr_base;
  57. bool use_vectors;
  58. uint32_t level; /* Remembers the state of level-triggered interrupts. */
  59. uint32_t uicsr; /* Status register */
  60. uint32_t uicer; /* Enable register */
  61. uint32_t uiccr; /* Critical register */
  62. uint32_t uicpr; /* Polarity register */
  63. uint32_t uictr; /* Triggering register */
  64. uint32_t uicvcr; /* Vector configuration register */
  65. uint32_t uicvr;
  66. };
  67. #endif