soc.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. /*
  2. * Copyright 2018-2021 NXP
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef SOC_H
  7. #define SOC_H
  8. /* Chassis specific defines - common across SoC's of a particular platform */
  9. #include <dcfg_lsch3.h>
  10. #include <soc_default_base_addr.h>
  11. #include <soc_default_helper_macros.h>
  12. /*
  13. * SVR Definition of LS1028A
  14. * (not include major and minor rev)
  15. * These info is listed in Table B-6. DCFG differences
  16. * between LS1028A and LS1027A of LS1028ARM(Reference Manual)
  17. */
  18. #define SVR_LS1017AN 0x870B25
  19. #define SVR_LS1017AE 0x870B24
  20. #define SVR_LS1018AN 0x870B21
  21. #define SVR_LS1018AE 0x870B20
  22. #define SVR_LS1027AN 0x870B05
  23. #define SVR_LS1027AE 0x870B04
  24. #define SVR_LS1028AN 0x870B01
  25. #define SVR_LS1028AE 0x870B00
  26. /* Number of cores in platform */
  27. #define PLATFORM_CORE_COUNT 2
  28. #define NUMBER_OF_CLUSTERS 1
  29. #define CORES_PER_CLUSTER 2
  30. /* Set to 0 if the clusters are not symmetrical */
  31. #define SYMMETRICAL_CLUSTERS 1
  32. #define NUM_DRAM_REGIONS 3
  33. #define NXP_DRAM0_ADDR 0x80000000
  34. #define NXP_DRAM0_MAX_SIZE 0x80000000 /* 2GB */
  35. #define NXP_DRAM1_ADDR 0x2080000000
  36. #define NXP_DRAM1_MAX_SIZE 0x1F80000000 /* 126G */
  37. #define NXP_DRAM2_ADDR 0x6000000000
  38. #define NXP_DRAM2_MAX_SIZE 0x2000000000 /* 128G */
  39. /* DRAM0 Size defined in platform_def.h */
  40. #define NXP_DRAM0_SIZE PLAT_DEF_DRAM0_SIZE
  41. /* CCSR space memory Map */
  42. #undef NXP_UART_ADDR
  43. #define NXP_UART_ADDR 0x021C0500
  44. #undef NXP_UART1_ADDR
  45. #define NXP_UART1_ADDR 0x021C0600
  46. #undef NXP_WDOG1_TZ_ADDR
  47. #define NXP_WDOG1_TZ_ADDR 0x023C0000
  48. #undef NXP_GICR_ADDR
  49. #define NXP_GICR_ADDR 0x06040000
  50. #undef NXP_GICR_SGI_ADDR
  51. #define NXP_GICR_SGI_ADDR 0x06050000
  52. /* EPU register offsets and values */
  53. #define EPU_EPGCR_OFFSET 0x0
  54. #define EPU_EPIMCR10_OFFSET 0x128
  55. #define EPU_EPCTR10_OFFSET 0xa28
  56. #define EPU_EPCCR10_OFFSET 0x828
  57. #define EPU_EPCCR10_VAL 0xb2800000
  58. #define EPU_EPIMCR10_VAL 0xba000000
  59. #define EPU_EPCTR10_VAL 0x0
  60. #define EPU_EPGCR_VAL (1 << 31)
  61. /* PORSR1 */
  62. #define PORSR1_RCW_MASK 0x07800000
  63. #define PORSR1_RCW_SHIFT 23
  64. #define SDHC1_VAL 0x8
  65. #define SDHC2_VAL 0x9
  66. #define I2C1_VAL 0xa
  67. #define FLEXSPI_NAND2K_VAL 0xc
  68. #define FLEXSPI_NAND4K_VAL 0xd
  69. #define FLEXSPI_NOR 0xf
  70. /*
  71. * Required LS standard platform porting definitions
  72. * for CCI-400
  73. */
  74. #define NXP_CCI_CLUSTER0_SL_IFACE_IX 4
  75. /* Defines required for using XLAT tables from ARM common code */
  76. #define PLAT_PHY_ADDR_SPACE_SIZE (1ull << 40)
  77. #define PLAT_VIRT_ADDR_SPACE_SIZE (1ull << 40)
  78. /* Clock Divisors */
  79. #define NXP_PLATFORM_CLK_DIVIDER 1
  80. #define NXP_UART_CLK_DIVIDER 2
  81. /* dcfg register offsets and values */
  82. #define DCFG_DEVDISR2_ENETC (1 << 31)
  83. #define MPIDR_AFFINITY0_MASK 0x00FF
  84. #define MPIDR_AFFINITY1_MASK 0xFF00
  85. #define CPUECTLR_DISABLE_TWALK_PREFETCH 0x4000000000
  86. #define CPUECTLR_INS_PREFETCH_MASK 0x1800000000
  87. #define CPUECTLR_DAT_PREFETCH_MASK 0x0300000000
  88. #define OSDLR_EL1_DLK_LOCK 0x1
  89. #define CNTP_CTL_EL0_EN 0x1
  90. #define CNTP_CTL_EL0_IMASK 0x2
  91. #define SYSTEM_PWR_DOMAINS 1
  92. #define PLAT_NUM_PWR_DOMAINS (PLATFORM_CORE_COUNT + \
  93. NUMBER_OF_CLUSTERS + \
  94. SYSTEM_PWR_DOMAINS)
  95. /* Power state coordination occurs at the system level */
  96. #define PLAT_PD_COORD_LVL MPIDR_AFFLVL2
  97. #define PLAT_MAX_PWR_LVL PLAT_PD_COORD_LVL
  98. /* Local power state for power domains in Run state */
  99. #define LS_LOCAL_STATE_RUN PSCI_LOCAL_STATE_RUN
  100. /* define retention state */
  101. #define PLAT_MAX_RET_STATE (PSCI_LOCAL_STATE_RUN + 1)
  102. #define LS_LOCAL_STATE_RET PLAT_MAX_RET_STATE
  103. /* define power-down state */
  104. #define PLAT_MAX_OFF_STATE (PLAT_MAX_RET_STATE + 1)
  105. #define LS_LOCAL_STATE_OFF PLAT_MAX_OFF_STATE
  106. /* One cache line needed for bakery locks on ARM platforms */
  107. #define PLAT_PERCPU_BAKERY_LOCK_SIZE (1 * CACHE_WRITEBACK_GRANULE)
  108. #ifndef __ASSEMBLER__
  109. /* CCI slave interfaces */
  110. static const int cci_map[] = {
  111. NXP_CCI_CLUSTER0_SL_IFACE_IX,
  112. };
  113. void soc_init_lowlevel(void);
  114. void soc_init_percpu(void);
  115. void _soc_set_start_addr(unsigned long addr);
  116. void _set_platform_security(void);
  117. #endif
  118. #endif /* SOC_H */