soc.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. /*
  2. * Copyright 2018-2021 NXP
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. *
  6. */
  7. #ifndef _SOC_H
  8. #define _SOC_H
  9. /* Chassis specific defines - common across SoC's of a particular platform */
  10. #include <dcfg_lsch3.h>
  11. #include <soc_default_base_addr.h>
  12. #include <soc_default_helper_macros.h>
  13. #define NUM_DRAM_REGIONS 3
  14. #define NXP_DRAM0_ADDR 0x80000000
  15. #define NXP_DRAM0_MAX_SIZE 0x80000000 /* 2 GB */
  16. #define NXP_DRAM1_ADDR 0x2080000000
  17. #define NXP_DRAM1_MAX_SIZE 0x1F80000000 /* 126 G */
  18. #define NXP_DRAM2_ADDR 0x6000000000
  19. #define NXP_DRAM2_MAX_SIZE 0x2000000000 /* 128G */
  20. /*DRAM0 Size defined in platform_def.h */
  21. #define NXP_DRAM0_SIZE PLAT_DEF_DRAM0_SIZE
  22. #define DDR_PLL_FIX
  23. #define NXP_DDR_PHY1_ADDR 0x01400000
  24. #define NXP_DDR_PHY2_ADDR 0x01600000
  25. #if defined(IMAGE_BL31)
  26. #define LS_SYS_TIMCTL_BASE 0x2890000
  27. #ifdef LS_SYS_TIMCTL_BASE
  28. #define PLAT_LS_NSTIMER_FRAME_ID 0
  29. #define LS_CONFIG_CNTACR 1
  30. #endif
  31. #endif
  32. /* Start: Macros used by soc.c: get_boot_dev */
  33. #define PORSR1_RCW_MASK 0x07800000
  34. #define PORSR1_RCW_SHIFT 23
  35. #define SDHC1_VAL 0x8
  36. #define SDHC2_VAL 0x9
  37. #define I2C1_VAL 0xa
  38. #define FLEXSPI_NAND2K_VAL 0xc
  39. #define FLEXSPI_NAND4K_VAL 0xd
  40. #define FLEXSPI_NOR 0xf
  41. /* End: Macros used by soc.c: get_boot_dev */
  42. /* SVR Definition (not include major and minor rev) */
  43. #define SVR_LX2160A 0x873601
  44. #define SVR_LX2160E 0x873610
  45. #define SVR_LX2160C 0x873600
  46. #define SVR_LX2160N 0x873611
  47. #define SVR_LX2120A 0x873621
  48. #define SVR_LX2120E 0x873630
  49. #define SVR_LX2120C 0x873620
  50. #define SVR_LX2120N 0x873631
  51. #define SVR_LX2080A 0x873603
  52. #define SVR_LX2080E 0x873612
  53. #define SVR_LX2080C 0x873602
  54. #define SVR_LX2080N 0x873613
  55. /* SVR Definition of SoC LX2162A. */
  56. #define SVR_LX2162A 0x873609
  57. #define SVR_LX2162E 0x873618
  58. #define SVR_LX2162C 0x873608
  59. #define SVR_LX2162N 0x873619
  60. #define SVR_LX2122A 0x873629
  61. #define SVR_LX2122E 0x873638
  62. #define SVR_LX2122C 0x873628
  63. #define SVR_LX2122N 0x873639
  64. #define SVR_LX2082A 0x87360b
  65. #define SVR_LX2082E 0x87361a
  66. #define SVR_LX2082C 0x87360a
  67. #define SVR_LX2082N 0x87361b
  68. /* Number of cores in platform */
  69. /* Used by common code for array initialization */
  70. #define NUMBER_OF_CLUSTERS 8
  71. #define CORES_PER_CLUSTER 2
  72. #define PLATFORM_CORE_COUNT NUMBER_OF_CLUSTERS * CORES_PER_CLUSTER
  73. /*
  74. * Required LS standard platform porting definitions
  75. * for CCN-508
  76. */
  77. #define PLAT_CLUSTER_TO_CCN_ID_MAP 11, 15, 27, 31, 12, 28, 16, 0
  78. #define PLAT_6CLUSTER_TO_CCN_ID_MAP 11, 15, 27, 31, 12, 28
  79. /* Defines required for using XLAT tables from ARM common code */
  80. #define PLAT_PHY_ADDR_SPACE_SIZE (1ull << 40)
  81. #define PLAT_VIRT_ADDR_SPACE_SIZE (1ull << 40)
  82. /* Clock Divisors */
  83. #define NXP_PLATFORM_CLK_DIVIDER 2
  84. #define NXP_UART_CLK_DIVIDER 4
  85. /* Start: Macros used by lx2160a.S */
  86. #define MPIDR_AFFINITY0_MASK 0x00FF
  87. #define MPIDR_AFFINITY1_MASK 0xFF00
  88. #define CPUECTLR_DISABLE_TWALK_PREFETCH 0x4000000000
  89. #define CPUECTLR_INS_PREFETCH_MASK 0x1800000000
  90. #define CPUECTLR_DAT_PREFETCH_MASK 0x0300000000
  91. #define CPUECTLR_RET_8CLK 0x2
  92. #define OSDLR_EL1_DLK_LOCK 0x1
  93. #define CNTP_CTL_EL0_EN 0x1
  94. #define CNTP_CTL_EL0_IMASK 0x2
  95. /* set to 0 if the clusters are not symmetrical */
  96. #define SYMMETRICAL_CLUSTERS 1
  97. /* End: Macros used by lx2160a.S */
  98. /* Start: Macros used by lib/psci files */
  99. #define SYSTEM_PWR_DOMAINS 1
  100. #define PLAT_NUM_PWR_DOMAINS (PLATFORM_CORE_COUNT + \
  101. NUMBER_OF_CLUSTERS + \
  102. SYSTEM_PWR_DOMAINS)
  103. /* Power state coordination occurs at the system level */
  104. #define PLAT_MAX_PWR_LVL MPIDR_AFFLVL2
  105. /* define retention state */
  106. #define PLAT_MAX_RET_STATE (PSCI_LOCAL_STATE_RUN + 1)
  107. /* define power-down state */
  108. #define PLAT_MAX_OFF_STATE (PLAT_MAX_RET_STATE + 1)
  109. /* End: Macros used by lib/psci files */
  110. /* Some data must be aligned on the biggest cache line size in the platform.
  111. * This is known only to the platform as it might have a combination of
  112. * integrated and external caches.
  113. *
  114. * CACHE_WRITEBACK_GRANULE is defined in soc.def
  115. *
  116. * One cache line needed for bakery locks on ARM platforms
  117. */
  118. #define PLAT_PERCPU_BAKERY_LOCK_SIZE (1 * CACHE_WRITEBACK_GRANULE)
  119. #ifndef WDOG_RESET_FLAG
  120. #define WDOG_RESET_FLAG DEFAULT_SET_VALUE
  121. #endif
  122. #ifndef WARM_BOOT_SUCCESS
  123. #define WARM_BOOT_SUCCESS DEFAULT_SET_VALUE
  124. #endif
  125. #ifndef __ASSEMBLER__
  126. void set_base_freq_CNTFID0(void);
  127. void soc_init_start(void);
  128. void soc_init_finish(void);
  129. void soc_init_percpu(void);
  130. void _soc_set_start_addr(unsigned long addr);
  131. void _set_platform_security(void);
  132. #endif
  133. #endif /* _SOC_H */