blob: ef0f489d0dab5eb95402155d4a4ff221967098b6 [file] [log] [blame]
Lee Leahy89b5fbd2015-05-11 17:24:31 -07001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2013 Google Inc.
5 * Copyright (C) 2015 Intel Corp.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
Lee Leahy89b5fbd2015-05-11 17:24:31 -070015 */
16
Lee Leahy89b5fbd2015-05-11 17:24:31 -070017#include <soc/romstage.h>
Matt DeVillierf2fc4972017-10-03 15:39:22 -050018#include <baseboard/variants.h>
Matt DeVillier4f20a4a2017-08-20 17:56:48 -050019#include <chip.h>
Lee Leahy89b5fbd2015-05-11 17:24:31 -070020
21/* All FSP specific code goes in this block */
22void mainboard_romstage_entry(struct romstage_params *rp)
23{
24 struct pei_data *ps = rp->pei_data;
25
26 mainboard_fill_spd_data(ps);
27
28 /* Call back into chipset code with platform values updated. */
29 romstage_common(rp);
30}
31
Lee Leahy89b5fbd2015-05-11 17:24:31 -070032void mainboard_memory_init_params(struct romstage_params *params,
33 MEMORY_INIT_UPD *memory_params)
34{
35 /* Update SPD data */
Matt DeVillierb3937bb2017-12-07 20:34:08 -060036 if (IS_ENABLED(CONFIG_BOARD_GOOGLE_CYAN)) {
Matt DeVillierf2fc4972017-10-03 15:39:22 -050037 memory_params->PcdMemoryTypeEnable = MEM_DDR3;
Matt DeVillierb3937bb2017-12-07 20:34:08 -060038 memory_params->PcdMemorySpdPtr =
39 (u32)params->pei_data->spd_data_ch0;
40 } else
Matt DeVillier4f20a4a2017-08-20 17:56:48 -050041 memory_params->PcdMemoryTypeEnable = MEM_LPDDR3;
Matt DeVillierb3937bb2017-12-07 20:34:08 -060042
Lee Leahy89b5fbd2015-05-11 17:24:31 -070043 memory_params->PcdMemChannel0Config = params->pei_data->spd_ch0_config;
44 memory_params->PcdMemChannel1Config = params->pei_data->spd_ch1_config;
Matt DeVillierf2fc4972017-10-03 15:39:22 -050045
46 /* Variant-specific memory params */
47 variant_memory_init_params(memory_params);
48}
49
Aaron Durbin64031672018-04-21 14:45:32 -060050__weak
Matt DeVillierf2fc4972017-10-03 15:39:22 -050051void variant_memory_init_params(MEMORY_INIT_UPD *memory_params)
52{
Lee Leahy89b5fbd2015-05-11 17:24:31 -070053}