coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
ux00ddr.h File Reference
#include <stdint.h>
#include <stddef.h>
Include dependency graph for ux00ddr.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define _REG32(p, i)   (*(volatile uint32_t *)((p) + (i)))
 
#define DRAM_CLASS_OFFSET   8
 
#define DRAM_CLASS_DDR4   0xA
 
#define OPTIMAL_RMODW_EN_OFFSET   0
 
#define DISABLE_RD_INTERLEAVE_OFFSET   16
 
#define OUT_OF_RANGE_OFFSET   1
 
#define MULTIPLE_OUT_OF_RANGE_OFFSET   2
 
#define PORT_COMMAND_CHANNEL_ERROR_OFFSET   7
 
#define MC_INIT_COMPLETE_OFFSET   8
 
#define LEVELING_OPERATION_COMPLETED_OFFSET   22
 
#define DFI_PHY_WRLELV_MODE_OFFSET   24
 
#define DFI_PHY_RDLVL_MODE_OFFSET   24
 
#define DFI_PHY_RDLVL_GATE_MODE_OFFSET   0
 
#define VREF_EN_OFFSET   24
 
#define PORT_ADDR_PROTECTION_EN_OFFSET   0
 
#define AXI0_ADDRESS_RANGE_ENABLE   8
 
#define AXI0_RANGE_PROT_BITS_0_OFFSET   24
 
#define RDLVL_EN_OFFSET   16
 
#define RDLVL_GATE_EN_OFFSET   24
 
#define WRLVL_EN_OFFSET   0
 
#define PHY_RX_CAL_DQ0_0_OFFSET   0
 
#define PHY_RX_CAL_DQ1_0_OFFSET   16
 

Functions

static void phy_reset (volatile uint32_t *ddrphyreg, const uint32_t *physettings)
 
static void ux00ddr_writeregmap (size_t ahbregaddr, const uint32_t *ctlsettings, const uint32_t *physettings)
 
static void ux00ddr_start (size_t ahbregaddr, size_t filteraddr, size_t ddrend)
 
static void ux00ddr_mask_mc_init_complete_interrupt (size_t ahbregaddr)
 
static void ux00ddr_mask_outofrange_interrupts (size_t ahbregaddr)
 
static void ux00ddr_mask_port_command_error_interrupt (size_t ahbregaddr)
 
static void ux00ddr_mask_leveling_completed_interrupt (size_t ahbregaddr)
 
static void ux00ddr_setuprangeprotection (size_t ahbregaddr, size_t end_addr)
 
static void ux00ddr_disableaxireadinterleave (size_t ahbregaddr)
 
static void ux00ddr_disableoptimalrmodw (size_t ahbregaddr)
 
static void ux00ddr_enablewriteleveling (size_t ahbregaddr)
 
static void ux00ddr_enablereadleveling (size_t ahbregaddr)
 
static void ux00ddr_enablereadlevelinggate (size_t ahbregaddr)
 
static void ux00ddr_enablevreftraining (size_t ahbregaddr)
 
static uint32_t ux00ddr_getdramclass (size_t ahbregaddr)
 
static uint64_t ux00ddr_phy_fixup (size_t ahbregaddr)
 

Macro Definition Documentation

◆ _REG32

#define _REG32 (   p,
 
)    (*(volatile uint32_t *)((p) + (i)))

Definition at line 13 of file ux00ddr.h.

◆ AXI0_ADDRESS_RANGE_ENABLE

#define AXI0_ADDRESS_RANGE_ENABLE   8

Definition at line 29 of file ux00ddr.h.

◆ AXI0_RANGE_PROT_BITS_0_OFFSET

#define AXI0_RANGE_PROT_BITS_0_OFFSET   24

Definition at line 30 of file ux00ddr.h.

◆ DFI_PHY_RDLVL_GATE_MODE_OFFSET

#define DFI_PHY_RDLVL_GATE_MODE_OFFSET   0

Definition at line 26 of file ux00ddr.h.

◆ DFI_PHY_RDLVL_MODE_OFFSET

#define DFI_PHY_RDLVL_MODE_OFFSET   24

Definition at line 25 of file ux00ddr.h.

◆ DFI_PHY_WRLELV_MODE_OFFSET

#define DFI_PHY_WRLELV_MODE_OFFSET   24

Definition at line 24 of file ux00ddr.h.

◆ DISABLE_RD_INTERLEAVE_OFFSET

#define DISABLE_RD_INTERLEAVE_OFFSET   16

Definition at line 18 of file ux00ddr.h.

◆ DRAM_CLASS_DDR4

#define DRAM_CLASS_DDR4   0xA

Definition at line 16 of file ux00ddr.h.

◆ DRAM_CLASS_OFFSET

#define DRAM_CLASS_OFFSET   8

Definition at line 15 of file ux00ddr.h.

◆ LEVELING_OPERATION_COMPLETED_OFFSET

#define LEVELING_OPERATION_COMPLETED_OFFSET   22

Definition at line 23 of file ux00ddr.h.

◆ MC_INIT_COMPLETE_OFFSET

#define MC_INIT_COMPLETE_OFFSET   8

Definition at line 22 of file ux00ddr.h.

◆ MULTIPLE_OUT_OF_RANGE_OFFSET

#define MULTIPLE_OUT_OF_RANGE_OFFSET   2

Definition at line 20 of file ux00ddr.h.

◆ OPTIMAL_RMODW_EN_OFFSET

#define OPTIMAL_RMODW_EN_OFFSET   0

Definition at line 17 of file ux00ddr.h.

◆ OUT_OF_RANGE_OFFSET

#define OUT_OF_RANGE_OFFSET   1

Definition at line 19 of file ux00ddr.h.

◆ PHY_RX_CAL_DQ0_0_OFFSET

#define PHY_RX_CAL_DQ0_0_OFFSET   0

Definition at line 35 of file ux00ddr.h.

◆ PHY_RX_CAL_DQ1_0_OFFSET

#define PHY_RX_CAL_DQ1_0_OFFSET   16

Definition at line 36 of file ux00ddr.h.

◆ PORT_ADDR_PROTECTION_EN_OFFSET

#define PORT_ADDR_PROTECTION_EN_OFFSET   0

Definition at line 28 of file ux00ddr.h.

◆ PORT_COMMAND_CHANNEL_ERROR_OFFSET

#define PORT_COMMAND_CHANNEL_ERROR_OFFSET   7

Definition at line 21 of file ux00ddr.h.

◆ RDLVL_EN_OFFSET

#define RDLVL_EN_OFFSET   16

Definition at line 31 of file ux00ddr.h.

◆ RDLVL_GATE_EN_OFFSET

#define RDLVL_GATE_EN_OFFSET   24

Definition at line 32 of file ux00ddr.h.

◆ VREF_EN_OFFSET

#define VREF_EN_OFFSET   24

Definition at line 27 of file ux00ddr.h.

◆ WRLVL_EN_OFFSET

#define WRLVL_EN_OFFSET   0

Definition at line 33 of file ux00ddr.h.

Function Documentation

◆ phy_reset()

static void phy_reset ( volatile uint32_t ddrphyreg,
const uint32_t physettings 
)
inlinestatic

Definition at line 38 of file ux00ddr.h.

Referenced by ux00ddr_writeregmap().

Here is the caller graph for this function:

◆ ux00ddr_disableaxireadinterleave()

static void ux00ddr_disableaxireadinterleave ( size_t  ahbregaddr)
inlinestatic

Definition at line 116 of file ux00ddr.h.

References _REG32, and DISABLE_RD_INTERLEAVE_OFFSET.

Referenced by sdram_init().

Here is the caller graph for this function:

◆ ux00ddr_disableoptimalrmodw()

static void ux00ddr_disableoptimalrmodw ( size_t  ahbregaddr)
inlinestatic

Definition at line 120 of file ux00ddr.h.

References _REG32, and OPTIMAL_RMODW_EN_OFFSET.

Referenced by sdram_init().

Here is the caller graph for this function:

◆ ux00ddr_enablereadleveling()

static void ux00ddr_enablereadleveling ( size_t  ahbregaddr)
inlinestatic

Definition at line 128 of file ux00ddr.h.

References _REG32, DFI_PHY_RDLVL_MODE_OFFSET, and RDLVL_EN_OFFSET.

Referenced by sdram_init().

Here is the caller graph for this function:

◆ ux00ddr_enablereadlevelinggate()

static void ux00ddr_enablereadlevelinggate ( size_t  ahbregaddr)
inlinestatic

Definition at line 133 of file ux00ddr.h.

References _REG32, DFI_PHY_RDLVL_GATE_MODE_OFFSET, and RDLVL_GATE_EN_OFFSET.

Referenced by sdram_init().

Here is the caller graph for this function:

◆ ux00ddr_enablevreftraining()

static void ux00ddr_enablevreftraining ( size_t  ahbregaddr)
inlinestatic

Definition at line 138 of file ux00ddr.h.

References _REG32, and VREF_EN_OFFSET.

Referenced by sdram_init().

Here is the caller graph for this function:

◆ ux00ddr_enablewriteleveling()

static void ux00ddr_enablewriteleveling ( size_t  ahbregaddr)
inlinestatic

Definition at line 124 of file ux00ddr.h.

References _REG32, DFI_PHY_WRLELV_MODE_OFFSET, and WRLVL_EN_OFFSET.

Referenced by sdram_init().

Here is the caller graph for this function:

◆ ux00ddr_getdramclass()

static uint32_t ux00ddr_getdramclass ( size_t  ahbregaddr)
inlinestatic

Definition at line 142 of file ux00ddr.h.

References _REG32, and DRAM_CLASS_OFFSET.

Referenced by sdram_init().

Here is the caller graph for this function:

◆ ux00ddr_mask_leveling_completed_interrupt()

static void ux00ddr_mask_leveling_completed_interrupt ( size_t  ahbregaddr)
inlinestatic

Definition at line 96 of file ux00ddr.h.

References _REG32, and LEVELING_OPERATION_COMPLETED_OFFSET.

Referenced by sdram_init().

Here is the caller graph for this function:

◆ ux00ddr_mask_mc_init_complete_interrupt()

static void ux00ddr_mask_mc_init_complete_interrupt ( size_t  ahbregaddr)
inlinestatic

Definition at line 77 of file ux00ddr.h.

References _REG32, and MC_INIT_COMPLETE_OFFSET.

Referenced by sdram_init().

Here is the caller graph for this function:

◆ ux00ddr_mask_outofrange_interrupts()

static void ux00ddr_mask_outofrange_interrupts ( size_t  ahbregaddr)
inlinestatic

Definition at line 83 of file ux00ddr.h.

References _REG32, MULTIPLE_OUT_OF_RANGE_OFFSET, and OUT_OF_RANGE_OFFSET.

Referenced by sdram_init().

Here is the caller graph for this function:

◆ ux00ddr_mask_port_command_error_interrupt()

static void ux00ddr_mask_port_command_error_interrupt ( size_t  ahbregaddr)
inlinestatic

Definition at line 90 of file ux00ddr.h.

References _REG32, and PORT_COMMAND_CHANNEL_ERROR_OFFSET.

Referenced by sdram_init().

Here is the caller graph for this function:

◆ ux00ddr_phy_fixup()

static uint64_t ux00ddr_phy_fixup ( size_t  ahbregaddr)
inlinestatic

Definition at line 146 of file ux00ddr.h.

References _REG32, PHY_RX_CAL_DQ0_0_OFFSET, and PHY_RX_CAL_DQ1_0_OFFSET.

Referenced by sdram_init().

Here is the caller graph for this function:

◆ ux00ddr_setuprangeprotection()

static void ux00ddr_setuprangeprotection ( size_t  ahbregaddr,
size_t  end_addr 
)
inlinestatic

Definition at line 102 of file ux00ddr.h.

References _REG32, AXI0_ADDRESS_RANGE_ENABLE, AXI0_RANGE_PROT_BITS_0_OFFSET, and PORT_ADDR_PROTECTION_EN_OFFSET.

Referenced by sdram_init().

Here is the caller graph for this function:

◆ ux00ddr_start()

static void ux00ddr_start ( size_t  ahbregaddr,
size_t  filteraddr,
size_t  ddrend 
)
inlinestatic

Definition at line 63 of file ux00ddr.h.

References _REG32, and MC_INIT_COMPLETE_OFFSET.

Referenced by sdram_init().

Here is the caller graph for this function:

◆ ux00ddr_writeregmap()

static void ux00ddr_writeregmap ( size_t  ahbregaddr,
const uint32_t ctlsettings,
const uint32_t physettings 
)
inlinestatic

Definition at line 50 of file ux00ddr.h.

References phy_reset().

Referenced by sdram_init().

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