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

External SDRAM controller register layout for the Renesas RA8D2. More...

#include <stddef.h>
#include <stdint.h>
Include dependency graph for ra8_sdramc_regs.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  r_sdramc_regs_t
 SDRAM controller register window. More...

Enumerations

enum  ra8_sdramc_addr_t : uintptr_t {
  k_ra8_sdramc_base_addr = 0x40003C00UL ,
  k_ra8_sdram_base_addr = 0x68000000UL ,
  k_ra8_system_sdckocr_addr = 0x4001E053UL
}
enum  ra8_sdram_geom_t : uint32_t { k_ra8_sdram_size_bytes = 0x04000000UL }
enum  ra8_sdramc_off_t : uint8_t {
  k_ra8_sdramc_off_sdccr = 0x00U ,
  k_ra8_sdramc_off_sdcmod = 0x01U ,
  k_ra8_sdramc_off_sdamod = 0x02U ,
  k_ra8_sdramc_off_sdself = 0x10U ,
  k_ra8_sdramc_off_sdrfcr = 0x14U ,
  k_ra8_sdramc_off_sdrfen = 0x16U ,
  k_ra8_sdramc_off_sdicr = 0x20U ,
  k_ra8_sdramc_off_sdir = 0x24U ,
  k_ra8_sdramc_off_sdadr = 0x40U ,
  k_ra8_sdramc_off_sdtr = 0x44U ,
  k_ra8_sdramc_off_sdmod = 0x48U ,
  k_ra8_sdramc_off_sdsr = 0x50U
}
 Register offsets within the SDRAMC sub-block. More...

Functions

static volatile r_sdramc_regs_tra8_sdramc (void)
 Get pointer to the SDRAMC register block.
static volatile uint8_t * ra8_sdramc_sdckocr (void)
 Get pointer to the R_SYSTEM SDCLK-output control register.

Detailed Description

External SDRAM controller register layout for the Renesas RA8D2.

The RA8D2 has a built-in SDRAMC that drives the external SDRAM on the EK-RA8D2 via the parallel bus. The board fits an ISSI IS42S32160F – a 512 Mbit (64 MB) SDR SDRAM organised as 16M x 32 bits, 13 row / 9 column / 4 bank – memory-mapped at k_ra8_sdram_base_addr (0x68000000).

Register offsets follow the RA8D2 Hardware User's Manual Ch 15 "Buses" (the SDRAMC sub-block of R_BUS) and the FSP CMSIS device header R_BUS->SDRAM.

Definition in file ra8_sdramc_regs.h.

Enumeration Type Documentation

◆ ra8_sdram_geom_t

enum ra8_sdram_geom_t : uint32_t
Enumerator
k_ra8_sdram_size_bytes 

64 MiB.

Definition at line 42 of file ra8_sdramc_regs.h.

◆ ra8_sdramc_addr_t

enum ra8_sdramc_addr_t : uintptr_t
Enumerator
k_ra8_sdramc_base_addr 

R_BUS.SDRAM sub-block.

k_ra8_sdram_base_addr 

External SDRAM window.

k_ra8_system_sdckocr_addr 

R_SYSTEM.SDCKOCR.

Definition at line 30 of file ra8_sdramc_regs.h.

◆ ra8_sdramc_off_t

enum ra8_sdramc_off_t : uint8_t

Register offsets within the SDRAMC sub-block.

Each value is the byte offset of a register from k_ra8_sdramc_base_addr per HUM Ch 15.3.11..15.3.22. The r_sdramc_regs_t reserved-field sizes and its layout static_asserts are both derived from these, so the struct carries no bare offset literals.

Enumerator
k_ra8_sdramc_off_sdccr 

SDCCR – SDC Control.

k_ra8_sdramc_off_sdcmod 

SDCMOD – SDC Mode.

k_ra8_sdramc_off_sdamod 

SDAMOD – SDRAM Access Mode.

k_ra8_sdramc_off_sdself 

SDSELF – Self-Refresh Control.

k_ra8_sdramc_off_sdrfcr 

SDRFCR – Refresh Control.

k_ra8_sdramc_off_sdrfen 

SDRFEN – Auto-Refresh Control.

k_ra8_sdramc_off_sdicr 

SDICR – Init Sequence Control.

k_ra8_sdramc_off_sdir 

SDIR – Initialization.

k_ra8_sdramc_off_sdadr 

SDADR – Address.

k_ra8_sdramc_off_sdtr 

SDTR – Timing.

k_ra8_sdramc_off_sdmod 

SDMOD – Mode.

k_ra8_sdramc_off_sdsr 

SDSR – Status (RO).

Definition at line 56 of file ra8_sdramc_regs.h.

Function Documentation

◆ ra8_sdramc()

◆ ra8_sdramc_sdckocr()

volatile uint8_t * ra8_sdramc_sdckocr ( void )
inlinestatic

Get pointer to the R_SYSTEM SDCLK-output control register.

Definition at line 127 of file ra8_sdramc_regs.h.

References k_ra8_system_sdckocr_addr.

Referenced by ra8_sdramc_init().