mb/google/brya: Add variant GPIO override functions

Provide functions to allow for variants to override only a few pads from
the baseboard table.

BUG=b:189362981

Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Change-Id: I3ae6c11ca8614d523f3402f1c1abb7c82124e473
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55324
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: EricR Lai <ericr_lai@compal.corp-partner.google.com>
This commit is contained in:
Tim Wawrzynczak 2021-06-08 14:44:56 -06:00 committed by Patrick Georgi
parent bc1445392f
commit 5fed1590e5
3 changed files with 14 additions and 4 deletions

View File

@ -8,10 +8,13 @@
static void mainboard_init(void *chip_info)
{
const struct pad_config *pads;
size_t num;
pads = variant_gpio_table(&num);
gpio_configure_pads(pads, num);
const struct pad_config *base_pads;
const struct pad_config *override_pads;
size_t base_num, override_num;
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_dev_init(struct device *dev)

View File

@ -406,6 +406,12 @@ const struct pad_config *__weak variant_gpio_table(size_t *num)
return gpio_table;
}
const struct pad_config *__weak variant_gpio_override_table(size_t *num)
{
*num = 0;
return NULL;
}
const struct pad_config *__weak variant_early_gpio_table(size_t *num)
{
*num = ARRAY_SIZE(early_gpio_table);

View File

@ -12,6 +12,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_early_gpio_table(size_t *num);
const struct cros_gpio *variant_cros_gpios(size_t *num);