|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
MIPI CSI-2 Receiver register layout for the RA8D2 (HUM Ch 66). More...
Go to the source code of this file.
Functions | |
| static volatile uint32_t * | ra8_mipi_csi_reg32 (ra8_mipi_csi_off_t off) |
| Get a 32-bit volatile pointer to a register inside the MIPI CSI window. | |
| static ra8_mipi_csi_off_t | ra8_mipi_csi_vc_off (ra8_mipi_csi_off_t base, uint8_t vc) |
| Compute the byte offset of a per-virtual-channel register. | |
| static ra8_mipi_csi_off_t | ra8_mipi_csi_dl_off (ra8_mipi_csi_off_t base, uint8_t lane) |
| Compute the byte offset of a per-data-lane register. | |
MIPI CSI-2 Receiver register layout for the RA8D2 (HUM Ch 66).
The RA8D2 exposes a single MIPI CSI-2 receiver block at base 0x40347000 (Secure) / 0x50347000 (Non-Secure). The peripheral accepts up to 2 D-PHY data lanes at 80-720 Mbps/lane and forwards decoded image data into the Video Input (VIN) module. It supports MIPI CSI-2 V3.0 and MIPI D-PHY V2.5.
The register window is 0x298 bytes long. The HUM specifies that ALL register accesses must be in 32-bit units (HUM Ch 66.3 "Register Descriptions" p 3935: "Access the following registers only in units of 32 bits.").
| Offset | Name | Width | Purpose |
|---|---|---|---|
| 0x000 | MCG | 32 | Module configuration (RO IP info: VER/SDLN/GSNM) |
| 0x010 | MCT0 | 32 | Lanes, modes, ECC/LFSR knobs |
| 0x018 | MCT2 | 32 | Clock-rate adjust (FRRSKW / FRRCLK) |
| 0x01C | MCT3 | 32 | RXEN reception enable |
| 0x028 | RTCT | 32 | Software reset control (VSRST W1) |
| 0x02C | RTST | 32 | Software reset status (VSRSTS) |
| 0x040 | EPCT | 32 | EPD Option Control (SLP/EPDOP/SSP/EPDEN) |
| 0x044 | EMCT | 32 | EPD Misc-Option (VLSIEN/EOTPEN) |
| 0x050 | MIST | 32 | Module IRQ status (DL/PM/GST/RX/VC[15:0]) |
| 0x060 | DTEL | 32 | Receive data-type enable low (DT 0x00-1F) |
| 0x064 | DTEH | 32 | Receive data-type enable high (DT 0x20-3F) |
| 0x070 | RXST | 32 | Receive status (FRMn[15:0], RACT, RACTDET) |
| 0x074 | RXSC | 32 | Receive status clear (RACTDETC) |
| 0x078 | RXIE | 32 | Receive interrupt enable (RACTDETE) |
| 0x080 | DLST0 | 32 | Data lane 0 status |
| 0x084 | DLSC0 | 32 | Data lane 0 status clear |
| 0x088 | DLIE0 | 32 | Data lane 0 interrupt enable |
| 0x090 | DLST1 | 32 | Data lane 1 status |
| 0x094 | DLSC1 | 32 | Data lane 1 status clear |
| 0x098 | DLIE1 | 32 | Data lane 1 interrupt enable |
| 0x100+ | VCST(M) | 32 | Virtual channel M status (16 channels, +0x10) |
| 0x104+ | VCSC(M) | 32 | Virtual channel M status clear |
| 0x108+ | VCIE(M) | 32 | Virtual channel M interrupt enable |
| 0x200 | PMST | 32 | Power-management status |
| 0x204 | PMSC | 32 | Power-management status clear |
| 0x208 | PMIE | 32 | Power-management interrupt enable |
| 0x280 | GSCT | 32 | Generic short packet control (SHTH/GFIF) |
| 0x284 | GSST | 32 | Generic short packet status (PNUM/GOV/...) |
| 0x288 | GSSC | 32 | Generic short packet status clear (GOVC) |
| 0x28C | GSIE | 32 | Generic short packet interrupt enable |
| 0x290 | GSHT | 32 | Generic short packet header (FIFO read) |
| 0x294 | GSIU | 32 | Generic short packet info update (FINC/GFCLR/GFEN) |
The MIPI CSI base address itself is declared in ra8_glcdc_regs.h (alongside its display-block siblings GLCDC, MIPI DSI, MIPI PHY, CEU) so all four display peripherals share one address enum. We re-use k_ra8_mipi_csi_base_addr from there rather than redefining it.
Definition in file ra8_mipi_csi_regs.h.
| enum ra8_mipi_csi_dlie_bits_t : uint32_t |
DLIE(N) (Data Lane N Interrupt Enable) bits.
HUM Ch 66.3.17 p 3948.
Definition at line 408 of file ra8_mipi_csi_regs.h.
| enum ra8_mipi_csi_dlsc_bits_t : uint32_t |
DLSC(N) (Data Lane N Status Clear) bits (W1C).
HUM Ch 66.3.16 p 3947-3948.
Definition at line 393 of file ra8_mipi_csi_regs.h.
| enum ra8_mipi_csi_dlst_bits_t : uint32_t |
DLST(N) (Data Lane N Status) bits.
HUM Ch 66.3.15 p 3946-3947.
Definition at line 377 of file ra8_mipi_csi_regs.h.
| enum ra8_mipi_csi_dt_high_bits_t : uint32_t |
DTEH (Receive Data Type Enable High) per-bit masks (HUM Ch 66.3.11 p 3944, Table 66.3).
Active bits in DT 0x20-0x3F: RGB888 (bit 4), RAW8 (bit 10). All other bits must be left at their reset value (0).
| Enumerator | |
|---|---|
| k_ra8_mipi_csi_dteh_rgb888_mask | [4] RGB888. |
| k_ra8_mipi_csi_dteh_raw8_mask | [10] RAW8. |
Definition at line 334 of file ra8_mipi_csi_regs.h.
| enum ra8_mipi_csi_dt_low_bits_t : uint32_t |
DTEL (Receive Data Type Enable Low) per-bit masks (HUM Ch 66.3.10 p 3943, Table 66.2).
Bits [3:0] are reserved (fixed to 1 by hardware). Bits [7:5] are reserved (fixed to 0). Bits [29:16] are reserved (fixed to 0). The active bits are EOT, GSP1..GSP8, YUV422_8/10.
Definition at line 310 of file ra8_mipi_csi_regs.h.
| enum ra8_mipi_csi_emct_bits_t : uint32_t |
EMCT (EPD Misc Option Control) field masks.
Per HUM Ch 66.3.8 "EMCT" p 3940-3941.
| Enumerator | |
|---|---|
| k_ra8_mipi_csi_emct_vlsien_mask | [5:4] var spacer. |
| k_ra8_mipi_csi_emct_vlsien_shift | VLSIEN shift. |
| k_ra8_mipi_csi_emct_eotpen_mask | [6] EOTP enable. |
Definition at line 268 of file ra8_mipi_csi_regs.h.
| enum ra8_mipi_csi_epct_bits_t : uint32_t |
EPCT (EPD Option Control) field masks.
Per HUM Ch 66.3.7 "EPCT" p 3939-3940.
Definition at line 252 of file ra8_mipi_csi_regs.h.
| enum ra8_mipi_csi_gsct_bits_t : uint32_t |
GSCT (Generic Short Packet Control) field masks.
HUM Ch 66.3.24 p 3957.
| Enumerator | |
|---|---|
| k_ra8_mipi_csi_gsct_shth_mask | [6:0] threshold. |
| k_ra8_mipi_csi_gsct_shth_shift | SHTH shift. |
| k_ra8_mipi_csi_gsct_gfif_mask | [16] FIFO store en. |
| k_ra8_mipi_csi_gsct_shth_max | Max meaningful SHTH. |
Definition at line 556 of file ra8_mipi_csi_regs.h.
| enum ra8_mipi_csi_gsht_bits_t : uint32_t |
GSHT (Generic Short Packet Header, RO) field masks.
HUM Ch 66.3.28 p 3959.
Definition at line 610 of file ra8_mipi_csi_regs.h.
| enum ra8_mipi_csi_gsie_bits_t : uint32_t |
GSIE (Generic Short Packet Interrupt Enable) bits.
HUM Ch 66.3.27 p 3958-3959.
Definition at line 595 of file ra8_mipi_csi_regs.h.
| enum ra8_mipi_csi_gsiu_bits_t : uint32_t |
GSIU (Generic Short Packet Information Update) bits.
HUM Ch 66.3.29 p 3960.
| Enumerator | |
|---|---|
| k_ra8_mipi_csi_gsiu_finc_mask | [0] FIFO increment. |
| k_ra8_mipi_csi_gsiu_gfclr_mask | [8] FIFO clear req. |
| k_ra8_mipi_csi_gsiu_gfen_mask | [16] FIFO re-enable. |
Definition at line 627 of file ra8_mipi_csi_regs.h.
| enum ra8_mipi_csi_gssc_bits_t : uint32_t |
GSSC (Generic Short Packet Status Clear) bits (W1C).
HUM Ch 66.3.26 p 3958.
| Enumerator | |
|---|---|
| k_ra8_mipi_csi_gssc_govc_mask | [4] clear GOV. |
Definition at line 586 of file ra8_mipi_csi_regs.h.
| enum ra8_mipi_csi_gsst_bits_t : uint32_t |
GSST (Generic Short Packet Status) bit layout.
HUM Ch 66.3.25 p 3957-3958. PNUM is at [15:8]; GOV at bit [4]; GCD at bit [16]; STRDS at bit [17]. The lower flag bits (GNE bit 0, GTH bit 1) are level-sensitive while data is queued.
Definition at line 571 of file ra8_mipi_csi_regs.h.
| enum ra8_mipi_csi_limits_t : uint16_t |
Module-wide constants (channel counts, stride values).
Definition at line 151 of file ra8_mipi_csi_regs.h.
| enum ra8_mipi_csi_mcg_bits_t : uint32_t |
MCG (Module Configuration, RO) field masks.
Per HUM Ch 66.3.1 "MCG : Module Configuration Register" p 3936.
Definition at line 172 of file ra8_mipi_csi_regs.h.
| enum ra8_mipi_csi_mct0_bits_t : uint32_t |
MCT0 (Module Control 0) bit masks.
Verified against HUM Ch 66.3.2 "MCT0 : Module Control Register 0" p 3936-3937.
Definition at line 188 of file ra8_mipi_csi_regs.h.
| enum ra8_mipi_csi_mct2_bits_t : uint32_t |
MCT2 (Module Control 2) field masks/shifts.
Per HUM Ch 66.3.3 p 3937-3938.
| Enumerator | |
|---|---|
| k_ra8_mipi_csi_mct2_frrclk_mask | [8:0] FRRCLK. |
| k_ra8_mipi_csi_mct2_frrclk_shift | FRRCLK shift. |
| k_ra8_mipi_csi_mct2_frrskw_mask | [24:16] FRRSKW. |
| k_ra8_mipi_csi_mct2_frrskw_shift | FRRSKW shift. |
Definition at line 203 of file ra8_mipi_csi_regs.h.
| enum ra8_mipi_csi_mct3_bits_t : uint32_t |
MCT3 (Module Control 3) bit masks.
The only writable bit is RXEN, which gates D-PHY reception.
Verified against HUM Ch 66.3.4 "MCT3 : Module Control Register 3" p 3938.
| Enumerator | |
|---|---|
| k_ra8_mipi_csi_mct3_rxen_mask | [0] RX enable. |
Definition at line 218 of file ra8_mipi_csi_regs.h.
| enum ra8_mipi_csi_mist_bits_t : uint32_t |
MIST (Module Interrupt Status, RO) bits.
Per HUM Ch 66.3.9 "MIST" p 3941-3942. Read-only summary register; clear is by clearing the underlying source registers.
Definition at line 291 of file ra8_mipi_csi_regs.h.
| enum ra8_mipi_csi_off_t : uint16_t |
Absolute byte offsets into the MIPI CSI register window.
Names mirror the HUM Ch 66.3 register names (MCG, MCT0, MCT2, ...). All offsets are 32-bit aligned per HUM Ch 66.3 "Register Descriptions" p 3935.
Only the first virtual channel (VC0) and data lane (DL0) are enumerated explicitly; VC1..VC15 follow at +0x10 stride from VCST0 / VCSC0 / VCIE0 and DL1 follows at +0x10 stride from DLST0 / DLSC0 / DLIE0. Helpers ra8_mipi_csi_vc_off() and ra8_mipi_csi_dl_off() below compute the offsets safely.
Definition at line 91 of file ra8_mipi_csi_regs.h.
| enum ra8_mipi_csi_pmie_bits_t : uint32_t |
PMIE (Power Management Interrupt Enable) bits.
HUM Ch 66.3.23 p 3956.
Definition at line 537 of file ra8_mipi_csi_regs.h.
| enum ra8_mipi_csi_pmsc_bits_t : uint32_t |
PMSC (Power Management Status Clear) bits (W1C).
HUM Ch 66.3.22 p 3955.
Definition at line 520 of file ra8_mipi_csi_regs.h.
| enum ra8_mipi_csi_pmst_bits_t : uint32_t |
PMST (Power Management Status) bit masks.
HUM Ch 66.3.21 p 3954-3955.
Definition at line 499 of file ra8_mipi_csi_regs.h.
| enum ra8_mipi_csi_rtct_bits_t : uint32_t |
RTCT (Reset Control) bits – write 1 to VSRST to reset the Video-Pixel interface.
Verified against HUM Ch 66.3.5 "RTCT : Reset Control Register" p 3938.
| Enumerator | |
|---|---|
| k_ra8_mipi_csi_rtct_vsrst_mask | [0] software reset. |
Definition at line 230 of file ra8_mipi_csi_regs.h.
| enum ra8_mipi_csi_rtst_bits_t : uint32_t |
RTST (Reset Status) bits – VSRSTS reads 1 while a reset is in progress, 0 once it has completed.
| Enumerator | |
|---|---|
| k_ra8_mipi_csi_rtst_vsrsts_mask | [0] reset busy. |
Definition at line 239 of file ra8_mipi_csi_regs.h.
| enum ra8_mipi_csi_rxie_bits_t : uint32_t |
RXIE (Receive Interrupt Enable) – enables RACTDET interrupt.
HUM Ch 66.3.14 p 3946.
| Enumerator | |
|---|---|
| k_ra8_mipi_csi_rxie_ractdete_mask | [17] enable IRQ. |
Definition at line 368 of file ra8_mipi_csi_regs.h.
| enum ra8_mipi_csi_rxsc_bits_t : uint32_t |
RXSC (Receive Status Clear) – write 1 to clear RACTDET.
HUM Ch 66.3.13 p 3945.
| Enumerator | |
|---|---|
| k_ra8_mipi_csi_rxsc_ractdetc_mask | [17] clear RXDET. |
Definition at line 359 of file ra8_mipi_csi_regs.h.
| enum ra8_mipi_csi_rxst_bits_t : uint32_t |
RXST (Receive Status) bits.
Bits [15:0] are FRMn (frame active for VC0..VC15). Bit 16 is RACT (live reception), bit 17 is RACTDET (sticky reception detect). HUM Ch 66.3.12 p 3944-3945.
| Enumerator | |
|---|---|
| k_ra8_mipi_csi_rxst_frm_mask | [15:0] FRMn flags. |
| k_ra8_mipi_csi_rxst_ract_mask | [16] RX active. |
| k_ra8_mipi_csi_rxst_ractdet_mask | [17] RX detected. |
Definition at line 348 of file ra8_mipi_csi_regs.h.
| enum ra8_mipi_csi_vcie_bits_t : uint32_t |
VCIE(M) (Virtual Channel M Interrupt Enable) bits.
HUM Ch 66.3.20 p 3952-3953. Bit positions match VCST.
Definition at line 475 of file ra8_mipi_csi_regs.h.
| enum ra8_mipi_csi_vcsc_bits_t : uint32_t |
VCSC(M) (Virtual Channel M Status Clear) bits (W1C).
HUM Ch 66.3.19 p 3951-3952.
Definition at line 449 of file ra8_mipi_csi_regs.h.
| enum ra8_mipi_csi_vcst_bits_t : uint32_t |
VCST(M) (Virtual Channel M Status) bit masks.
HUM Ch 66.3.18 p 3949-3950.
Definition at line 423 of file ra8_mipi_csi_regs.h.
| enum ra8_mipi_csi_vlsien_t : uint8_t |
Encodings for EMCT.VLSIEN[5:4] (HUM Ch 66.3.8 p 3941).
Definition at line 278 of file ra8_mipi_csi_regs.h.
|
inlinestatic |
Compute the byte offset of a per-data-lane register.
| [in] | base | One of k_ra8_mipi_csi_off_dlst0 / k_ra8_mipi_csi_off_dlsc0 / k_ra8_mipi_csi_off_dlie0. |
| [in] | lane | Data lane index 0..1. |
See implementation.
| k_ra8_ok | Operation succeeded. |
Definition at line 700 of file ra8_mipi_csi_regs.h.
References k_ra8_mipi_csi_dl_stride.
Referenced by ra8_mipi_csi_dl_clear_status(), ra8_mipi_csi_dl_get_status(), and ra8_mipi_csi_dl_set_irq_enable().
|
inlinestatic |
Get a 32-bit volatile pointer to a register inside the MIPI CSI window.
All MIPI CSI register accesses are 32 bits wide per HUM Ch 66.3 "Register Descriptions" p 3935. Going through this accessor (rather than raw (*(volatile uint32_t*)addr) casts) lets the host-side unit-test fake mmap intercept the access and back it with ordinary heap memory.
| [in] | off | One of the k_ra8_mipi_csi_off_* enum values. |
Definition at line 648 of file ra8_mipi_csi_regs.h.
References k_ra8_mipi_csi_base_addr.
Referenced by internal_program_irq_masks(), internal_program_receiver(), internal_recompute_dt_filter(), internal_reject_if_running(), internal_wait_reset_idle(), ra8_mipi_csi_clear_status(), ra8_mipi_csi_deinit(), ra8_mipi_csi_dispatch(), ra8_mipi_csi_dispatch_dl(), ra8_mipi_csi_dispatch_pm(), ra8_mipi_csi_dispatch_short_packet(), ra8_mipi_csi_dispatch_vc(), ra8_mipi_csi_dl_clear_status(), ra8_mipi_csi_dl_get_status(), ra8_mipi_csi_dl_set_irq_enable(), ra8_mipi_csi_get_module_info(), ra8_mipi_csi_get_module_irq_status(), ra8_mipi_csi_get_status(), ra8_mipi_csi_init(), ra8_mipi_csi_pm_clear_status(), ra8_mipi_csi_pm_get_status(), ra8_mipi_csi_pm_set_irq_enable(), ra8_mipi_csi_read_short_packet(), ra8_mipi_csi_reset(), ra8_mipi_csi_set_data_type_filter(), ra8_mipi_csi_set_ecc_mode(), ra8_mipi_csi_set_epd(), ra8_mipi_csi_set_frame_error_mode(), ra8_mipi_csi_set_lrte(), ra8_mipi_csi_set_rx_irq_enable(), ra8_mipi_csi_set_virtual_channels(), ra8_mipi_csi_short_packet_clear_fifo(), ra8_mipi_csi_short_packet_clear_status(), ra8_mipi_csi_short_packet_configure(), ra8_mipi_csi_short_packet_get_status(), ra8_mipi_csi_short_packet_re_enable_store(), ra8_mipi_csi_short_packet_set_irq_enable(), ra8_mipi_csi_start_receive(), ra8_mipi_csi_stop_receive(), ra8_mipi_csi_vc_clear_status(), ra8_mipi_csi_vc_get_status(), and ra8_mipi_csi_vc_set_irq_enable().
|
inlinestatic |
Compute the byte offset of a per-virtual-channel register.
| [in] | base | One of k_ra8_mipi_csi_off_vcst0 / k_ra8_mipi_csi_off_vcsc0 / k_ra8_mipi_csi_off_vcie0 (caller chooses status, clear, or interrupt-enable). |
| [in] | vc | Virtual channel index 0..15. Caller is expected to validate. |
See implementation.
| k_ra8_ok | Operation succeeded. |
Definition at line 674 of file ra8_mipi_csi_regs.h.
References k_ra8_mipi_csi_vc_stride.
Referenced by internal_program_irq_masks(), ra8_mipi_csi_deinit(), ra8_mipi_csi_dispatch_vc(), ra8_mipi_csi_set_virtual_channels(), ra8_mipi_csi_vc_clear_status(), ra8_mipi_csi_vc_get_status(), and ra8_mipi_csi_vc_set_irq_enable().