blob: a0bd8cddbd6a17ae8a7afeb6d9898a51d21f4fa4 [file] [log] [blame]
Marc Jones2d79f162017-05-22 21:35:16 -06001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2015-2016 Advanced Micro Devices, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
Marshall Dawson3f6c4002017-09-25 10:11:50 -060016#include <chip.h>
Richard Spiegel0ad74ac2017-12-08 16:53:29 -070017#include <amdblocks/agesawrapper.h>
chris wang76118a72018-10-18 18:52:58 +080018#include <boardid.h>
Marc Jones2d79f162017-05-22 21:35:16 -060019
Marshall Dawson3f6c4002017-09-25 10:11:50 -060020#define DIMMS_PER_CHANNEL 1
21#if DIMMS_PER_CHANNEL > MAX_DIMMS_PER_CH
22#error "Too many DIMM sockets defined for the mainboard"
23#endif
24
Marc Jones2d79f162017-05-22 21:35:16 -060025static const PSO_ENTRY DDR4PlatformMemoryConfiguration[] = {
26 DRAM_TECHNOLOGY(ANY_SOCKET, DDR4_TECHNOLOGY),
Marshall Dawson3f6c4002017-09-25 10:11:50 -060027 NUMBER_OF_DIMMS_SUPPORTED(ANY_SOCKET, ANY_CHANNEL, DIMMS_PER_CHANNEL),
28 NUMBER_OF_CHANNELS_SUPPORTED(ANY_SOCKET, MAX_DRAM_CH),
Marc Jones2d79f162017-05-22 21:35:16 -060029 MOTHER_BOARD_LAYERS(LAYERS_6),
30 MEMCLK_DIS_MAP(ANY_SOCKET, ANY_CHANNEL,
31 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00),
32 CKE_TRI_MAP(ANY_SOCKET, ANY_CHANNEL, 0xff, 0xff, 0xff, 0xff),
33 ODT_TRI_MAP(ANY_SOCKET, ANY_CHANNEL, 0xff, 0xff, 0xff, 0xff),
34 CS_TRI_MAP(ANY_SOCKET, ANY_CHANNEL,
35 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00),
36 PSO_END
37};
chris wang76118a72018-10-18 18:52:58 +080038/* TODO: Remove when no longer needed */
39static const PSO_ENTRY DDR4LiaraMemoryConfiguration[] = {
40 DRAM_TECHNOLOGY(ANY_SOCKET, DDR4_TECHNOLOGY),
41 NUMBER_OF_DIMMS_SUPPORTED(ANY_SOCKET, ANY_CHANNEL, DIMMS_PER_CHANNEL),
42 NUMBER_OF_CHANNELS_SUPPORTED(ANY_SOCKET, MAX_DRAM_CH),
43 MOTHER_BOARD_LAYERS(LAYERS_6),
44 MEMCLK_DIS_MAP(ANY_SOCKET, ANY_CHANNEL,
45 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00),
46 CKE_TRI_MAP(ANY_SOCKET, ANY_CHANNEL, 0xff, 0xff, 0xff, 0xff),
47 ODT_TRI_MAP(ANY_SOCKET, ANY_CHANNEL, 0xff, 0xff, 0xff, 0xff),
48 CS_TRI_MAP(ANY_SOCKET, ANY_CHANNEL,
49 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00),
50 TBLDRV_CONFIG_TO_OVERRIDE(DIMMS_PER_CHANNEL, ANY_SPEED, VOLT_ANY_,
51 ANY_),
52 TBLDRV_CONFIG_ENTRY_SLOWACCMODE(1),
53 PSO_END
54};
Marc Jones2d79f162017-05-22 21:35:16 -060055
56void OemPostParams(AMD_POST_PARAMS *PostParams)
57{
chris wang76118a72018-10-18 18:52:58 +080058 if ((IS_ENABLED(CONFIG_BOARD_GOOGLE_LIARA)) && (board_id() <= 4))
59 PostParams->MemConfig.PlatformMemoryConfiguration =
60 (PSO_ENTRY *)DDR4LiaraMemoryConfiguration;
61 else
62 PostParams->MemConfig.PlatformMemoryConfiguration =
63 (PSO_ENTRY *)DDR4PlatformMemoryConfiguration;
Richard Spiegel9b3da9f2018-02-16 14:33:59 -070064 /*
65 * Bank interleaving is enabled by default in AGESA. However, from AMD's
66 * explanation, bank interleaving is really chip select interleave,
67 * requiring 2 chip select arriving to the DIMM (rank interleaving). As
68 * both kahlee and grunt are hardware limited to a single chip select
69 * arriving at the DIMM, interleave will not work. This causes AGESA to
70 * throw a warning. To avoid the warning, interleaving needs to be
71 * disabled.
72 */
73 PostParams->MemConfig.EnableBankIntlv = FALSE;
Marc Jones2d79f162017-05-22 21:35:16 -060074}
Richard Spiegel5d3707b2018-07-27 12:44:22 -070075
76void set_board_env_params(GNB_ENV_CONFIGURATION *params)
77{
78 params->EDPv1_4VSMode = EDP_VS_HIGH_VDIFF_MODE;
79}