blob: ff0354dc10c2d497475747bbd2d2bb33f305be2c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
/*
* This file is part of the coreboot project.
*
* Copyright 2018 Intel Corp.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <baseboard/variants.h>
#include <boardid.h>
#include <console/console.h>
#include <ec/google/chromeec/ec.h>
#include <memory_info.h>
#include <soc/meminit.h>
#include <soc/romstage.h>
void mainboard_memory_init_params(FSPM_UPD *memupd)
{
meminit_lpddr4_by_sku(&memupd->FspmConfig,
variant_lpddr4_config(), variant_memory_sku());
}
static void save_dimm_info_by_sku_config(void)
{
save_lpddr4_dimm_info(variant_lpddr4_config(), variant_memory_sku());
}
void mainboard_save_dimm_info(void)
{
char part_num_store[DIMM_INFO_PART_NUMBER_SIZE];
const char *part_num = NULL;
if (!CONFIG(DRAM_PART_NUM_IN_CBI)) {
save_dimm_info_by_sku_config();
return;
}
if (!CONFIG(DRAM_PART_NUM_ALWAYS_IN_CBI)) {
/* Fall back on part numbers encoded in lp4cfg array. */
if ((int)board_id() < CONFIG_DRAM_PART_IN_CBI_BOARD_ID_MIN) {
save_dimm_info_by_sku_config();
return;
}
}
if (google_chromeec_cbi_get_dram_part_num(&part_num_store[0],
ARRAY_SIZE(part_num_store)) < 0)
printk(BIOS_ERR, "ERROR: Couldn't obtain DRAM part number from CBI\n");
else
part_num = &part_num_store[0];
save_lpddr4_dimm_info_part_num(part_num);
}
|