1 /* 2 * Copyright 2024-2025 NXP 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 #ifndef PLATFORM_DEF_H 7 #define PLATFORM_DEF_H 8 9 #include <lib/utils_def.h> 10 #include <lib/xlat_tables/xlat_tables_v2.h> 11 12 #include <imx94_scmi_def.h> 13 14 #define PLATFORM_LINKER_FORMAT "elf64-littleaarch64" 15 #define PLATFORM_LINKER_ARCH aarch64 16 17 #define PLATFORM_STACK_SIZE 0xB00 18 #define CACHE_WRITEBACK_GRANULE 64 19 20 #define PLAT_PRIMARY_CPU U(0x0) 21 #define PLATFORM_MAX_CPU_PER_CLUSTER U(4) 22 #define PLATFORM_CLUSTER_COUNT U(1) 23 #define PLATFORM_CLUSTER0_CORE_COUNT U(4) 24 #define PLATFORM_CORE_COUNT U(4) 25 26 #define IMX_PWR_LVL0 MPIDR_AFFLVL0 27 28 #define PWR_DOMAIN_AT_MAX_LVL U(1) 29 #define PLAT_MAX_PWR_LVL U(2) 30 #define PLAT_MAX_OFF_STATE U(4) 31 #define PLAT_MAX_RET_STATE U(2) 32 33 /* DRAM region 256KB */ 34 #define BL31_BASE U(0x8A200000) 35 #define BL31_LIMIT U(0x8A240000) 36 37 /* non-secure uboot base */ 38 #define PLAT_NS_IMAGE_OFFSET U(0x90200000) 39 40 /* GICv4 base address */ 41 #define PLAT_GICD_BASE U(0x48000000) 42 #define PLAT_GICR_BASE U(0x48060000) 43 #define PLAT_ARM_GICR_BASE PLAT_GICR_BASE 44 #define PLAT_ARM_GICD_BASE PLAT_GICD_BASE 45 46 #define PLAT_VIRT_ADDR_SPACE_SIZE (ULL(1) << 32) 47 #define PLAT_PHY_ADDR_SPACE_SIZE (ULL(1) << 32) 48 49 #define MAX_XLAT_TABLES 14U 50 #define MAX_MMAP_REGIONS 32U 51 52 #define IMX_LPUART_BASE 0x44380000 53 54 #define IMX_BOOT_UART_CLK_IN_HZ 24000000 /* Select 24MHz oscillator */ 55 #define IMX_CONSOLE_BAUDRATE 4000000 56 57 #define AIPSx_SIZE U(0x800000) 58 #define AIPS1_BASE U(0x44000000) 59 #define AIPS2_BASE U(0x42000000) 60 #define AIPS3_BASE U(0x42800000) 61 #define AIPS4_BASE U(0x49000000) 62 #define MU_SECURE_BASE U(0x44220000) 63 #define GPIO1_BASE U(0x47400000) 64 #define GPIO2_BASE U(0x43810000) 65 #define GPIO3_BASE U(0x43820000) 66 #define GPIO4_BASE U(0x43840000) 67 #define GPIO5_BASE U(0x43850000) 68 #define GPIO6_BASE U(0x43860000) 69 #define GPIO7_BASE U(0x43870000) 70 #define WDOG3_BASE U(0x49220000) 71 #define WDOG4_BASE U(0x49230000) 72 73 #define ELE_MU_BASE U(0x47540000) 74 75 #define SMT_BUFFER_BASE U(0x204d6000) 76 #define SMT_BUFFER_SIZE 0x1000 77 78 #define IMX9_SCMI_PAYLOAD_BASE 0x44221000 79 #define IMX9_MU1_BASE 0x44220000 80 #define MU_GCR_OFF 0x114 81 82 #define SM_AP_SEMA_ADDR 0x442213F8 83 84 #define XSPI1_BASE U(0x42b90000) 85 #define XSPI2_BASE U(0x42bE0000) 86 #define XSPI_MTO U(0x928) 87 88 #define GPIO_NUM 6U 89 #define PER_NUM 30U 90 #define WDOG_NUM 2U 91 #define IMR_NUM 15U 92 93 #define NETC_IREC_PCI_INT_X0 U(359) 94 95 #define COUNTER_FREQUENCY 24000000 96 97 /* 98 * Define a list of Group 1 Secure and Group 0 interrupt properties 99 * as per GICv3 terminology. 100 */ 101 #define PLAT_ARM_G1S_IRQ_PROPS(grp) \ 102 INTR_PROP_DESC(29U, GIC_HIGHEST_SEC_PRIORITY, grp, \ 103 GIC_INTR_CFG_LEVEL) 104 105 #define PLAT_ARM_G0_IRQ_PROPS(grp) \ 106 INTR_PROP_DESC(8U, GIC_HIGHEST_SEC_PRIORITY, \ 107 (grp), GIC_INTR_CFG_LEVEL) 108 109 /* Memory map regions */ 110 #define AIPS2_MAP MAP_REGION_FLAT(AIPS2_BASE, AIPSx_SIZE, MT_DEVICE | MT_RW) 111 #define AIPS3_MAP MAP_REGION_FLAT(AIPS3_BASE, AIPSx_SIZE, MT_DEVICE | MT_RW) 112 #define GIC_MAP MAP_REGION_FLAT(PLAT_GICD_BASE, 0x200000, MT_DEVICE | MT_RW) 113 #define AIPS1_MAP MAP_REGION_FLAT(AIPS1_BASE, AIPSx_SIZE, MT_DEVICE | MT_RW) 114 #define GPIO2_MAP MAP_REGION_FLAT(GPIO2_BASE, 0x20000, MT_DEVICE | MT_RW) 115 #define GPIO4_MAP MAP_REGION_FLAT(GPIO4_BASE, 0x20000, MT_DEVICE | MT_RW) 116 #define GPIO6_MAP MAP_REGION_FLAT(GPIO6_BASE, 0x20000, MT_DEVICE | MT_RW) 117 #define ELE_MU_MAP MAP_REGION_FLAT(ELE_MU_BASE, 0x10000, MT_DEVICE | MT_RW) 118 #define AIPS4_MAP MAP_REGION_FLAT(AIPS4_BASE, AIPSx_SIZE, MT_DEVICE | MT_RW) 119 120 #endif /* PLATFORM_DEF_H */ 121