rk3568.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /*
  2. * Copyright (c) 2006-2022, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2022-3-08 GuEe-GUI the first version
  9. */
  10. #ifndef __RK3568_H__
  11. #define __RK3568_H__
  12. /* UART */
  13. #define UART_MMIO_BASE 0xfe650000
  14. #define UART0_MMIO_BASE 0xfdd50000
  15. #define UART1_MMIO_BASE (UART_MMIO_BASE + 0)
  16. #define UART2_MMIO_BASE (UART_MMIO_BASE + 0x10000)
  17. #define UART3_MMIO_BASE (UART_MMIO_BASE + 0x20000)
  18. #define UART4_MMIO_BASE (UART_MMIO_BASE + 0x30000)
  19. #define UART5_MMIO_BASE (UART_MMIO_BASE + 0x40000)
  20. #define UART6_MMIO_BASE (UART_MMIO_BASE + 0x50000)
  21. #define UART7_MMIO_BASE (UART_MMIO_BASE + 0x60000)
  22. #define UART8_MMIO_BASE (UART_MMIO_BASE + 0x70000)
  23. #define UART9_MMIO_BASE (UART_MMIO_BASE + 0x80000)
  24. #define UART_MMIO_SIZE 0x100
  25. #define UART_IRQ_BASE (32 + 116)
  26. #define UART0_IRQ (UART_IRQ_BASE + 0)
  27. #define UART1_IRQ (UART_IRQ_BASE + 1)
  28. #define UART2_IRQ (UART_IRQ_BASE + 2)
  29. #define UART3_IRQ (UART_IRQ_BASE + 3)
  30. #define UART4_IRQ (UART_IRQ_BASE + 4)
  31. #define UART5_IRQ (UART_IRQ_BASE + 5)
  32. #define UART6_IRQ (UART_IRQ_BASE + 6)
  33. #define UART7_IRQ (UART_IRQ_BASE + 7)
  34. #define UART8_IRQ (UART_IRQ_BASE + 8)
  35. #define UART9_IRQ (UART_IRQ_BASE + 9)
  36. /* GPIO */
  37. #define GPIO0_MMIO_BASE 0xfdd60000
  38. #define GPIO1_MMIO_BASE 0xfe740000
  39. #define GPIO2_MMIO_BASE 0xfe750000
  40. #define GPIO3_MMIO_BASE 0xfe760000
  41. #define GPIO4_MMIO_BASE 0xfe770000
  42. #define GPIO_MMIO_SIZE 0x100
  43. #define GPIO_IRQ_BASE (32 + 33)
  44. #define GPIO0_IRQ (GPIO_IRQ_BASE + 0)
  45. #define GPIO1_IRQ (GPIO_IRQ_BASE + 1)
  46. #define GPIO2_IRQ (GPIO_IRQ_BASE + 2)
  47. #define GPIO3_IRQ (GPIO_IRQ_BASE + 3)
  48. #define GPIO4_IRQ (GPIO_IRQ_BASE + 4)
  49. /* MMC */
  50. #define MMC0_MMIO_BASE 0xfe310000 /* sdhci */
  51. #define MMC1_MMIO_BASE 0xfe2b0000 /* sdmmc0 */
  52. #define MMC2_MMIO_BASE 0xfe2c0000 /* sdmmc1 */
  53. #define MMC3_MMIO_BASE 0xfe000000 /* sdmmc2 */
  54. #define MMC0_MMIO_SIZE 0x10000
  55. #define MMC_MMIO_SIZE 0x4000
  56. #define MMC0_IRQ (32 + 19)
  57. #define MMC1_IRQ (32 + 98)
  58. #define MMC2_IRQ (32 + 99)
  59. #define MMC3_IRQ (32 + 100)
  60. /* Ethernet */
  61. #define GMAC0_MMIO_BASE 0xfe2a0000
  62. #define GMAC1_MMIO_BASE 0xfe010000
  63. #define GMAC_MMIO_SIZE 0x10000
  64. #define GMAC0_MAC_IRQ (32 + 27)
  65. #define GMAC0_WAKE_IRQ (32 + 24)
  66. #define GMAC1_MAC_IRQ (32 + 32)
  67. #define GMAC1_WAKE_IRQ (32 + 29)
  68. /* GIC */
  69. #define MAX_HANDLERS 256
  70. #define GIC_IRQ_START 0
  71. #define ARM_GIC_NR_IRQS 256
  72. #define ARM_GIC_MAX_NR 1
  73. #define IRQ_ARM_IPI_KICK 0
  74. #define IRQ_ARM_IPI_CALL 1
  75. #define GIC_PL600_DISTRIBUTOR_PPTR 0xfd400000
  76. #define GIC_PL600_REDISTRIBUTOR_PPTR 0xfd460000
  77. #define GIC_PL600_CONTROLLER_PPTR RT_NULL
  78. #define GIC_PL600_ITS_PPTR 0xfd440000
  79. rt_inline rt_uint32_t platform_get_gic_dist_base(void)
  80. {
  81. return GIC_PL600_DISTRIBUTOR_PPTR;
  82. }
  83. rt_inline rt_uint32_t platform_get_gic_redist_base(void)
  84. {
  85. return GIC_PL600_REDISTRIBUTOR_PPTR;
  86. }
  87. rt_inline rt_uint32_t platform_get_gic_cpu_base(void)
  88. {
  89. return GIC_PL600_CONTROLLER_PPTR;
  90. }
  91. rt_inline rt_uint32_t platform_get_gic_its_base(void)
  92. {
  93. return GIC_PL600_ITS_PPTR;
  94. }
  95. #endif /* __RK3568_H__ */