mb/google/kahlee: Add getter function for GPIO array
Instead of getting the address of the GPIO function with an extern, add a getter function and make the GPIO arrays static. TEST=Build Grunt; Build & boot Kahlee BUG=b:69164070 Change-Id: I3defcb66696459b915d7d4f43234d5c08ab7d417 Signed-off-by: Martin Roth <martinroth@google.com> Reviewed-on: https://review.coreboot.org/22435 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Marc Jones <marc@marcjonesconsulting.com> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
b77bc6f5e7
commit
dffd280b55
|
@ -18,17 +18,16 @@
|
||||||
#include <FchPlatform.h>
|
#include <FchPlatform.h>
|
||||||
#include <soc/southbridge.h>
|
#include <soc/southbridge.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <baseboard/variants.h>
|
||||||
extern const GPIO_CONTROL agesa_board_gpios[];
|
|
||||||
|
|
||||||
void platform_FchParams_reset(FCH_RESET_DATA_BLOCK *FchParams_reset)
|
void platform_FchParams_reset(FCH_RESET_DATA_BLOCK *FchParams_reset)
|
||||||
{
|
{
|
||||||
FchParams_reset->EarlyOemGpioTable = (void *)agesa_board_gpios;
|
FchParams_reset->EarlyOemGpioTable = (void *)get_gpio_table();
|
||||||
}
|
}
|
||||||
|
|
||||||
void platform_FchParams_env(FCH_DATA_BLOCK *FchParams_env)
|
void platform_FchParams_env(FCH_DATA_BLOCK *FchParams_env)
|
||||||
{
|
{
|
||||||
FchParams_env->PostOemGpioTable = (void *)agesa_board_gpios;
|
FchParams_env->PostOemGpioTable = (void *)get_gpio_table();
|
||||||
|
|
||||||
/* SDHCI/MMC configuration */
|
/* SDHCI/MMC configuration */
|
||||||
if (IS_ENABLED(CONFIG_BOARD_GOOGLE_KAHLEE))
|
if (IS_ENABLED(CONFIG_BOARD_GOOGLE_KAHLEE))
|
||||||
|
|
|
@ -20,10 +20,15 @@
|
||||||
#include <soc/southbridge.h>
|
#include <soc/southbridge.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
const GPIO_CONTROL __attribute__((weak)) agesa_board_gpios[] = {
|
static const GPIO_CONTROL agesa_board_gpios[] = {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const __attribute__((weak)) GPIO_CONTROL *get_gpio_table(void)
|
||||||
|
{
|
||||||
|
return agesa_board_gpios;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* GPE setup table must match ACPI GPE ASL
|
* GPE setup table must match ACPI GPE ASL
|
||||||
* { gevent, gpe, direction, level }
|
* { gevent, gpe, direction, level }
|
||||||
|
|
|
@ -19,7 +19,9 @@
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <soc/smi.h>
|
#include <soc/smi.h>
|
||||||
|
#include <AGESA.h>
|
||||||
|
|
||||||
|
const GPIO_CONTROL *get_gpio_table(void);
|
||||||
const struct sci_source *get_gpe_table(size_t *num);
|
const struct sci_source *get_gpe_table(size_t *num);
|
||||||
size_t variant_board_id(void);
|
size_t variant_board_id(void);
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <variant/gpio.h>
|
#include <variant/gpio.h>
|
||||||
|
|
||||||
const GPIO_CONTROL agesa_board_gpios[] = {
|
static const GPIO_CONTROL agesa_board_gpios[] = {
|
||||||
/* AGPIO2 PCIE/WLAN WAKE# SCI*/
|
/* AGPIO2 PCIE/WLAN WAKE# SCI*/
|
||||||
{2, Function1, FCH_GPIO_PULL_UP_ENABLE },
|
{2, Function1, FCH_GPIO_PULL_UP_ENABLE },
|
||||||
|
|
||||||
|
@ -100,6 +100,11 @@ const GPIO_CONTROL agesa_board_gpios[] = {
|
||||||
{-1}
|
{-1}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const GPIO_CONTROL *get_gpio_table(void)
|
||||||
|
{
|
||||||
|
return agesa_board_gpios;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* GPE setup table must match ACPI GPE ASL
|
* GPE setup table must match ACPI GPE ASL
|
||||||
* { gevent, gpe, direction, level }
|
* { gevent, gpe, direction, level }
|
||||||
|
|
Loading…
Reference in New Issue