ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_board_ek_ra8d2_dualcore.c File Reference

EK-RA8D2 BSP – the runtime view of the CPU0 <-> CPU1 shared window. More...

#include "ra8_board_ek_ra8d2_dualcore.h"
#include <stdint.h>
#include "ra8_check.h"
#include "ra8_err.h"
Include dependency graph for ra8_board_ek_ra8d2_dualcore.c:

Go to the source code of this file.

Functions

ra8_err_t ra8_board_shared_ram (ra8_board_shared_ram_t *out)
 Describe the window where the M85 and the M33 meet.

Variables

static const char *const s_tag = "ra8_board.dualcore"
 Module log tag.
static const bool s_shared_ram_is_non_cacheable = false
 Whether the boot MPU marks the shared window Normal non-cacheable.

Detailed Description

EK-RA8D2 BSP – the runtime view of the CPU0 <-> CPU1 shared window.

Tag
[Ring 5 / BSP] {World: S}

One function, projecting the compile-time map in ra8_board_ek_ra8d2_dualcore.h into the descriptor an application can carve from. It exists so a consumer can ask the board rather than copy a literal; the address itself is the header's, and this unit adds no second copy of it.

Touches no MCU registers.

Since
0.1.0

Definition in file ra8_board_ek_ra8d2_dualcore.c.

Function Documentation

◆ ra8_board_shared_ram()

ra8_err_t ra8_board_shared_ram ( ra8_board_shared_ram_t * out)
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.

Parameters
[out]outDescriptor to fill in. Must not be null. Fully overwritten on success.
Returns
ra8_err_t Error code.
Return values
k_ra8_okout describes the shared window.
k_ra8_err_null_ptrout was null.
Precondition
The image is running on an EK-RA8D2 (or its emulator), whose linker scripts leave this window unallocated.
Called from a context that may read board configuration – any, since no register is touched.
Postcondition
On success out->base is k_ra8_board_shared_ram_base and out->size_bytes is k_ra8_board_shared_ram_size_bytes.
On failure no caller-visible state is modified.
Note
Thread-safe and reentrant: it reads only compile-time constants.
Warning
The window is shared. Two applications' worth of structures cannot both start at base; carve from it with an explicit offset when a component needs more than the first object.
See also
ra8_board_dualcore_addr_t The same facts as compile-time constants, for a statically placed object.
ra8_cpu1_release Starting the M33 once the window is set up.
Since
0.1.0

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.

Variable Documentation

◆ s_shared_ram_is_non_cacheable

const bool s_shared_ram_is_non_cacheable = false
static

Whether the boot MPU marks the shared window Normal non-cacheable.

src/boot/system_init.c programmes MPU region 4 over the shared window only under RA8_BOOT_ENABLE_CACHE_MPU, which also gates enabling the M85 caches. Reporting the flag rather than a constant true keeps the descriptor honest: in a build without it nothing is stale (there is no cache to be stale) but the memory map makes no promise, and an application that later enables the D-cache by another route must know that.

Note
Compile-time constant; no runtime state.
Warning
Do not hardcode true here – the whole point of the field is that it tracks the build that is actually running.
Since
0.1.0

Definition at line 52 of file ra8_board_ek_ra8d2_dualcore.c.

Referenced by ra8_board_shared_ram().

◆ s_tag

const char* const s_tag = "ra8_board.dualcore"
static

Module log tag.

Definition at line 30 of file ra8_board_ek_ra8d2_dualcore.c.