Skip to content

Commit e3538a3

Browse files
lucien-nxpkartben
authored andcommitted
soc: nxp: imxrt: imxrt118x: change trdc permission getting strategy
When TRDC permission fails to be obtained, it does not recycle to access ELE core to prevent blocking problems. The current practice only generates a log warning alarm. Signed-off-by: Lucien Zhao <[email protected]>
1 parent fbd97a1 commit e3538a3

File tree

1 file changed

+21
-16
lines changed
  • soc/nxp/imxrt/imxrt118x

1 file changed

+21
-16
lines changed

soc/nxp/imxrt/imxrt118x/soc.c

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
/*
2-
* Copyright 2024 NXP
2+
* Copyright 2024-2025 NXP
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

77
#include <zephyr/kernel.h>
88
#include <zephyr/device.h>
99
#include <zephyr/init.h>
10+
#include <zephyr/logging/log.h>
1011
#include <soc.h>
1112
#include <zephyr/linker/sections.h>
1213
#include <zephyr/linker/linker-defs.h>
@@ -23,6 +24,8 @@
2324
#include <zephyr/dt-bindings/clock/imx_ccm_rev2.h>
2425
#include <cmsis_core.h>
2526

27+
LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
28+
2629
/*
2730
* Set ELE_STICK_FAILED_STS to 0 when ELE status check is not required,
2831
* which is useful when debug reset, where the core has already get the
@@ -521,34 +524,36 @@ static ALWAYS_INLINE void trdc_enable_all_access(void)
521524
status_t sts;
522525
uint8_t i, j;
523526

524-
/* Get ELE FW status */
527+
/* Get ELE FW status */
525528
do {
526529
uint32_t ele_fw_sts;
527530

528531
sts = ELE_BaseAPI_GetFwStatus(MU_RT_S3MUA, &ele_fw_sts);
529532
} while (sts != kStatus_Success);
530533

531-
do {
532534
#if defined(CONFIG_SOC_MIMXRT1189_CM33)
533-
/* Release TRDC A to CM33 core */
534-
sts = ELE_BaseAPI_ReleaseRDC(MU_RT_S3MUA, ELE_TRDC_AON_ID, ELE_CORE_CM33_ID);
535+
/* Release TRDC AON to CM33 core */
536+
sts = ELE_BaseAPI_ReleaseRDC(MU_RT_S3MUA, ELE_TRDC_AON_ID, ELE_CORE_CM33_ID);
535537
#elif defined(CONFIG_SOC_MIMXRT1189_CM7)
536-
/* Release TRDC A to CM7 core */
537-
sts = ELE_BaseAPI_ReleaseRDC(MU_RT_S3MUA, ELE_TRDC_AON_ID, ELE_CORE_CM7_ID);
538+
/* Release TRDC AON to CM7 core */
539+
sts = ELE_BaseAPI_ReleaseRDC(MU_RT_S3MUA, ELE_TRDC_AON_ID, ELE_CORE_CM7_ID);
538540
#endif
539-
} while (ELE_IS_FAILED(sts));
541+
if (sts != kStatus_Success) {
542+
LOG_WRN("warning: TRDC AON permission get failed. If core don't get TRDC "
543+
"AON permission, AON domain permission can't be configured.");
544+
}
540545

541-
/* Release TRDC W to CM33 core */
542-
do {
543546
#if defined(CONFIG_SOC_MIMXRT1189_CM33)
544-
/* Release TRDC A to CM33 core */
545-
sts = ELE_BaseAPI_ReleaseRDC(MU_RT_S3MUA, ELE_TRDC_WAKEUP_ID, ELE_CORE_CM33_ID);
547+
/* Release TRDC Wakeup to CM33 core */
548+
sts = ELE_BaseAPI_ReleaseRDC(MU_RT_S3MUA, ELE_TRDC_WAKEUP_ID, ELE_CORE_CM33_ID);
546549
#elif defined(CONFIG_SOC_MIMXRT1189_CM7)
547-
/* Release TRDC A to CM7 core */
548-
sts = ELE_BaseAPI_ReleaseRDC(MU_RT_S3MUA, ELE_TRDC_WAKEUP_ID, ELE_CORE_CM7_ID);
550+
/* Release TRDC Wakeup to CM7 core */
551+
sts = ELE_BaseAPI_ReleaseRDC(MU_RT_S3MUA, ELE_TRDC_WAKEUP_ID, ELE_CORE_CM7_ID);
549552
#endif
550-
} while (ELE_IS_FAILED(sts));
551-
553+
if (sts != kStatus_Success) {
554+
LOG_WRN("warning: TRDC Wakeup permission get failed. If core don't get TRDC "
555+
"Wakeup permission, Wakeup domain permission can't be configured.");
556+
}
552557

553558
/* Set the master domain access configuration for eDMA3/eDMA4 */
554559
trdc_non_processor_domain_assignment_t edmaAssignment;

0 commit comments

Comments
 (0)