|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Reset block register layout (offsets, bit masks, accessors)for the Renesas RA8D2. More...
#include <stdint.h>Go to the source code of this file.
Functions | |
| static volatile uint8_t * | ra8_reset_rstsr0 (void) |
| Pointer to the 8-bit RSTSR0 register. | |
| static volatile uint32_t * | ra8_reset_rstsr1 (void) |
| Pointer to the 32-bit RSTSR1 register. | |
| static volatile uint8_t * | ra8_reset_rstsr2 (void) |
| Pointer to the 8-bit RSTSR2 register. | |
| static volatile uint8_t * | ra8_reset_rstsr3 (void) |
| Pointer to the 8-bit RSTSR3 register. | |
| static volatile uint32_t * | ra8_reset_rstsar (void) |
| Pointer to the 32-bit RSTSAR (security attribution) register. | |
| static volatile uint32_t * | ra8_reset_aircr (void) |
| Pointer to the Cortex-M85 SCB AIRCR register. | |
| static volatile uint16_t * | ra8_reset_prcr (void) |
| Pointer to the 16-bit PRCR write-protect register. | |
| static volatile uint8_t * | ra8_reset_syrstmsk0 (void) |
| Pointer to the 8-bit SYRSTMSK0 register. | |
| static volatile uint8_t * | ra8_reset_syrstmsk1 (void) |
| Pointer to the 8-bit SYRSTMSK1 register. | |
| static volatile uint8_t * | ra8_reset_syrstmsk2 (void) |
| Pointer to the 8-bit SYRSTMSK2 register. | |
| static volatile uint8_t * | ra8_reset_temprcr (void) |
| Pointer to the 8-bit TEMPRCR register. | |
| static volatile uint8_t * | ra8_reset_temprlr (void) |
| Pointer to the 8-bit TEMPRLR register. | |
Reset block register layout (offsets, bit masks, accessors)
for the Renesas RA8D2.
The RA8D2 reset-cause / reset-control registers physically live inside the System Control (SYSC) block at base 0x4001_E000. The shared header ra8_system_regs.h already exposes a partial map of SYSC and includes pointer accessors for RSTSR0, RSTSR1 and RSTSR2. The shared brief explicitly forbids editing the shared system header from a per-driver task, so this header mirrors the subset of reset registers needed by ra8_reset.c (the three RSTSR flags plus RSTSR3, plus RSTSAR for security attribution) without duplicating or changing anything in ra8_system_regs.h.
| Offset | Reg | Width | Purpose |
|---|---|---|---|
| 0x0C0 | RSTSR1 | 32 | Reset Status Register 1 (W,SW,WDT,LM,...) |
| 0x3C4 | RSTSAR | 32 | Reset Security Attribution Register |
| 0xA40 | RSTSR0 | 8 | Reset Status Register 0 (POR, LVD, DPSRSTF) |
| 0xA44 | RSTSR2 | 8 | Reset Status Register 2 (CWSF) |
| 0xA48 | RSTSR3 | 8 | Reset Status Register 3 (CVMRF, OCPRF, TEMPRF) |
The "Software Reset Register" (SWRR) called out in the task brief is not a SYSC register on the RA8D2 – the HUM Ch 6.1 p 244 entry for "Software reset" reads:
Register setting (use the software reset bit AIRCR.SYSRESETREQ)
That is the ARMv8-M System Control Block AIRCR register at 0xE000_ED0C. ra8_reset_software_reset() therefore writes AIRCR with the mandatory 0x05FA write-key in the upper half-word and the SYSRESETREQ bit set, exactly as CMSIS NVIC_SystemReset does. The constants for the AIRCR access live below alongside the other reset-related register addresses so the driver implementation has a single include for everything it touches.
Verified against:
Definition in file ra8_reset_regs.h.
| enum ra8_reset_addr_t : uintptr_t |
Memory-mapped base addresses used by the reset driver.
| Enumerator | |
|---|---|
| k_ra8_reset_sysc_base_addr | R_SYSTEM (SYSC) base. |
| k_ra8_reset_scb_aircr_addr | Cortex-M85 SCB AIRCR (software reset). |
Definition at line 82 of file ra8_reset_regs.h.
| enum ra8_reset_aircr_t : uint32_t |
AIRCR fields touched when triggering a software reset.
Per ARMv8-M Architecture Reference Manual / DDI0489 Sec B3.2.6, the Application Interrupt and Reset Control Register at 0xE000ED0C requires the upper 16 bits to carry the magic key 0x05FA on every write or the access is ignored. SYSRESETREQ asks the system controller to schedule a system reset.
HUM Ch 6.1 p 244 explicitly names this as the software-reset path: "Software reset / Source / Register setting (use the software reset bit AIRCR.SYSRESETREQ)".
Definition at line 330 of file ra8_reset_regs.h.
| enum ra8_reset_offset_t : uint16_t |
Offset (within SYSC) of every register the reset driver touches.
Mirrored from ra8_system_regs.h::ra8_system_offset_t for the three RSTSR registers, plus the RSTSR3 and RSTSAR offsets the shared header does not yet expose.
Definition at line 101 of file ra8_reset_regs.h.
| enum ra8_reset_prcr_bits_t : uint16_t |
PRCR (Protect Register) password + PRC5 enable bit.
SYRSTMSK0/1/2, TEMPRCR and TEMPRLR are write-protected behind PRCR.PRC5. A 16-bit write must carry the 0xA5 password in the upper byte; PRC5 (bit 5) enables writes to the reset-control group.
Definition at line 124 of file ra8_reset_regs.h.
| enum ra8_reset_syrstmsk0_bits_t : uint8_t |
SYRSTMSK0 mask bits (1 = reset disabled).
HUM Ch 6.2.6 p 262.
Definition at line 134 of file ra8_reset_regs.h.
| enum ra8_reset_syrstmsk1_bits_t : uint8_t |
SYRSTMSK1 mask bits (1 = reset disabled).
HUM Ch 6.2.7 p 263.
| Enumerator | |
|---|---|
| k_ra8_reset_syrstmsk1_wdt1_msk | WDT1MASK: CPU1 WDT reset. |
| k_ra8_reset_syrstmsk1_clu1_msk | CLU1MASK: CPU1 lockup reset. |
| k_ra8_reset_syrstmsk1_lm1_msk | LM1MASK: local-memory-1 error. |
Definition at line 148 of file ra8_reset_regs.h.
| enum ra8_reset_syrstmsk2_bits_t : uint8_t |
SYRSTMSK2 mask bits (1 = reset disabled).
HUM Ch 6.2.8 p 263.
| Enumerator | |
|---|---|
| k_ra8_reset_syrstmsk2_pvd1_msk | PVD1MASK: voltage-monitor-1 reset. |
| k_ra8_reset_syrstmsk2_pvd2_msk | PVD2MASK: voltage-monitor-2 reset. |
Definition at line 158 of file ra8_reset_regs.h.
| enum ra8_reset_temprcr_bits_t : uint8_t |
TEMPRCR (Temperature Monitor Reset Control) bits.
HUM Ch 6.2.9 p 264.
Definition at line 167 of file ra8_reset_regs.h.
| enum ra8_reset_temprlr_bits_t : uint8_t |
TEMPRLR (Temperature Monitor Reset Lock) bits.
HUM Ch 6.2.10 p 265.
| Enumerator | |
|---|---|
| k_ra8_reset_temprlr_lock_msk | LOCK: 1 = TEMPRCR locked (reset value). |
Definition at line 178 of file ra8_reset_regs.h.
| enum ra8_rstsar_bits_t : uint32_t |
RSTSAR bit positions / masks (per HUM Ch 6.2.1 p 256).
Each NONSECn bit selects whether the matching reset cause's detect flag and mask register is reachable from non-secure side. On the RA8D2 the field is 5 bits wide (FSP CMSIS lines 15735-15740); higher bits read as 0.
Definition at line 300 of file ra8_reset_regs.h.
| enum ra8_rstsr0_bits_t : uint8_t |
RSTSR0 bit positions / masks.
Per HUM Ch 6.2.2 p 257-258. Each flag is set by hardware when the matching reset cause fires and is cleared by software using the write-1-then-0 protocol described in HUM Ch 6.2.2 p 258 Note: "Only 0 can be written. To write 0, the bit must be read as 1 first."
Definition at line 198 of file ra8_reset_regs.h.
| enum ra8_rstsr1_bits_t : uint32_t |
RSTSR1 bit positions and masks.
Per HUM Ch 6.2.3 p 258-260 and FSP CMSIS R7KA8D2KF_core0.h lines 15205-15226. Reserved bits read as 0 and write as 0.
Definition at line 228 of file ra8_reset_regs.h.
| enum ra8_rstsr2_bits_t : uint8_t |
RSTSR2 bit positions / masks (per HUM Ch 6.2.4 p 261).
| Enumerator | |
|---|---|
| k_ra8_reset_rstsr2_cwsf_pos | CWSF: 0 = cold start, 1 = warm start. |
| k_ra8_reset_rstsr2_cwsf_msk | CWSF mask. |
Definition at line 262 of file ra8_reset_regs.h.
| enum ra8_rstsr3_bits_t : uint8_t |
RSTSR3 bit positions / masks (per HUM Ch 6.2.5 p 261-262).
Definition at line 276 of file ra8_reset_regs.h.
|
inlinestatic |
Pointer to the Cortex-M85 SCB AIRCR register.
Definition at line 395 of file ra8_reset_regs.h.
References k_ra8_reset_scb_aircr_addr.
Referenced by ra8_reset_software_reset().
|
inlinestatic |
Pointer to the 16-bit PRCR write-protect register.
Definition at line 404 of file ra8_reset_regs.h.
References k_ra8_reset_off_prcr, and k_ra8_reset_sysc_base_addr.
Referenced by ra8_reset_set_source_mask().
|
inlinestatic |
Pointer to the 32-bit RSTSAR (security attribution) register.
Definition at line 386 of file ra8_reset_regs.h.
References k_ra8_reset_off_rstsar, and k_ra8_reset_sysc_base_addr.
Referenced by ra8_reset_get_attribution().
|
inlinestatic |
Pointer to the 8-bit RSTSR0 register.
Definition at line 350 of file ra8_reset_regs.h.
References k_ra8_reset_off_rstsr0, and k_ra8_reset_sysc_base_addr.
Referenced by internal_read_raw(), and ra8_reset_clear_cause().
|
inlinestatic |
Pointer to the 32-bit RSTSR1 register.
Definition at line 359 of file ra8_reset_regs.h.
References k_ra8_reset_off_rstsr1, and k_ra8_reset_sysc_base_addr.
Referenced by internal_read_raw(), and ra8_reset_clear_cause().
|
inlinestatic |
Pointer to the 8-bit RSTSR2 register.
Definition at line 368 of file ra8_reset_regs.h.
References k_ra8_reset_off_rstsr2, and k_ra8_reset_sysc_base_addr.
Referenced by internal_read_raw(), and ra8_reset_clear_cause().
|
inlinestatic |
Pointer to the 8-bit RSTSR3 register.
Definition at line 377 of file ra8_reset_regs.h.
References k_ra8_reset_off_rstsr3, and k_ra8_reset_sysc_base_addr.
Referenced by internal_read_raw().
|
inlinestatic |
Pointer to the 8-bit SYRSTMSK0 register.
Definition at line 413 of file ra8_reset_regs.h.
References k_ra8_reset_off_syrstmsk0, and k_ra8_reset_sysc_base_addr.
Referenced by internal_source_loc().
|
inlinestatic |
Pointer to the 8-bit SYRSTMSK1 register.
Definition at line 422 of file ra8_reset_regs.h.
References k_ra8_reset_off_syrstmsk1, and k_ra8_reset_sysc_base_addr.
Referenced by internal_source_loc().
|
inlinestatic |
Pointer to the 8-bit SYRSTMSK2 register.
Definition at line 431 of file ra8_reset_regs.h.
References k_ra8_reset_off_syrstmsk2, and k_ra8_reset_sysc_base_addr.
Referenced by internal_source_loc().
|
inlinestatic |
Pointer to the 8-bit TEMPRCR register.
Definition at line 440 of file ra8_reset_regs.h.
References k_ra8_reset_off_temprcr, and k_ra8_reset_sysc_base_addr.
|
inlinestatic |
Pointer to the 8-bit TEMPRLR register.
Definition at line 449 of file ra8_reset_regs.h.
References k_ra8_reset_off_temprlr, and k_ra8_reset_sysc_base_addr.