socfpga_plat_def.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. /*
  2. * Copyright (c) 2019-2023, ARM Limited and Contributors. All rights reserved.
  3. * Copyright (c) 2024, Altera Corporation. All rights reserved.
  4. *
  5. * SPDX-License-Identifier: BSD-3-Clause
  6. */
  7. #ifndef PLAT_SOCFPGA_DEF_H
  8. #define PLAT_SOCFPGA_DEF_H
  9. #include <platform_def.h>
  10. #include <lib/utils_def.h>
  11. #include "s10_system_manager.h"
  12. /* Platform Setting */
  13. #define PLATFORM_MODEL PLAT_SOCFPGA_STRATIX10
  14. #define PLAT_PRIMARY_CPU 0
  15. #define PLAT_CLUSTER_ID_MPIDR_AFF_SHIFT MPIDR_AFF1_SHIFT
  16. #define PLAT_CPU_ID_MPIDR_AFF_SHIFT MPIDR_AFF0_SHIFT
  17. #define PLAT_HANDOFF_OFFSET 0xFFE3F000
  18. #define PLAT_TIMER_BASE_ADDR 0xFFD01000
  19. /* FPGA config helpers */
  20. #define INTEL_SIP_SMC_FPGA_CONFIG_ADDR 0x400000
  21. #define INTEL_SIP_SMC_FPGA_CONFIG_SIZE 0x1000000
  22. /* QSPI Setting */
  23. #define CAD_QSPIDATA_OFST 0xff900000
  24. #define CAD_QSPI_OFFSET 0xff8d2000
  25. /* FIP Setting */
  26. #define PLAT_FIP_BASE (0)
  27. #define PLAT_FIP_MAX_SIZE (0x1000000)
  28. /* SDMMC Setting */
  29. #define PLAT_MMC_DATA_BASE (0xffe3c000)
  30. #define PLAT_MMC_DATA_SIZE (0x2000)
  31. #define SOCFPGA_MMC_BLOCK_SIZE U(8192)
  32. /* Register Mapping */
  33. #define SOCFPGA_CCU_NOC_REG_BASE 0xf7000000
  34. #define SOCFPGA_F2SDRAMMGR_REG_BASE U(0xf8024000)
  35. #define SOCFPGA_MMC_REG_BASE 0xff808000
  36. #define SOCFPGA_RSTMGR_REG_BASE 0xffd11000
  37. #define SOCFPGA_SYSMGR_REG_BASE 0xffd12000
  38. #define SOCFPGA_ECC_QSPI_REG_BASE 0xffa22000
  39. #define SOCFPGA_L4_PER_SCR_REG_BASE 0xffd21000
  40. #define SOCFPGA_L4_SYS_SCR_REG_BASE 0xffd21100
  41. #define SOCFPGA_SOC2FPGA_SCR_REG_BASE 0xffd21200
  42. #define SOCFPGA_LWSOC2FPGA_SCR_REG_BASE 0xffd21300
  43. /*******************************************************************************
  44. * Platform memory map related constants
  45. ******************************************************************************/
  46. #define DRAM_BASE (0x0)
  47. #define DRAM_SIZE (0x80000000)
  48. #define OCRAM_BASE (0xFFE00000)
  49. #define OCRAM_SIZE (0x00040000)
  50. #define MEM64_BASE (0x0100000000)
  51. #define MEM64_SIZE (0x1F00000000)
  52. #define DEVICE1_BASE (0x80000000)
  53. #define DEVICE1_SIZE (0x60000000)
  54. #define DEVICE2_BASE (0xF7000000)
  55. #define DEVICE2_SIZE (0x08E00000)
  56. #define DEVICE3_BASE (0xFFFC0000)
  57. #define DEVICE3_SIZE (0x00008000)
  58. #define DEVICE4_BASE (0x2000000000)
  59. #define DEVICE4_SIZE (0x0100000000)
  60. #define BL2_BASE (0xffe00000)
  61. #define BL2_LIMIT (0xffe2b000)
  62. #define BL31_BASE (0x1000)
  63. #define BL31_LIMIT (0x81000)
  64. /*******************************************************************************
  65. * UART related constants
  66. ******************************************************************************/
  67. #define PLAT_UART0_BASE (0xFFC02000)
  68. #define PLAT_UART1_BASE (0xFFC02100)
  69. /*******************************************************************************
  70. * WDT related constants
  71. ******************************************************************************/
  72. #define WDT_BASE (0xFFD00200)
  73. /*******************************************************************************
  74. * GIC related constants
  75. ******************************************************************************/
  76. #define PLAT_GIC_BASE (0xFFFC0000)
  77. #define PLAT_GICC_BASE (PLAT_GIC_BASE + 0x2000)
  78. #define PLAT_GICD_BASE (PLAT_GIC_BASE + 0x1000)
  79. #define PLAT_GICR_BASE 0
  80. #define PLAT_SYS_COUNTER_FREQ_IN_TICKS (400000000)
  81. #define PLAT_HZ_CONVERT_TO_MHZ (1000000)
  82. /*******************************************************************************
  83. * SDMMC related pointer function
  84. ******************************************************************************/
  85. #define SDMMC_READ_BLOCKS mmc_read_blocks
  86. #define SDMMC_WRITE_BLOCKS mmc_write_blocks
  87. /*******************************************************************************
  88. * sysmgr.boot_scratch_cold6 & 7 (64bit) are used to indicate L2 reset
  89. * is done and HPS should trigger warm reset via RMR_EL3.
  90. ******************************************************************************/
  91. #define L2_RESET_DONE_REG 0xFFD12218
  92. /* Platform specific system counter */
  93. #define PLAT_SYS_COUNTER_FREQ_IN_MHZ U(400)
  94. #endif /* PLATSOCFPGA_DEF_H */