summaryrefslogtreecommitdiff
path: root/src/mainboard/google/zork/bootblock.c
blob: 202b9577793faefe942a0347e4806f6448cf4573 (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
/* SPDX-License-Identifier: GPL-2.0-only */

#include <bootblock_common.h>
#include <baseboard/variants.h>
#include <acpi/acpi.h>
#include <amdblocks/espi.h>

void mb_set_up_early_espi(void)
{
	size_t num_gpios;
	const struct soc_amd_gpio *gpios;

	gpios = variant_espi_gpio_table(&num_gpios);
	gpio_configure_pads(gpios, num_gpios);
}

void bootblock_mainboard_early_init(void)
{
	size_t num_gpios;
	const struct soc_amd_gpio *gpios;

	/*
	 * The GPIOs below would normally be programmed in verstage, but
	 * if we're not using PSP verstage, need to set them up here instead.
	 */
	if (!CONFIG(VBOOT_STARTS_BEFORE_BOOTBLOCK)) {
		gpios = variant_early_gpio_table(&num_gpios);
		gpio_configure_pads(gpios, num_gpios);

		gpios = variant_tpm_gpio_table(&num_gpios);
		gpio_configure_pads(gpios, num_gpios);

	}

	gpios = variant_bootblock_gpio_table(&num_gpios, acpi_get_sleep_type());
	gpio_configure_pads(gpios, num_gpios);

	baseboard_pcie_gpio_configure();
}