Skip to content

Commit f8a33e2

Browse files
jaccoo01adeaarm
authored andcommitted
RSE: Initialise UART ATU when logging disabled
Ensure that BL1 always initialises the ATU region for the UART, even when logging in BL1 is disabled. This is required as later components might enabled logging and therefore use the UART via the ATU. This patch therefore adds the ATU region initialisation in BL1_2 using the same ifdefs as initialising the ATU window to device memory. Change-Id: I324d24234866cd080c291a22aaf4309ef71e9f82 Signed-off-by: Jackson Cooper-Driver <jackson.cooper-driver@arm.com>
1 parent f1fe49f commit f8a33e2

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

platform/ext/target/arm/rse/common/bl1/boot_hal_bl1_2.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,24 @@ static int32_t init_mpu_region_for_atu(void)
129129

130130
return mpu_armv8m_enable(&dev_mpu_s, PRIVILEGED_DEFAULT_ENABLE, HARDFAULT_NMI_ENABLE);
131131
}
132+
133+
#if defined(RSE_USE_HOST_UART)
134+
static enum tfm_plat_err_t init_atu_region_for_uart(void)
135+
{
136+
enum atu_error_t atu_err;
137+
138+
/* Initialize UART region */
139+
atu_err = atu_initialize_region(&ATU_DEV_S,
140+
get_supported_region_count(&ATU_DEV_S) - 1,
141+
HOST_UART0_BASE_NS, HOST_UART_BASE,
142+
HOST_UART_SIZE);
143+
if (atu_err != ATU_ERR_NONE) {
144+
return (enum tfm_plat_err_t)atu_err;
145+
}
146+
147+
return TFM_PLAT_ERR_SUCCESS;
148+
}
149+
#endif /* defined(RSE_USE_HOST_UART) */
132150
#endif /* !(defined(LOGGING_ENABLED) && defined(RSE_USE_HOST_UART)) */
133151

134152
#ifdef RSE_SUPPORT_ROM_LIB_RELOCATION
@@ -257,6 +275,18 @@ int32_t boot_platform_init(void)
257275
if (result != 0) {
258276
return result;
259277
}
278+
279+
#if defined(RSE_USE_HOST_UART)
280+
/**
281+
* Add the ATU region for the UART even though logging is disabled
282+
* in BL1_2 as later components might enable logging and try and use
283+
* it
284+
*/
285+
plat_err = init_atu_region_for_uart();
286+
if (plat_err != TFM_PLAT_ERR_SUCCESS) {
287+
return plat_err;
288+
}
289+
#endif /* defined(RSE_USE_HOST_UART) */
260290
#endif /* !(defined(LOGGING_ENABLED) && defined(RSE_USE_HOST_UART)) */
261291

262292
#ifdef LOGGING_ENABLED

0 commit comments

Comments
 (0)