30static const char*
s_tag =
"ETHMFW";
124typedef enum : uint32_t {
157 const uintptr_t addr =
160 return (
volatile uint32_t*)addr;
168 volatile uint32_t*
const reg =
static const char * s_tag
Logging / check tag.
Annotation-attribute framework macros for ra8-firmware.
#define RA8_HW_REGISTER_ACCESS
Mark an MMIO accessor function (returns volatile register pointer).
#define RA8_ISR_SAFE
The function is callable from interrupt context.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
Validation and Error-Checking Macros for ra8-firmware.
#define RA8_RETURN_ON_ERROR(err, tag, message)
Early return on error, propagating the code upward.
#define RA8_CHECK_NULL_PTR(ptr, tag, message)
Reject nullptr pointer, returning k_ra8_err_null_ptr.
Error Code Definitions for ra8-firmware.
@ k_ra8_err_invalid_arg
Invalid function argument.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
ra8_err_t ra8_eth_mfwd_set_forwarding_masks(const uint8_t port_masks[3])
Program the per-port forwarding-destination masks (FWPBFC0).
static volatile uint32_t * internal_mfwd_fwpbfcsdc(uint8_t port)
Return a typed pointer to FWPBFCSDC0[port] inside MFWD.
void ra8_eth_mfwd_dispatch(void)
Dispatch an MFWD event.
ra8_err_t ra8_eth_mfwd_attach_handler(ra8_eth_mfwd_event_fn_t fn, void *ctx)
Attach the shared event handler.
ra8_err_t ra8_eth_mfwd_init(void)
Initialise the MFWD block (MSTP enable + reset regs).
ra8_eth_mfwd_internal_t
MFWD register offsets used by the routing programming path.
@ k_ra8_mfwd_pbdv_mask
FWPBFC0.PBDV mask.
@ k_ra8_mfwd_max_queue
Highest GWCA queue.
@ k_ra8_mfwd_fwpbfcsdc_stride
Per-port stride.
@ k_ra8_mfwd_max_port
Highest GMAC port index.
@ k_ra8_mfwd_pbcsd_mask
PBCSD field mask.
@ k_ra8_mfwd_off_fwpbfcsdc0_base
FWPBFCSDC00 offset.
@ k_ra8_mfwd_port_count
Port[0] + Port[1] + host.
@ k_ra8_mfwd_off_fwpbfc0_base
FWPBFC0[0] offset.
ra8_err_t ra8_eth_mfwd_exit_stop(void)
Exit MSTP-gated stop.
ra8_err_t ra8_eth_mfwd_deinit(void)
Tear down the MFWD block.
static ra8_eth_mfwd_event_fn_t s_mfwd_fn
ra8_err_t ra8_eth_mfwd_enter_stop(void)
Put MFWD into MSTP-gated stop.
ra8_err_t ra8_eth_mfwd_route_queue(uint8_t port, uint8_t queue_index)
Route inbound frames from a GMAC port into a GWCA RX queue.
ra8_err_t ra8_eth_mfwd_clear_status(uint32_t mask)
Clear bits in MFWD_STS via MFWD_ICLR.
ra8_err_t ra8_eth_mfwd_get_status(uint32_t *out_mask)
Read the MFWD_STS status register.
Ethernet Message Forwarding Engine (MFWD) driver.
void(* ra8_eth_mfwd_event_fn_t)(void *ctx, uint32_t status_mask)
MFWD event callback.
Ethernet controller base addresses for the Renesas RA8D2.
@ k_ra8_mfwd_base_addr
RA8 mfwd base address.
static volatile r_mfwd_regs_t * ra8_mfwd(void)
Get pointer to the MFWD register block.
Lightweight Logging Interface for ra8-firmware.
#define ra8_log_info(tag, message)
RA8 log info.
#define ra8_log_error(tag, message)
RA8 log error.
Ref-counted Module Stop Control wrapper for the RA8D2.
ra8_err_t ra8_mstp_enable(ra8_mstp_t id)
Reference-counted "ungate this peripheral" request.
ra8_err_t ra8_mstp_disable(ra8_mstp_t id)
Reference-counted "gate this peripheral" request.
Module Stop Control (MSTP) register layout for the Renesas RA8D2.
@ k_ra8_mstp_eswm
MSTPC30 ESWM.
Minimal Message Forwarding Engine (MFWD) register window.
volatile uint32_t MFWD_ICLR
+0x0C Interrupt Clear.
volatile uint32_t MFWD_STS
+0x04 Status.
volatile uint32_t MFWD_CTRL
+0x00 Forwarding Control.
volatile uint32_t MFWD_IE
+0x08 Interrupt Enable.