|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
MIPI D-PHY register layout for the RA8D2. More...
Go to the source code of this file.
Functions | |
| static volatile uint32_t * | ra8_mipi_phy_reg32 (ra8_mipi_phy_block_off_t offset) |
| Pointer to a 32-bit MIPI PHY register at the given offset. | |
MIPI D-PHY register layout for the RA8D2.
The MIPI PHY block at MMIO base 0x4034_6C00 is the physical layer shared by the MIPI DSI host (Ch 65) and the MIPI CSI receiver (Ch 66). It implements MIPI Alliance Specification v2.1 D-PHY with up to 2 lanes at a maximum line rate of 720 Mbps/lane (HUM Ch 64.1 "Overview" Table 64.1, p 3822).
The block exposes a small set of 32-bit registers (HUM Ch 64.2 "Register Description" notes "Access the following registers only in units of 32 bits.", p 3822):
| Offset | Name | Purpose |
|---|---|---|
| 0x000 | DPHYREFCR | Reference clock setting (PCLKA MHz) |
| 0x004 | DPHYPLFCR | PLL frequency control (I/N/NF/P) |
| 0x008 | DPHYPLOCR | PLL operation control (PLLSTP) |
| 0x00C | DPHYESCCR | Escape mode clock divisor (ESCDIV) |
| 0x010 | DPHYPWRCR | LDO power supply control (PWRSEN) |
| 0x01C | DPHYSFR | Status flags (PWRSF, PLLSF) – RO |
| 0x020 | DPHYOCR | Operation control (DPHYEN) |
| 0x024 | DPHYTIM1 | TINIT timing |
| 0x028 | DPHYTIM2 | TCLK_PREP/SETT/MISS timing |
| 0x02C | DPHYTIM3 | THS_PREP/SETT timing |
| 0x030 | DPHYTIM4 | TCLK_ZERO/PRE/POST/TRAIL timing |
| 0x034 | DPHYTIM5 | THS_ZERO/TRAIL/EXIT timing |
| 0x038 | DPHYTIM6 | TLPX timing |
| 0x048 | DPHYMDC | Host/device mode (DSI vs CSI) |
Cross-checked against FSP R_MIPI_PHY register list in r_mipi_phy.c and the bit-field definitions in the FSP r_mipi_phy.h instance header.
Note: k_ra8_mipi_phy_base_addr is already declared in ra8_glcdc_regs.h as part of the ra8_display_addr_t enum that groups the GLCDC + MIPI + CEU bases. This header uses that constant rather than redefining it.
Definition in file ra8_mipi_phy_regs.h.
| enum ra8_mipi_phy_block_off_t : uint16_t |
32-bit register offsets inside the MIPI PHY window.
Names mirror the HUM register acronyms (DPHYxxx). Verified against HUM Ch 64.2 sections 64.2.1 .. 64.2.14, p 3822-3837.
Definition at line 66 of file ra8_mipi_phy_regs.h.
| enum ra8_mipi_phy_esccr_mask_t : uint32_t |
DPHYESCCR field masks.
HUM Ch 64.2.4 "DPHYESCCR : D-PHY Escape Mode Clock Control Register" p 3825: ESCDIV[4:0] controls the LP-state clock divisor (1 .. 32). Must be set while the PLL is stopped.
| Enumerator | |
|---|---|
| k_ra8_mipi_phy_esccr_escdiv_mask | ESCDIV[4:0] field. |
Definition at line 187 of file ra8_mipi_phy_regs.h.
| enum ra8_mipi_phy_input_clk_t : uint8_t |
Input clock guardrails to PLL (HUM Ch 64.1 Table 64.1 p 3822).
The MOSC reference must be 8..48 MHz, and after IDIV division the PLL input must land in 8..24 MHz.
Definition at line 321 of file ra8_mipi_phy_regs.h.
| enum ra8_mipi_phy_lane_speed_limit_t : uint16_t |
Per-lane line-rate guardrails (Mbps).
HUM Ch 64.1 Table 64.1 p 3822: D-PHY supports 80 Mbps to 720 Mbps per lane. The driver clamps the requested speed into this range before computing PLL coefficients.
| Enumerator | |
|---|---|
| k_ra8_mipi_phy_line_rate_min_mbps | Lower line-rate limit. |
| k_ra8_mipi_phy_line_rate_max_mbps | Upper line-rate limit. |
Definition at line 278 of file ra8_mipi_phy_regs.h.
| enum ra8_mipi_phy_mdc_bit_t : uint32_t |
DPHYMDC bit positions / masks.
HUM Ch 64.2.14 "DPHYMDC : D-PHY Mode Control Register" p 3836:
| Enumerator | |
|---|---|
| k_ra8_mipi_phy_mdc_hosten | DPHYMDC.MASTEREN bit 0: host (DSI) mode. |
Definition at line 145 of file ra8_mipi_phy_regs.h.
| enum ra8_mipi_phy_ocr_bit_t : uint32_t |
DPHYOCR bit positions / masks.
HUM Ch 64.2.7 "DPHYOCR : D-PHY Operation Control Register" p 3827: bit 0 = DPHYEN (0 = D-PHY off, 1 = D-PHY on).
| Enumerator | |
|---|---|
| k_ra8_mipi_phy_ocr_dphyen | Bit 0 mask: enable D-PHY. |
Definition at line 115 of file ra8_mipi_phy_regs.h.
| enum ra8_mipi_phy_pll_band_t : uint16_t |
VCO frequency band guardrails (HUM Ch 64.1 Table 64.1 p 3822).
The PLL VCO must oscillate between 960 MHz and 3000 MHz. The post-divider band depends on PMUL[1:0]:
Used by the driver-side band validator to reject impossible combinations of NMUL_int / NFMUL / PMUL before they ever reach the silicon.
Definition at line 300 of file ra8_mipi_phy_regs.h.
| enum ra8_mipi_phy_pll_field_mask_t : uint32_t |
DPHYPLFCR field width masks (pre-shift, applied to value).
| Enumerator | |
|---|---|
| k_ra8_mipi_phy_plfcr_mask_idiv | IDIV[1:0] mask. |
| k_ra8_mipi_phy_plfcr_mask_nfmul | NFMUL[1:0] mask. |
| k_ra8_mipi_phy_plfcr_mask_pmul | PMUL[1:0] mask. |
| k_ra8_mipi_phy_plfcr_mask_nmul | NMUL[8:0] mask. |
Definition at line 262 of file ra8_mipi_phy_regs.h.
| enum ra8_mipi_phy_pll_field_shift_t : uint8_t |
DPHYPLFCR field positions.
HUM Ch 64.2.2 "DPHYPLFCR : D-PHY PLL Frequency Control Register" p 3823:
Definition at line 251 of file ra8_mipi_phy_regs.h.
| enum ra8_mipi_phy_plocr_bit_t : uint32_t |
DPHYPLOCR bit positions / masks.
HUM Ch 64.2.3 "DPHYPLOCR : D-PHY PLL Operation Control Register" p 3824: bit 0 = PLLSTP (0 = run PLL, 1 = stop PLL). Reset = 1.
| Enumerator | |
|---|---|
| k_ra8_mipi_phy_plocr_pllstp | Bit 0 mask: stop the PLL. |
Definition at line 103 of file ra8_mipi_phy_regs.h.
| enum ra8_mipi_phy_pwrcr_bit_t : uint32_t |
DPHYPWRCR bit positions / masks.
HUM Ch 64.2.5 "DPHYPWRCR : D-PHY Power Supplying Control Register" p 3826: bit 0 = PWRSEN (0 = stop LDO, 1 = enable LDO).
| Enumerator | |
|---|---|
| k_ra8_mipi_phy_pwrcr_pwrsen | Bit 0 mask: enable D-PHY LDO. |
Definition at line 91 of file ra8_mipi_phy_regs.h.
| enum ra8_mipi_phy_refcr_bias_t : uint8_t |
Software-side bias used when encoding DPHYREFCR.RFREQ.
HUM Ch 64.2.1 p 3822: hardware encoding subtracts one from the frequency in MHz before storing it in RFREQ[7:0]. Use this constant everywhere the driver converts pclka_mhz to a register value.
| Enumerator | |
|---|---|
| k_ra8_mipi_phy_refcr_rfreq_bias | RFREQ encodes (MHz - 1). |
Definition at line 174 of file ra8_mipi_phy_regs.h.
| enum ra8_mipi_phy_refcr_mask_t : uint32_t |
DPHYREFCR field masks.
HUM Ch 64.2.1 "DPHYREFCR : D-PHY Reference Clock Setting Register" p 3822 documents the encoding as a strict RFREQ = pclka_mhz - 1 mapping: 0x27 = 40 MHz, 0x28 = 41 MHz, ..., 0x7C = 125 MHz. PCLKA must be >= 40 MHz to use MIPI DSI. Driver code MUST subtract one before writing – this matches FSP r_mipi_phy.c which writes (pclka_hz / 1MHz) - 1.
| Enumerator | |
|---|---|
| k_ra8_mipi_phy_refcr_rfreq_mask | RFREQ[7:0] field. |
Definition at line 161 of file ra8_mipi_phy_regs.h.
| enum ra8_mipi_phy_sfr_bit_t : uint32_t |
DPHYSFR status flag positions / masks (read-only).
HUM Ch 64.2.6 "DPHYSFR : D-PHY Status Flag Register" p 3826:
The full status mask combines both flags (used by status-get helpers that want to assert "PHY fully ready").
| Enumerator | |
|---|---|
| k_ra8_mipi_phy_sfr_pwrsf | Bit 0 mask: LDO stable. |
| k_ra8_mipi_phy_sfr_pllsf | Bit 8 mask: PLL clock stable. |
| k_ra8_mipi_phy_sfr_ready_mask | PWRSF | PLLSF. |
Definition at line 131 of file ra8_mipi_phy_regs.h.
| enum ra8_mipi_phy_tim1_mask_t : uint32_t |
DPHYTIM1 field masks.
HUM Ch 64.2.8 "DPHYTIM1 : D-PHY Timing Control Register 1" p 3827: TINIT[18:0] = (TINIT count) where T_INIT = (TINIT + 1) * PCLKA.
| Enumerator | |
|---|---|
| k_ra8_mipi_phy_tim1_tinit_mask | TINIT[18:0] field. |
Definition at line 199 of file ra8_mipi_phy_regs.h.
| enum ra8_mipi_phy_tim6_mask_t : uint32_t |
DPHYTIM6 field masks.
HUM Ch 64.2.13 "DPHYTIM6 : D-PHY Timing Control Register 6" p 3830: TLPX[7:0] – only one byte-wide field, upper 24 bits are reserved.
| Enumerator | |
|---|---|
| k_ra8_mipi_phy_tim6_tlpx_mask | TLPX[7:0] field. |
Definition at line 235 of file ra8_mipi_phy_regs.h.
| enum ra8_mipi_phy_tim_byte_mask_t : uint32_t |
8-bit per-field mask applied before shifting in DPHYTIM2..5.
| Enumerator | |
|---|---|
| k_ra8_mipi_phy_tim_byte_mask | Mask for each 8-bit lane. |
Definition at line 222 of file ra8_mipi_phy_regs.h.
| enum ra8_mipi_phy_tim_byte_shift_t : uint8_t |
Generic 8-bit byte-lane shifts used inside DPHYTIM2..5.
Many DPHYTIMx registers pack three / four 8-bit fields into the 32-bit word. These shifts replace the magic numbers 0/8/16/24.
Definition at line 211 of file ra8_mipi_phy_regs.h.
|
inlinestatic |
Pointer to a 32-bit MIPI PHY register at the given offset.
| [in] | offset | Register offset from ra8_mipi_phy_block_off_t. |
Definition at line 340 of file ra8_mipi_phy_regs.h.
References k_ra8_mipi_phy_base_addr.
Referenced by internal_mipi_phy_cache_state(), internal_mipi_phy_init_host(), internal_mipi_phy_init_power_up(), priv_mipi_phy_write_timing(), ra8_mipi_phy_deinit(), ra8_mipi_phy_dispatch(), ra8_mipi_phy_get_status(), ra8_mipi_phy_init(), ra8_mipi_phy_is_ldo_stable(), ra8_mipi_phy_is_pll_locked(), ra8_mipi_phy_ldo_disable(), ra8_mipi_phy_ldo_enable(), ra8_mipi_phy_pll_start(), ra8_mipi_phy_pll_stop(), ra8_mipi_phy_reset(), ra8_mipi_phy_set_escape_divisor(), ra8_mipi_phy_set_lane_speed(), ra8_mipi_phy_set_pclka_freq(), ra8_mipi_phy_switch_mode(), and ra8_mipi_phy_wait_ready().