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

Go to the source code of this file.

Data Structures

struct  rec_timing
 

Macros

#define MAX_COARSE   15
 
#define DQS_HIGH   1
 
#define DQS_LOW   0
 
#define RESET_CNTL(channel)   (0x5d8 + (channel) * 0x400)
 

Functions

static void mfence (void)
 
static u8 sampledqs (u32 addr, u8 lane, u8 channel)
 
static void program_timing (const struct rec_timing *timing, u8 channel, u8 lane)
 
static int increase_medium (struct rec_timing *timing)
 
static int decrease_medium (struct rec_timing *timing)
 
static int increase_tap (struct rec_timing *timing)
 
static int decrease_tap (struct rec_timing *timing)
 
static int decr_coarse_low (u8 channel, u8 lane, u32 addr, struct rec_timing *timing)
 
static int fine_search_dqs_high (u8 channel, u8 lane, u32 addr, struct rec_timing *timing)
 
static int find_dqs_low (u8 channel, u8 lane, u32 addr, struct rec_timing *timing)
 
static int find_dqs_high (u8 channel, u8 lane, u32 addr, struct rec_timing *timing)
 
static int find_dqs_edge_lowhigh (u8 channel, u8 lane, u32 addr, struct rec_timing *timing)
 
static int find_preamble (u8 channel, u8 lane, u32 addr, struct rec_timing *timing)
 
static int calibrate_receive_enable (u8 channel, u8 lane, u32 addr, struct rec_timing *timing)
 
void rcven (struct sysinfo *s)
 

Macro Definition Documentation

◆ DQS_HIGH

#define DQS_HIGH   1

Definition at line 11 of file rcven.c.

◆ DQS_LOW

#define DQS_LOW   0

Definition at line 12 of file rcven.c.

◆ MAX_COARSE

#define MAX_COARSE   15

Definition at line 10 of file rcven.c.

◆ RESET_CNTL

#define RESET_CNTL (   channel)    (0x5d8 + (channel) * 0x400)

Definition at line 14 of file rcven.c.

Function Documentation

◆ calibrate_receive_enable()

static int calibrate_receive_enable ( u8  channel,
u8  lane,
u32  addr,
struct rec_timing timing 
)
static

Definition at line 240 of file rcven.c.

References addr, BIOS_WARNING, decrease_tap(), find_dqs_edge_lowhigh(), find_dqs_low(), find_preamble(), increase_medium(), mchbar_clrbits16, mchbar_clrsetbits16(), rec_timing::pi, printk, and program_timing().

Referenced by rcven().

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

◆ decr_coarse_low()

static int decr_coarse_low ( u8  channel,
u8  lane,
u32  addr,
struct rec_timing timing 
)
static

Definition at line 124 of file rcven.c.

References addr, BIOS_CRIT, rec_timing::coarse, DQS_LOW, rec_timing::medium, printk, program_timing(), RAM_DEBUG, and sampledqs().

Referenced by find_preamble().

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

◆ decrease_medium()

static int decrease_medium ( struct rec_timing timing)
static

Definition at line 86 of file rcven.c.

References BIOS_ERR, rec_timing::coarse, rec_timing::medium, and printk.

Referenced by decrease_tap(), and find_dqs_edge_lowhigh().

Here is the caller graph for this function:

◆ decrease_tap()

static int decrease_tap ( struct rec_timing timing)
static

Definition at line 112 of file rcven.c.

References decrease_medium(), and rec_timing::tap.

Referenced by calibrate_receive_enable().

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

◆ find_dqs_edge_lowhigh()

static int find_dqs_edge_lowhigh ( u8  channel,
u8  lane,
u32  addr,
struct rec_timing timing 
)
static

Definition at line 204 of file rcven.c.

References addr, decrease_medium(), find_dqs_high(), fine_search_dqs_high(), and program_timing().

Referenced by calibrate_receive_enable().

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

◆ find_dqs_high()

static int find_dqs_high ( u8  channel,
u8  lane,
u32  addr,
struct rec_timing timing 
)
static

Definition at line 187 of file rcven.c.

References addr, BIOS_CRIT, rec_timing::coarse, DQS_HIGH, increase_medium(), rec_timing::medium, printk, program_timing(), RAM_DEBUG, and sampledqs().

Referenced by find_dqs_edge_lowhigh().

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

◆ find_dqs_low()

static int find_dqs_low ( u8  channel,
u8  lane,
u32  addr,
struct rec_timing timing 
)
static

Definition at line 172 of file rcven.c.

References addr, BIOS_CRIT, rec_timing::coarse, DQS_LOW, increase_medium(), rec_timing::medium, printk, program_timing(), RAM_DEBUG, and sampledqs().

Referenced by calibrate_receive_enable().

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

◆ find_preamble()

static int find_preamble ( u8  channel,
u8  lane,
u32  addr,
struct rec_timing timing 
)
static

Definition at line 221 of file rcven.c.

References addr, BIOS_CRIT, decr_coarse_low(), DQS_HIGH, increase_medium(), printk, program_timing(), and sampledqs().

Referenced by calibrate_receive_enable().

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

◆ fine_search_dqs_high()

static int fine_search_dqs_high ( u8  channel,
u8  lane,
u32  addr,
struct rec_timing timing 
)
static

Definition at line 140 of file rcven.c.

References addr, BIOS_CRIT, BIOS_WARNING, rec_timing::coarse, DQS_HIGH, increase_tap(), rec_timing::medium, printk, program_timing(), RAM_DEBUG, sampledqs(), and rec_timing::tap.

Referenced by find_dqs_edge_lowhigh().

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

◆ increase_medium()

static int increase_medium ( struct rec_timing timing)
static

Definition at line 72 of file rcven.c.

References BIOS_ERR, rec_timing::coarse, MAX_COARSE, rec_timing::medium, and printk.

Referenced by calibrate_receive_enable(), find_dqs_high(), find_dqs_low(), find_preamble(), and increase_tap().

Here is the caller graph for this function:

◆ increase_tap()

static int increase_tap ( struct rec_timing timing)
static

Definition at line 100 of file rcven.c.

References increase_medium(), and rec_timing::tap.

Referenced by fine_search_dqs_high().

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

◆ mfence()

static void mfence ( void  )
inlinestatic

Definition at line 23 of file rcven.c.

Referenced by sampledqs().

Here is the caller graph for this function:

◆ program_timing()

static void program_timing ( const struct rec_timing timing,
u8  channel,
u8  lane 
)
static

◆ rcven()

◆ sampledqs()

static u8 sampledqs ( u32  addr,
u8  lane,
u8  channel 
)
static

Definition at line 28 of file rcven.c.

References addr, mchbar_clrbits8, mchbar_read8(), mchbar_setbits8, mfence(), read32p(), RESET_CNTL, TOTAL_CHANNELS, and udelay().

Referenced by decr_coarse_low(), find_dqs_high(), find_dqs_low(), find_preamble(), and fine_search_dqs_high().

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