|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Shared-SRAM contract for the low-power "hold the page" dual-core demo. More...
Go to the source code of this file.
Data Structures | |
| struct | lowpower_mailbox_t |
| Cross-core handoff block backed by a fixed shared-SRAM address. More... | |
Enumerations | |
| enum | lowpower_mailbox_addr_t : uintptr_t { k_lowpower_mailbox_addr } |
| Fixed shared-SRAM base address of the mailbox. More... | |
| enum | lowpower_const_t : uint32_t { k_lowpower_magic = 0x484F4C44U , k_lowpower_core_m85 = 0U , k_lowpower_core_m33 = 1U } |
| Signature + active-core enumerators shared by both core images. More... | |
Functions | |
| static volatile lowpower_mailbox_t * | lowpower_mailbox (void) |
| Typed pointer to the fixed-address shared mailbox. | |
Shared-SRAM contract for the low-power "hold the page" dual-core demo.
This header pins the cross-core message block for the #150 low-power-mode demo at one fixed shared-SRAM address both core images agree on. The Cortex-M85 (primary, "CPU0") renders a page, hands the workload to the Cortex-M33 (secondary, "CPU1"), and parks; the M33 then HOLDS the page and services the user switch at a fraction of the power. The mailbox carries the handoff state both directions.
Why a fixed address: each core is a separate compiled image with its own linker script, so a static global in one image is invisible to the other. Both linker scripts leave SRAM2 (which starts at 0x22100000) unclaimed – the M85 image uses SRAM0+SRAM1 (ending at 0x22100000) and the M33 image uses a separate 64 KiB block – so the bytes at 0x22100000 are backed by the same physical SRAM on both sides with no overlap.
Coherency: this app's system_init.c leaves the M85 data cache OFF, so a store from one core is visible to the other once a dsb has drained the write buffer; no cache clean / invalidate dance is needed. The fields are volatile so the compiler emits a real load/store on every access.
Protocol (the low-power handoff):
Definition in file lowpower_holdpage.h.
| enum lowpower_const_t : uint32_t |
Signature + active-core enumerators shared by both core images.
k_lowpower_magic ("HOLD") lets each core confirm the mailbox is live before trusting its fields; active_core names which core currently owns the page – the whole point of the demo is that it flips from M85 to M33 when low-power mode engages.
| Enumerator | |
|---|---|
| k_lowpower_magic | "HOLD" – M85 stamps it when ready. |
| k_lowpower_core_m85 | active_core: the M85 owns the page. |
| k_lowpower_core_m33 | active_core: the M33 holds the page. |
Definition at line 84 of file lowpower_holdpage.h.
| enum lowpower_mailbox_addr_t : uintptr_t |
Fixed shared-SRAM base address of the mailbox.
The mailbox sits at the base of the CPU0 <-> CPU1 window. The window itself is a board fact, declared once in ra8_board_ek_ra8d2_dualcore.h along with why both linker scripts leave it free; this app only names its own slice of it.
| Enumerator | |
|---|---|
| k_lowpower_mailbox_addr | Mailbox base = window base. |
Definition at line 67 of file lowpower_holdpage.h.
|
inlinestatic |
Typed pointer to the fixed-address shared mailbox.
Inlined so both core images compute the identical address with no shared translation unit. Returns the same physical SRAM location on the M85 and the M33.
| non-NULL | Always; the address is a compile-time constant. |
Definition at line 142 of file lowpower_holdpage.h.
References k_lowpower_mailbox_addr.
Referenced by cpu1_hold_page(), and main().