David Wu has uploaded this change for review. ( https://review.coreboot.org/28964
Change subject: mb/google/fizz: Provide cros_gpio variant API ......................................................................
mb/google/fizz: Provide cros_gpio variant API
Add support for ChromeOS GPIO ACPI table information by providing weak implementation from the baseboard.
BUG=b:117066935 BRANCH=Fizz TEST=emerge-fizz coreboot
Change-Id: I2fa52c005cacdbcc322d107a3ac92d22df3f3697 Signed-off-by: David Wu david_wu@quanta.corp-partner.google.com --- M src/mainboard/google/fizz/chromeos.c M src/mainboard/google/fizz/variants/baseboard/gpio.c M src/mainboard/google/fizz/variants/baseboard/include/baseboard/variants.h 3 files changed, 18 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/64/28964/1
diff --git a/src/mainboard/google/fizz/chromeos.c b/src/mainboard/google/fizz/chromeos.c index 98bee6b..066d0c3 100644 --- a/src/mainboard/google/fizz/chromeos.c +++ b/src/mainboard/google/fizz/chromeos.c @@ -15,6 +15,7 @@
#include <gpio.h> #include <rules.h> +#include <baseboard/variants.h> #include <soc/gpio.h> #include <vendorcode/google/chromeos/chromeos.h>
@@ -44,12 +45,11 @@ return gpio_get(GPIO_PCH_WP); }
-static const struct cros_gpio cros_gpios[] = { - CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, CROS_GPIO_DEVICE_NAME), - CROS_GPIO_WP_AH(GPIO_PCH_WP, CROS_GPIO_DEVICE_NAME), -}; - void mainboard_chromeos_acpi_generate(void) { - chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios)); + const struct cros_gpio *gpios; + size_t num; + + gpios = variant_cros_gpios(&num); + chromeos_acpi_gpio_generate(gpios, num); } diff --git a/src/mainboard/google/fizz/variants/baseboard/gpio.c b/src/mainboard/google/fizz/variants/baseboard/gpio.c index 5c8e9d0..2a96dfd 100644 --- a/src/mainboard/google/fizz/variants/baseboard/gpio.c +++ b/src/mainboard/google/fizz/variants/baseboard/gpio.c @@ -266,3 +266,13 @@ *num = ARRAY_SIZE(early_gpio_table); return early_gpio_table; } + +static const struct cros_gpio cros_gpios[] = { + CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, CROS_GPIO_DEVICE_NAME), + CROS_GPIO_WP_AH(GPIO_PCH_WP, CROS_GPIO_DEVICE_NAME), +}; +const struct cros_gpio * __attribute__((weak)) variant_cros_gpios(size_t *num) +{ + *num = ARRAY_SIZE(cros_gpios); + return cros_gpios; +} diff --git a/src/mainboard/google/fizz/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/fizz/variants/baseboard/include/baseboard/variants.h index 41e0da0..52615be 100644 --- a/src/mainboard/google/fizz/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/fizz/variants/baseboard/include/baseboard/variants.h @@ -18,6 +18,7 @@
#include <soc/gpio.h> #include <stdint.h> +#include <vendorcode/google/chromeos/chromeos.h>
/* Return the board id for the current variant board. */ uint8_t variant_board_id(void); @@ -29,5 +30,6 @@ const struct pad_config *variant_gpio_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);
#endif /* __BASEBOARD_VARIANTS_H__ */