Skip to content

Commit 706d91a

Browse files
committed
plat-k3: drivers: add platform flavors for 62A and 62P devices
Even though the SA2UL integration on the AM62Ax and AM62Px platforms are functionally identical to the AM62x platforms many, when building OP-TEE, are using the platform name they are building and not 'am62x' which leaves the SA2UL_BASE address undefined and builds to fail In file included from core/include/mm/core_memprot.h:9, from core/include/kernel/interrupt.h:10, from core/arch/arm/plat-k3/drivers/sa2ul_rng.c:12: core/arch/arm/plat-k3/./platform_config.h:91:34: error: ‘SA2UL_BASE’ undeclared here (not in a function); did you mean ‘SCU_BASE’? 91 | #define RNG_BASE (SA2UL_BASE + 0x10000) | ^~~~~~~~~~ For now let's just define the AM62Ax and AM62Px platform flavors identical to how AM62x is defined and add an #else statement to catch when a undefined platform flavor tries to build the SA2UL driver Signed-off-by: Bryan Brattlof <bb@ti.com>
1 parent 45c754c commit 706d91a

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

core/arch/arm/plat-k3/drivers/sa2ul.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,10 @@ static TEE_Result sa2ul_init(void)
121121
start_address = RNG_BASE;
122122
end_address = RNG_BASE + RNG_REG_SIZE - 1;
123123
permissions[num_perm++] = (FW_BIG_ARM_PRIVID << 16) | FW_SECURE_ONLY;
124-
#if defined(PLATFORM_FLAVOR_am62x)
124+
#if defined(PLATFORM_FLAVOR_am62x) || \
125+
defined(PLATFORM_FLAVOR_am62ax) || \
126+
defined(PLATFORM_FLAVOR_am62px)
127+
125128
permissions[num_perm++] = (FW_TIFS_PRIVID << 16) | FW_NON_SECURE;
126129
#endif
127130
ret = ti_sci_set_fwl_region(fwl_id, rng_region, num_perm,

core/arch/arm/plat-k3/platform_config.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,24 @@
7979
#define SA2UL_TI_SCI_DEV_ID 133
8080
#define SA2UL_TI_SCI_FW_ID 35
8181
#define SA2UL_TI_SCI_FW_RGN_ID 0
82-
#elif defined(PLATFORM_FLAVOR_am62x)
82+
#elif defined(PLATFORM_FLAVOR_am62x) || \
83+
defined(PLATFORM_FLAVOR_am62ax) || \
84+
defined(PLATFORM_FLAVOR_am62px)
8385
#define SA2UL_BASE 0x40900000
8486
#define SA2UL_TI_SCI_DEV_ID -1
8587
#define SA2UL_TI_SCI_FW_ID 66
8688
#define SA2UL_TI_SCI_FW_RGN_ID 1
89+
#elif defined(CFG_WITH_SOFTWARE_PRNG)
90+
#error "Undefined platform flavor! No SA2UL_BASE address is defined"
8791
#endif
8892
#define SA2UL_REG_SIZE 0x1000
8993

9094
/* RNG */
9195
#define RNG_BASE (SA2UL_BASE + 0x10000)
9296
#define RNG_REG_SIZE 0x1000
93-
#if defined(PLATFORM_FLAVOR_am62x)
97+
#if defined(PLATFORM_FLAVOR_am62x) || \
98+
defined(PLATFORM_FLAVOR_am62ax) || \
99+
defined(PLATFORM_FLAVOR_am62px)
94100
#define RNG_TI_SCI_FW_RGN_ID 2
95101
#else
96102
#define RNG_TI_SCI_FW_RGN_ID 3

0 commit comments

Comments
 (0)