12 #include <soc/romstage.h>
38 spd_file =
cbfs_map(
"spd.bin", &spd_file_len);
40 die(
"SPD data not found.");
43 die(
"Missing SPD data.");
69 if (
CONFIG(DISPLAY_SPD_DATA) && spd_content !=
NULL) {
81 if (spd_content !=
NULL) {
94 if (
CONFIG(BOARD_GOOGLE_CYAN)) {
104 const int spd_capmb[8] = { 1, 2, 4, 8, 16, 32, 64, 0 };
105 const int spd_ranks[8] = { 1, 2, 3, 4, -1, -1, -1, -1 };
106 const int spd_devw[8] = { 4, 8, 16, 32, -1, -1, -1, -1 };
107 const int spd_busw[8] = { 8, 16, 32, 64, -1, -1, -1, -1 };
115 EFI_HOB_GUID_TYPE *hob_ptr;
116 FSP_SMBIOS_MEMORY_INFO *memory_info_hob;
121 hob_ptr =
get_guid_hob(&memory_info_hob_guid, hob_list_ptr);
122 if (hob_ptr !=
NULL) {
123 memory_info_hob = (FSP_SMBIOS_MEMORY_INFO *)(hob_ptr + 1);
131 if (
CONFIG(BOARD_GOOGLE_CYAN)) {
136 dimm->
dimm_size = capmb / 8 * busw / devw * ranks;
165 const void *spd_content;
171 if (spd_content ==
NULL)
180 if (mem_info ==
NULL)
182 memset(mem_info, 0,
sizeof(*mem_info));
void * memset(void *dstpp, int c, size_t len)
static struct sdram_info params
static void * cbfs_map(const char *name, size_t *size_out)
void * cbmem_add(u32 id, u64 size)
#define printk(level,...)
void __noreturn die(const char *fmt,...)
int get_variant_spd_index(int ram_id, int *dual)
void * fsp_get_hob_list(void)
void * get_guid_hob(const EFI_GUID *guid, const void *hob_start)
uint32_t gpio_base2_value(const gpio_t gpio[], int num_gpio)
void hexdump(const void *memory, size_t length)
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
#define SPD_DENSITY_BANKS
__weak uint8_t get_ramid(void)
static void set_dimm_info(const uint8_t *spd, struct dimm_info *dimm)
void spd_memory_init_params(MEMORY_INIT_UPD *memory_params)
void mainboard_save_dimm_info(struct romstage_params *params)
static void * get_spd_pointer(int *dual)
static const int spd_index[32]
const struct smm_save_state_ops *legacy_ops __weak
#define FSP_SMBIOS_MEMORY_INFO_GUID
#define LPDDR3_SPD_PART_LEN
#define DDR3_BUS_DEV_WIDTH
#define DDR3_ORGANIZATION
char * strncpy(char *to, const char *from, int count)
If this table is filled and put in CBMEM, then these info in CBMEM will be used to generate smbios ty...
uint8_t module_part_number[DIMM_INFO_PART_NUMBER_SIZE]
struct dimm_info dimm[DIMM_INFO_TOTAL]