mb/google/guybrush: Add stubs to configure GPIOs
BUG=b:175143925 TEST=builds Signed-off-by: Mathew King <mathewk@chromium.org> Change-Id: I5afd2df396ba41f7d25fa7ff6879b7c1f82f438c Reviewed-on: https://review.coreboot.org/c/coreboot/+/49954 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: EricR Lai <ericr_lai@compal.corp-partner.google.com> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
committed by
Patrick Georgi
parent
30cca6ca2a
commit
10dd775ae3
@@ -5,5 +5,9 @@
|
||||
|
||||
void bootblock_mainboard_early_init(void)
|
||||
{
|
||||
/* TODO: Perform mainboard initialization */
|
||||
size_t num_gpios;
|
||||
const struct soc_amd_gpio *gpios;
|
||||
|
||||
gpios = variant_bootblock_gpio_table(&num_gpios);
|
||||
program_gpios(gpios, num_gpios);
|
||||
}
|
||||
|
@@ -1,10 +1,23 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#include <baseboard/variants.h>
|
||||
#include <device/device.h>
|
||||
|
||||
static void mainboard_configure_gpios(void)
|
||||
{
|
||||
size_t base_num_gpios, override_num_gpios;
|
||||
const struct soc_amd_gpio *base_gpios, *override_gpios;
|
||||
|
||||
base_gpios = variant_base_gpio_table(&base_num_gpios);
|
||||
override_gpios = variant_override_gpio_table(&override_num_gpios);
|
||||
|
||||
gpio_configure_pads_with_override(base_gpios, base_num_gpios, override_gpios,
|
||||
override_num_gpios);
|
||||
}
|
||||
|
||||
static void mainboard_init(void *chip_info)
|
||||
{
|
||||
/* TODO: Perform mainboard initialization */
|
||||
mainboard_configure_gpios();
|
||||
}
|
||||
|
||||
static void mainboard_enable(struct device *dev)
|
||||
|
@@ -0,0 +1,3 @@
|
||||
bootblock-y += gpio.c
|
||||
|
||||
ramstage-y += gpio.c
|
32
src/mainboard/google/guybrush/variants/baseboard/gpio.c
Normal file
32
src/mainboard/google/guybrush/variants/baseboard/gpio.c
Normal file
@@ -0,0 +1,32 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#include <baseboard/gpio.h>
|
||||
#include <baseboard/variants.h>
|
||||
#include <commonlib/helpers.h>
|
||||
|
||||
/* GPIO configuration in ramstage*/
|
||||
static const struct soc_amd_gpio base_gpio_table[] = {
|
||||
/* TODO: Fill gpio configuration */
|
||||
};
|
||||
|
||||
/* Early GPIO configuration in bootblock */
|
||||
static const struct soc_amd_gpio bootblock_gpio_table[] = {
|
||||
/* TODO: Fill bootblock gpio configuration */
|
||||
};
|
||||
|
||||
const struct soc_amd_gpio *__weak variant_base_gpio_table(size_t *size)
|
||||
{
|
||||
*size = ARRAY_SIZE(base_gpio_table);
|
||||
return base_gpio_table;
|
||||
}
|
||||
const struct soc_amd_gpio *__weak variant_override_gpio_table(size_t *size)
|
||||
{
|
||||
*size = 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const struct soc_amd_gpio *__weak variant_bootblock_gpio_table(size_t *size)
|
||||
{
|
||||
*size = ARRAY_SIZE(bootblock_gpio_table);
|
||||
return bootblock_gpio_table;
|
||||
}
|
@@ -3,4 +3,22 @@
|
||||
#ifndef __BASEBOARD_VARIANTS_H__
|
||||
#define __BASEBOARD_VARIANTS_H__
|
||||
|
||||
#include <amdblocks/gpio_banks.h>
|
||||
|
||||
/*
|
||||
* This function provides base GPIO configuration table. It is typically provided by
|
||||
* baseboard using a weak implementation. If GPIO configuration for a variant differs
|
||||
* significantly from the baseboard, then the variant can also provide a strong implementation
|
||||
* of this function.
|
||||
*/
|
||||
const struct soc_amd_gpio *variant_base_gpio_table(size_t *size);
|
||||
/*
|
||||
* This function allows variant to override any GPIOs that are different than the base GPIO
|
||||
* configuration provided by variant_base_gpio_table().
|
||||
*/
|
||||
const struct soc_amd_gpio *variant_override_gpio_table(size_t *size);
|
||||
|
||||
/* This function provides GPIO init in bootblock. */
|
||||
const struct soc_amd_gpio *variant_bootblock_gpio_table(size_t *size);
|
||||
|
||||
#endif /* __BASEBOARD_VARIANTS_H__ */
|
||||
|
Reference in New Issue
Block a user