blob: 5527a2e962e59327da4cd46e8b57765b778a8903 [file] [log] [blame]
Angel Pons58c0d322020-04-05 13:20:46 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Marc Jonesd8621212015-06-09 21:18:38 -06002
Marc Jonesd8621212015-06-09 21:18:38 -06003#include <endian.h>
4#include <string.h>
Angel Pons52e48b52021-01-28 17:03:19 +01005#include <southbridge/intel/lynxpoint/lp_gpio.h>
Marc Jonesd8621212015-06-09 21:18:38 -06006#include <soc/pei_data.h>
7#include <soc/romstage.h>
8#include <ec/google/chromeec/ec.h>
9#include <mainboard/google/auron/ec.h>
Angel Ponsaf4e8e82021-01-20 21:47:31 +010010#include <mainboard/google/auron/variant.h>
11
12/* Auron board memory configuration GPIOs */
13#define SPD_GPIO_BIT0 13
14#define SPD_GPIO_BIT1 9
15#define SPD_GPIO_BIT2 47
Marc Jonesd8621212015-06-09 21:18:38 -060016
Marc Jonesd8621212015-06-09 21:18:38 -060017/* Copy SPD data for on-board memory */
18void mainboard_fill_spd_data(struct pei_data *pei_data)
19{
Angel Ponsf9acd372021-01-20 23:25:59 +010020 const int gpio_vector[] = {
Marc Jonesd8621212015-06-09 21:18:38 -060021 SPD_GPIO_BIT0,
22 SPD_GPIO_BIT1,
Angel Ponsf9acd372021-01-20 23:25:59 +010023 SPD_GPIO_BIT2,
24 -1,
Marc Jonesd8621212015-06-09 21:18:38 -060025 };
Marc Jonesd8621212015-06-09 21:18:38 -060026
Angel Ponsf9acd372021-01-20 23:25:59 +010027 const unsigned int spd_index = get_gpios(gpio_vector);
Marc Jonesd8621212015-06-09 21:18:38 -060028
Angel Pons292a7642021-01-20 22:24:22 +010029 fill_spd_for_index(pei_data->spd_data[0][0], spd_index);
Marc Jonesd8621212015-06-09 21:18:38 -060030
Marc Jonesd8621212015-06-09 21:18:38 -060031 /* Index 0-2 are 4GB config with both CH0 and CH1.
32 * Index 4-6 are 2GB config with CH0 only. */
33 if (spd_index > 3)
34 pei_data->dimm_channel1_disabled = 3;
35 else
Angel Pons292a7642021-01-20 22:24:22 +010036 memcpy(pei_data->spd_data[1][0], pei_data->spd_data[0][0], SPD_LEN);
Marc Jonesd8621212015-06-09 21:18:38 -060037}