summaryrefslogtreecommitdiff
path: root/src/mainboard
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@chromium.org>2017-04-14 15:44:15 -0700
committerFurquan Shaikh <furquan@google.com>2017-04-19 19:17:37 +0200
commit374d1ff8aacba5fc872b76bed6daf97da55e997a (patch)
tree4d72c5d7a154cf93573654ebedaacae59c196a7c /src/mainboard
parentc0f5205402d285de53942258ff692a9e5acc158b (diff)
downloadcoreboot-374d1ff8aacba5fc872b76bed6daf97da55e997a.tar.xz
mainboard/google/poppy: Provide cros_gpio variant API
Add support for ChromeOS GPIO ACPI table information by providing weak implementation from the baseboard. BUG=b:37375693 Change-Id: I641afe6bb45f106ddebde081a8ac2c64278ebeb9 Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://review.coreboot.org/19324 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/mainboard')
-rw-r--r--src/mainboard/google/poppy/chromeos.c12
-rw-r--r--src/mainboard/google/poppy/variants/baseboard/gpio.c11
-rw-r--r--src/mainboard/google/poppy/variants/baseboard/include/baseboard/variants.h2
3 files changed, 19 insertions, 6 deletions
diff --git a/src/mainboard/google/poppy/chromeos.c b/src/mainboard/google/poppy/chromeos.c
index 250effd4a1..e74933dd7b 100644
--- a/src/mainboard/google/poppy/chromeos.c
+++ b/src/mainboard/google/poppy/chromeos.c
@@ -14,6 +14,7 @@
*/
#include <arch/acpi.h>
+#include <baseboard/variants.h>
#include <gpio.h>
#include <rules.h>
#include <soc/gpe.h>
@@ -47,14 +48,13 @@ 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, 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);
}
int tis_plat_irq_status(void)
diff --git a/src/mainboard/google/poppy/variants/baseboard/gpio.c b/src/mainboard/google/poppy/variants/baseboard/gpio.c
index c08c8f6df1..4d77f5e068 100644
--- a/src/mainboard/google/poppy/variants/baseboard/gpio.c
+++ b/src/mainboard/google/poppy/variants/baseboard/gpio.c
@@ -387,3 +387,14 @@ const struct pad_config * __attribute__((weak))
*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/poppy/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/poppy/variants/baseboard/include/baseboard/variants.h
index c9bb401a6e..0b7cf3519b 100644
--- a/src/mainboard/google/poppy/variants/baseboard/include/baseboard/variants.h
+++ b/src/mainboard/google/poppy/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 @@ uint8_t variant_board_id(void);
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__ */