diff options
author | Tyler Miller <tyler.miller@airbusus.com> | 2023-12-21 15:16:48 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2024-01-15 10:33:22 +0100 |
commit | b995211907aee43d0b23c3764cd342aae2afd10f (patch) | |
tree | bf28af5d9c83c0805385cbd7c9c01b04756a95f5 /bsps/arm/tms570/start/tms570_selftest.c | |
parent | bsp/tms570: Enable hardware init for some variants (diff) | |
download | rtems-b995211907aee43d0b23c3764cd342aae2afd10f.tar.bz2 |
bsp/tms570: Add tms570_pbist_run_and_check()
Update #4982.
Diffstat (limited to '')
-rw-r--r-- | bsps/arm/tms570/start/tms570_selftest.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/bsps/arm/tms570/start/tms570_selftest.c b/bsps/arm/tms570/start/tms570_selftest.c index 7fad351aee..20d0f0d352 100644 --- a/bsps/arm/tms570/start/tms570_selftest.c +++ b/bsps/arm/tms570/start/tms570_selftest.c @@ -9,6 +9,7 @@ */ /* + * Copyright (C) 2022 Airbus U.S. Space & Defense, Inc * Copyright (C) 2009-2015 Texas Instruments Incorporated - www.ti.com * * @@ -440,6 +441,33 @@ bool tms570_pbist_is_test_passed( void ) } /** + * Helper method that will run a pbist test and blocks until it finishes + * Reduces code duplication in start system start hooks + */ +void tms570_pbist_run_and_check(uint32_t raminfoL, uint32_t algomask) +{ + /* Run PBIST on region */ + tms570_pbist_run(raminfoL, algomask); + + /* Wait for PBIST for region to be completed */ + /*SAFETYMCUSW 28 D MR:NA <APPROVED> "Hardware status bit read check" */ + while (!tms570_pbist_is_test_completed()) { + } /* Wait */ + + /* Check if PBIST on region passed the self-test */ + if (!tms570_pbist_is_test_passed()) { + /* PBIST and region failed the self-test. + * Need custom handler to check the memory failure + * and to take the appropriate next step. + */ + tms570_pbist_fail(); + } + + /* Disable PBIST clocks and disable memory self-test mode */ + tms570_pbist_stop(); +} + +/** * @brief Checks to see if the PBIST Port test is completed successfully (HCG:pbistPortTestStatus) * @param[in] port - Select the port to get the status. * @return 1 if PBIST Port test completed successfully, otherwise 0. |