ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_nsc_ota.c
Go to the documentation of this file.
1
24
25#include <stdint.h>
26
27#include "ota_commit.h"
28#include "ra8_err.h"
29#include "ra8_nsc.h"
30#include "ra8_nsc_veneer.h"
31
53{
54 if ((target_bank != (uint8_t)k_ra8_ota_bank_a) && (target_bank != (uint8_t)k_ra8_ota_bank_b)) {
56 }
57 return ra8_ota_commit_swap_bank((ra8_ota_bank_t)target_bank);
58}
59
90{
91 /* The secure side masks; we just forward. The NSC veneer's value
92 * is in *labelling* the operation as crossing the security
93 * boundary, so static analysis can flag NS-side callers. */
94 return ra8_ota_commit_set_bank_config(raw_value);
95}
Secure-side OTA bank commit + flash-bank-config write.
ra8_err_t ra8_ota_commit_set_bank_config(uint32_t raw_value)
Write the bank-config register, masked to the allowed bits.
Definition ota_commit.c:132
ra8_ota_bank_t
Bank selector used by ra8_ota_commit_swap_bank.
Definition ota_commit.h:51
@ k_ra8_ota_bank_b
Bank B is the next-boot target.
Definition ota_commit.h:53
@ k_ra8_ota_bank_a
Bank A is the next-boot target.
Definition ota_commit.h:52
ra8_err_t ra8_ota_commit_swap_bank(ra8_ota_bank_t target)
Arm the boot ROM to start from target on next reset.
Definition ota_commit.c:90
#define RA8_NSC_VENEER
Mark a TrustZone Secure-to-Non-Secure entry-point veneer.
Error Code Definitions for ra8-firmware.
@ k_ra8_err_invalid_arg
Invalid function argument.
Definition ra8_err.h:152
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
Non-Secure Callable veneers – the only NS->S gateway.
ra8_err_t ra8_nsc_ota_commit(uint8_t target_bank)
NSC veneer: persist an OTA bank-swap commit.
Definition ra8_nsc_ota.c:52
ra8_err_t ra8_nsc_flash_bank_config(uint32_t raw_value)
NSC veneer: write the flash bank-config word.
Definition ra8_nsc_ota.c:89
Macros for declaring Non-Secure Callable veneer functions.