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

#include <bootblock_common.h>
#include <baseboard/variants.h>
#include <delay.h>
#include <gpio.h>
#include <soc/gpio.h>

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

	if (!CONFIG(VBOOT_STARTS_BEFORE_BOOTBLOCK)) {
		gpios = variant_early_gpio_table(&num_gpios);
		program_gpios(gpios, num_gpios);
	}

	if (CONFIG(GPIO_SIGN_OF_LIFE)) {
		for (int x = 0; x < 20; x++) {
			gpio_set(GPIO_31, 1);
			mdelay(10);
			gpio_set(GPIO_31, 0);
			mdelay(10);
		}
	}
}