ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_nsc.h
Go to the documentation of this file.
1
58
59#pragma once
60
61#ifdef __cplusplus
62extern "C" {
63#endif
64
65#include <stdint.h>
66
67#include "ra8_err.h"
68#include "ra8_nsc_veneer.h"
69
70/* =============================================================================
71 * XSPI (external octa-SPI flash) veneers
72 * =============================================================================
73 */
74
115[[nodiscard]] RA8_NSC_VENEER ra8_err_t ra8_nsc_xspi_read(uint32_t flash_off,
116 uint8_t* ns_dst,
117 uint32_t len);
118
142[[nodiscard]] RA8_NSC_VENEER ra8_err_t ra8_nsc_xspi_status(uint8_t instance, uint32_t* out_mask);
143
144/* =============================================================================
145 * Ethernet veneers
146 * =============================================================================
147 */
148
174[[nodiscard]] RA8_NSC_VENEER ra8_err_t ra8_nsc_eth_send(const uint8_t* ns_frame, uint16_t len);
175
199[[nodiscard]] RA8_NSC_VENEER ra8_err_t ra8_nsc_eth_recv(uint8_t* ns_buf, uint16_t* inout_len);
200
201/* =============================================================================
202 * Logging veneer
203 * =============================================================================
204 */
205
235[[nodiscard]] RA8_NSC_VENEER ra8_err_t ra8_nsc_log_emit(const char* tag, const char* message);
236
237/* =============================================================================
238 * Peripheral init veneer (boot-time only)
239 * =============================================================================
240 */
241
275
276/* =============================================================================
277 * Watchdog veneers (Secure-owned WDT; NS runs the ThreadX supervisor)
278 * =============================================================================
279 */
280
307[[nodiscard]] RA8_NSC_VENEER ra8_err_t ra8_nsc_wdt_start(void);
308
338
339/* =============================================================================
340 * Key vault veneer
341 * =============================================================================
342 */
343
380[[nodiscard]] RA8_NSC_VENEER ra8_err_t ra8_nsc_key_vault_challenge(uint16_t slot,
381 const uint8_t* ns_chal,
382 uint8_t* ns_digest);
383
384/* The sealed-key-import and TRNG NSC veneers (ra8_nsc_key_import /
385 * ra8_nsc_trng_read) were declared here but never defined -- a phantom NS->S
386 * entry point that misrepresents the trust-boundary surface. They are removed
387 * until a real definition exists (enforced by
388 * scripts/checks/check_nsc_veneer_defs.py). The secure-side backing code lives
389 * in libs/ra8_secure_app/src/{key_import,secure_trng}.c; re-add each
390 * declaration in the
391 * same change that adds its RA8_NSC_VENEER definition. */
392
393/* =============================================================================
394 * Constants surfaced to NS callers
395 * =============================================================================
396 */
397
412
413/* =============================================================================
414 * OTA bank-commit veneers (forwarded to libs/ra8_secure_app/src/ota_commit.c)
415 * =============================================================================
416 */
417
423[[nodiscard]] RA8_NSC_VENEER ra8_err_t ra8_nsc_ota_commit(uint8_t target_bank);
424
430[[nodiscard]] RA8_NSC_VENEER ra8_err_t ra8_nsc_flash_bank_config(uint32_t raw_value);
431
432#ifdef __cplusplus
433}
434#endif
#define RA8_NSC_VENEER
Mark a TrustZone Secure-to-Non-Secure entry-point veneer.
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
ra8_nsc_limits_t
Boundary-policy limits exposed to NS callers.
Definition ra8_nsc.h:407
@ k_ra8_nsc_eth_frame_max
Max ethernet frame bytes.
Definition ra8_nsc.h:409
@ k_ra8_nsc_xspi_max_read
Max bytes per ra8_nsc_xspi_read.
Definition ra8_nsc.h:408
@ k_ra8_nsc_log_msg_max_len
Truncated copy size for logs.
Definition ra8_nsc.h:410
ra8_err_t ra8_nsc_eth_send(const uint8_t *ns_frame, uint16_t len)
NSC veneer: hand a frame to the secure ESWM transmit path.
Definition ra8_nsc_eth.c:50
ra8_err_t ra8_nsc_eth_recv(uint8_t *ns_buf, uint16_t *inout_len)
NSC veneer: pull the next received frame to NS memory.
Definition ra8_nsc_eth.c:82
ra8_err_t ra8_nsc_wdt_start(void)
NSC veneer: arm the Secure WDT with the e-reader configuration.
Definition ra8_nsc_wdt.c:82
ra8_err_t ra8_nsc_xspi_read(uint32_t flash_off, uint8_t *ns_dst, uint32_t len)
NSC veneer: read len bytes from external XSPI flash.
ra8_err_t ra8_nsc_log_emit(const char *tag, const char *message)
NSC veneer: emit a log line via the secure ITM channel.
Definition ra8_nsc_log.c:94
ra8_err_t ra8_nsc_xspi_status(uint8_t instance, uint32_t *out_mask)
NSC veneer: query secure-side XSPI status.
ra8_err_t ra8_nsc_ota_commit(uint8_t target_bank)
NSC veneer: commit OTA target bank as the boot bank.
Definition ra8_nsc_ota.c:52
ra8_err_t ra8_nsc_key_vault_challenge(uint16_t slot, const uint8_t *ns_chal, uint8_t *ns_digest)
NSC veneer: SHA-256(key XOR challenge) for a stored slot.
void ra8_nsc_wdt_refresh(void)
NSC veneer: refresh the Secure WDT down-counter.
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
ra8_err_t ra8_nsc_periph_init(void)
NSC veneer: bring up the secure-side peripheral substrate.
Macros for declaring Non-Secure Callable veneer functions.