|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
ra8_io block-device backend over the external 64 MiB SDRAM window. More...
#include <stdint.h>#include "ra8_err.h"#include "ra8_io_blockdev.h"#include "ra8_io_blockdev_ram.h"Go to the source code of this file.
Functions | |
| ra8_err_t | ra8_io_blockdev_sdram_init (ra8_io_blockdev_t *bd, ra8_io_blockdev_ram_state_t *state, uint32_t block_count) |
| Bring up the SDRAM controller and bind it as a volatile ramdisk. | |
ra8_io block-device backend over the external 64 MiB SDRAM window.
The SDRAM backend is a volatile ramdisk: once the SDRAM controller is brought up, the external 64 MiB window at k_ra8_sdram_base_addr is plain memory, so this backend reuses the RAM backend's vtable and state (ra8_io_blockdev_ram_state_t) verbatim. It treats the SDRAM window as an array of 512-byte logical blocks, erases to zero, and needs no erase-before-write. Contents do not survive a power cycle.
Definition in file ra8_io_blockdev_sdram.h.
|
nodiscard |
Bring up the SDRAM controller and bind it as a volatile ramdisk.
Validates block_count against the 64 MiB SDRAM window, initialises the SDRAM controller via ra8_sdramc_init, then delegates to ra8_io_blockdev_ram_init using the SDRAM base address as the backing buffer (writable, never read-only). The reused ra8_io_blockdev_ram_state_t is caller-owned and must out-live every call made through the device.
| [out] | bd | Handle to bind (zero-initialised by the caller). |
| [out] | state | Caller-owned RAM-backend state to populate. |
| [in] | block_count | Number of 512-byte logical blocks (>= 1, <= window). |
| k_ra8_ok | Controller up and backend bound; bd is usable. |
| k_ra8_err_null_ptr | bd or state was NULL. |
| k_ra8_err_invalid_size | block_count was zero or exceeds the window. |
Definition at line 69 of file ra8_io_blockdev_sdram.c.
References internal_sdram_max_blocks(), k_ra8_err_invalid_size, k_ra8_io_sdram_min_blocks, k_ra8_sdram_base_addr, RA8_CHECK_NULL_PTR, ra8_io_blockdev_ram_init(), RA8_RETURN_ON_ERROR, ra8_sdramc_init(), and s_tag.
Referenced by demo_run(), and internal_demo_run().