|
1 | 1 | /* |
2 | | - * Copyright 2024 NXP |
| 2 | + * Copyright 2024-2025 NXP |
3 | 3 | * |
4 | 4 | * SPDX-License-Identifier: Apache-2.0 |
5 | 5 | */ |
6 | 6 |
|
7 | 7 | #include <zephyr/kernel.h> |
8 | 8 | #include <zephyr/device.h> |
9 | 9 | #include <zephyr/init.h> |
| 10 | +#include <zephyr/logging/log.h> |
10 | 11 | #include <soc.h> |
11 | 12 | #include <zephyr/linker/sections.h> |
12 | 13 | #include <zephyr/linker/linker-defs.h> |
|
23 | 24 | #include <zephyr/dt-bindings/clock/imx_ccm_rev2.h> |
24 | 25 | #include <cmsis_core.h> |
25 | 26 |
|
| 27 | +LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL); |
| 28 | + |
26 | 29 | /* |
27 | 30 | * Set ELE_STICK_FAILED_STS to 0 when ELE status check is not required, |
28 | 31 | * 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) |
521 | 524 | status_t sts; |
522 | 525 | uint8_t i, j; |
523 | 526 |
|
524 | | - /* Get ELE FW status */ |
| 527 | + /* Get ELE FW status */ |
525 | 528 | do { |
526 | 529 | uint32_t ele_fw_sts; |
527 | 530 |
|
528 | 531 | sts = ELE_BaseAPI_GetFwStatus(MU_RT_S3MUA, &ele_fw_sts); |
529 | 532 | } while (sts != kStatus_Success); |
530 | 533 |
|
531 | | - do { |
532 | 534 | #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); |
535 | 537 | #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); |
538 | 540 | #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 | + } |
540 | 545 |
|
541 | | - /* Release TRDC W to CM33 core */ |
542 | | - do { |
543 | 546 | #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); |
546 | 549 | #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); |
549 | 552 | #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 | + } |
552 | 557 |
|
553 | 558 | /* Set the master domain access configuration for eDMA3/eDMA4 */ |
554 | 559 | trdc_non_processor_domain_assignment_t edmaAssignment; |
|
0 commit comments