|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Shared-SRAM mailbox layout for the M85 <-> M33 dual-core demo. More...
Go to the source code of this file.
Data Structures | |
| struct | dualcore_mailbox_t |
| Cross-core message block backed by a fixed shared-SRAM address. More... | |
Enumerations | |
| enum | dualcore_mailbox_addr_t : uintptr_t { k_dualcore_mailbox_addr } |
| Where this app puts its mailbox inside the board's shared window. More... | |
| enum | dualcore_mailbox_const_t : uint32_t { k_dualcore_m33_signature = 33U , k_dualcore_m33_mul = 3U , k_dualcore_m33_add = 1U , k_dualcore_poll_budget = 20000000UL } |
| Compile-time signature and transform constants. More... | |
Functions | |
| static volatile dualcore_mailbox_t * | dualcore_mailbox (void) |
| Typed pointer to the fixed-address shared mailbox. | |
Shared-SRAM mailbox layout for the M85 <-> M33 dual-core demo.
This is the contract that lets the two cores of the RA8D2 talk to each other. The Cortex-M85 (primary, "CPU0") and the Cortex-M33 (secondary, "CPU1") do not share a cache, but they DO share the on-chip SRAM. This header pins a small message struct at one fixed SRAM address that both cores agree on, so a write by one core is seen by the other.
Why a fixed address instead of a normal global? Each core is a separate compiled image with its own linker script, so a static global in one image is invisible to the other. A hard-coded shared address is the one name both images can resolve identically. Neither linker script claims the 0x22100000 mailbox word:
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 (a request / reply handshake carried by sequence counters):
Definition in file dualcore_mailbox.h.
| enum dualcore_mailbox_addr_t : uintptr_t |
Where this app puts its mailbox inside the board's shared window.
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_dualcore_mailbox_addr | Mailbox base = window base. |
Definition at line 72 of file dualcore_mailbox.h.
| enum dualcore_mailbox_const_t : uint32_t |
Compile-time signature and transform constants.
Shared by both core images so the M85 and M33 agree on what a valid reply looks like.
Definition at line 89 of file dualcore_mailbox.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 150 of file dualcore_mailbox.h.
References k_dualcore_mailbox_addr.
Referenced by cpu1_main(), and main().