|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Cross-TU surface for the ra8_mstp module-stop driver (test access). More...
Go to the source code of this file.
Functions | |
| ra8_err_t | priv_ra8_mstp_wait_reg_settle_internal (uint8_t reg, uint32_t expect, uint32_t care_mask) |
Poll one MSTPCR register until its cared-for bits read back expect. | |
| uint32_t | priv_ra8_mstp_ns_mask_internal (uint8_t reg) |
| Non-secure-owned bit mask for one MSTPCR register (read from PSAR). | |
Cross-TU surface for the ra8_mstp module-stop driver (test access).
Not part of the public API. Declares two helpers promoted from TU-private statics so the host tests can exercise the TrustZone Non-secure-attribution read-back masking directly: the on-silicon scenario (a Secure module-stop write to a Non-secure-owned bit that never reads back the commanded value) cannot be reproduced by the host register RAM, which honours every write, so the mask logic is tested here against a pre-set register value instead of through a live write. See CLAUDE.md "Test access to internal symbols (MC/DC scope)".
Definition in file ra8_mstp_internal.h.
|
nodiscard |
Non-secure-owned bit mask for one MSTPCR register (read from PSAR).
Promoted from a TU-private static for test access. Returns the PSAR-attributed (Non-secure-owned) bits of MSTPCR[reg]: the PSAR register value for MSTPCRB..E, and 0 for MSTPCRA (no attribution register) and on any non-TrustZone system (every PSAR reads 0).
| [in] | reg | MSTPCR index (< 5). |
reg 0) always yields 0.Non-secure-owned bit mask for one MSTPCR register (read from PSAR).
Definition at line 268 of file ra8_mstp.c.
References k_ra8_mstp_psarb_addr, k_ra8_mstp_psarc_addr, k_ra8_mstp_psard_addr, k_ra8_mstp_psare_addr, and k_ra8_mstp_reg_count.
Referenced by ra8_mstp_init().
|
nodiscard |
Poll one MSTPCR register until its cared-for bits read back expect.
Promoted from a TU-private static so the host tests can drive the Non-secure-attribution mask directly. Bounded settle poll: succeeds when (reg & care_mask) == (expect & care_mask), so bits excluded from care_mask (Non-secure-owned, not Secure-writable) are tolerated even when they never take the commanded state.
| [in] | reg | MSTPCR index (< 5). |
| [in] | expect | Value the cared-for bits must read back. |
| [in] | care_mask | Bits that must match (Secure-owned bits). |
| k_ra8_ok | The cared-for bits settled to expect. |
| k_ra8_err_hw_timeout | They never settled within the spin budget. |
expect. Poll one MSTPCR register until its cared-for bits read back expect.
Definition at line 248 of file ra8_mstp.c.
References internal_reg_ptr(), k_ra8_err_hw_timeout, k_ra8_mstp_readback_spin, and k_ra8_ok.
Referenced by ra8_mstp_init().