mb/google/nissa: Change fw config override to pad_number table based
BUG=b:231690996 TEST=gpios are the same in kernel pinctrl dump. Signed-off-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Change-Id: I67a466fac478b2a3a682451174fbdcdd67816769 Reviewed-on: https://review.coreboot.org/c/coreboot/+/64714 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Reka Norman <rekanorman@chromium.org>
This commit is contained in:
parent
8b9bc48f4d
commit
a8d2cb86b5
|
@ -69,6 +69,11 @@ void __weak variant_init(void)
|
||||||
/* default implementation does nothing */
|
/* default implementation does nothing */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void __weak fw_config_gpio_padbased_override(struct pad_config *padbased_table)
|
||||||
|
{
|
||||||
|
/* default implementation does nothing */
|
||||||
|
}
|
||||||
|
|
||||||
void __weak variant_configure_pads(void)
|
void __weak variant_configure_pads(void)
|
||||||
{
|
{
|
||||||
const struct pad_config *base_pads;
|
const struct pad_config *base_pads;
|
||||||
|
|
|
@ -16,6 +16,7 @@ const struct pad_config *variant_gpio_table(size_t *num);
|
||||||
const struct pad_config *variant_gpio_override_table(size_t *num);
|
const struct pad_config *variant_gpio_override_table(size_t *num);
|
||||||
const struct pad_config *variant_early_gpio_table(size_t *num);
|
const struct pad_config *variant_early_gpio_table(size_t *num);
|
||||||
const struct pad_config *variant_romstage_gpio_table(size_t *num);
|
const struct pad_config *variant_romstage_gpio_table(size_t *num);
|
||||||
|
void fw_config_gpio_padbased_override(struct pad_config *padbased_table);
|
||||||
|
|
||||||
const struct mb_cfg *variant_memory_params(void);
|
const struct mb_cfg *variant_memory_params(void);
|
||||||
void variant_get_spd_info(struct mem_spd *spd_info);
|
void variant_get_spd_info(struct mem_spd *spd_info);
|
||||||
|
|
|
@ -18,6 +18,7 @@ void variant_configure_pads(void)
|
||||||
gpio_padbased_override(padbased_table, base_pads, base_num);
|
gpio_padbased_override(padbased_table, base_pads, base_num);
|
||||||
override_pads = variant_gpio_override_table(&override_num);
|
override_pads = variant_gpio_override_table(&override_num);
|
||||||
gpio_padbased_override(padbased_table, override_pads, override_num);
|
gpio_padbased_override(padbased_table, override_pads, override_num);
|
||||||
|
fw_config_gpio_padbased_override(padbased_table);
|
||||||
gpio_configure_pads_with_padbased(padbased_table);
|
gpio_configure_pads_with_padbased(padbased_table);
|
||||||
free(padbased_table);
|
free(padbased_table);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||||
|
|
||||||
#include <baseboard/gpio.h>
|
#include <baseboard/gpio.h>
|
||||||
|
#include <baseboard/variants.h>
|
||||||
#include <bootstate.h>
|
#include <bootstate.h>
|
||||||
#include <console/console.h>
|
#include <console/console.h>
|
||||||
#include <fw_config.h>
|
#include <fw_config.h>
|
||||||
|
@ -45,25 +46,28 @@ static const struct pad_config sd_disable_pads[] = {
|
||||||
PAD_NC(GPP_H13, NONE),
|
PAD_NC(GPP_H13, NONE),
|
||||||
};
|
};
|
||||||
|
|
||||||
static void fw_config_handle(void *unused)
|
void fw_config_gpio_padbased_override(struct pad_config *padbased_table)
|
||||||
{
|
{
|
||||||
if (fw_config_probe(FW_CONFIG(DB_USB, DB_1C_LTE))) {
|
if (fw_config_probe(FW_CONFIG(DB_USB, DB_1C_LTE))) {
|
||||||
printk(BIOS_INFO, "Enable LTE-related GPIO pins.\n");
|
printk(BIOS_INFO, "Enable LTE-related GPIO pins.\n");
|
||||||
gpio_configure_pads(lte_enable_pads, ARRAY_SIZE(lte_enable_pads));
|
gpio_padbased_override(padbased_table, lte_enable_pads,
|
||||||
|
ARRAY_SIZE(lte_enable_pads));
|
||||||
} else {
|
} else {
|
||||||
printk(BIOS_INFO, "Disable LTE-related GPIO pins on craask.\n");
|
printk(BIOS_INFO, "Disable LTE-related GPIO pins on craask.\n");
|
||||||
gpio_configure_pads(lte_disable_pads, ARRAY_SIZE(lte_disable_pads));
|
gpio_padbased_override(padbased_table, lte_disable_pads,
|
||||||
|
ARRAY_SIZE(lte_disable_pads));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fw_config_probe(FW_CONFIG(WFC, WFC_ABSENT))) {
|
if (fw_config_probe(FW_CONFIG(WFC, WFC_ABSENT))) {
|
||||||
printk(BIOS_INFO, "Disable MIPI WFC GPIO pins.\n");
|
printk(BIOS_INFO, "Disable MIPI WFC GPIO pins.\n");
|
||||||
gpio_configure_pads(wfc_disable_pads, ARRAY_SIZE(wfc_disable_pads));
|
gpio_padbased_override(padbased_table, wfc_disable_pads,
|
||||||
|
ARRAY_SIZE(wfc_disable_pads));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fw_config_probe(FW_CONFIG(SD_CARD, SD_ABSENT))) {
|
if (fw_config_probe(FW_CONFIG(SD_CARD, SD_ABSENT))) {
|
||||||
printk(BIOS_INFO, "Disable SD card GPIO pins.\n");
|
printk(BIOS_INFO, "Disable SD card GPIO pins.\n");
|
||||||
gpio_configure_pads(sd_disable_pads, ARRAY_SIZE(sd_disable_pads));
|
gpio_padbased_override(padbased_table, sd_disable_pads,
|
||||||
|
ARRAY_SIZE(sd_disable_pads));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, fw_config_handle, NULL);
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||||
|
|
||||||
#include <baseboard/gpio.h>
|
#include <baseboard/gpio.h>
|
||||||
|
#include <baseboard/variants.h>
|
||||||
#include <boardid.h>
|
#include <boardid.h>
|
||||||
#include <bootstate.h>
|
#include <bootstate.h>
|
||||||
#include <console/console.h>
|
#include <console/console.h>
|
||||||
|
@ -91,45 +92,47 @@ static const struct pad_config nvme_disable_pads[] = {
|
||||||
PAD_NC(GPP_E17, NONE),
|
PAD_NC(GPP_E17, NONE),
|
||||||
};
|
};
|
||||||
|
|
||||||
static void fw_config_handle(void *unused)
|
void fw_config_gpio_padbased_override(struct pad_config *padbased_table)
|
||||||
{
|
{
|
||||||
if (fw_config_probe(FW_CONFIG(DB_USB, DB_1C_LTE))) {
|
if (fw_config_probe(FW_CONFIG(DB_USB, DB_1C_LTE))) {
|
||||||
printk(BIOS_INFO, "Enable LTE-related GPIO pins.\n");
|
printk(BIOS_INFO, "Enable LTE-related GPIO pins.\n");
|
||||||
gpio_configure_pads(lte_enable_pads, ARRAY_SIZE(lte_enable_pads));
|
gpio_padbased_override(padbased_table, lte_enable_pads,
|
||||||
|
ARRAY_SIZE(lte_enable_pads));
|
||||||
} else {
|
} else {
|
||||||
if (board_id() >= 2) {
|
if (board_id() >= 2) {
|
||||||
printk(BIOS_INFO, "Disable LTE-related GPIO pins on nirwen.\n");
|
printk(BIOS_INFO, "Disable LTE-related GPIO pins on nirwen.\n");
|
||||||
gpio_configure_pads(
|
gpio_padbased_override(padbased_table, lte_disable_pads_nirwen,
|
||||||
lte_disable_pads_nirwen,
|
ARRAY_SIZE(lte_disable_pads_nirwen)
|
||||||
ARRAY_SIZE(lte_disable_pads_nirwen)
|
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
printk(BIOS_INFO, "Disable LTE-related GPIO pins on nivviks.\n");
|
printk(BIOS_INFO, "Disable LTE-related GPIO pins on nivviks.\n");
|
||||||
gpio_configure_pads(
|
gpio_padbased_override(padbased_table, lte_disable_pads_nivviks,
|
||||||
lte_disable_pads_nivviks,
|
ARRAY_SIZE(lte_disable_pads_nivviks)
|
||||||
ARRAY_SIZE(lte_disable_pads_nivviks)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fw_config_probe(FW_CONFIG(SD_CARD, SD_ABSENT))) {
|
if (fw_config_probe(FW_CONFIG(SD_CARD, SD_ABSENT))) {
|
||||||
printk(BIOS_INFO, "Disable SD card GPIO pins.\n");
|
printk(BIOS_INFO, "Disable SD card GPIO pins.\n");
|
||||||
gpio_configure_pads(sd_disable_pads, ARRAY_SIZE(sd_disable_pads));
|
gpio_padbased_override(padbased_table, sd_disable_pads,
|
||||||
|
ARRAY_SIZE(sd_disable_pads));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fw_config_probe(FW_CONFIG(WFC, WFC_ABSENT))) {
|
if (fw_config_probe(FW_CONFIG(WFC, WFC_ABSENT))) {
|
||||||
printk(BIOS_INFO, "Disable MIPI WFC GPIO pins.\n");
|
printk(BIOS_INFO, "Disable MIPI WFC GPIO pins.\n");
|
||||||
gpio_configure_pads(wfc_disable_pads, ARRAY_SIZE(wfc_disable_pads));
|
gpio_padbased_override(padbased_table, wfc_disable_pads,
|
||||||
|
ARRAY_SIZE(wfc_disable_pads));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fw_config_probe(FW_CONFIG(STORAGE, STORAGE_EMMC))) {
|
if (!fw_config_probe(FW_CONFIG(STORAGE, STORAGE_EMMC))) {
|
||||||
printk(BIOS_INFO, "Disable eMMC SSD GPIO pins.\n");
|
printk(BIOS_INFO, "Disable eMMC SSD GPIO pins.\n");
|
||||||
gpio_configure_pads(emmc_disable_pads, ARRAY_SIZE(emmc_disable_pads));
|
gpio_padbased_override(padbased_table, emmc_disable_pads,
|
||||||
|
ARRAY_SIZE(emmc_disable_pads));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (board_id() >= 2 && !fw_config_probe(FW_CONFIG(STORAGE, STORAGE_NVME))) {
|
if (board_id() >= 2 && !fw_config_probe(FW_CONFIG(STORAGE, STORAGE_NVME))) {
|
||||||
printk(BIOS_INFO, "Disable NVMe SSD GPIO pins.\n");
|
printk(BIOS_INFO, "Disable NVMe SSD GPIO pins.\n");
|
||||||
gpio_configure_pads(nvme_disable_pads, ARRAY_SIZE(nvme_disable_pads));
|
gpio_padbased_override(padbased_table, nvme_disable_pads,
|
||||||
|
ARRAY_SIZE(nvme_disable_pads));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, fw_config_handle, NULL);
|
|
||||||
|
|
Loading…
Reference in New Issue