|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Cross-translation-unit seam for the EK-RA8D2 BSP implementation. More...
Go to the source code of this file.
Enumerations | |
| enum | panel_pll_const_t : uint16_t { k_panel_pclka_mhz = 60U , k_panel_pll_nmul = 48U } |
| MIPI panel PLL bring-up constants (pending datasheet confirm). More... | |
Functions | |
| bool | priv_ra8_board_uart_console_is_up (void) |
| Report whether ra8_board_uart_console_init has succeeded. | |
| ra8_err_t | priv_ra8_board_eth_eswm_bring_up (uint32_t *out_eswclk_hz) |
| Bring up the Ethernet clock, power, MSTP, and COMA boundary. | |
| ra8_err_t | priv_ra8_board_eth_etha_to_config (void) |
| Walk the board Ethernet ETHA from RESET to CONFIG. | |
Cross-translation-unit seam for the EK-RA8D2 BSP implementation.
The EK-RA8D2 board-support implementation is split across several translation units (ra8_board_ek_ra8d2*.c) that share one library. This header carries the only declarations that must be visible to more than one of those units: the MIPI/MIPI-DSI panel PLL constant block, which is authored alongside the Octo-SPI bring-up in the primary unit but consumed by the MIPI panel bring-up in a sibling unit, and the console readiness predicate the stream binding needs. Keeping them here keeps a single source-of-truth and avoids an "undeclared identifier" break if either unit moves.
Definition in file ra8_board_ek_ra8d2_internal.h.
| enum panel_pll_const_t : uint16_t |
MIPI panel PLL bring-up constants (pending datasheet confirm).
These two coefficients seed the D-PHY PLL solve in the MIPI panel bring-up path. k_panel_pclka_mhz assumes the chip's CGC reset default and k_panel_pll_nmul is the integer multiplier the placeholder 480 Mbps/lane target lands on. They live in this shared header because they are authored next to the Octo-SPI reset timings in the primary unit yet referenced from the MIPI panel config in a sibling unit.
| Enumerator | |
|---|---|
| k_panel_pclka_mhz | PCLKA assumed CGC reset default. |
| k_panel_pll_nmul | PLL integer multiplier. |
Definition at line 50 of file ra8_board_ek_ra8d2_internal.h.
| ra8_err_t priv_ra8_board_eth_eswm_bring_up | ( | uint32_t * | out_eswclk_hz | ) |
Bring up the Ethernet clock, power, MSTP, and COMA boundary.
Initializes ESWCLK and ESWPHYCLK, powers the ESWM domain, and publishes the live ESWCLK frequency. It then acquires the ESWM module-stop reference and runs the COMA reset, buffer-pool readiness poll, and agent clock fan-out. These steps implement the prerequisites described by HUM Ch 9.10.23 "EtherSW Clock (ESWCLK)" p 405 and Ch 31 "Ethernet Common Agent (COMA)" p 1590.
| [out] | out_eswclk_hz | Published ESWCLK frequency on success. |
| k_ra8_ok | Clock, power, module-stop, and COMA bring-up completed. |
| k_ra8_err_null_ptr | out_eswclk_hz is nullptr. |
| k_ra8_err_invalid_state | An Ethernet module-stop reference count is saturated. |
| k_ra8_err_hw_timeout | A clock, module-stop, or COMA readiness poll timed out. |
out_eswclk_hz points to writable storage. Bring up the Ethernet clock, power, MSTP, and COMA boundary.
Factored out of ra8_board_ethernet_init to keep that function under the project's NASA Rule 4 / clang-tidy function-size threshold. Runs the four upstream gates the RMAC / ETHA register windows hang off: ESWCLK / ESWPHYCLK, PDCTRESWM power-on, MSTPC30 (ESWM) MSTP release, MSTPC28 (ETHPHYCLK) MSTP release, and finally the chip-generic COMA RRC/RCEC/CABPIRM bring-up via ra8_eth_coma_bringup. out_eswclk_hz receives the live ESWCLK frequency so the caller can plumb it into ra8_rmac_config_t.
| [out] | out_eswclk_hz | Live ESWCLK frequency in Hz on success. |
| k_ra8_ok | Bring-up sequence completed. |
| k_ra8_err_hw_timeout | Sub-step (eswclk, MSTP) timed out. |
Definition at line 265 of file ra8_board_ek_ra8d2_ethernet.c.
References k_ra8_mstp_eswm, k_ra8_ok, ra8_cgc_eswclk_hz(), ra8_cgc_eswclk_init(), ra8_eth_coma_bringup(), ra8_mstp_enable(), and RA8_PRIV.
Referenced by ra8_board_ethernet_init().
| ra8_err_t priv_ra8_board_eth_etha_to_config | ( | void | ) |
Walk the board Ethernet ETHA from RESET to CONFIG.
Initializes ETHA1 in RESET with all error interrupts masked, then requests the ordered RESET-to-DISABLE-to-CONFIG transitions. Each transition polls EAMS until it reflects the EAMC request, as specified by HUM Ch 32.3.1.1 "EAMC : Mode Configuration Register" p 1630 and Ch 32.3.1.2 "EAMS : Mode Status Register" p 1631.
| k_ra8_ok | ETHA1 reached CONFIG mode. |
| k_ra8_err_invalid_state | The ESWM module-stop reference count is saturated. |
| k_ra8_err_hw_timeout | The ESWM release or an ETHA mode transition timed out. |
Walk the board Ethernet ETHA from RESET to CONFIG.
Per FSP r_rmac_phy_open, RMAC.MPIC is only writable while the paired ETHA is in CONFIG mode (writes are silently dropped in other modes). This helper drives ETHA into CONFIG so ra8_rmac_init can land the MPIC programming; internal_eth_etha_to_operation flips to OPERATION afterwards so MDIO traffic can start.
| k_ra8_ok | Walked to CONFIG. |
| k_ra8_err_invalid_arg | ra8_etha_set_mode rejected an argument. |
Definition at line 307 of file ra8_board_ek_ra8d2_ethernet.c.
References k_ra8_board_eth_etha_port, k_ra8_board_eth_etha_step_iters, k_ra8_etha_opc_config, k_ra8_etha_opc_disable, k_ra8_etha_opc_reset, k_ra8_ok, ra8_etha_init(), ra8_etha_set_mode(), and RA8_PRIV.
Referenced by ra8_board_ethernet_init().
|
nodiscard |
Report whether ra8_board_uart_console_init has succeeded.
The console's "is it up" flag is private to the comms translation unit – the write / read / flush entry points there consult it directly. The stream binding in a sibling unit needs the same answer before it hands an ra8_io_stream_t to an application, so the flag is published as a predicate rather than as a mutable extern: a caller can ask, and cannot lie about it.
Library-private (RA8_PRIV): production code outside libs/ra8_board_ek_ra8d2 must use the public console API, which enforces the same state itself.
| true | ra8_board_uart_console_init returned k_ra8_ok at least once, so SCI8 is configured and PD02 / PD03 are routed. |
| false | The console has never come up; nothing may be written to it. |
Report whether ra8_board_uart_console_init has succeeded.
Definition at line 343 of file ra8_board_ek_ra8d2_comms.c.
References RA8_PRIV, and s_uart_console_initialized.
Referenced by ra8_board_console_stream().