diff options
Diffstat (limited to 'src/mainboard/google')
5 files changed, 30 insertions, 11 deletions
diff --git a/src/mainboard/google/kahlee/bootblock/bootblock.c b/src/mainboard/google/kahlee/bootblock/bootblock.c index 90c8acbabf..244abe051f 100644 --- a/src/mainboard/google/kahlee/bootblock/bootblock.c +++ b/src/mainboard/google/kahlee/bootblock/bootblock.c @@ -13,12 +13,18 @@ * GNU General Public License for more details. */ +#include <baseboard/variants.h> #include <bootblock_common.h> #include <soc/southbridge.h> #include <variant/ec.h> void bootblock_mainboard_init(void) { + size_t num_gpios; + const struct soc_amd_stoneyridge_gpio *gpios; + gpios = variant_early_gpio_table(&num_gpios); + sb_program_gpios(gpios, num_gpios); + /* Enable the EC as soon as we have visibility */ mainboard_ec_init(); diff --git a/src/mainboard/google/kahlee/mainboard.c b/src/mainboard/google/kahlee/mainboard.c index b7adfc026a..aa8d080b6a 100644 --- a/src/mainboard/google/kahlee/mainboard.c +++ b/src/mainboard/google/kahlee/mainboard.c @@ -156,11 +156,16 @@ static void mainboard_init(void *chip_info) const struct sci_source *gpes; size_t num; int boardid = board_id(); + size_t num_gpios; + const struct soc_amd_stoneyridge_gpio *gpios; printk(BIOS_INFO, "Board ID: %d\n", boardid); mainboard_ec_init(); + gpios = variant_gpio_table(&num_gpios); + sb_program_gpios(gpios, num_gpios); + gpes = get_gpe_table(&num); gpe_configure_sci(gpes, num); diff --git a/src/mainboard/google/kahlee/variants/baseboard/gpio.c b/src/mainboard/google/kahlee/variants/baseboard/gpio.c index a6bcea5c86..1e1f34b005 100644 --- a/src/mainboard/google/kahlee/variants/baseboard/gpio.c +++ b/src/mainboard/google/kahlee/variants/baseboard/gpio.c @@ -258,13 +258,16 @@ const static struct soc_amd_stoneyridge_gpio gpio_set_stage_ram[] = { { GPIO_135, Function1, FCH_GPIO_PULL_UP_ENABLE | INPUT }, }; -const __attribute__((weak)) const struct soc_amd_stoneyridge_gpio - *board_get_gpio(size_t *size) +const __attribute__((weak)) +struct soc_amd_stoneyridge_gpio *variant_early_gpio_table(size_t *size) +{ + *size = ARRAY_SIZE(gpio_set_stage_reset); + return gpio_set_stage_reset; +} + +const __attribute__((weak)) +struct soc_amd_stoneyridge_gpio *variant_gpio_table(size_t *size) { - if (GPIO_TABLE_BOOTBLOCK) { - *size = ARRAY_SIZE(gpio_set_stage_reset); - return gpio_set_stage_reset; - } *size = ARRAY_SIZE(gpio_set_stage_ram); return gpio_set_stage_ram; } diff --git a/src/mainboard/google/kahlee/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/kahlee/variants/baseboard/include/baseboard/variants.h index bf14ef4d7c..83ee1190e3 100644 --- a/src/mainboard/google/kahlee/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/kahlee/variants/baseboard/include/baseboard/variants.h @@ -19,6 +19,7 @@ #include <stddef.h> #include <soc/smi.h> +#include <soc/southbridge.h> #include <amdblocks/agesawrapper.h> const struct sci_source *get_gpe_table(size_t *num); @@ -26,5 +27,7 @@ uint8_t variant_memory_sku(void); int variant_mainboard_read_spd(uint8_t spdAddress, char *buf, size_t len); int variant_get_xhci_oc_map(uint16_t *usb_oc_map); int variant_get_ehci_oc_map(uint16_t *usb_oc_map); +const struct soc_amd_stoneyridge_gpio *variant_early_gpio_table(size_t *size); +const struct soc_amd_stoneyridge_gpio *variant_gpio_table(size_t *size); #endif /* __BASEBOARD_VARIANTS_H__ */ diff --git a/src/mainboard/google/kahlee/variants/kahlee/gpio.c b/src/mainboard/google/kahlee/variants/kahlee/gpio.c index e357c7e2c3..d1cc017c93 100644 --- a/src/mainboard/google/kahlee/variants/kahlee/gpio.c +++ b/src/mainboard/google/kahlee/variants/kahlee/gpio.c @@ -96,12 +96,14 @@ const struct soc_amd_stoneyridge_gpio gpio_set_stage_ram[] = { {GPIO_119, Function2, FCH_GPIO_PULL_UP_ENABLE | OUTPUT_H }, }; -const struct soc_amd_stoneyridge_gpio *board_get_gpio(size_t *size) +const struct soc_amd_stoneyridge_gpio *variant_early_gpio_table(size_t *size) +{ + *size = ARRAY_SIZE(gpio_set_stage_reset); + return gpio_set_stage_reset; +} + +const struct soc_amd_stoneyridge_gpio *variant_gpio_table(size_t *size) { - if (GPIO_TABLE_BOOTBLOCK) { - *size = ARRAY_SIZE(gpio_set_stage_reset); - return gpio_set_stage_reset; - } *size = ARRAY_SIZE(gpio_set_stage_ram); return gpio_set_stage_ram; } |