ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_nsc_xspi.c
Go to the documentation of this file.
1
20
21#include <stdint.h>
22
23#include "ra8_check.h"
24#include "ra8_err.h"
25#include "ra8_nsc.h"
26#include "ra8_nsc_veneer.h"
27#include "ra8_xspi.h"
28
29static const char* s_tag = "NSCXSPI";
30
31typedef enum : uint8_t {
34
64RA8_NSC_VENEER ra8_err_t ra8_nsc_xspi_read(uint32_t flash_off, uint8_t* ns_dst, uint32_t len)
65{
66 RA8_CHECK_NULL_PTR(ns_dst, s_tag, "xspi_read: ns_dst");
67 if ((len == 0U) || (len > k_ra8_nsc_xspi_max_read)) {
69 }
70 RA8_NSC_CHECK_NS_RANGE_RW(ns_dst, len);
71 return ra8_xspi_flash_read(k_ra8_nsc_xspi_instance, flash_off, ns_dst, len);
72}
73
100RA8_NSC_VENEER ra8_err_t ra8_nsc_xspi_status(uint8_t instance, uint32_t* out_mask)
101{
102 RA8_CHECK_NULL_PTR(out_mask, s_tag, "xspi_status: out_mask");
103 RA8_NSC_CHECK_NS_RANGE_RW(out_mask, sizeof(*out_mask));
104 return ra8_xspi_get_status(instance, out_mask);
105}
static const char * s_tag
Logging / check tag.
Definition ra8_app.c:17
#define RA8_NSC_VENEER
Mark a TrustZone Secure-to-Non-Secure entry-point veneer.
Validation and Error-Checking Macros for ra8-firmware.
#define RA8_CHECK_NULL_PTR(ptr, tag, message)
Reject nullptr pointer, returning k_ra8_err_null_ptr.
Definition ra8_check.h:243
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.
@ k_ra8_nsc_xspi_max_read
Max bytes per ra8_nsc_xspi_read.
Definition ra8_nsc.h:408
Macros for declaring Non-Secure Callable veneer functions.
#define RA8_NSC_CHECK_NS_RANGE_RW(ptr, len)
RA8 NSC CHECK NS RANGE RW.
ra8_nsc_xspi_instance_t
@ k_ra8_nsc_xspi_instance
Only one xspi instance today.
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_xspi_status(uint8_t instance, uint32_t *out_mask)
NSC veneer: query secure-side XSPI status.
xSPI / Octo-SPI driver (flash read/program/erase + ID/status)
ra8_err_t ra8_xspi_flash_read(uint8_t instance, uint32_t flash_addr, uint8_t *buf, uint32_t len)
Read len bytes from external flash into buf.
ra8_err_t ra8_xspi_get_status(uint8_t instance, uint32_t *out_mask)
Read the xSPI COMSTT busy/error mask.
Definition ra8_xspi.c:464