fparameters.h 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. /*
  2. * Copyright : (C) 2022 Phytium Information Technology, Inc.
  3. * All Rights Reserved.
  4. *
  5. * This program is OPEN SOURCE software: you can redistribute it and/or modify it
  6. * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd,
  7. * either version 1.0 of the License, or (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY;
  10. * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. * See the Phytium Public License for more details.
  12. *
  13. *
  14. * FilePath: fparameters.h
  15. * Date: 2022-02-10 14:53:42
  16. * LastEditTime: 2022-02-17 17:58:51
  17. * Description:  This file is for
  18. *
  19. * Modify History:
  20. * Ver   Who        Date         Changes
  21. * ----- ------     --------    --------------------------------------
  22. */
  23. #ifndef BSP_BOARD_D2000_PARAMETERS_H
  24. #define BSP_BOARD_D2000_PARAMETERS_H
  25. #ifdef __cplusplus
  26. extern "C"
  27. {
  28. #endif
  29. #if !defined(__ASSEMBLER__)
  30. #include "ftypes.h"
  31. #endif
  32. #define CORE0_AFF 0x0
  33. #define CORE1_AFF 0x1
  34. #define CORE2_AFF 0x100
  35. #define CORE3_AFF 0x101
  36. #define CORE4_AFF 0x200
  37. #define CORE5_AFF 0x201
  38. #define CORE6_AFF 0x300
  39. #define CORE7_AFF 0x301
  40. /* cache */
  41. #define CACHE_LINE_ADDR_MASK 0x3F
  42. #define CACHE_LINE 64U
  43. /* Device register address */
  44. #define FDEV_BASE_ADDR 0x28000000
  45. #define FDEV_END_ADDR 0x2FFFFFFF
  46. /* Generic Timer */
  47. #define GENERIC_TIMER_NS_IRQ_NUM 30
  48. /* PCI */
  49. #define FPCIE_NUM 1
  50. #define FPCIE0_ID 0
  51. #define FPCIE0_MISC_IRQ_NUM 59
  52. #define FPCIE_CFG_MAX_NUM_OF_BUS 256
  53. #define FPCIE_CFG_MAX_NUM_OF_DEV 32
  54. #define FPCIE_CFG_MAX_NUM_OF_FUN 8
  55. #define FPCI_CONFIG_BASE_ADDR 0x40000000
  56. #define FPCI_CONFIG_REG_LENGTH 0x10000000
  57. #define FPCI_IO_CONFIG_BASE_ADDR 0x50000000
  58. #define FPCI_IO_CONFIG_REG_LENGTH 0x08000000
  59. #define FPCI_MEM32_BASE_ADDR 0x58000000
  60. #define FPCI_MEM32_REG_LENGTH 0x27ffffff
  61. #define FPCI_MEM64_BASE_ADDR 0x1000000000
  62. #define FPCI_MEM64_REG_LENGTH 0x1000000000
  63. #define FPCI_EU0_C0_CONTROL_BASE_ADDR 0x29900000
  64. #define FPCI_EU0_C1_CONTROL_BASE_ADDR 0x29910000
  65. #define FPCI_EU0_C2_CONTROL_BASE_ADDR 0x29920000
  66. #define FPCI_EU1_C0_CONTROL_BASE_ADDR 0x29930000
  67. #define FPCI_EU1_C1_CONTROL_BASE_ADDR 0x29940000
  68. #define FPCI_EU1_C2_CONTROL_BASE_ADDR 0x29950000
  69. #define FPCI_EU0_CONFIG_BASE_ADDR 0x29900000
  70. #define FPCI_EU1_CONFIG_BASE_ADDR 0x299A0000
  71. #define FPCI_INTA_IRQ_NUM 60
  72. #define FPCI_INTB_IRQ_NUM 61
  73. #define FPCI_INTC_IRQ_NUM 62
  74. #define FPCI_INTD_IRQ_NUM 63
  75. #define FPCI_NEED_SKIP 0
  76. #define FPCI_INTX_EOI
  77. #define FPCI_INTX_PEU0_STAT 0x29100000
  78. #define FPCI_INTX_PEU1_STAT 0x29101000
  79. #define FPCI_INTX_EU0_C0_CONTROL 0x29000184
  80. #define FPCI_INTX_EU0_C1_CONTROL 0x29010184
  81. #define FPCI_INTX_EU0_C2_CONTROL 0x29020184
  82. #define FPCI_INTX_EU1_C0_CONTROL 0x29030184
  83. #define FPCI_INTX_EU1_C1_CONTROL 0x29040184
  84. #define FPCI_INTX_EU1_C2_CONTROL 0x29050184
  85. #define FPCI_INTX_CONTROL_NUM 6 /* Total number of controllers */
  86. #define FPCI_INTX_SATA_NUM 2 /* Total number of controllers */
  87. /* platform ahci host */
  88. #define PLAT_AHCI_HOST_MAX_COUNT 5
  89. #define AHCI_BASE_0 0
  90. #define AHCI_BASE_1 0
  91. #define AHCI_BASE_2 0
  92. #define AHCI_BASE_3 0
  93. #define AHCI_BASE_4 0
  94. #define AHCI_IRQ_0 0
  95. #define AHCI_IRQ_1 0
  96. #define AHCI_IRQ_2 0
  97. #define AHCI_IRQ_3 0
  98. #define AHCI_IRQ_4 0
  99. /* UART */
  100. #if !defined(__ASSEMBLER__)
  101. enum
  102. {
  103. FUART0_ID = 0,
  104. FUART1_ID,
  105. FUART2_ID,
  106. FUART3_ID,
  107. FUART_NUM
  108. };
  109. #endif
  110. #define FUART0_IRQ_NUM 38
  111. #define FUART0_BASE_ADDR 0x28000000
  112. #define FUART0_CLK_FREQ_HZ 48000000
  113. #define FUART1_IRQ_NUM 39
  114. #define FUART1_BASE_ADDR 0x28001000
  115. #define FUART1_CLK_FREQ_HZ 48000000
  116. #define FUART2_IRQ_NUM 40
  117. #define FUART2_BASE_ADDR 0x28002000
  118. #define FUART2_CLK_FREQ_HZ 48000000
  119. #define FUART3_IRQ_NUM 41
  120. #define FUART3_BASE_ADDR 0x28003000
  121. #define FUART3_CLK_FREQ_HZ 48000000
  122. #define FT_STDOUT_BASE_ADDR FUART1_BASE_ADDR
  123. #define FT_STDIN_BASE_ADDR FUART1_BASE_ADDR
  124. /* QSPI */
  125. #if !defined(__ASSEMBLER__)
  126. enum
  127. {
  128. FQSPI0_ID = 0,
  129. FQSPI_NUM
  130. };
  131. /* FQSPI cs 0_3, chip number */
  132. enum
  133. {
  134. FQSPI_CS_0 = 0,
  135. FQSPI_CS_1 = 1,
  136. FQSPI_CS_2 = 2,
  137. FQSPI_CS_3 = 3,
  138. FQSPI_CS_NUM
  139. };
  140. #endif
  141. #define FQSPI_BASE_ADDR 0x28014000
  142. #define FQSPI_MEM_START_ADDR 0x0
  143. #define FQSPI_MEM_END_ADDR 0x1FFFFFFF
  144. /* GIC v3 */
  145. #define ARM_GIC_NR_IRQS 1024
  146. #define ARM_GIC_IRQ_START 0
  147. #define FGIC_NUM 1
  148. #define GICV3_BASE_ADDR 0x29a00000U
  149. #define GICV3_DISTRIBUTOR_BASE_ADDR (GICV3_BASE_ADDR + 0)
  150. #define GICV3_RD_BASE_ADDR (GICV3_BASE_ADDR + 0x100000U)
  151. #define GICV3_RD_OFFSET (2U << 16)
  152. #define FT_GICV3_VECTORTABLE_NUM GIC_INT_MAX_NUM
  153. /*
  154. * The maximum priority value that can be used in the GIC.
  155. */
  156. #define GICV3_MAX_INTR_PRIO_VAL 240U
  157. #define GICV3_INTR_PRIO_MASK 0x000000f0U
  158. #define ARM_GIC_IPI_COUNT 16 /* MPCore IPI count */
  159. #define SGI_INT_MAX 16
  160. #define SPI_START_INT_NUM 32 /* SPI start at ID32 */
  161. #define PPI_START_INT_NUM 16 /* PPI start at ID16 */
  162. #define GIC_INT_MAX_NUM 1020 /* GIC max interrupts count */
  163. /* GPIO */
  164. #define FGPIO0_BASE_ADDR (0x28004000)
  165. #define FGPIO1_BASE_ADDR (0x28005000)
  166. #define FGPIO0_ID 0
  167. #define FGPIO1_ID 1
  168. #define FGPIO_NUM 2
  169. #define FGPIO0_IRQ_NUM (42) /* gpio0 irq number */
  170. #define FGPIO1_IRQ_NUM (43) /* gpio1 irq number */
  171. /* IOMUX */
  172. #define FIOCTRL_REG_BASE_ADDR 0x28180000
  173. /* SPI */
  174. #define FSPI0_BASE_ADDR 0x2800c000
  175. #define FSPI1_BASE_ADDR 0x28013000
  176. #define FSPI0_ID 0
  177. #define FSPI1_ID 1
  178. #define FSPI_CLK_FREQ_HZ 48000000
  179. #define FSPI_NUM 2
  180. #define FSPI0_IRQ_NUM 50
  181. #define FSPI1_IRQ_NUM 51
  182. /* I2C */
  183. #if !defined(__ASSEMBLER__)
  184. enum
  185. {
  186. FI2C0_ID = 0,
  187. FI2C1_ID = 1,
  188. FI2C2_ID,
  189. FI2C3_ID,
  190. FI2C_NUM
  191. };
  192. #endif
  193. #define FI2C0_BASE_ADDR 0x28006000
  194. #define FI2C1_BASE_ADDR 0x28007000
  195. #define FI2C2_BASE_ADDR 0x28008000
  196. #define FI2C3_BASE_ADDR 0x28009000
  197. #define FI2C0_IRQ_NUM 44
  198. #define FI2C1_IRQ_NUM 45
  199. #define FI2C2_IRQ_NUM 46
  200. #define FI2C3_IRQ_NUM 47
  201. #define FI2C_CLK_FREQ_HZ 48000000 /* 48MHz */
  202. /* WDT */
  203. #if !defined(__ASSEMBLER__)
  204. enum
  205. {
  206. FWDT0_ID = 0,
  207. FWDT1_ID = 1,
  208. FWDT_NUM
  209. };
  210. #endif
  211. #define FWDT0_REFRESH_BASE_ADDR 0x2800a000
  212. #define FWDT1_REFRESH_BASE_ADDR 0x28016000
  213. #define FWDT_CONTROL_BASE_ADDR(x) ((x)+0x1000)
  214. #define FWDT0_IRQ_NUM 48
  215. #define FWDT1_IRQ_NUM 49
  216. #define FWDT_CLK_FREQ_HZ 48000000 /* 48MHz */
  217. /* SDCI */
  218. #if !defined(__ASSEMBLER__)
  219. enum
  220. {
  221. FSDMMC0_ID = 0,
  222. FSDMMC_NUM
  223. };
  224. #endif
  225. #define FSDMMC0_BASE_ADDR 0x28207C00
  226. #define FSDMMC0_DMA_IRQ_NUM 52
  227. #define FSDMMC0_CMD_IRQ_NUM 53
  228. #define FSDMMC0_ERR_IRQ_NUM 54
  229. #define FSDMMC_CLK_FREQ_HZ 600000000 /* 600 MHz */
  230. /* GMAC */
  231. #define FGMAC_PUB_REG_BASE_ADDR 0x2820B000 /* 公共寄存器基地址 */
  232. #if !defined(__ASSEMBLER__)
  233. enum
  234. {
  235. FGMAC0_ID = 0,
  236. FGMAC1_ID,
  237. FGMAC_NUM
  238. };
  239. #endif
  240. #define FGMAC0_BASE_ADDR 0x2820C000
  241. #define FGMAC1_BASE_ADDR 0x28210000
  242. #define FGMAC0_IRQ_NUM 81
  243. #define FGMAC1_IRQ_NUM 82
  244. #define FGMAC_DMA_MIN_ALIGN 128
  245. #define FGMAC_MAX_PACKET_SIZE 1600
  246. /* rtc base address */
  247. #define RTC_CONTROL_BASE 0x2800D000
  248. #define FT_CPUS_NR CORE_NUM
  249. /* can */
  250. #define FCAN_CLK_FREQ_HZ 600000000
  251. #define FCAN_REG_LENGTH 0x1000
  252. #define FCAN0_BASE_ADDR 0x28207000
  253. #define FCAN1_BASE_ADDR 0x28207400
  254. #define FCAN2_BASE_ADDR 0x28207800
  255. #define FCAN0_IRQ_NUM 119
  256. #define FCAN1_IRQ_NUM 123
  257. #define FCAN2_IRQNUM 124
  258. #if !defined(__ASSEMBLER__)
  259. enum
  260. {
  261. FCAN0_ID = 0,
  262. FCAN1_ID = 1,
  263. FCAN2_ID = 2,
  264. FCAN_NUM
  265. };
  266. #endif
  267. #ifdef __cplusplus
  268. }
  269. #endif
  270. #endif // !