Hadi Asyrafi | 9f5dfc9 | 2019-10-23 16:26:53 +0800 | [diff] [blame] | 1 | /* |
Jit Loon Lim | 28c1c78 | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 2 | * Copyright (c) 2019-2023, ARM Limited and Contributors. All rights reserved. |
Hadi Asyrafi | 9f5dfc9 | 2019-10-23 16:26:53 +0800 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #ifndef PLAT_SOCFPGA_DEF_H |
| 8 | #define PLAT_SOCFPGA_DEF_H |
| 9 | |
| 10 | #include <platform_def.h> |
Jit Loon Lim | 28c1c78 | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 11 | #include "s10_system_manager.h" |
Hadi Asyrafi | 9f5dfc9 | 2019-10-23 16:26:53 +0800 | [diff] [blame] | 12 | |
| 13 | /* Platform Setting */ |
Jit Loon Lim | 28c1c78 | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 14 | #define PLATFORM_MODEL PLAT_SOCFPGA_STRATIX10 |
| 15 | #define BOOT_SOURCE BOOT_SOURCE_SDMMC |
| 16 | #define PLAT_PRIMARY_CPU 0 |
| 17 | #define PLAT_CLUSTER_ID_MPIDR_AFF_SHIFT MPIDR_AFF1_SHIFT |
| 18 | #define PLAT_CPU_ID_MPIDR_AFF_SHIFT MPIDR_AFF0_SHIFT |
Hadi Asyrafi | 9f5dfc9 | 2019-10-23 16:26:53 +0800 | [diff] [blame] | 19 | |
Sieu Mun Tang | a544da1 | 2022-02-28 15:24:59 +0800 | [diff] [blame] | 20 | /* FPGA config helpers */ |
| 21 | #define INTEL_SIP_SMC_FPGA_CONFIG_ADDR 0x400000 |
| 22 | #define INTEL_SIP_SMC_FPGA_CONFIG_SIZE 0x1000000 |
| 23 | |
Jit Loon Lim | 28c1c78 | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 24 | /* QSPI Setting */ |
| 25 | #define CAD_QSPIDATA_OFST 0xff900000 |
| 26 | #define CAD_QSPI_OFFSET 0xff8d2000 |
| 27 | |
Hadi Asyrafi | 9f5dfc9 | 2019-10-23 16:26:53 +0800 | [diff] [blame] | 28 | /* Register Mapping */ |
Abdul Halim, Muhammad Hadi Asyrafi | 616b5e7 | 2020-08-05 22:12:23 +0800 | [diff] [blame] | 29 | #define SOCFPGA_CCU_NOC_REG_BASE 0xf7000000 |
Sieu Mun Tang | 82cf5df | 2022-05-05 17:07:21 +0800 | [diff] [blame] | 30 | #define SOCFPGA_F2SDRAMMGR_REG_BASE U(0xf8024000) |
Abdul Halim, Muhammad Hadi Asyrafi | 616b5e7 | 2020-08-05 22:12:23 +0800 | [diff] [blame] | 31 | |
Hadi Asyrafi | 9f5dfc9 | 2019-10-23 16:26:53 +0800 | [diff] [blame] | 32 | #define SOCFPGA_MMC_REG_BASE 0xff808000 |
Hadi Asyrafi | 8ebd237 | 2019-12-23 17:58:04 +0800 | [diff] [blame] | 33 | |
Hadi Asyrafi | 67cb0ea | 2019-12-23 13:25:33 +0800 | [diff] [blame] | 34 | #define SOCFPGA_RSTMGR_REG_BASE 0xffd11000 |
Hadi Asyrafi | 8ebd237 | 2019-12-23 17:58:04 +0800 | [diff] [blame] | 35 | #define SOCFPGA_SYSMGR_REG_BASE 0xffd12000 |
| 36 | |
| 37 | #define SOCFPGA_L4_PER_SCR_REG_BASE 0xffd21000 |
| 38 | #define SOCFPGA_L4_SYS_SCR_REG_BASE 0xffd21100 |
| 39 | #define SOCFPGA_SOC2FPGA_SCR_REG_BASE 0xffd21200 |
| 40 | #define SOCFPGA_LWSOC2FPGA_SCR_REG_BASE 0xffd21300 |
| 41 | |
Jit Loon Lim | 28c1c78 | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 42 | /******************************************************************************* |
| 43 | * Platform memory map related constants |
| 44 | ******************************************************************************/ |
| 45 | #define DRAM_BASE (0x0) |
| 46 | #define DRAM_SIZE (0x80000000) |
| 47 | |
| 48 | #define OCRAM_BASE (0xFFE00000) |
| 49 | #define OCRAM_SIZE (0x00040000) |
| 50 | |
| 51 | #define MEM64_BASE (0x0100000000) |
| 52 | #define MEM64_SIZE (0x1F00000000) |
| 53 | |
| 54 | #define DEVICE1_BASE (0x80000000) |
| 55 | #define DEVICE1_SIZE (0x60000000) |
| 56 | |
| 57 | #define DEVICE2_BASE (0xF7000000) |
| 58 | #define DEVICE2_SIZE (0x08E00000) |
| 59 | |
| 60 | #define DEVICE3_BASE (0xFFFC0000) |
| 61 | #define DEVICE3_SIZE (0x00008000) |
| 62 | |
| 63 | #define DEVICE4_BASE (0x2000000000) |
| 64 | #define DEVICE4_SIZE (0x0100000000) |
| 65 | |
| 66 | #define BL2_BASE (0xffe00000) |
Jit Loon Lim | f6186b2 | 2023-09-27 11:02:45 +0800 | [diff] [blame] | 67 | #define BL2_LIMIT (0xffe2b000) |
Jit Loon Lim | 28c1c78 | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 68 | |
| 69 | #define BL31_BASE (0x1000) |
| 70 | #define BL31_LIMIT (0x81000) |
| 71 | |
| 72 | /******************************************************************************* |
| 73 | * UART related constants |
| 74 | ******************************************************************************/ |
| 75 | #define PLAT_UART0_BASE (0xFFC02000) |
| 76 | #define PLAT_UART1_BASE (0xFFC02100) |
| 77 | |
| 78 | /******************************************************************************* |
Sieu Mun Tang | 6284537 | 2023-06-09 23:33:36 +0800 | [diff] [blame] | 79 | * WDT related constants |
| 80 | ******************************************************************************/ |
| 81 | #define WDT_BASE (0xFFD00200) |
| 82 | |
| 83 | /******************************************************************************* |
Jit Loon Lim | 28c1c78 | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 84 | * GIC related constants |
| 85 | ******************************************************************************/ |
| 86 | #define PLAT_GIC_BASE (0xFFFC0000) |
| 87 | #define PLAT_GICC_BASE (PLAT_GIC_BASE + 0x2000) |
| 88 | #define PLAT_GICD_BASE (PLAT_GIC_BASE + 0x1000) |
| 89 | #define PLAT_GICR_BASE 0 |
| 90 | |
| 91 | #define PLAT_SYS_COUNTER_FREQ_IN_TICKS (400000000) |
| 92 | #define PLAT_HZ_CONVERT_TO_MHZ (1000000) |
| 93 | |
Jit Loon Lim | 4c249f1 | 2023-05-17 12:26:11 +0800 | [diff] [blame] | 94 | /******************************************************************************* |
| 95 | * SDMMC related pointer function |
| 96 | ******************************************************************************/ |
| 97 | #define SDMMC_READ_BLOCKS mmc_read_blocks |
| 98 | #define SDMMC_WRITE_BLOCKS mmc_write_blocks |
| 99 | |
| 100 | /******************************************************************************* |
| 101 | * sysmgr.boot_scratch_cold6 & 7 (64bit) are used to indicate L2 reset |
| 102 | * is done and HPS should trigger warm reset via RMR_EL3. |
| 103 | ******************************************************************************/ |
| 104 | #define L2_RESET_DONE_REG 0xFFD12218 |
| 105 | |
BenjaminLimJL | a4a4327 | 2022-04-06 10:19:16 +0800 | [diff] [blame] | 106 | /* Platform specific system counter */ |
| 107 | #define PLAT_SYS_COUNTER_FREQ_IN_MHZ get_cpu_clk() |
| 108 | |
Hadi Asyrafi | 9f5dfc9 | 2019-10-23 16:26:53 +0800 | [diff] [blame] | 109 | #endif /* PLATSOCFPGA_DEF_H */ |
| 110 | |