coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
ramtest.c File Reference
#include <stdint.h>
#include <lib.h>
#include <console/console.h>
#include <device/mmio.h>
Include dependency graph for ramtest.c:

Go to the source code of this file.

Functions

static void write_phys (uintptr_t addr, u32 value)
 
static void phys_memory_barrier (void)
 
static u32 read_phys (uintptr_t addr)
 
static void test_pattern (unsigned short int idx, unsigned long *addr, unsigned long *value)
 Rotate ones test pattern that access every bit on a 128bit wide memory bus. More...
 
static int ram_bitset_nodie (uintptr_t start)
 Simple write-read-verify memory test. More...
 
void ram_check (uintptr_t start)
 
int ram_check_nodie (uintptr_t start)
 
int ram_check_noprint_nodie (uintptr_t start)
 
void quick_ram_check_or_die (uintptr_t dst)
 

Function Documentation

◆ phys_memory_barrier()

static void phys_memory_barrier ( void  )
static

Definition at line 28 of file ramtest.c.

Referenced by quick_ram_check_or_die(), ram_bitset_nodie(), and ram_check_noprint_nodie().

Here is the caller graph for this function:

◆ quick_ram_check_or_die()

void quick_ram_check_or_die ( uintptr_t  dst)

Definition at line 177 of file ramtest.c.

References die(), phys_memory_barrier(), post_code, read_phys(), and write_phys().

Referenced by cbmem_top_init_once().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ram_bitset_nodie()

static int ram_bitset_nodie ( uintptr_t  start)
static

Simple write-read-verify memory test.

See console debug output for any dislocated bytes.

Tests 1MiB of memory starting from start.

Parameters
startSystem memory offset, aligned to 128bytes

Definition at line 70 of file ramtest.c.

References addr, BIOS_DEBUG, BIOS_ERR, phys_memory_barrier(), post_code, printk, read_phys(), test_pattern(), value, and write_phys().

Referenced by ram_check(), and ram_check_nodie().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ram_check()

void ram_check ( uintptr_t  start)

Definition at line 120 of file ramtest.c.

References BIOS_DEBUG, die(), printk, and ram_bitset_nodie().

Here is the call graph for this function:

◆ ram_check_nodie()

int ram_check_nodie ( uintptr_t  start)

Definition at line 134 of file ramtest.c.

References BIOS_DEBUG, printk, and ram_bitset_nodie().

Referenced by raminit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ram_check_noprint_nodie()

int ram_check_noprint_nodie ( uintptr_t  start)

Definition at line 149 of file ramtest.c.

References addr, phys_memory_barrier(), read_phys(), test_pattern(), value, and write_phys().

Here is the call graph for this function:

◆ read_phys()

static u32 read_phys ( uintptr_t  addr)
static

Definition at line 34 of file ramtest.c.

References addr, and read32().

Referenced by quick_ram_check_or_die(), ram_bitset_nodie(), and ram_check_noprint_nodie().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_pattern()

static void test_pattern ( unsigned short int  idx,
unsigned long *  addr,
unsigned long *  value 
)
inlinestatic

Rotate ones test pattern that access every bit on a 128bit wide memory bus.

To test most address lines, addresses are scattered using 256B, 4kB and 64kB increments.

Parameters
idxIndex to test pattern (0=<idx<0x400)
addrMemory to access on idx
valueValue to write or read at addr

Definition at line 48 of file ramtest.c.

References addr, and value.

Referenced by ram_bitset_nodie(), and ram_check_noprint_nodie().

Here is the caller graph for this function:

◆ write_phys()

static void write_phys ( uintptr_t  addr,
u32  value 
)
static

Definition at line 23 of file ramtest.c.

References addr, value, and write32().

Referenced by quick_ram_check_or_die(), ram_bitset_nodie(), and ram_check_noprint_nodie().

Here is the call graph for this function:
Here is the caller graph for this function: