coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
memory.c File Reference
#include <baseboard/variants.h>
#include <console/console.h>
#include <gpio.h>
#include <variant/gpio.h>
#include <string.h>
Include dependency graph for memory.c:

Go to the source code of this file.

Macros

#define MEM_ID(x)   (1 << ((x) - 1))
 

Functions

static void fill_lpddr3_memory_params (struct memory_params *p)
 
static void fill_ddr4_memory_params (struct memory_params *p)
 
void variant_memory_params (struct memory_params *p)
 

Variables

static const u16 rcomp_resistor_ddp [] = { 121, 81, 100 }
 
static const u16 rcomp_resistor_sdp [] = { 200, 81, 100 }
 
static const u16 rcomp_resistor_lpddr3 [] = { 200, 81, 162 }
 
static const u16 rcomp_target [] = { 100, 40, 20, 20, 26 }
 
static const u16 rcomp_target_lpddr3 [] = { 100, 40, 40, 23, 40 }
 
static const u8 dq_map_lpddr3 [][12]
 
static const u8 dqs_map_lpddr3 [][8]
 
static const uint16_t ddp_bitmap = MEM_ID(4)
 

Macro Definition Documentation

◆ MEM_ID

#define MEM_ID (   x)    (1 << ((x) - 1))

Definition at line 33 of file memory.c.

Function Documentation

◆ fill_ddr4_memory_params()

static void fill_ddr4_memory_params ( struct memory_params p)
static

◆ fill_lpddr3_memory_params()

◆ variant_memory_params()

void variant_memory_params ( struct memory_params p)

Definition at line 74 of file memory.c.

References fill_ddr4_memory_params(), fill_lpddr3_memory_params(), gpio_get(), gpio_input_pulldown(), GPIO_MEM_CONFIG_4, GPP_D10, memset(), and memory_params::single_channel.

Here is the call graph for this function:

Variable Documentation

◆ ddp_bitmap

const uint16_t ddp_bitmap = MEM_ID(4)
static

Definition at line 36 of file memory.c.

Referenced by fill_ddr4_memory_params().

◆ dq_map_lpddr3

const u8 dq_map_lpddr3[][12]
static
Initial value:
= {
{ 0x0F, 0xF0, 0x00, 0xF0, 0x0F, 0xF0,
0x0F, 0x00, 0xFF, 0x00, 0xFF, 0x00 },
{ 0x0F, 0xF0, 0x00, 0xF0, 0x0F, 0xF0,
0x0F, 0x00, 0xFF, 0x00, 0xFF, 0x00 }
}

Definition at line 19 of file memory.c.

Referenced by fill_lpddr3_memory_params().

◆ dqs_map_lpddr3

const u8 dqs_map_lpddr3[][8]
static
Initial value:
= {
{ 1, 0, 3, 2, 6, 5, 4, 7 },
{ 0, 3, 2, 1, 6, 4, 7, 5 },
}

Definition at line 27 of file memory.c.

Referenced by fill_lpddr3_memory_params().

◆ rcomp_resistor_ddp

const u16 rcomp_resistor_ddp[] = { 121, 81, 100 }
static

Definition at line 10 of file memory.c.

Referenced by fill_ddr4_memory_params().

◆ rcomp_resistor_lpddr3

const u16 rcomp_resistor_lpddr3[] = { 200, 81, 162 }
static

Definition at line 12 of file memory.c.

Referenced by fill_lpddr3_memory_params().

◆ rcomp_resistor_sdp

const u16 rcomp_resistor_sdp[] = { 200, 81, 100 }
static

Definition at line 11 of file memory.c.

Referenced by fill_ddr4_memory_params().

◆ rcomp_target

const u16 rcomp_target[] = { 100, 40, 20, 20, 26 }
static

Definition at line 15 of file memory.c.

Referenced by fill_ddr4_memory_params().

◆ rcomp_target_lpddr3

const u16 rcomp_target_lpddr3[] = { 100, 40, 40, 23, 40 }
static

Definition at line 16 of file memory.c.

Referenced by fill_lpddr3_memory_params().