|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
MRAM Memory System (MRMS) wait-state register layout for the RA8D2. More...
#include <stdint.h>Go to the source code of this file.
Enumerations | |
| enum | ra8_mrms_addr_t : uintptr_t { k_ra8_mrms_base_addr = 0x4013C000UL } |
| Base address for the MRMS register block. More... | |
| enum | ra8_mrms_offset_t : uint16_t { k_ra8_mrms_off_mrcpfb = 0x000U , k_ra8_mrms_off_mrcfreq = 0x004U , k_ra8_mrms_off_mrefreq = 0x008U } |
| Per-register offsets relative to k_ra8_mrms_base_addr. More... | |
| enum | ra8_mrms_key_t : uint32_t { k_ra8_mrcfreq_key = 0x1E000000UL , k_ra8_mrefreq_key = 0xE1000000UL } |
| Mandatory key bytes that must occupy the upper byte of MRCFREQ / MREFREQ for hardware to accept the write. More... | |
| enum | ra8_mrms_pfb_t : uint32_t { k_ra8_mrcpfb_disable = 0x00000000UL , k_ra8_mrcpfb_enable = 0x00000001UL } |
| Values written to MRCPFB to enable / disable the prefetch buffer. More... | |
| enum | ra8_mrms_pfb_threshold_t : uint32_t { k_ra8_mrcpfb_threshold_mhz = 100UL } |
| MRICLK frequency threshold below which the prefetch buffer must remain disabled. More... | |
Functions | |
| static volatile uint32_t * | ra8_mrms_mrcpfb (void) |
| Get pointer to the 32-bit MRCPFB register. | |
| static volatile uint32_t * | ra8_mrms_mrcfreq (void) |
| Get pointer to the 32-bit MRCFREQ register (MRICLK frequency). | |
| static volatile uint32_t * | ra8_mrms_mrefreq (void) |
| Get pointer to the 32-bit MREFREQ register (MRPCLK frequency). | |
MRAM Memory System (MRMS) wait-state register layout for the RA8D2.
The Renesas RA8 Gen2 family does not expose the legacy MEMWAIT / FLDWAITR / FLWT registers (bsp_feature.h set BSP_FEATURE_CGC_HAS_MEMWAIT = 0, HAS_FLDWAITR = 0, HAS_FLWT = 0). Wait states for the on-chip MRAM are programmed through a dedicated MRMS (MRAM Memory System) register block at 0x4013C000.
The CGC bring-up sequence (HUM Ch 54.4.3 "Frequency Change Procedure for MRAM" / FSP bsp_clocks.c) requires:
| Offset | Reg | Width | Notes |
|---|---|---|---|
| 0x000 | MRCPFB | 32 | Prefetch buffer enable (0 or 1). |
| 0x004 | MRCFREQ | 32 | MRICLK frequency in MHz, upper byte = 0x1E. |
| 0x008 | MREFREQ | 32 | MRPCLK frequency in MHz, upper byte = 0xE1. |
Definition in file ra8_mrms_regs.h.
| enum ra8_mrms_addr_t : uintptr_t |
Base address for the MRMS register block.
| Enumerator | |
|---|---|
| k_ra8_mrms_base_addr | R_MRMS base. |
Definition at line 58 of file ra8_mrms_regs.h.
| enum ra8_mrms_key_t : uint32_t |
Mandatory key bytes that must occupy the upper byte of MRCFREQ / MREFREQ for hardware to accept the write.
Cited from FSP bsp_clocks.c (BSP_PRV_MRCFREQ_KEY / BSP_PRV_MREFREQ_KEY). MRCFREQ uses 0x1E in the upper byte; MREFREQ uses 0xE1. Writes whose key byte is anything else are silently dropped (the register continues to read back its previous value).
| Enumerator | |
|---|---|
| k_ra8_mrcfreq_key | MRCFREQ unlock key, upper byte = 0x1E. |
| k_ra8_mrefreq_key | MREFREQ unlock key, upper byte = 0xE1. |
Definition at line 93 of file ra8_mrms_regs.h.
| enum ra8_mrms_offset_t : uint16_t |
Per-register offsets relative to k_ra8_mrms_base_addr.
| Enumerator | |
|---|---|
| k_ra8_mrms_off_mrcpfb | MRCPFB prefetch buffer enable. |
| k_ra8_mrms_off_mrcfreq | MRCFREQ MRICLK frequency latch (key 0x1E). |
| k_ra8_mrms_off_mrefreq | MREFREQ MRPCLK frequency latch (key 0xE1). |
Definition at line 71 of file ra8_mrms_regs.h.
| enum ra8_mrms_pfb_t : uint32_t |
Values written to MRCPFB to enable / disable the prefetch buffer.
The prefetch buffer must be disabled before any frequency change (HUM Ch 54.4.3) and re-enabled only after the new MRICLK has settled and only if MRICLK >= 100 MHz.
| Enumerator | |
|---|---|
| k_ra8_mrcpfb_disable | Prefetch buffer off. |
| k_ra8_mrcpfb_enable | Prefetch buffer on. |
Definition at line 107 of file ra8_mrms_regs.h.
| enum ra8_mrms_pfb_threshold_t : uint32_t |
MRICLK frequency threshold below which the prefetch buffer must remain disabled.
FSP bsp_clocks.c (BSP_PRV_MRCPFB_LIMIT == 100): only enable the prefetch buffer when MRCFREQ reads back a value >= 100 MHz.
| Enumerator | |
|---|---|
| k_ra8_mrcpfb_threshold_mhz | Minimum MRICLK MHz to enable PFB. |
Definition at line 121 of file ra8_mrms_regs.h.
|
inlinestatic |
Get pointer to the 32-bit MRCFREQ register (MRICLK frequency).
Definition at line 161 of file ra8_mrms_regs.h.
References k_ra8_mrms_base_addr, and k_ra8_mrms_off_mrcfreq.
Referenced by internal_set_mrm_wait_states(), and internal_set_pfb().
|
inlinestatic |
Get pointer to the 32-bit MRCPFB register.
Definition at line 143 of file ra8_mrms_regs.h.
References k_ra8_mrms_base_addr, and k_ra8_mrms_off_mrcpfb.
Referenced by internal_clear_pfb(), and internal_set_pfb().
|
inlinestatic |
Get pointer to the 32-bit MREFREQ register (MRPCLK frequency).
Definition at line 179 of file ra8_mrms_regs.h.
References k_ra8_mrms_base_addr, and k_ra8_mrms_off_mrefreq.
Referenced by internal_set_mrm_wait_states().