ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_etha_ops.h
Go to the documentation of this file.
1
22
23#pragma once
24
25#include <stdint.h>
26
27#include "ra8_err.h"
28#include "ra8_etha_regs.h"
29#include "ra8_etha_types.h"
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
55[[nodiscard]] ra8_err_t ra8_etha_init(ra8_etha_port_t port, const ra8_etha_config_t* cfg);
56
75[[nodiscard]] ra8_err_t ra8_etha_deinit(ra8_etha_port_t port);
76
99
120[[nodiscard]] ra8_err_t
122
143[[nodiscard]] ra8_err_t
145
166[[nodiscard]] ra8_err_t
168
189[[nodiscard]] ra8_err_t
191
215
236
256
275[[nodiscard]] ra8_err_t ra8_etha_reset(ra8_etha_port_t port);
276
323
344[[nodiscard]] ra8_err_t ra8_etha_set_queue_arb(ra8_etha_port_t port, ra8_etha_tc_t tc, uint8_t arb);
345
366[[nodiscard]] ra8_err_t
368
392 ra8_etha_tc_t tc,
393 uint16_t* cur_level,
394 uint16_t* peak);
395
418 uint8_t preempt,
419 uint8_t cut_thru,
420 ra8_etha_afs_t afs);
421
442[[nodiscard]] ra8_err_t
443ra8_etha_set_max_frame_size(ra8_etha_port_t port, ra8_etha_tc_t tc, uint16_t max_bytes);
444
466[[nodiscard]] ra8_err_t ra8_etha_set_ipv_remap(ra8_etha_port_t port, const uint8_t* map);
467
468#ifdef __cplusplus
469}
470#endif
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_err_t ra8_etha_set_ipv_remap(ra8_etha_port_t port, const uint8_t *map)
Programme the IPV (PCP-to-internal-priority) remap table.
Definition ra8_etha.c:583
ra8_err_t ra8_etha_deinit(ra8_etha_port_t port)
Tear down an ETHA port (drop into RESET, mask all IRQs).
Definition ra8_etha.c:203
ra8_err_t ra8_etha_set_mode(ra8_etha_port_t port, ra8_etha_opc_t mode)
Issue an explicit EAMC mode-change command.
Definition ra8_etha.c:494
ra8_err_t ra8_etha_disable_irq(ra8_etha_port_t port, ra8_etha_irq_class_t block, uint32_t mask)
Atomically disable specific error IRQ bits in one of the three blocks.
Definition ra8_etha.c:316
ra8_err_t ra8_etha_enter_stop(ra8_etha_port_t port)
Drop an ETHA port into low-power stop (DISABLE mode).
Definition ra8_etha.c:390
ra8_err_t ra8_etha_clear_status(ra8_etha_port_t port, ra8_etha_irq_class_t block, uint32_t mask)
Clear bits in EAEIS0 / EAEIS1 / EAEIS2 via EAEIDx.
Definition ra8_etha.c:255
ra8_err_t ra8_etha_set_queue_depth(ra8_etha_port_t port, ra8_etha_tc_t tc, uint16_t depth)
Set the TX descriptor queue depth for one traffic class.
Definition ra8_etha.c:523
ra8_err_t ra8_etha_enable_irq(ra8_etha_port_t port, ra8_etha_irq_class_t block, uint32_t mask)
Atomically enable specific error IRQ bits in one of the three blocks.
Definition ra8_etha.c:289
void ra8_etha_dispatch(ra8_etha_port_t port)
Snapshot all three EAEISx, clear them, then fire the per-port handler.
Definition ra8_etha.c:355
ra8_err_t ra8_etha_attach_handler(ra8_etha_port_t port, ra8_etha_event_fn_t cb, void *ctx)
Attach a per-port event handler.
Definition ra8_etha.c:343
ra8_err_t ra8_etha_get_status(ra8_etha_port_t port, ra8_etha_status_t *out)
Read a port's status snapshot (mode + 3x error IRQ status + TAS).
Definition ra8_etha.c:228
ra8_err_t ra8_etha_set_preemption(ra8_etha_port_t port, uint8_t preempt, uint8_t cut_thru, ra8_etha_afs_t afs)
Configure 802.3br TX preemption: which classes are pre-emptable.
Definition ra8_etha.c:555
ra8_err_t ra8_etha_reset(ra8_etha_port_t port)
Software-reset the port: drop to RESET, then re-enter CONFIG.
Definition ra8_etha.c:412
ra8_err_t ra8_etha_exit_stop(ra8_etha_port_t port)
Bring an ETHA port back from low-power stop (OPERATION mode).
Definition ra8_etha.c:401
ra8_err_t ra8_etha_set_max_frame_size(ra8_etha_port_t port, ra8_etha_tc_t tc, uint16_t max_bytes)
Set the maximum frame size for one traffic class (jumbo OK).
Definition ra8_etha.c:572
ra8_err_t ra8_etha_set_queue_arb(ra8_etha_port_t port, ra8_etha_tc_t tc, uint8_t arb)
Configure the per-traffic-class TX queue arbitration weight.
Definition ra8_etha.c:506
ra8_err_t ra8_etha_init(ra8_etha_port_t port, const ra8_etha_config_t *cfg)
Initialise an ETHA port (MSTP gate + reset registers + initial mode).
Definition ra8_etha.c:167
ra8_err_t ra8_etha_get_queue_level(ra8_etha_port_t port, ra8_etha_tc_t tc, uint16_t *cur_level, uint16_t *peak)
Read the current and high-water-mark queue level for one class.
Definition ra8_etha.c:534
Ethernet Agent (ETHA) per-port register layout for the RA8D2.
ra8_etha_port_t
ETHA port index (m = 0, 1).
ra8_etha_afs_t
EATPEC.AFS[1:0] additional fragment size policy for 802.3br.
ra8_etha_tc_t
Traffic-class index (q = 0..7) used by every per-class array.
ra8_etha_opc_t
ETHA EAMC.OPC[1:0] operating mode commands.
ra8_etha_irq_class_t
Identifier for one of the three error-interrupt blocks.
Per-port Ethernet Agent (ETHA) data types – HUM Ch 32 (p 1627-1702).
void(* ra8_etha_event_fn_t)(void *ctx, ra8_etha_port_t port, uint32_t eaeis0, uint32_t eaeis1, uint32_t eaeis2)
ETHA per-port event callback.
Per-port ETHA configuration knobs.
Snapshot of an ETHA port's runtime state.