36static const char*
s_tag =
"ETHGWC";
50typedef enum : uint32_t {
74 volatile uint32_t*
const fwpc10 =
76 volatile uint32_t*
const fwpc11 =
78 volatile uint32_t*
const fwpc12 =
128 const uint32_t mask = reg->
GWCA_STS;
234 volatile uint32_t*
const gwmc =
242 volatile const uint32_t*
const gwms =
249#if defined(RA8_OFF_TARGET) && defined(UNIT_TEST)
289 k_ra8_gwarirm_ariog = 1UL << 0,
290 k_ra8_gwarirm_arr = 1UL << 1,
292 volatile uint32_t*
const gwarirm =
294 *gwarirm = k_ra8_gwarirm_ariog;
301 (uint32_t)k_ra8_gwarirm_arr,
334 uint32_t entry_count)
338 k_ra8_gwca_linkfix_max_entries = 32U
340 if (entry_count == 0U || entry_count > k_ra8_gwca_linkfix_max_entries) {
350 for (uint32_t i = 0U; i < entry_count; ++i) {
359 const uintptr_t addr = (uintptr_t)linkfix_table;
361 k_ra8_linkfix_upper_shift = 32U,
362 k_ra8_linkfix_upper_mask = 0xFFULL,
363 k_ra8_linkfix_lower_mask = 0xFFFFFFFFULL,
365 const uint32_t upper =
366 (uint32_t)((uint64_t)addr >> k_ra8_linkfix_upper_shift) & k_ra8_linkfix_upper_mask;
367 const uint32_t lower = (uint32_t)addr & k_ra8_linkfix_lower_mask;
368 volatile uint32_t*
const gwdcbac0 =
370 volatile uint32_t*
const gwdcbac1 =
403 uint32_t entry_count)
static const char * s_tag
Logging / check tag.
Annotation-attribute framework macros for ra8-firmware.
#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_err_hw_timeout
Hardware timed out waiting for a flag or handshake.
@ 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_gwca_axi_init(void)
Request the GWCA AXI bridge to initialize via GWARIRM.ARIOG.
void ra8_eth_gwca_dispatch(void)
Dispatch a GWCA event.
ra8_err_t ra8_eth_gwca_install_linkfix(ra8_gwca_basic_descriptor_t *linkfix_table, uint32_t entry_count)
Install a fresh LINKFIX table at GWDCBAC0/1.
volatile uint32_t g_ra8_eth_gwca_pre_step
Bench-side debug trail bumped inside internal_default_open_pre.
ra8_err_t ra8_eth_gwca_bring_up(ra8_gwca_basic_descriptor_t *linkfix_table, uint32_t entry_count)
Six-step GWCA bring-up: RESET -> DISABLE -> CONFIG -> AXI -> install_linkfix -> DISABLE -> OPERATION.
ra8_err_t ra8_eth_gwca_enter_stop(void)
Put GWCA into MSTP-gated stop.
volatile uint32_t g_ra8_eth_gwca_bring_up_step
Bench-side debug trail bumped inside ra8_eth_gwca_bring_up.
ra8_err_t ra8_eth_gwca_clear_status(uint32_t mask)
Clear GWCA_STS bits via GWCA_ICLR.
ra8_err_t ra8_eth_gwca_deinit(void)
Tear down GWCA.
static ra8_eth_gwca_event_fn_t s_gwca_fn
ra8_err_t ra8_eth_gwca_get_status(uint32_t *out_mask)
Read GWCA_STS.
ra8_err_t ra8_eth_gwca_exit_stop(void)
Exit MSTP-gated stop.
static ra8_err_t internal_bring_up_to_config(ra8_gwca_basic_descriptor_t *linkfix_table, uint32_t entry_count)
DISABLE -> CONFIG -> axi_init -> install_linkfix bring-up phase.
volatile uint32_t g_ra8_eth_gwca_open_step
Bench-side debug trail bumped by ra8_eth_gwca_default_open.
ra8_err_t ra8_eth_gwca_init(void)
Initialise GWCA.
ra8_err_t ra8_eth_gwca_set_operation_mode(ra8_gwmc_opc_t mode)
Transition the GWCA / ESWM state machine to a new OPC mode.
ra8_err_t ra8_eth_gwca_attach_handler(ra8_eth_gwca_event_fn_t fn, void *ctx)
Attach the shared event handler.
ra8_eth_gwca_init_layout_t
MFWD FWPC10/11/12 offsets used to enable extended descriptors.
@ k_ra8_mfwd_fwpc_dde
DDE bit position 0.
@ k_ra8_mfwd_off_fwpc10
FWPC10 (GWCA agent).
@ k_ra8_mfwd_off_fwpc12
FWPC12 (ETHA1 agent).
@ k_ra8_mfwd_off_fwpc11
FWPC11 (ETHA0 agent).
Ethernet CPU Agent (GWCA) driver.
void(* ra8_eth_gwca_event_fn_t)(void *ctx, uint32_t status_mask)
GWCA event callback.
Cross-TU shared surface for the ra8_eth_gwca driver split.
@ k_ra8_eth_gwca_mode_spin
GWMS.OPS / GWARIRM.ARR poll budget.
@ k_ra8_eth_gwca_step_fail_6
RA8 Ethernet gwca step fail 6.
@ k_ra8_eth_gwca_step_fail_2
RA8 Ethernet gwca step fail 2.
@ k_ra8_eth_gwca_step_fail_5
RA8 Ethernet gwca step fail 5.
@ k_ra8_eth_gwca_step_ok_6
RA8 Ethernet gwca step ok 6.
@ k_ra8_eth_gwca_step_ok_3
RA8 Ethernet gwca step ok 3.
@ k_ra8_eth_gwca_step_fail_4
RA8 Ethernet gwca step fail 4.
@ k_ra8_eth_gwca_step_ok_2
RA8 Ethernet gwca step ok 2.
@ k_ra8_eth_gwca_step_ok_5
RA8 Ethernet gwca step ok 5.
@ k_ra8_eth_gwca_step_fail_1
RA8 Ethernet gwca step fail 1.
@ k_ra8_eth_gwca_step_ok_4
RA8 Ethernet gwca step ok 4.
@ k_ra8_eth_gwca_step_fail_3
RA8 Ethernet gwca step fail 3.
@ k_ra8_eth_gwca_step_ok_1
RA8 Ethernet gwca step ok 1.
Ethernet controller base addresses for the Renesas RA8D2.
@ k_ra8_gwca_off_gwmc
Mode Configuration.
@ k_ra8_gwca_off_gwdcbac1
Descriptor chain base addr 1 (lower).
@ k_ra8_gwca_off_gwms
Mode Status.
@ k_ra8_gwca_off_gwdcbac0
Descriptor chain base addr 0 (upper).
@ k_ra8_gwca_off_gwarirm
AXI RAM Init Req Monitoring (FSP-confirmed offset).
@ k_ra8_gwdcc_dt_lempty
LEMPTY – queue disabled.
@ k_ra8_mfwd_base_addr
RA8 mfwd base address.
@ k_ra8_gwca0_base_addr
RA8 gwca0 base address.
static volatile r_gwca_regs_t * ra8_gwca(void)
Get pointer to the GWCA register block.
ra8_gwmc_opc_t
GWMC.OPC operation-mode values (HUM Ch 34.3.1 "GWMC" p 1797).
@ k_ra8_gwmc_opc_disable
DR: Disable request.
@ k_ra8_gwmc_opc_mask
RA8 gwmc opc mask.
@ k_ra8_gwmc_opc_config
CR: Config request – LINKFIX writable here.
@ k_ra8_gwmc_opc_operation
OR: Operation request – frames flow.
void * memset(void *dst, int value, size_t n)
Fill memory with a constant byte value.
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 CPU Agent (GWCA) register window.
volatile uint32_t GWCA_IE
+0x08 reserved – misnamed as "IE".
volatile uint32_t GWCA_STS
+0x04 GWMS (Mode Status) – misnamed.
volatile uint32_t GWCA_ICLR
+0x0C reserved – misnamed as "ICLR".
volatile uint32_t GWCA_CTRL
+0x00 GWMC (Mode Configuration) – misnamed.
8-byte basic descriptor (HUM Ch 34.5.1.2 "General Formats").
volatile uint8_t dt
20..23 Descriptor type (ra8_gwdcc_dt_t).