| Jerry Wang | b79a256 | 2024-07-29 13:07:55 +0100 | [diff] [blame] | 1 | /* |
| Boyan Karatotev | 6d144db | 2025-06-23 15:04:53 +0100 | [diff] [blame^] | 2 | * Copyright (c) 2024-2025, Arm Limited and Contributors. All rights reserved. |
| Jerry Wang | b79a256 | 2024-07-29 13:07:55 +0100 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | * This file is limited to include the trusted firmware required platform port |
| 7 | * definitions for the second generation platforms based on the N2/V2 CPUs. The |
| 8 | * common platform support for Arm platforms expect platforms to define certain |
| 9 | * definitions and those definitions are referred to as the platform port |
| 10 | * definitions. |
| 11 | */ |
| 12 | |
| 13 | #ifndef NRD_PLAT_ARM_DEF2_H |
| 14 | #define NRD_PLAT_ARM_DEF2_H |
| 15 | |
| 16 | #ifndef __ASSEMBLER__ |
| 17 | #include <lib/mmio.h> |
| 18 | #endif /* __ASSEMBLER__ */ |
| 19 | |
| 20 | #include <lib/utils_def.h> |
| 21 | #include "nrd_css_fw_def2.h" |
| Jerry Wang | ccd8270 | 2024-07-31 16:27:23 +0100 | [diff] [blame] | 22 | #include "nrd_ros_def2.h" |
| Jerry Wang | b79a256 | 2024-07-29 13:07:55 +0100 | [diff] [blame] | 23 | |
| 24 | /******************************************************************************* |
| 25 | * Linker related definitions |
| 26 | ******************************************************************************/ |
| 27 | |
| 28 | /* Platform binary types for linking */ |
| 29 | #define PLATFORM_LINKER_FORMAT "elf64-littleaarch64" |
| 30 | #define PLATFORM_LINKER_ARCH aarch64 |
| 31 | |
| 32 | /******************************************************************************* |
| 33 | * Stack size |
| 34 | ******************************************************************************/ |
| 35 | |
| 36 | /* Size of cacheable stacks */ |
| 37 | #define PLATFORM_STACK_SIZE U(0x1400) /* 5120 bytes */ |
| 38 | |
| 39 | /* Size of coherent stacks */ |
| 40 | #define PCPU_DV_MEM_STACK_SIZE U(0x600) /* 1536 bytes */ |
| 41 | |
| 42 | /******************************************************************************* |
| 43 | * Core count |
| 44 | ******************************************************************************/ |
| 45 | |
| 46 | #define PLATFORM_CORE_COUNT (PLAT_ARM_CLUSTER_COUNT * \ |
| 47 | NRD_MAX_CPUS_PER_CLUSTER) |
| 48 | #define PLATFORM_NUM_AFFS (PLAT_ARM_CLUSTER_COUNT + \ |
| 49 | PLATFORM_CORE_COUNT) |
| 50 | |
| 51 | /******************************************************************************* |
| 52 | * Power related definitions |
| 53 | ******************************************************************************/ |
| 54 | |
| 55 | #define PLATFORM_MAX_AFFLVL MPIDR_AFFLVL1 |
| 56 | |
| 57 | #define PLAT_MAX_PWR_LEVEL PLATFORM_MAX_AFFLVL |
| 58 | #define PLAT_MAX_PWR_STATES_PER_LVL U(2) |
| 59 | |
| 60 | /* Local state bit width for each level in the state-ID field of power state */ |
| 61 | #define PLAT_LOCAL_PSTATE_WIDTH U(4) |
| 62 | |
| 63 | /******************************************************************************* |
| 64 | * XLAT definitions |
| 65 | ******************************************************************************/ |
| 66 | |
| 67 | /* Platform specific page table and MMU setup constants */ |
| 68 | #define MAX_XLAT_TABLES U(6) |
| 69 | #define MAX_MMAP_REGIONS U(16) |
| 70 | |
| 71 | /******************************************************************************* |
| 72 | * I/O definitions |
| 73 | ******************************************************************************/ |
| 74 | |
| 75 | /* I/O Storage NOR flash device */ |
| 76 | #define MAX_IO_DEVICES U(1) |
| 77 | #define MAX_IO_HANDLES U(1) |
| 78 | |
| Jerry Wang | b79a256 | 2024-07-29 13:07:55 +0100 | [diff] [blame] | 79 | /* Maximum SPI */ |
| 80 | #define PLAT_MAX_SPI_OFFSET_ID U(256) |
| 81 | |
| 82 | /******************************************************************************* |
| 83 | * Timer related config |
| 84 | ******************************************************************************/ |
| 85 | |
| 86 | /* Per-CPU Hypervisor Timer Interrupt ID */ |
| 87 | #define IRQ_PCPU_HP_TIMER U(26) |
| 88 | |
| 89 | /* Memory mapped Generic timer interfaces */ |
| Jerry Wang | 4ccb1ef | 2024-07-31 13:28:08 +0100 | [diff] [blame] | 90 | #define SYS_CNT_BASE1 NRD_CSS_NSEC_CNT_BASE1 |
| Jerry Wang | b79a256 | 2024-07-29 13:07:55 +0100 | [diff] [blame] | 91 | |
| 92 | /* AP_REFCLK Generic Timer, Non-secure. */ |
| 93 | #define IRQ_CNTPSIRQ1 U(109) |
| 94 | |
| 95 | /* Times(in ms) used by test code for completion of different events */ |
| 96 | #define PLAT_SUSPEND_ENTRY_TIME U(15) |
| 97 | #define PLAT_SUSPEND_ENTRY_EXIT_TIME U(30) |
| 98 | |
| 99 | /******************************************************************************* |
| 100 | * Console config |
| 101 | ******************************************************************************/ |
| 102 | |
| 103 | #define PLAT_ARM_UART_BASE NRD_CSS_NSEC_UART_BASE |
| 104 | #define PLAT_ARM_UART_CLK_IN_HZ NRD_CSS_NSEC_CLK_IN_HZ |
| 105 | |
| 106 | /******************************************************************************* |
| 107 | * DRAM config |
| 108 | ******************************************************************************/ |
| 109 | |
| 110 | /* TF-A reserves DRAM space 0xFF000000- 0xFFFFFFFF for TZC */ |
| Jerry Wang | 2d20ac0 | 2024-07-29 15:35:07 +0100 | [diff] [blame] | 111 | #define DRAM_BASE NRD_CSS_DRAM1_BASE |
| 112 | #define DRAM_SIZE (NRD_CSS_DRAM1_SIZE - 0x1000000) |
| Jerry Wang | b79a256 | 2024-07-29 13:07:55 +0100 | [diff] [blame] | 113 | |
| 114 | /******************************************************************************* |
| 115 | * Cache related config |
| 116 | ******************************************************************************/ |
| 117 | #define CACHE_WRITEBACK_SHIFT U(6) |
| Jerry Wang | 2d20ac0 | 2024-07-29 15:35:07 +0100 | [diff] [blame] | 118 | #define CACHE_WRITEBACK_GRANULE (1 << CACHE_WRITEBACK_SHIFT) |
| Jerry Wang | b79a256 | 2024-07-29 13:07:55 +0100 | [diff] [blame] | 119 | |
| 120 | /******************************************************************************* |
| 121 | * Run-time address of the TFTF image. |
| 122 | * It has to match the location where the Trusted Firmware-A loads the BL33 |
| 123 | * image. |
| 124 | ******************************************************************************/ |
| 125 | |
| 126 | #define TFTF_BASE UL(0xE0000000) |
| 127 | |
| 128 | /******************************************************************************* |
| 129 | * TFTF NVM configs |
| 130 | ******************************************************************************/ |
| 131 | |
| 132 | #define TFTF_NVM_OFFSET U(0x0) |
| 133 | #define TFTF_NVM_SIZE UL(0x08000000) /* 128 MB */ |
| 134 | |
| 135 | /******************************************************************************* |
| 136 | * Watchdog related config |
| 137 | ******************************************************************************/ |
| 138 | |
| 139 | /* Base address of trusted watchdog (SP805) */ |
| Jerry Wang | 4ccb1ef | 2024-07-31 13:28:08 +0100 | [diff] [blame] | 140 | #define SP805_TWDOG_BASE NRD_CSS_TWDOG_BASE |
| Jerry Wang | b79a256 | 2024-07-29 13:07:55 +0100 | [diff] [blame] | 141 | |
| 142 | /* Base address of non-trusted watchdog (SP805) */ |
| Jerry Wang | 4ccb1ef | 2024-07-31 13:28:08 +0100 | [diff] [blame] | 143 | #define SP805_WDOG_BASE NRD_CSS_WDOG_BASE |
| Jerry Wang | b79a256 | 2024-07-29 13:07:55 +0100 | [diff] [blame] | 144 | |
| 145 | /* Trusted watchdog (SP805) Interrupt ID */ |
| 146 | #define IRQ_TWDOG_INTID U(107) |
| 147 | |
| 148 | /******************************************************************************* |
| 149 | * Flash related config |
| 150 | ******************************************************************************/ |
| 151 | |
| 152 | /* Base address and size of external NVM flash */ |
| Jerry Wang | ccd8270 | 2024-07-31 16:27:23 +0100 | [diff] [blame] | 153 | #define FLASH_BASE NRD_ROS_FLASH_BASE |
| 154 | #define FLASH_SIZE NRD_ROS_FLASH_SIZE |
| Jerry Wang | b79a256 | 2024-07-29 13:07:55 +0100 | [diff] [blame] | 155 | #define NOR_FLASH_BLOCK_SIZE UL(0x40000) /* 256KB */ |
| 156 | |
| Boyan Karatotev | 6d144db | 2025-06-23 15:04:53 +0100 | [diff] [blame^] | 157 | #endif /* NRD_PLAT_ARM_DEF2_H */ |