29static const char*
s_tag =
"ETHCMA";
45typedef enum : uint32_t {
89 __asm__
volatile(
"nop");
96 __asm__
volatile(
"nop");
120 __asm__
volatile(
"nop");
155 const uint32_t mask = reg->
COMA_STS;
static const char * s_tag
Logging / check tag.
#define RA8_ISR_SAFE
The function is callable from interrupt context.
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_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_coma_enter_stop(void)
Put COMA into MSTP-gated stop.
ra8_err_t ra8_eth_coma_exit_stop(void)
Exit MSTP-gated stop.
ra8_err_t ra8_eth_coma_attach_handler(ra8_eth_coma_event_fn_t fn, void *ctx)
Attach the shared event handler.
void ra8_eth_coma_dispatch(void)
Dispatch a COMA event.
ra8_err_t ra8_eth_coma_bringup(void)
Bring the COMA switch out of reset, init the buffer pool, and fan every per-agent clock out.
ra8_err_t ra8_eth_coma_deinit(void)
Tear down COMA.
ra8_err_t ra8_eth_coma_clear_status(uint32_t mask)
Clear COMA_STS bits via COMA_ICLR.
ra8_err_t ra8_eth_coma_get_status(uint32_t *out_mask)
Read COMA_STS.
ra8_eth_coma_delay_t
Busy-wait iteration counts for the COMA bring-up sequence.
@ k_ra8_eth_coma_delay_iters
~1-3 ms busy wait between COMA writes.
@ k_ra8_eth_coma_bpr_poll_max
CABPIRM.BPR poll upper bound.
static ra8_eth_coma_event_fn_t s_coma_fn
ra8_err_t ra8_eth_coma_init(void)
Initialise COMA.
Ethernet Common Agent (COMA) driver.
void(* ra8_eth_coma_event_fn_t)(void *ctx, uint32_t status_mask)
COMA event callback.
Ethernet controller base addresses for the Renesas RA8D2.
static volatile r_coma_regs_t * ra8_coma(void)
Get pointer to the COMA register block.
static volatile uint32_t * ra8_coma_rcec(void)
Get pointer to the 32-bit COMA.RCEC (Clock Enable Configuration).
static volatile uint32_t * ra8_coma_rrc(void)
Get pointer to the 32-bit COMA.RRC (Reset Configuration).
@ k_ra8_coma_cabpirm_bpiog
CABPIRM.BPIOG – buf-pool init kick.
@ k_ra8_coma_rrc_rr
RRC.RR – pulse to reset ESWM IP.
@ k_ra8_coma_cabpirm_bpr
CABPIRM.BPR – buf-pool ready flag.
@ k_ra8_coma_rcec_rce
RCEC.RCE – enable switch clock.
@ k_ra8_coma_rcec_ace_mask
RCEC.ACE[6:0] – agent clock enable.
static volatile uint32_t * ra8_coma_cabpirm(void)
Get pointer to the 32-bit COMA.CABPIRM (Buf-pool Init/Reset/Monitor).
Bounded wait-flag primitives for RA8D2 HAL drivers.
static ra8_err_t ra8_hw_wait_flag_set32(volatile const uint32_t *reg, uint32_t mask, uint32_t budget)
Spin until (*reg & mask) != 0 or budget runs out.
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 Common Agent (COMA) register window.
volatile uint32_t COMA_ICLR
+0x0C Interrupt Clear.
volatile uint32_t COMA_CTRL
+0x00 Common Agent Control.
volatile uint32_t COMA_IE
+0x08 Interrupt Enable.
volatile uint32_t COMA_STS
+0x04 Status.