gxl_def.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /*
  2. * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef GXL_DEF_H
  7. #define GXL_DEF_H
  8. #include <lib/utils_def.h>
  9. /*******************************************************************************
  10. * System oscillator
  11. ******************************************************************************/
  12. #define AML_OSC24M_CLK_IN_HZ ULL(24000000) /* 24 MHz */
  13. /*******************************************************************************
  14. * Memory regions
  15. ******************************************************************************/
  16. #define AML_NSDRAM0_BASE UL(0x01000000)
  17. #define AML_NSDRAM0_SIZE UL(0x0F000000)
  18. #define AML_NSDRAM1_BASE UL(0x10000000)
  19. #define AML_NSDRAM1_SIZE UL(0x00100000)
  20. #define BL31_BASE UL(0x05100000)
  21. #define BL31_SIZE UL(0x000C0000)
  22. #define BL31_LIMIT (BL31_BASE + BL31_SIZE)
  23. /* Shared memory used for SMC services */
  24. #define AML_SHARE_MEM_INPUT_BASE UL(0x050FE000)
  25. #define AML_SHARE_MEM_OUTPUT_BASE UL(0x050FF000)
  26. #define AML_SEC_DEVICE0_BASE UL(0xC0000000)
  27. #define AML_SEC_DEVICE0_SIZE UL(0x09000000)
  28. #define AML_SEC_DEVICE1_BASE UL(0xD0040000)
  29. #define AML_SEC_DEVICE1_SIZE UL(0x00008000)
  30. #define AML_TZRAM_BASE UL(0xD9000000)
  31. #define AML_TZRAM_SIZE UL(0x00014000)
  32. /* Top 0xC000 bytes (up to 0xD9020000) used by BL2 */
  33. /* Mailboxes */
  34. #define AML_MHU_SECURE_SCP_TO_AP_PAYLOAD UL(0xD9013800)
  35. #define AML_MHU_SECURE_AP_TO_SCP_PAYLOAD UL(0xD9013A00)
  36. #define AML_PSCI_MAILBOX_BASE UL(0xD9013F00)
  37. // * [ 1K] 0xD901_3800 - 0xD901_3BFF Secure Mailbox (3)
  38. // * [ 1K] 0xD901_3400 - 0xD901_37FF High Mailbox (2) *
  39. // * [ 1K] 0xD901_3000 - 0xD901_33FF High Mailbox (1) *
  40. #define AML_TZROM_BASE UL(0xD9040000)
  41. #define AML_TZROM_SIZE UL(0x00010000)
  42. #define AML_SEC_DEVICE2_BASE UL(0xDA000000)
  43. #define AML_SEC_DEVICE2_SIZE UL(0x00200000)
  44. #define AML_SEC_DEVICE3_BASE UL(0xDA800000)
  45. #define AML_SEC_DEVICE3_SIZE UL(0x00200000)
  46. /*******************************************************************************
  47. * GIC-400 and interrupt handling related constants
  48. ******************************************************************************/
  49. #define AML_GICD_BASE UL(0xC4301000)
  50. #define AML_GICC_BASE UL(0xC4302000)
  51. #define IRQ_SEC_PHY_TIMER 29
  52. #define IRQ_SEC_SGI_0 8
  53. #define IRQ_SEC_SGI_1 9
  54. #define IRQ_SEC_SGI_2 10
  55. #define IRQ_SEC_SGI_3 11
  56. #define IRQ_SEC_SGI_4 12
  57. #define IRQ_SEC_SGI_5 13
  58. #define IRQ_SEC_SGI_6 14
  59. #define IRQ_SEC_SGI_7 15
  60. /*******************************************************************************
  61. * UART definitions
  62. ******************************************************************************/
  63. #define AML_UART0_AO_BASE UL(0xC81004C0)
  64. #define AML_UART0_AO_CLK_IN_HZ AML_OSC24M_CLK_IN_HZ
  65. #define AML_UART_BAUDRATE U(115200)
  66. /*******************************************************************************
  67. * Memory-mapped I/O Registers
  68. ******************************************************************************/
  69. #define AML_AO_TIMESTAMP_CNTL UL(0xC81000B4)
  70. #define AML_SYS_CPU_CFG7 UL(0xC8834664)
  71. #define AML_AO_RTI_STATUS_REG3 UL(0xDA10001C)
  72. #define AML_AO_RTI_SCP_STAT UL(0xDA10023C)
  73. #define AML_AO_RTI_SCP_READY_OFF U(0x14)
  74. #define AML_A0_RTI_SCP_READY_MASK U(3)
  75. #define AML_AO_RTI_SCP_IS_READY(v) \
  76. ((((v) >> AML_AO_RTI_SCP_READY_OFF) & \
  77. AML_A0_RTI_SCP_READY_MASK) == AML_A0_RTI_SCP_READY_MASK)
  78. #define AML_HIU_MAILBOX_SET_0 UL(0xDA83C404)
  79. #define AML_HIU_MAILBOX_STAT_0 UL(0xDA83C408)
  80. #define AML_HIU_MAILBOX_CLR_0 UL(0xDA83C40C)
  81. #define AML_HIU_MAILBOX_SET_3 UL(0xDA83C428)
  82. #define AML_HIU_MAILBOX_STAT_3 UL(0xDA83C42C)
  83. #define AML_HIU_MAILBOX_CLR_3 UL(0xDA83C430)
  84. #define AML_SHA_DMA_BASE UL(0xC883E000)
  85. #define AML_SHA_DMA_DESC (AML_SHA_DMA_BASE + 0x08)
  86. #define AML_SHA_DMA_STATUS (AML_SHA_DMA_BASE + 0x18)
  87. /*******************************************************************************
  88. * System Monitor Call IDs and arguments
  89. ******************************************************************************/
  90. #define AML_SM_GET_SHARE_MEM_INPUT_BASE U(0x82000020)
  91. #define AML_SM_GET_SHARE_MEM_OUTPUT_BASE U(0x82000021)
  92. #define AML_SM_EFUSE_READ U(0x82000030)
  93. #define AML_SM_EFUSE_USER_MAX U(0x82000033)
  94. #define AML_SM_JTAG_ON U(0x82000040)
  95. #define AML_SM_JTAG_OFF U(0x82000041)
  96. #define AML_SM_GET_CHIP_ID U(0x82000044)
  97. #define AML_JTAG_STATE_ON U(0)
  98. #define AML_JTAG_STATE_OFF U(1)
  99. #define AML_JTAG_M3_AO U(0)
  100. #define AML_JTAG_M3_EE U(1)
  101. #define AML_JTAG_A53_AO U(2)
  102. #define AML_JTAG_A53_EE U(3)
  103. #endif /* GXL_DEF_H */