|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Where the EK-RA8D2's Cortex-M85 and Cortex-M33 meet, stated once. More...
Go to the source code of this file.
Data Structures | |
| struct | ra8_board_shared_ram_t |
| Runtime descriptor of the CPU0 <-> CPU1 shared window. More... | |
Enumerations | |
| enum | ra8_board_dualcore_addr_t : uintptr_t { k_ra8_board_shared_ram_base = 0x22100000UL , k_ra8_board_cpu1_sram_base = 0x22190000UL , k_ra8_board_cpu1_image_base = 0x020C0000UL } |
| Base addresses of the EK-RA8D2 dual-core memory map. More... | |
| enum | ra8_board_dualcore_size_t : uint32_t { k_ra8_board_shared_ram_size_bytes = 0x90000UL , k_ra8_board_cpu1_sram_size_bytes = 0x10000UL , k_ra8_board_cpu1_image_size_bytes = 0x40000UL } |
| Lengths of the windows named by ra8_board_dualcore_addr_t. More... | |
Functions | |
| ra8_err_t | ra8_board_shared_ram (ra8_board_shared_ram_t *out) |
| Describe the window where the M85 and the M33 meet. | |
Where the EK-RA8D2's Cortex-M85 and Cortex-M33 meet, stated once.
The RA8D2 is a dual-core part and its two cores have to agree on an address to talk through. Nothing in the tree used to say what that address was, so every dual-core application invented its own answer: seven app-private headers each declared the same SRAM2 base under a different name (k_dualcore_mailbox_addr, k_cpu1_pingpong_shared_addr, k_cache_coherency_shared_addr, k_erm33_mailbox_addr, k_lowpower_mailbox_addr, k_com33_mailbox_addr, k_bg_sram_base), each re-arguing the same three facts in a hand-written paragraph. One memory-map decision was spelled out in roughly nineteen places across examples/, and a change to it would have had to find all nineteen.
It is a BOARD fact, and the board already acts on it: this package's src/boot/system_init.c programmes MPU region 4 over exactly this window. That translation unit now takes its numbers from here, so the boot and the applications cannot drift apart.
SELF-CONTAINED ON PURPOSE. A dual-core app's CPU1 translation unit compiles against a deliberately narrow include path (ra8_core/inc, ra8_hal/inc, this directory) because a Cortex-M33 image must not reach a header that drags in the logger or the pin validator. This header pulls in nothing but <stdint.h> and ra8_err.h so it can be included from either core's image. Only ra8_board_shared_ram needs the M85-side translation unit; the constants alone cost no link dependency.
| Window | Base | Length |
|---|---|---|
| CPU0 (M85) private SRAM0+1 | 0x22000000 | 1 MiB |
| CPU0 <-> CPU1 shared window | 0x22100000 | 576 KiB |
| CPU1 (M33) private SRAM bank | 0x22190000 | 64 KiB |
| CPU1 (M33) code image, MRAM | 0x020C0000 | 256 KiB |
The shared window is unallocated by BOTH linker scripts – CPU0's ends at 0x22100000 and CPU1's claims only the 64 KiB bank above it – so the same physical bytes back the same addresses on both cores with no aliasing.
Definition in file ra8_board_ek_ra8d2_dualcore.h.
| enum ra8_board_dualcore_addr_t : uintptr_t |
Base addresses of the EK-RA8D2 dual-core memory map.
uintptr_t rather than uint32_t: these are addresses, and the host unit-test build is 64-bit, where a uint32_t enum silently truncates a pointer cast.
Definition at line 86 of file ra8_board_ek_ra8d2_dualcore.h.
| enum ra8_board_dualcore_size_t : uint32_t |
Lengths of the windows named by ra8_board_dualcore_addr_t.
The shared window's length is the distance from its base up to CPU1's private bank – it is bounded by that bank, not by the top of SRAM, so an application carving a large buffer out of it cannot silently overrun into the M33's stack.
Definition at line 115 of file ra8_board_ek_ra8d2_dualcore.h.
|
nodiscard |
Describe the window where the M85 and the M33 meet.
Publishes the board's answer to "where do the two cores talk", so an application stops carrying its own copy of the address, the length and the cacheability argument. The values are compile-time board facts; this call performs no hardware access and cannot fail for any reason other than a null argument.
| [out] | out | Descriptor to fill in. Must not be null. Fully overwritten on success. |
| k_ra8_ok | out describes the shared window. |
| k_ra8_err_null_ptr | out was null. |
Definition at line 55 of file ra8_board_ek_ra8d2_dualcore.c.
References k_ra8_board_shared_ram_base, k_ra8_board_shared_ram_size_bytes, k_ra8_ok, RA8_CHECK_NULL_PTR, s_shared_ram_is_non_cacheable, and s_tag.