hi3798cv200.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /*
  2. * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef HI3798CV200_H
  7. #define HI3798CV200_H
  8. #include <lib/utils_def.h>
  9. /* PL011 */
  10. #define PL011_UART0_BASE (0xF8B00000)
  11. #define PL011_BAUDRATE (115200)
  12. #define PL011_UART0_CLK_IN_HZ (75000000)
  13. /* Sys Counter */
  14. #define SYS_COUNTER_FREQ_IN_TICKS (24000000)
  15. #define SYS_COUNTER_FREQ_IN_MHZ (24)
  16. /* Timer */
  17. #define SEC_TIMER0_BASE (0xF8008000)
  18. #define TIMER00_LOAD (SEC_TIMER0_BASE + 0x000)
  19. #define TIMER00_VALUE (SEC_TIMER0_BASE + 0x004)
  20. #define TIMER00_CONTROL (SEC_TIMER0_BASE + 0x008)
  21. #define TIMER00_BGLOAD (SEC_TIMER0_BASE + 0x018)
  22. #define SEC_TIMER2_BASE (0xF8009000)
  23. #define TIMER20_LOAD (SEC_TIMER2_BASE + 0x000)
  24. #define TIMER20_VALUE (SEC_TIMER2_BASE + 0x004)
  25. #define TIMER20_CONTROL (SEC_TIMER2_BASE + 0x008)
  26. #define TIMER20_BGLOAD (SEC_TIMER2_BASE + 0x018)
  27. /* GPIO */
  28. #define GPIO_MAX (13)
  29. #define GPIO_BASE(x) (x != 5 ? \
  30. 0xf820000 + x * 0x1000 : 0xf8004000)
  31. /* SCTL */
  32. #define REG_BASE_SCTL (0xF8000000)
  33. #define REG_SC_SYSRES (0x0004)
  34. #define REG_SC_GEN12 (0x00B0)
  35. #define REG_SC_LOCKEN (0x020C)
  36. #define SC_UNLOCK_MAGIC (0x4F50454E)
  37. /* CRG */
  38. #define REG_BASE_CRG (0xF8A22000)
  39. #define REG_CPU_LP (0x48)
  40. #define REG_CPU_RST (0x50)
  41. #define REG_PERI_CRG39 (0x9C)
  42. #define REG_PERI_CRG40 (0xA0)
  43. /* MCI */
  44. #define REG_BASE_MCI (0xF9830000)
  45. #define MCI_CDETECT (0x50)
  46. #define MCI_VERID (0x6C)
  47. #define MCI_VERID_VALUE (0x5342250A)
  48. #define MCI_VERID_VALUE2 (0x5342270A)
  49. /* EMMC */
  50. #define REG_EMMC_PERI_CRG REG_PERI_CRG40
  51. #define REG_SDCARD_PERI_CRG REG_PERI_CRG39
  52. #define EMMC_CLK_MASK (0x7 << 8)
  53. #define EMMC_SRST_REQ (0x1 << 4)
  54. #define EMMC_CKEN (0x1 << 1)
  55. #define EMMC_BUS_CKEN (0x1 << 0)
  56. #define EMMC_CLK_100M (0 << 8)
  57. #define EMMC_CLK_50M (1 << 8)
  58. #define EMMC_CLK_25M (2 << 8)
  59. #define EMMC_DESC_SIZE U(0x00100000) /* 1MB */
  60. #define EMMC_INIT_PARAMS(base) \
  61. { .bus_width = MMC_BUS_WIDTH_8, \
  62. .clk_rate = 25 * 1000 * 1000, \
  63. .desc_base = (base), \
  64. .desc_size = EMMC_DESC_SIZE, \
  65. .flags = MMC_FLAG_CMD23, \
  66. .reg_base = REG_BASE_MCI, \
  67. }
  68. /* GIC-400 */
  69. #define GICD_BASE (0xF1001000)
  70. #define GICC_BASE (0xF1002000)
  71. #define GICR_BASE (0xF1000000)
  72. /* FIQ platform related define */
  73. #define HISI_IRQ_SEC_SGI_0 8
  74. #define HISI_IRQ_SEC_SGI_1 9
  75. #define HISI_IRQ_SEC_SGI_2 10
  76. #define HISI_IRQ_SEC_SGI_3 11
  77. #define HISI_IRQ_SEC_SGI_4 12
  78. #define HISI_IRQ_SEC_SGI_5 13
  79. #define HISI_IRQ_SEC_SGI_6 14
  80. #define HISI_IRQ_SEC_SGI_7 15
  81. #define HISI_IRQ_SEC_PPI_0 29
  82. #define HISI_IRQ_SEC_TIMER0 60
  83. #define HISI_IRQ_SEC_TIMER1 50
  84. #define HISI_IRQ_SEC_TIMER2 52
  85. #define HISI_IRQ_SEC_TIMER3 88
  86. #define HISI_IRQ_SEC_AXI 110
  87. /* Watchdog */
  88. #define HISI_WDG0_BASE (0xF8A2C000)
  89. #define HISI_TZPC_BASE (0xF8A80000)
  90. #define HISI_TZPC_SEC_ATTR_CTRL (HISI_TZPC_BASE + 0x10)
  91. #endif /* HI3798CV200_H */