Attention is currently required from: Jason Glenesk, Marshall Dawson, Tim Wawrzynczak, Nick Vaccaro, Felix Held. Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/58897 )
Change subject: [RFC] ChromeOS: Promote variant_cros_gpio() ......................................................................
[RFC] ChromeOS: Promote variant_cros_gpio()
The only purpose of mainboard_chromeos_acpi_generate() was to pass cros_gpio array for ACPI \OIPG package generation.
Promote variant_cros_gpio() from baseboards to ChromeOS declaration.
Change-Id: I5c2ac1dcea35f1f00dea401528404bc6ca0ab53c Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/mainboard/amd/majolica/chromeos.c M src/mainboard/emulation/qemu-q35/chromeos.c M src/mainboard/google/auron/chromeos.c M src/mainboard/google/beltino/chromeos.c M src/mainboard/google/brya/chromeos.c M src/mainboard/google/brya/variants/baseboard/include/baseboard/variants.h M src/mainboard/google/butterfly/chromeos.c M src/mainboard/google/cyan/chromeos.c M src/mainboard/google/dedede/chromeos.c M src/mainboard/google/dedede/variants/baseboard/include/baseboard/variants.h M src/mainboard/google/deltaur/chromeos.c M src/mainboard/google/deltaur/variants/baseboard/include/baseboard/variants.h M src/mainboard/google/drallion/chromeos.c M src/mainboard/google/drallion/variants/drallion/include/variant/gpio.h M src/mainboard/google/eve/chromeos.c M src/mainboard/google/fizz/chromeos.c M src/mainboard/google/fizz/variants/baseboard/include/baseboard/variants.h M src/mainboard/google/glados/chromeos.c M src/mainboard/google/guybrush/chromeos.c M src/mainboard/google/hatch/chromeos.c M src/mainboard/google/hatch/variants/baseboard/include/baseboard/variants.h M src/mainboard/google/jecht/chromeos.c M src/mainboard/google/kahlee/chromeos.c M src/mainboard/google/link/chromeos.c M src/mainboard/google/octopus/chromeos.c M src/mainboard/google/octopus/variants/baseboard/include/baseboard/variants.h M src/mainboard/google/parrot/chromeos.c M src/mainboard/google/poppy/chromeos.c M src/mainboard/google/poppy/variants/baseboard/include/baseboard/variants.h M src/mainboard/google/rambi/chromeos.c M src/mainboard/google/reef/chromeos.c M src/mainboard/google/reef/variants/baseboard/include/baseboard/variants.h M src/mainboard/google/sarien/chromeos.c M src/mainboard/google/sarien/variants/arcada/include/variant/gpio.h M src/mainboard/google/sarien/variants/sarien/include/variant/gpio.h M src/mainboard/google/slippy/chromeos.c M src/mainboard/google/stout/chromeos.c M src/mainboard/google/volteer/chromeos.c M src/mainboard/google/volteer/variants/baseboard/include/baseboard/variants.h M src/mainboard/google/zork/chromeos.c M src/mainboard/intel/adlrvp/chromeos.c M src/mainboard/intel/adlrvp/include/baseboard/variants.h M src/mainboard/intel/baskingridge/chromeos.c M src/mainboard/intel/coffeelake_rvp/chromeos.c M src/mainboard/intel/coffeelake_rvp/variants/baseboard/include/baseboard/variants.h M src/mainboard/intel/emeraldlake2/chromeos.c M src/mainboard/intel/glkrvp/chromeos.c M src/mainboard/intel/glkrvp/variants/baseboard/include/baseboard/variants.h M src/mainboard/intel/icelake_rvp/chromeos.c M src/mainboard/intel/icelake_rvp/variants/baseboard/include/baseboard/variants.h M src/mainboard/intel/jasperlake_rvp/chromeos.c M src/mainboard/intel/jasperlake_rvp/variants/baseboard/include/baseboard/variants.h M src/mainboard/intel/kblrvp/chromeos.c M src/mainboard/intel/kunimitsu/chromeos.c M src/mainboard/intel/shadowmountain/chromeos.c M src/mainboard/intel/shadowmountain/variants/baseboard/include/baseboard/variants.h M src/mainboard/intel/strago/chromeos.c M src/mainboard/intel/tglrvp/chromeos.c M src/mainboard/intel/tglrvp/variants/baseboard/include/baseboard/variants.h M src/mainboard/intel/wtm2/chromeos.c M src/mainboard/samsung/lumpy/chromeos.c M src/mainboard/samsung/stumpy/chromeos.c M src/vendorcode/google/chromeos/acpi.c M src/vendorcode/google/chromeos/chromeos.h M src/vendorcode/google/chromeos/gnvs.c 65 files changed, 87 insertions(+), 266 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/97/58897/1
diff --git a/src/mainboard/amd/majolica/chromeos.c b/src/mainboard/amd/majolica/chromeos.c index c73e047..239b530 100644 --- a/src/mainboard/amd/majolica/chromeos.c +++ b/src/mainboard/amd/majolica/chromeos.c @@ -16,11 +16,9 @@ return 0; }
-static const struct cros_gpio cros_gpios[] = { - /* No ChromeOS GPIOs */ -}; - -void mainboard_chromeos_acpi_generate(void) +const struct cros_gpio *variant_cros_gpios(size_t *num) { - chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios)); + /* No ChromeOS GPIOs */ + *num = 0; + return NULL; } diff --git a/src/mainboard/emulation/qemu-q35/chromeos.c b/src/mainboard/emulation/qemu-q35/chromeos.c index 1af2e02..4a5a409 100644 --- a/src/mainboard/emulation/qemu-q35/chromeos.c +++ b/src/mainboard/emulation/qemu-q35/chromeos.c @@ -49,7 +49,8 @@ CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, "QEMU"), };
-void mainboard_chromeos_acpi_generate(void) +const struct cros_gpio *variant_cros_gpios(size_t *num) { - chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios)); + *num = ARRAY_SIZE(cros_gpios); + return cros_gpios; } diff --git a/src/mainboard/google/auron/chromeos.c b/src/mainboard/google/auron/chromeos.c index 50eeddc..849d86a 100644 --- a/src/mainboard/google/auron/chromeos.c +++ b/src/mainboard/google/auron/chromeos.c @@ -28,7 +28,8 @@ CROS_GPIO_WP_AH(CROS_WP_GPIO, CROS_GPIO_DEVICE_NAME), };
-void mainboard_chromeos_acpi_generate(void) +const struct cros_gpio *variant_cros_gpios(size_t *num) { - chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios)); + *num = ARRAY_SIZE(cros_gpios); + return cros_gpios; } diff --git a/src/mainboard/google/beltino/chromeos.c b/src/mainboard/google/beltino/chromeos.c index a33caca..e378103 100644 --- a/src/mainboard/google/beltino/chromeos.c +++ b/src/mainboard/google/beltino/chromeos.c @@ -61,7 +61,8 @@ CROS_GPIO_WP_AH(GPIO_SPI_WP, CROS_GPIO_DEVICE_NAME), };
-void mainboard_chromeos_acpi_generate(void) +const struct cros_gpio *variant_cros_gpios(size_t *num) { - chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios)); + *num = ARRAY_SIZE(cros_gpios); + return cros_gpios; } diff --git a/src/mainboard/google/brya/chromeos.c b/src/mainboard/google/brya/chromeos.c index add7346..a0e5c2e 100644 --- a/src/mainboard/google/brya/chromeos.c +++ b/src/mainboard/google/brya/chromeos.c @@ -22,10 +22,3 @@ return gpio_get(GPIO_PCH_WP); }
-void mainboard_chromeos_acpi_generate(void) -{ - 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/brya/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/brya/variants/baseboard/include/baseboard/variants.h index 3e0fd05..55058f4 100644 --- a/src/mainboard/google/brya/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/brya/variants/baseboard/include/baseboard/variants.h @@ -15,7 +15,6 @@ const struct pad_config *variant_gpio_table(size_t *num); const struct pad_config *variant_gpio_override_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); const struct pad_config *variant_romstage_gpio_table(size_t *num);
const struct mb_cfg *variant_memory_params(void); diff --git a/src/mainboard/google/butterfly/chromeos.c b/src/mainboard/google/butterfly/chromeos.c index e43d442..202c767 100644 --- a/src/mainboard/google/butterfly/chromeos.c +++ b/src/mainboard/google/butterfly/chromeos.c @@ -75,7 +75,8 @@ CROS_GPIO_WP_AL(WP_GPIO, CROS_GPIO_DEVICE_NAME), };
-void mainboard_chromeos_acpi_generate(void) +const struct cros_gpio *variant_cros_gpios(size_t *num) { - chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios)); + *num = ARRAY_SIZE(cros_gpios); + return cros_gpios; } diff --git a/src/mainboard/google/cyan/chromeos.c b/src/mainboard/google/cyan/chromeos.c index b88862c..a343229 100644 --- a/src/mainboard/google/cyan/chromeos.c +++ b/src/mainboard/google/cyan/chromeos.c @@ -58,7 +58,8 @@ CROS_GPIO_WP_AH(0x10013, CROS_GPIO_DEVICE_NAME), };
-void mainboard_chromeos_acpi_generate(void) +const struct cros_gpio *variant_cros_gpios(size_t *num) { - chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios)); + *num = ARRAY_SIZE(cros_gpios); + return cros_gpios; } diff --git a/src/mainboard/google/dedede/chromeos.c b/src/mainboard/google/dedede/chromeos.c index fb904cc..a0e5c2e 100644 --- a/src/mainboard/google/dedede/chromeos.c +++ b/src/mainboard/google/dedede/chromeos.c @@ -22,11 +22,3 @@ return gpio_get(GPIO_PCH_WP); }
-void mainboard_chromeos_acpi_generate(void) -{ - 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/dedede/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/dedede/variants/baseboard/include/baseboard/variants.h index 78e44b4..aef3075 100644 --- a/src/mainboard/google/dedede/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/dedede/variants/baseboard/include/baseboard/variants.h @@ -13,7 +13,6 @@ const struct pad_config *variant_base_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); -const struct cros_gpio *variant_cros_gpios(size_t *num); const struct pad_config *variant_override_gpio_table(size_t *num);
/** diff --git a/src/mainboard/google/deltaur/chromeos.c b/src/mainboard/google/deltaur/chromeos.c index 9d3929e..8c9e1b7 100644 --- a/src/mainboard/google/deltaur/chromeos.c +++ b/src/mainboard/google/deltaur/chromeos.c @@ -51,15 +51,6 @@ return 0; }
-void mainboard_chromeos_acpi_generate(void) -{ - const struct cros_gpio *cros_gpios; - size_t num_gpios = 0; - - cros_gpios = variant_cros_gpios(&num_gpios); - - chromeos_acpi_gpio_generate(cros_gpios, num_gpios); -}
int get_write_protect_state(void) { diff --git a/src/mainboard/google/deltaur/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/deltaur/variants/baseboard/include/baseboard/variants.h index 7a4ed08..a54477a 100644 --- a/src/mainboard/google/deltaur/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/deltaur/variants/baseboard/include/baseboard/variants.h @@ -6,7 +6,6 @@ #include <soc/gpio.h> #include <soc/meminit.h> #include <stddef.h> -#include <vendorcode/google/chromeos/chromeos.h>
/* * The next set of functions return the gpio table and fill in the number of @@ -16,8 +15,6 @@ const struct pad_config *variant_early_gpio_table(size_t *num); const struct pad_config *variant_override_gpio_table(size_t *num);
-const struct cros_gpio *variant_cros_gpios(size_t *num); - const struct mb_cfg *variant_memory_params(void); void variant_memory_init(FSP_M_CONFIG *mem_cfg);
diff --git a/src/mainboard/google/drallion/chromeos.c b/src/mainboard/google/drallion/chromeos.c index d92ebb1..f418cc1 100644 --- a/src/mainboard/google/drallion/chromeos.c +++ b/src/mainboard/google/drallion/chromeos.c @@ -49,15 +49,6 @@ return 0; }
-void mainboard_chromeos_acpi_generate(void) -{ - const struct cros_gpio *cros_gpios; - size_t num_gpios = 0; - - cros_gpios = variant_cros_gpios(&num_gpios); - - chromeos_acpi_gpio_generate(cros_gpios, num_gpios); -}
int get_write_protect_state(void) { diff --git a/src/mainboard/google/drallion/variants/drallion/include/variant/gpio.h b/src/mainboard/google/drallion/variants/drallion/include/variant/gpio.h index 22a2d45..db0b3a9 100644 --- a/src/mainboard/google/drallion/variants/drallion/include/variant/gpio.h +++ b/src/mainboard/google/drallion/variants/drallion/include/variant/gpio.h @@ -29,7 +29,4 @@ const struct pad_config *variant_gpio_table(size_t *num); const struct pad_config *variant_early_gpio_table(size_t *num);
-struct cros_gpio; -const struct cros_gpio *variant_cros_gpios(size_t *num); - #endif diff --git a/src/mainboard/google/eve/chromeos.c b/src/mainboard/google/eve/chromeos.c index 11931c6..8297049 100644 --- a/src/mainboard/google/eve/chromeos.c +++ b/src/mainboard/google/eve/chromeos.c @@ -30,7 +30,8 @@ CROS_GPIO_WP_AH(GPIO_PCH_WP, CROS_GPIO_DEVICE_NAME), };
-void mainboard_chromeos_acpi_generate(void) +const struct cros_gpio *variant_cros_gpios(size_t *num) { - chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios)); + *num = ARRAY_SIZE(cros_gpios); + return cros_gpios; } diff --git a/src/mainboard/google/fizz/chromeos.c b/src/mainboard/google/fizz/chromeos.c index a74c2f7..8c0646d 100644 --- a/src/mainboard/google/fizz/chromeos.c +++ b/src/mainboard/google/fizz/chromeos.c @@ -26,11 +26,3 @@ return gpio_get(GPIO_PCH_WP); }
-void mainboard_chromeos_acpi_generate(void) -{ - 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/include/baseboard/variants.h b/src/mainboard/google/fizz/variants/baseboard/include/baseboard/variants.h index cf22926..ae5eeff 100644 --- a/src/mainboard/google/fizz/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/fizz/variants/baseboard/include/baseboard/variants.h @@ -5,7 +5,6 @@
#include <soc/gpio.h> #include <stdint.h> -#include <vendorcode/google/chromeos/chromeos.h>
/* * The next set of functions return the gpio table and fill in the number of @@ -14,8 +13,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); - void variant_smi_sleep(u8 slp_typ);
struct nhlt; diff --git a/src/mainboard/google/glados/chromeos.c b/src/mainboard/google/glados/chromeos.c index 6a1f0b4..2acf5d7 100644 --- a/src/mainboard/google/glados/chromeos.c +++ b/src/mainboard/google/glados/chromeos.c @@ -29,7 +29,8 @@ CROS_GPIO_WP_AH(GPIO_PCH_WP, CROS_GPIO_DEVICE_NAME), };
-void mainboard_chromeos_acpi_generate(void) +const struct cros_gpio *variant_cros_gpios(size_t *num) { - chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios)); + *num = ARRAY_SIZE(cros_gpios); + return cros_gpios; } diff --git a/src/mainboard/google/guybrush/chromeos.c b/src/mainboard/google/guybrush/chromeos.c index df99e64..ee7a0d4 100644 --- a/src/mainboard/google/guybrush/chromeos.c +++ b/src/mainboard/google/guybrush/chromeos.c @@ -22,9 +22,10 @@ CROS_GPIO_WP_AL(CROS_WP_GPIO, GPIO_DEVICE_NAME), };
-void mainboard_chromeos_acpi_generate(void) +const struct cros_gpio *variant_cros_gpios(size_t *num) { - chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios)); + *num = ARRAY_SIZE(cros_gpios); + return cros_gpios; }
void mainboard_spi_fast_speed_override(uint8_t *fast_speed) diff --git a/src/mainboard/google/hatch/chromeos.c b/src/mainboard/google/hatch/chromeos.c index ee54ade..882a01c 100644 --- a/src/mainboard/google/hatch/chromeos.c +++ b/src/mainboard/google/hatch/chromeos.c @@ -25,12 +25,3 @@ return gpio_get(GPIO_PCH_WP); }
-void mainboard_chromeos_acpi_generate(void) -{ - const struct cros_gpio *cros_gpios; - size_t num_gpios = 0; - - cros_gpios = variant_cros_gpios(&num_gpios); - - chromeos_acpi_gpio_generate(cros_gpios, num_gpios); -} diff --git a/src/mainboard/google/hatch/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/hatch/variants/baseboard/include/baseboard/variants.h index 2f06a55..125f738 100644 --- a/src/mainboard/google/hatch/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/hatch/variants/baseboard/include/baseboard/variants.h @@ -6,7 +6,6 @@ #include <soc/cnl_memcfg_init.h> #include <soc/gpio.h> #include <stdint.h> -#include <vendorcode/google/chromeos/chromeos.h>
/* * The next set of functions return the gpio table and fill in the number of @@ -28,9 +27,6 @@ /* Return GPIO pads that need to be configured before ramstage */ const struct pad_config *variant_early_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); - /* Modify devictree settings during ramstage. */ void variant_devtree_update(void);
diff --git a/src/mainboard/google/jecht/chromeos.c b/src/mainboard/google/jecht/chromeos.c index cf59636..0c2ff7d 100644 --- a/src/mainboard/google/jecht/chromeos.c +++ b/src/mainboard/google/jecht/chromeos.c @@ -63,7 +63,8 @@ CROS_GPIO_WP_AH(GPIO_SPI_WP, CROS_GPIO_DEVICE_NAME), };
-void mainboard_chromeos_acpi_generate(void) +const struct cros_gpio *variant_cros_gpios(size_t *num) { - chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios)); + *num = ARRAY_SIZE(cros_gpios); + return cros_gpios; } diff --git a/src/mainboard/google/kahlee/chromeos.c b/src/mainboard/google/kahlee/chromeos.c index b85f976..45be2f9 100644 --- a/src/mainboard/google/kahlee/chromeos.c +++ b/src/mainboard/google/kahlee/chromeos.c @@ -28,7 +28,8 @@ CROS_GPIO_WP_AL(CROS_WP_GPIO, GPIO_DEVICE_NAME), };
-void mainboard_chromeos_acpi_generate(void) +const struct cros_gpio *variant_cros_gpios(size_t *num) { - chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios)); + *num = ARRAY_SIZE(cros_gpios); + return cros_gpios; } diff --git a/src/mainboard/google/link/chromeos.c b/src/mainboard/google/link/chromeos.c index 540803c..43021b3 100644 --- a/src/mainboard/google/link/chromeos.c +++ b/src/mainboard/google/link/chromeos.c @@ -33,7 +33,8 @@ CROS_GPIO_WP_AH(57, CROS_GPIO_DEVICE_NAME), };
-void mainboard_chromeos_acpi_generate(void) +const struct cros_gpio *variant_cros_gpios(size_t *num) { - chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios)); + *num = ARRAY_SIZE(cros_gpios); + return cros_gpios; } diff --git a/src/mainboard/google/octopus/chromeos.c b/src/mainboard/google/octopus/chromeos.c index 03d3b4f..3cb42c1 100644 --- a/src/mainboard/google/octopus/chromeos.c +++ b/src/mainboard/google/octopus/chromeos.c @@ -25,11 +25,3 @@ return gpio_get(GPIO_PCH_WP); }
-void mainboard_chromeos_acpi_generate(void) -{ - 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/octopus/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/octopus/variants/baseboard/include/baseboard/variants.h index 5f2c6e2..bbc5d56 100644 --- a/src/mainboard/google/octopus/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/octopus/variants/baseboard/include/baseboard/variants.h @@ -6,7 +6,6 @@ #include <soc/gpio.h> #include <soc/meminit.h> #include <stdint.h> -#include <vendorcode/google/chromeos/chromeos.h>
/* The next set of functions return the gpio table and fill in the number of * entries for each table. */ @@ -23,8 +22,6 @@ const struct lpddr4_cfg *variant_lpddr4_config(void); /* Return memory SKU for the board. */ size_t variant_memory_sku(void); -/* Return ChromeOS gpio table and fill in number of entries. */ -const struct cros_gpio *variant_cros_gpios(size_t *num);
/* Seed the NHLT tables with the board specific information. */ struct nhlt; diff --git a/src/mainboard/google/parrot/chromeos.c b/src/mainboard/google/parrot/chromeos.c index 9f4be26..328ad59 100644 --- a/src/mainboard/google/parrot/chromeos.c +++ b/src/mainboard/google/parrot/chromeos.c @@ -61,7 +61,8 @@ CROS_GPIO_WP_AL(70, CROS_GPIO_DEVICE_NAME), };
-void mainboard_chromeos_acpi_generate(void) +const struct cros_gpio *variant_cros_gpios(size_t *num) { - chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios)); + *num = ARRAY_SIZE(cros_gpios); + return cros_gpios; } diff --git a/src/mainboard/google/poppy/chromeos.c b/src/mainboard/google/poppy/chromeos.c index 5dd1e98..b86a279e 100644 --- a/src/mainboard/google/poppy/chromeos.c +++ b/src/mainboard/google/poppy/chromeos.c @@ -30,11 +30,3 @@ return gpio_get(GPIO_PCH_WP); }
-void mainboard_chromeos_acpi_generate(void) -{ - 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/poppy/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/poppy/variants/baseboard/include/baseboard/variants.h index 1fdc32f..9d3e7f0 100644 --- a/src/mainboard/google/poppy/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/poppy/variants/baseboard/include/baseboard/variants.h @@ -5,7 +5,6 @@
#include <soc/gpio.h> #include <stdint.h> -#include <vendorcode/google/chromeos/chromeos.h>
/* * The next set of functions return the gpio table and fill in the number of @@ -20,7 +19,6 @@ */ const struct pad_config *variant_romstage_gpio_table(size_t *num);
-const struct cros_gpio *variant_cros_gpios(size_t *num); /* Config gpio by different sku id */ const struct pad_config *variant_sku_gpio_table(size_t *num);
diff --git a/src/mainboard/google/rambi/chromeos.c b/src/mainboard/google/rambi/chromeos.c index f9a1718..150a7d2 100644 --- a/src/mainboard/google/rambi/chromeos.c +++ b/src/mainboard/google/rambi/chromeos.c @@ -39,7 +39,8 @@ CROS_GPIO_WP_AH(0x2006, CROS_GPIO_DEVICE_NAME), };
-void mainboard_chromeos_acpi_generate(void) +const struct cros_gpio *variant_cros_gpios(size_t *num) { - chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios)); + *num = ARRAY_SIZE(cros_gpios); + return cros_gpios; } diff --git a/src/mainboard/google/reef/chromeos.c b/src/mainboard/google/reef/chromeos.c index 94d76b9..57bddfa 100644 --- a/src/mainboard/google/reef/chromeos.c +++ b/src/mainboard/google/reef/chromeos.c @@ -25,11 +25,3 @@ return gpio_get(GPIO_PCH_WP); }
-void mainboard_chromeos_acpi_generate(void) -{ - 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/include/baseboard/variants.h b/src/mainboard/google/reef/variants/baseboard/include/baseboard/variants.h index 5b08c6a..c9b8b9d 100644 --- a/src/mainboard/google/reef/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/reef/variants/baseboard/include/baseboard/variants.h @@ -6,7 +6,6 @@ #include <soc/gpio.h> #include <soc/meminit.h> #include <stdint.h> -#include <vendorcode/google/chromeos/chromeos.h>
/* Return the sku id based off the strapping resistors attached to SoC. */ uint8_t sku_strapping_value(void); @@ -29,9 +28,6 @@ /* Set variant board sku to ec by sku id */ void variant_board_ec_set_skuid(void);
-/* Return ChromeOS gpio table and fill in number of entries. */ -const struct cros_gpio *variant_cros_gpios(size_t *num); - /* Seed the NHLT tables with the board specific information. */ struct nhlt; void variant_nhlt_oem_overrides(const char **oem_id, diff --git a/src/mainboard/google/sarien/chromeos.c b/src/mainboard/google/sarien/chromeos.c index f49b639..96ada16 100644 --- a/src/mainboard/google/sarien/chromeos.c +++ b/src/mainboard/google/sarien/chromeos.c @@ -47,15 +47,6 @@ return 0; }
-void mainboard_chromeos_acpi_generate(void) -{ - const struct cros_gpio *cros_gpios; - size_t num_gpios = 0; - - cros_gpios = variant_cros_gpios(&num_gpios); - - chromeos_acpi_gpio_generate(cros_gpios, num_gpios); -}
int get_write_protect_state(void) { diff --git a/src/mainboard/google/sarien/variants/arcada/include/variant/gpio.h b/src/mainboard/google/sarien/variants/arcada/include/variant/gpio.h index f56a8b5..f56059c 100644 --- a/src/mainboard/google/sarien/variants/arcada/include/variant/gpio.h +++ b/src/mainboard/google/sarien/variants/arcada/include/variant/gpio.h @@ -15,7 +15,4 @@ const struct pad_config *variant_gpio_table(size_t *num); const struct pad_config *variant_early_gpio_table(size_t *num);
-struct cros_gpio; -const struct cros_gpio *variant_cros_gpios(size_t *num); - #endif diff --git a/src/mainboard/google/sarien/variants/sarien/include/variant/gpio.h b/src/mainboard/google/sarien/variants/sarien/include/variant/gpio.h index f56a8b5..f56059c 100644 --- a/src/mainboard/google/sarien/variants/sarien/include/variant/gpio.h +++ b/src/mainboard/google/sarien/variants/sarien/include/variant/gpio.h @@ -15,7 +15,4 @@ const struct pad_config *variant_gpio_table(size_t *num); const struct pad_config *variant_early_gpio_table(size_t *num);
-struct cros_gpio; -const struct cros_gpio *variant_cros_gpios(size_t *num); - #endif diff --git a/src/mainboard/google/slippy/chromeos.c b/src/mainboard/google/slippy/chromeos.c index 4fffd45..3916a72 100644 --- a/src/mainboard/google/slippy/chromeos.c +++ b/src/mainboard/google/slippy/chromeos.c @@ -26,7 +26,8 @@ CROS_GPIO_WP_AH(58, CROS_GPIO_DEVICE_NAME), };
-void mainboard_chromeos_acpi_generate(void) +const struct cros_gpio *variant_cros_gpios(size_t *num) { - chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios)); + *num = ARRAY_SIZE(cros_gpios); + return cros_gpios; } diff --git a/src/mainboard/google/stout/chromeos.c b/src/mainboard/google/stout/chromeos.c index ed78b37..4508b8a 100644 --- a/src/mainboard/google/stout/chromeos.c +++ b/src/mainboard/google/stout/chromeos.c @@ -83,7 +83,8 @@ CROS_GPIO_WP_AL(7, CROS_GPIO_DEVICE_NAME), };
-void mainboard_chromeos_acpi_generate(void) +const struct cros_gpio *variant_cros_gpios(size_t *num) { - chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios)); + *num = ARRAY_SIZE(cros_gpios); + return cros_gpios; } diff --git a/src/mainboard/google/volteer/chromeos.c b/src/mainboard/google/volteer/chromeos.c index abd50c5..ceb98cb 100644 --- a/src/mainboard/google/volteer/chromeos.c +++ b/src/mainboard/google/volteer/chromeos.c @@ -24,11 +24,3 @@ return gpio_get(GPIO_PCH_WP); }
-void mainboard_chromeos_acpi_generate(void) -{ - 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/volteer/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/volteer/variants/baseboard/include/baseboard/variants.h index ba4bf7f..94c39d9 100644 --- a/src/mainboard/google/volteer/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/volteer/variants/baseboard/include/baseboard/variants.h @@ -6,7 +6,6 @@ #include <soc/gpio.h> #include <soc/meminit.h> #include <stddef.h> -#include <vendorcode/google/chromeos/chromeos.h>
/* * The next set of functions return the gpio table and fill in the number of @@ -17,8 +16,6 @@ const struct pad_config *variant_sleep_gpio_table(u8 slp_typ, size_t *num); const struct pad_config *variant_override_gpio_table(size_t *num);
-const struct cros_gpio *variant_cros_gpios(size_t *num); - const struct mb_cfg *variant_memory_params(void); int variant_memory_sku(void); void memcfg_variant_init(FSPM_UPD *mupd); diff --git a/src/mainboard/google/zork/chromeos.c b/src/mainboard/google/zork/chromeos.c index b581b90..6443011 100644 --- a/src/mainboard/google/zork/chromeos.c +++ b/src/mainboard/google/zork/chromeos.c @@ -27,7 +27,8 @@ CROS_GPIO_WP_AL(CROS_WP_GPIO, GPIO_DEVICE_NAME), };
-void mainboard_chromeos_acpi_generate(void) +const struct cros_gpio *variant_cros_gpios(size_t *num) { - chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios)); + *num = ARRAY_SIZE(cros_gpios); + return cros_gpios; } diff --git a/src/mainboard/intel/adlrvp/chromeos.c b/src/mainboard/intel/adlrvp/chromeos.c index 244b942..30e87c1 100644 --- a/src/mainboard/intel/adlrvp/chromeos.c +++ b/src/mainboard/intel/adlrvp/chromeos.c @@ -39,11 +39,3 @@ return 0; }
-void mainboard_chromeos_acpi_generate(void) -{ - const struct cros_gpio *gpios; - size_t num; - - gpios = variant_cros_gpios(&num); - chromeos_acpi_gpio_generate(gpios, num); -} diff --git a/src/mainboard/intel/adlrvp/include/baseboard/variants.h b/src/mainboard/intel/adlrvp/include/baseboard/variants.h index 9ab05f6..796a2da 100644 --- a/src/mainboard/intel/adlrvp/include/baseboard/variants.h +++ b/src/mainboard/intel/adlrvp/include/baseboard/variants.h @@ -6,7 +6,6 @@ #include <soc/gpio.h> #include <soc/meminit.h> #include <stdint.h> -#include <vendorcode/google/chromeos/chromeos.h>
enum adl_boardid { /* ADL-P LPDDR4 RVPs */ @@ -26,9 +25,6 @@ ADL_M_LP5 = 0x2, };
-/* The next set of functions return the gpio table and fill in the number of - * entries for each table. */ -const struct cros_gpio *variant_cros_gpios(size_t *num); /* Functions to configure GPIO as per variant schematics */ void variant_configure_gpio_pads(void); void variant_configure_early_gpio_pads(void); diff --git a/src/mainboard/intel/baskingridge/chromeos.c b/src/mainboard/intel/baskingridge/chromeos.c index 2b14014..4c1590e 100644 --- a/src/mainboard/intel/baskingridge/chromeos.c +++ b/src/mainboard/intel/baskingridge/chromeos.c @@ -45,7 +45,8 @@ CROS_GPIO_WP_AL(22, CROS_GPIO_DEVICE_NAME), };
-void mainboard_chromeos_acpi_generate(void) +const struct cros_gpio *variant_cros_gpios(size_t *num) { - chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios)); + *num = ARRAY_SIZE(cros_gpios); + return cros_gpios; } diff --git a/src/mainboard/intel/coffeelake_rvp/chromeos.c b/src/mainboard/intel/coffeelake_rvp/chromeos.c index 5fb7922..b0a15d4 100644 --- a/src/mainboard/intel/coffeelake_rvp/chromeos.c +++ b/src/mainboard/intel/coffeelake_rvp/chromeos.c @@ -34,11 +34,3 @@ return 0; }
-void mainboard_chromeos_acpi_generate(void) -{ - const struct cros_gpio *gpios; - size_t num; - - gpios = variant_cros_gpios(&num); - chromeos_acpi_gpio_generate(gpios, num); -} diff --git a/src/mainboard/intel/coffeelake_rvp/variants/baseboard/include/baseboard/variants.h b/src/mainboard/intel/coffeelake_rvp/variants/baseboard/include/baseboard/variants.h index b7a1616..6ae25d4 100644 --- a/src/mainboard/intel/coffeelake_rvp/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/intel/coffeelake_rvp/variants/baseboard/include/baseboard/variants.h @@ -5,7 +5,6 @@
#include <soc/cnl_memcfg_init.h> #include <soc/gpio.h> -#include <vendorcode/google/chromeos/chromeos.h>
/* The next set of functions return the gpio table and fill in the number of * entries for each table. */ @@ -13,8 +12,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); - /* Return memory configuration structure. */ const struct cnl_mb_cfg *variant_memcfg_config(void);
diff --git a/src/mainboard/intel/emeraldlake2/chromeos.c b/src/mainboard/intel/emeraldlake2/chromeos.c index e0f5faf..932a6d7 100644 --- a/src/mainboard/intel/emeraldlake2/chromeos.c +++ b/src/mainboard/intel/emeraldlake2/chromeos.c @@ -42,7 +42,8 @@ CROS_GPIO_WP_AL(48, CROS_GPIO_DEVICE_NAME), };
-void mainboard_chromeos_acpi_generate(void) +const struct cros_gpio *variant_cros_gpios(size_t *num) { - chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios)); + *num = ARRAY_SIZE(cros_gpios); + return cros_gpios; } diff --git a/src/mainboard/intel/glkrvp/chromeos.c b/src/mainboard/intel/glkrvp/chromeos.c index 5944406..9b2d232 100644 --- a/src/mainboard/intel/glkrvp/chromeos.c +++ b/src/mainboard/intel/glkrvp/chromeos.c @@ -24,15 +24,6 @@ return 0; }
-void mainboard_chromeos_acpi_generate(void) -{ - const struct cros_gpio *gpios; - size_t num; - - gpios = variant_cros_gpios(&num); - chromeos_acpi_gpio_generate(gpios, num); -} - int __weak get_lid_switch(void) { return -1; diff --git a/src/mainboard/intel/glkrvp/variants/baseboard/include/baseboard/variants.h b/src/mainboard/intel/glkrvp/variants/baseboard/include/baseboard/variants.h index f1df937..24c28f9 100644 --- a/src/mainboard/intel/glkrvp/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/intel/glkrvp/variants/baseboard/include/baseboard/variants.h @@ -5,7 +5,6 @@
#include <soc/gpio.h> #include <soc/meminit.h> -#include <vendorcode/google/chromeos/chromeos.h>
/** * variant_board_id() - Get the board id for the current board variant @@ -27,9 +26,6 @@ /* Return memory SKU for the board. */ size_t variant_memory_sku(void);
-/* Return ChromeOS gpio table and fill in number of entries. */ -const struct cros_gpio *variant_cros_gpios(size_t *num); - /* Seed the NHLT tables with the board specific information. */ struct nhlt; void variant_nhlt_init(struct nhlt *nhlt); diff --git a/src/mainboard/intel/icelake_rvp/chromeos.c b/src/mainboard/intel/icelake_rvp/chromeos.c index c98c4f8..c433d2a 100644 --- a/src/mainboard/intel/icelake_rvp/chromeos.c +++ b/src/mainboard/intel/icelake_rvp/chromeos.c @@ -34,11 +34,3 @@ return 0; }
-void mainboard_chromeos_acpi_generate(void) -{ - const struct cros_gpio *gpios; - size_t num; - - gpios = variant_cros_gpios(&num); - chromeos_acpi_gpio_generate(gpios, num); -} diff --git a/src/mainboard/intel/icelake_rvp/variants/baseboard/include/baseboard/variants.h b/src/mainboard/intel/icelake_rvp/variants/baseboard/include/baseboard/variants.h index ccbadca..48d6c1c 100644 --- a/src/mainboard/intel/icelake_rvp/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/intel/icelake_rvp/variants/baseboard/include/baseboard/variants.h @@ -4,13 +4,11 @@ #define __BASEBOARD_VARIANTS_H__
#include <soc/gpio.h> -#include <vendorcode/google/chromeos/chromeos.h>
/* The next set of functions return the gpio table and fill in the number of * entries for each table. */
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__ */ diff --git a/src/mainboard/intel/jasperlake_rvp/chromeos.c b/src/mainboard/intel/jasperlake_rvp/chromeos.c index c59fac8..097c015 100644 --- a/src/mainboard/intel/jasperlake_rvp/chromeos.c +++ b/src/mainboard/intel/jasperlake_rvp/chromeos.c @@ -36,11 +36,3 @@ return 0; }
-void mainboard_chromeos_acpi_generate(void) -{ - const struct cros_gpio *gpios; - size_t num; - - gpios = variant_cros_gpios(&num); - chromeos_acpi_gpio_generate(gpios, num); -} diff --git a/src/mainboard/intel/jasperlake_rvp/variants/baseboard/include/baseboard/variants.h b/src/mainboard/intel/jasperlake_rvp/variants/baseboard/include/baseboard/variants.h index e2e331a..120833f 100644 --- a/src/mainboard/intel/jasperlake_rvp/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/intel/jasperlake_rvp/variants/baseboard/include/baseboard/variants.h @@ -6,7 +6,6 @@ #include <soc/gpio.h> #include <soc/meminit.h> #include <stdint.h> -#include <vendorcode/google/chromeos/chromeos.h>
enum jsl_board_id { jsl_ddr4 = 1, @@ -18,7 +17,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); const struct mb_cfg *variant_memcfg_config(uint8_t board_id);
#endif /*__BASEBOARD_VARIANTS_H__ */ diff --git a/src/mainboard/intel/kblrvp/chromeos.c b/src/mainboard/intel/kblrvp/chromeos.c index 270c84d..6bfba36 100644 --- a/src/mainboard/intel/kblrvp/chromeos.c +++ b/src/mainboard/intel/kblrvp/chromeos.c @@ -58,7 +58,8 @@ CROS_GPIO_WP_AH(CROS_GPIO_VIRTUAL, CROS_GPIO_DEVICE_NAME), };
-void mainboard_chromeos_acpi_generate(void) +const struct cros_gpio *variant_cros_gpios(size_t *num) { - chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios)); + *num = ARRAY_SIZE(cros_gpios); + return cros_gpios; } diff --git a/src/mainboard/intel/kunimitsu/chromeos.c b/src/mainboard/intel/kunimitsu/chromeos.c index 3b8725f..5886726 100644 --- a/src/mainboard/intel/kunimitsu/chromeos.c +++ b/src/mainboard/intel/kunimitsu/chromeos.c @@ -29,7 +29,8 @@ CROS_GPIO_WP_AH(GPIO_PCH_WP, CROS_GPIO_DEVICE_NAME), };
-void mainboard_chromeos_acpi_generate(void) +const struct cros_gpio *variant_cros_gpios(size_t *num) { - chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios)); + *num = ARRAY_SIZE(cros_gpios); + return cros_gpios; } diff --git a/src/mainboard/intel/shadowmountain/chromeos.c b/src/mainboard/intel/shadowmountain/chromeos.c index 35a54a8..04455a5 100644 --- a/src/mainboard/intel/shadowmountain/chromeos.c +++ b/src/mainboard/intel/shadowmountain/chromeos.c @@ -24,11 +24,3 @@ return gpio_get(GPIO_PCH_WP); }
-void mainboard_chromeos_acpi_generate(void) -{ - const struct cros_gpio *gpios; - size_t num; - - gpios = variant_cros_gpios(&num); - chromeos_acpi_gpio_generate(gpios, num); -} diff --git a/src/mainboard/intel/shadowmountain/variants/baseboard/include/baseboard/variants.h b/src/mainboard/intel/shadowmountain/variants/baseboard/include/baseboard/variants.h index a145ac9..e8886d9 100644 --- a/src/mainboard/intel/shadowmountain/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/intel/shadowmountain/variants/baseboard/include/baseboard/variants.h @@ -6,7 +6,6 @@ #include <soc/gpio.h> #include <soc/meminit.h> #include <stddef.h> -#include <vendorcode/google/chromeos/chromeos.h>
/* * The next set of functions return the gpio table and fill in the number of @@ -14,7 +13,6 @@ */ const struct pad_config *variant_base_gpio_table(size_t *num); const struct pad_config *variant_override_gpio_table(size_t *num); -const struct cros_gpio *variant_cros_gpios(size_t *num);
void variant_configure_early_gpio_pads(void);
diff --git a/src/mainboard/intel/strago/chromeos.c b/src/mainboard/intel/strago/chromeos.c index f01f7f1..f4543aa 100644 --- a/src/mainboard/intel/strago/chromeos.c +++ b/src/mainboard/intel/strago/chromeos.c @@ -40,7 +40,8 @@ CROS_GPIO_WP_AH(0x10013, CROS_GPIO_DEVICE_NAME), };
-void mainboard_chromeos_acpi_generate(void) +const struct cros_gpio *variant_cros_gpios(size_t *num) { - chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios)); + *num = ARRAY_SIZE(cros_gpios); + return cros_gpios; } diff --git a/src/mainboard/intel/tglrvp/chromeos.c b/src/mainboard/intel/tglrvp/chromeos.c index 7da61be..58e9b23 100644 --- a/src/mainboard/intel/tglrvp/chromeos.c +++ b/src/mainboard/intel/tglrvp/chromeos.c @@ -37,11 +37,3 @@ return 0; }
-void mainboard_chromeos_acpi_generate(void) -{ - const struct cros_gpio *gpios; - size_t num; - - gpios = variant_cros_gpios(&num); - chromeos_acpi_gpio_generate(gpios, num); -} diff --git a/src/mainboard/intel/tglrvp/variants/baseboard/include/baseboard/variants.h b/src/mainboard/intel/tglrvp/variants/baseboard/include/baseboard/variants.h index fbb86f7..45ae15e 100644 --- a/src/mainboard/intel/tglrvp/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/intel/tglrvp/variants/baseboard/include/baseboard/variants.h @@ -5,14 +5,12 @@
#include <soc/gpio.h> #include <soc/meminit.h> -#include <vendorcode/google/chromeos/chromeos.h>
/* The next set of functions return the gpio table and fill in the number of * entries for each table. */
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);
size_t variant_memory_sku(void); const struct mb_cfg *variant_memory_params(void); diff --git a/src/mainboard/intel/wtm2/chromeos.c b/src/mainboard/intel/wtm2/chromeos.c index 996eee2..a154b7c 100644 --- a/src/mainboard/intel/wtm2/chromeos.c +++ b/src/mainboard/intel/wtm2/chromeos.c @@ -35,7 +35,8 @@ CROS_GPIO_WP_AL(CROS_GPIO_VIRTUAL, CROS_GPIO_DEVICE_NAME), };
-void mainboard_chromeos_acpi_generate(void) +const struct cros_gpio *variant_cros_gpios(size_t *num) { - chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios)); + *num = ARRAY_SIZE(cros_gpios); + return cros_gpios; } diff --git a/src/mainboard/samsung/lumpy/chromeos.c b/src/mainboard/samsung/lumpy/chromeos.c index d5e20bd..16d5896 100644 --- a/src/mainboard/samsung/lumpy/chromeos.c +++ b/src/mainboard/samsung/lumpy/chromeos.c @@ -78,7 +78,8 @@ CROS_GPIO_WP_AH(GPIO_SPI_WP, CROS_GPIO_DEVICE_NAME), };
-void mainboard_chromeos_acpi_generate(void) +const struct cros_gpio *variant_cros_gpios(size_t *num) { - chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios)); + *num = ARRAY_SIZE(cros_gpios); + return cros_gpios; } diff --git a/src/mainboard/samsung/stumpy/chromeos.c b/src/mainboard/samsung/stumpy/chromeos.c index c8fbf98..785bde4 100644 --- a/src/mainboard/samsung/stumpy/chromeos.c +++ b/src/mainboard/samsung/stumpy/chromeos.c @@ -69,7 +69,8 @@ CROS_GPIO_WP_AH(GPIO_SPI_WP, CROS_GPIO_DEVICE_NAME), };
-void mainboard_chromeos_acpi_generate(void) +const struct cros_gpio *variant_cros_gpios(size_t *num) { - chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios)); + *num = ARRAY_SIZE(cros_gpios); + return cros_gpios; } diff --git a/src/vendorcode/google/chromeos/acpi.c b/src/vendorcode/google/chromeos/acpi.c index 5a54d70..383cd31 100644 --- a/src/vendorcode/google/chromeos/acpi.c +++ b/src/vendorcode/google/chromeos/acpi.c @@ -6,11 +6,16 @@ #endif #include "chromeos.h"
-void chromeos_acpi_gpio_generate(const struct cros_gpio *gpios, size_t num) +void chromeos_acpi_gpio_generate(void) { - size_t i; + const struct cros_gpio *gpios; + size_t i, num; int gpio_num;
+ gpios = variant_cros_gpios(&num); + if (!gpios) + return; + acpigen_write_scope("\"); acpigen_write_name("OIPG");
diff --git a/src/vendorcode/google/chromeos/chromeos.h b/src/vendorcode/google/chromeos/chromeos.h index b770525..693336a 100644 --- a/src/vendorcode/google/chromeos/chromeos.h +++ b/src/vendorcode/google/chromeos/chromeos.h @@ -44,16 +44,9 @@ enum cb_err get_dsm_calibration_from_key(const char *key, uint64_t *value);
/* - * Create the OIPG package containing the Chrome OS gpios described by - * the chromeos_gpio array. - */ -struct cros_gpio; -void chromeos_acpi_gpio_generate(const struct cros_gpio *gpios, size_t num); - -/* * Declaration for mainboards to use to generate ACPI-specific Chrome OS needs. */ -void mainboard_chromeos_acpi_generate(void); +void chromeos_acpi_gpio_generate(void);
enum { CROS_GPIO_REC = 1, /* Recovery */ @@ -110,4 +103,6 @@ #define CROS_GPIO_PE_AH(num, dev) \ CROS_GPIO_PE_INITIALIZER(CROS_GPIO_ACTIVE_HIGH, num, dev)
+const struct cros_gpio *variant_cros_gpios(size_t *num); + #endif /* __CHROMEOS_H__ */ diff --git a/src/vendorcode/google/chromeos/gnvs.c b/src/vendorcode/google/chromeos/gnvs.c index b0a1884..36e407e 100644 --- a/src/vendorcode/google/chromeos/gnvs.c +++ b/src/vendorcode/google/chromeos/gnvs.c @@ -105,8 +105,7 @@ acpigen_write_opregion(&cnvs_op); acpigen_pop_len();
- /* Usually this creates OIPG package for GPIOs. */ - mainboard_chromeos_acpi_generate(); + chromeos_acpi_gpio_generate(); }
static struct device_operations crhw_ops = {