mb/google/nissa: Apply gpio padbased table override

In order to improve gpio merge mechanism. Change iteration override
to padbased table override. And the following patch will change fw
config override with ramstage gpio table override.

BUG=b:231690996
TEST=check gpios in pinctrl are the same.

Signed-off-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Change-Id: I3d0beabc2c185405cb0af31e5506b6df94e9522c
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64713
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
This commit is contained in:
Eric Lai 2022-05-27 09:32:06 +08:00 committed by Felix Held
parent ce026c9365
commit 7aef2b1294
4 changed files with 30 additions and 1 deletions

View File

@ -69,7 +69,7 @@ void __weak variant_init(void)
/* default implementation does nothing */
}
static void mainboard_init(void *chip_info)
void __weak variant_configure_pads(void)
{
const struct pad_config *base_pads;
const struct pad_config *override_pads;
@ -78,7 +78,11 @@ static void mainboard_init(void *chip_info)
base_pads = variant_gpio_table(&base_num);
override_pads = variant_gpio_override_table(&override_num);
gpio_configure_pads_with_override(base_pads, base_num, override_pads, override_num);
}
static void mainboard_init(void *chip_info)
{
variant_configure_pads();
variant_init();
variant_devtree_update();
}

View File

@ -23,6 +23,7 @@ int variant_memory_sku(void);
bool variant_is_half_populated(void);
void variant_update_soc_chip_config(struct soc_intel_alderlake_config *config);
void variant_fill_ssdt(const struct device *dev);
void variant_configure_pads(void);
enum s0ix_entry {
S0IX_EXIT,

View File

@ -4,3 +4,4 @@ romstage-y += memory.c
romstage-y += gpio.c
ramstage-y += gpio.c
ramstage-y += ramstage.c

View File

@ -0,0 +1,23 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#include <baseboard/gpio.h>
#include <baseboard/variants.h>
#include <gpio.h>
#include <soc/gpio.h>
#include <soc/ramstage.h>
void variant_configure_pads(void)
{
const struct pad_config *base_pads;
const struct pad_config *override_pads;
struct pad_config *padbased_table;
size_t base_num, override_num;
padbased_table = new_padbased_table();
base_pads = variant_gpio_table(&base_num);
gpio_padbased_override(padbased_table, base_pads, base_num);
override_pads = variant_gpio_override_table(&override_num);
gpio_padbased_override(padbased_table, override_pads, override_num);
gpio_configure_pads_with_padbased(padbased_table);
free(padbased_table);
}