Aaron Durbin (adurbin@chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16422
-gerrit
commit 243a43c54d1d724c1fca611ec9de86e50c8454c7 Author: Aaron Durbin adurbin@chromium.org Date: Fri Sep 2 17:50:22 2016 -0500
mainboard/google/reef: provide cros_gpio variant API
Add support for Chrome OS gpio ACPI table information by providing weak implementation from the baseboard.
BUG=chrome-os-partner:56677
Change-Id: I517764b78f47fb7b3637482ff9efc053cdd1ac69 Signed-off-by: Aaron Durbin adurbin@chromium.org --- src/mainboard/google/reef/chromeos.c | 12 ++++++------ src/mainboard/google/reef/variants/baseboard/gpio.c | 11 +++++++++++ .../reef/variants/baseboard/include/baseboard/variants.h | 4 ++++ 3 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/src/mainboard/google/reef/chromeos.c b/src/mainboard/google/reef/chromeos.c index 7d7af9e..58c2cd8 100644 --- a/src/mainboard/google/reef/chromeos.c +++ b/src/mainboard/google/reef/chromeos.c @@ -13,6 +13,7 @@ * GNU General Public License for more details. */
+#include <baseboard/variants.h> #include <boot/coreboot_tables.h> #include <ec/google/chromeec/ec.h> #include <gpio.h> @@ -67,12 +68,11 @@ int get_write_protect_state(void) return gpio_get(GPIO_PCH_WP); }
-static const struct cros_gpio cros_gpios[] = { - CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, GPIO_COMM_NW_NAME), - CROS_GPIO_WP_AH(PAD_NW(GPIO_PCH_WP), GPIO_COMM_NW_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/reef/variants/baseboard/gpio.c b/src/mainboard/google/reef/variants/baseboard/gpio.c index 09a58be..828fc34 100644 --- a/src/mainboard/google/reef/variants/baseboard/gpio.c +++ b/src/mainboard/google/reef/variants/baseboard/gpio.c @@ -376,3 +376,14 @@ variant_sleep_gpio_table(size_t *num) *num = ARRAY_SIZE(sleep_gpio_table); return sleep_gpio_table; } + +static const struct cros_gpio cros_gpios[] = { + CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, GPIO_COMM_NW_NAME), + CROS_GPIO_WP_AH(PAD_NW(GPIO_PCH_WP), GPIO_COMM_NW_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/reef/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/reef/variants/baseboard/include/baseboard/variants.h index 4bb8434..8c94d27 100644 --- a/src/mainboard/google/reef/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/reef/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); @@ -28,4 +29,7 @@ const struct pad_config *variant_gpio_table(size_t *num); const struct pad_config *variant_early_gpio_table(size_t *num); const struct pad_config *variant_sleep_gpio_table(size_t *num);
+/* Return ChromeOS gpio table and fill in number of entries. */ +const struct cros_gpio *variant_cros_gpios(size_t *num); + #endif /* BASEBOARD_VARIANTS_H */