bcm283x.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. #ifndef BCM283X_H__
  2. #define BCM283X_H__
  3. #include <rthw.h>
  4. #define PER_BASE (0x3F000000)
  5. #define PER_BASE_40000000 (0x40000000)
  6. /*
  7. * GPIO
  8. */
  9. #define GPIO_BASE (PER_BASE + 0x200000)
  10. #define GPIO_GPFSEL0 HWREG32(GPIO_BASE + 0x00) /* GPIO Function Select 0 32bit R/W */
  11. #define GPIO_GPFSEL1 HWREG32(GPIO_BASE + 0x04) /* GPIO Function Select 1 32bit R/W */
  12. #define GPIO_GPFSEL2 HWREG32(GPIO_BASE + 0x08) /* GPIO Function Select 2 32bit R/W */
  13. #define GPIO_GPFSEL4 HWREG32(GPIO_BASE + 0x10) /* GPIO Function Select 4 32bit R/W */
  14. #define GPIO_GPSET0 HWREG32(GPIO_BASE + 0x1C)
  15. #define GPIO_GPCLR0 HWREG32(GPIO_BASE + 0x28)
  16. #define GPIO_GPPUD HWREG32(GPIO_BASE + 0x94) /* GPIO Pin Pull-up/down Enable */
  17. #define GPIO_GPPUDCLK0 HWREG32(GPIO_BASE + 0x98) /* GPIO Pin Pull-up/down Enable Clock 0 */
  18. #define GPIO_GPPUDCLK1 HWREG32(GPIO_BASE + 0x9C) /* GPIO Pin Pull-up/down Enable Clock 1 */
  19. /*
  20. * Interrupt Controler
  21. */
  22. #define IRQ_BASE (PER_BASE + 0xB200)
  23. #define IRQ_PEND_BASIC HWREG32(IRQ_BASE + 0x00)
  24. #define IRQ_PEND1 HWREG32(IRQ_BASE + 0x04)
  25. #define IRQ_PEND2 HWREG32(IRQ_BASE + 0x08)
  26. #define IRQ_FIQ_CONTROL HWREG32(IRQ_BASE + 0x0C)
  27. #define IRQ_ENABLE1 HWREG32(IRQ_BASE + 0x10)
  28. #define IRQ_ENABLE2 HWREG32(IRQ_BASE + 0x14)
  29. #define IRQ_ENABLE_BASIC HWREG32(IRQ_BASE + 0x18)
  30. #define IRQ_DISABLE1 HWREG32(IRQ_BASE + 0x1C)
  31. #define IRQ_DISABLE2 HWREG32(IRQ_BASE + 0x20)
  32. #define IRQ_DISABLE_BASIC HWREG32(IRQ_BASE + 0x24)
  33. /*
  34. * System Timer
  35. */
  36. #define STIMER_BASE (PER_BASE + 0x3000)
  37. #define STIMER_CS HWREG32(STIMER_BASE + 0x00)
  38. #define STIMER_CLO HWREG32(STIMER_BASE + 0x04)
  39. #define STIMER_CHI HWREG32(STIMER_BASE + 0x08)
  40. #define STIMER_C0 HWREG32(STIMER_BASE + 0x0C)
  41. #define STIMER_C1 HWREG32(STIMER_BASE + 0x10)
  42. #define STIMER_C2 HWREG32(STIMER_BASE + 0x14)
  43. #define STIMER_C3 HWREG32(STIMER_BASE + 0x18)
  44. /*
  45. * ARM Timer
  46. */
  47. #define ARM_TIMER_BASE (PER_BASE + 0xB000)
  48. #define ARM_TIMER_LOAD HWREG32(ARM_TIMER_BASE + 0x400)
  49. #define ARM_TIMER_VALUE HWREG32(ARM_TIMER_BASE + 0x404)
  50. #define ARM_TIMER_CTRL HWREG32(ARM_TIMER_BASE + 0x408)
  51. #define ARM_TIMER_IRQCLR HWREG32(ARM_TIMER_BASE + 0x40C)
  52. #define ARM_TIMER_RAWIRQ HWREG32(ARM_TIMER_BASE + 0x410)
  53. #define ARM_TIMER_MASKIRQ HWREG32(ARM_TIMER_BASE + 0x414)
  54. #define ARM_TIMER_RELOAD HWREG32(ARM_TIMER_BASE + 0x418)
  55. #define ARM_TIMER_PREDIV HWREG32(ARM_TIMER_BASE + 0x41C)
  56. #define ARM_TIMER_CNTR HWREG32(ARM_TIMER_BASE + 0x420)
  57. /*
  58. * Core Timer
  59. */
  60. #define CTIMER_CTL HWREG32(PER_BASE_40000000 + 0x00) /* Control register */
  61. #define CTIMER_PRE HWREG32(PER_BASE_40000000 + 0x08) /* Core timer prescaler */
  62. #define CTIMER_LS32B HWREG32(PER_BASE_40000000 + 0x1C) /* Core timer access LS 32 bits */
  63. #define CTIMER_MS32B HWREG32(PER_BASE_40000000 + 0x20) /* Core timer access MS 32 bits */
  64. /*
  65. * ARM Core Timer
  66. */
  67. #define C0TIMER_INTCTL HWREG32(PER_BASE_40000000 + 0x40) /* Core0 timers Interrupt control */
  68. #define C1TIMER_INTCTL HWREG32(PER_BASE_40000000 + 0x44) /* Core1 timers Interrupt control */
  69. #define C2TIMER_INTCTL HWREG32(PER_BASE_40000000 + 0x48) /* Core2 timers Interrupt control */
  70. #define C3TIMER_INTCTL HWREG32(PER_BASE_40000000 + 0x4C) /* Core3 timers Interrupt control */
  71. /*
  72. * ARM Core Mailbox interrupt
  73. */
  74. #define C0MB_INTCTL HWREG32(PER_BASE_40000000 + 0x50) /* Core0 Mailboxes Interrupt control */
  75. #define C1MB_INTCTL HWREG32(PER_BASE_40000000 + 0x54) /* Core1 Mailboxes Interrupt control */
  76. #define C2MB_INTCTL HWREG32(PER_BASE_40000000 + 0x58) /* Core2 Mailboxes Interrupt control */
  77. #define C3MB_INTCTL HWREG32(PER_BASE_40000000 + 0x5C) /* Core3 Mailboxes Interrupt control */
  78. /*
  79. * ARM Core IRQ/FIQ status
  80. */
  81. #define C0_IRQSOURCE HWREG32(PER_BASE_40000000 + 0x60) /* Core0 IRQ Source */
  82. #define C1_IRQSOURCE HWREG32(PER_BASE_40000000 + 0x64) /* Core1 IRQ Source */
  83. #define C2_IRQSOURCE HWREG32(PER_BASE_40000000 + 0x68) /* Core2 IRQ Source */
  84. #define C3_IRQSOURCE HWREG32(PER_BASE_40000000 + 0x6C) /* Core3 IRQ Source */
  85. #define C0_FIQSOURCE HWREG32(PER_BASE_40000000 + 0x70) /* Core0 FIQ Source */
  86. #define C1_FIQSOURCE HWREG32(PER_BASE_40000000 + 0x74) /* Core1 FIQ Source */
  87. #define C2_FIQSOURCE HWREG32(PER_BASE_40000000 + 0x78) /* Core2 FIQ Source */
  88. #define C3_FIQSOURCE HWREG32(PER_BASE_40000000 + 0x7C) /* Core3 FIQ Source */
  89. #define IRQ_ARM_TIMER 0
  90. #define IRQ_ARM_MAILBOX 1
  91. #define IRQ_ARM_DB0 2
  92. #define IRQ_ARM_DB1 3
  93. #define IRQ_ARM_GPU0_HALT 4
  94. #define IRQ_ARM_GPU1_HALT 5
  95. #define IRQ_ARM_ILLEGAL_ACC1 6
  96. #define IRQ_ARM_ILLEGAL_ACC0 7
  97. #define IRQ_AUX 29
  98. #define IRQ_IIC_SPI_SLV 43
  99. #define IRQ_PWA0 45
  100. #define IRQ_PWA1 46
  101. #define IRQ_SMI 48
  102. #define IRQ_GPIO0 49
  103. #define IRQ_GPIO1 50
  104. #define IRQ_GPIO2 51
  105. #define IRQ_GPIO3 52
  106. #define IRQ_IIC 53
  107. #define IRQ_SPI 54
  108. #define IRQ_PCM 55
  109. #define IRQ_UART 57
  110. #endif