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>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58897
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
diff --git a/src/mainboard/amd/chausie/chromeos.c b/src/mainboard/amd/chausie/chromeos.c
index 062fdad..fffde8d 100644
--- a/src/mainboard/amd/chausie/chromeos.c
+++ b/src/mainboard/amd/chausie/chromeos.c
@@ -18,11 +18,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/amd/majolica/chromeos.c b/src/mainboard/amd/majolica/chromeos.c
index 14f89d1..acef8d1 100644
--- a/src/mainboard/amd/majolica/chromeos.c
+++ b/src/mainboard/amd/majolica/chromeos.c
@@ -18,11 +18,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 c4770ff..7fd2add 100644
--- a/src/mainboard/emulation/qemu-q35/chromeos.c
+++ b/src/mainboard/emulation/qemu-q35/chromeos.c
@@ -20,9 +20,10 @@
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;
}
int get_ec_is_trusted(void)
diff --git a/src/mainboard/google/auron/chromeos.c b/src/mainboard/google/auron/chromeos.c
index 9807ace..71f5099 100644
--- a/src/mainboard/google/auron/chromeos.c
+++ b/src/mainboard/google/auron/chromeos.c
@@ -36,9 +36,10 @@
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;
}
int get_ec_is_trusted(void)
diff --git a/src/mainboard/google/beltino/chromeos.c b/src/mainboard/google/beltino/chromeos.c
index db64649..df051a8 100644
--- a/src/mainboard/google/beltino/chromeos.c
+++ b/src/mainboard/google/beltino/chromeos.c
@@ -70,9 +70,10 @@
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;
}
int get_ec_is_trusted(void)
diff --git a/src/mainboard/google/brya/chromeos.c b/src/mainboard/google/brya/chromeos.c
index cb636c6..5c99371 100644
--- a/src/mainboard/google/brya/chromeos.c
+++ b/src/mainboard/google/brya/chromeos.c
@@ -1,12 +1,10 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#include <baseboard/gpio.h>
-#include <baseboard/variants.h>
#include <bootmode.h>
#include <boot/coreboot_tables.h>
#include <gpio.h>
#include <types.h>
-#include <vendorcode/google/chromeos/chromeos.h>
void fill_lb_gpios(struct lb_gpios *gpios)
{
@@ -24,14 +22,6 @@
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);
-}
-
int get_ec_is_trusted(void)
{
/* EC is trusted if not in RW. */
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 9accc08..8c79a8a 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 b4bd5fe..f31967c 100644
--- a/src/mainboard/google/butterfly/chromeos.c
+++ b/src/mainboard/google/butterfly/chromeos.c
@@ -53,9 +53,10 @@
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;
}
int get_ec_is_trusted(void)
diff --git a/src/mainboard/google/cyan/chromeos.c b/src/mainboard/google/cyan/chromeos.c
index a11b6f9f..6ecab94 100644
--- a/src/mainboard/google/cyan/chromeos.c
+++ b/src/mainboard/google/cyan/chromeos.c
@@ -60,9 +60,10 @@
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;
}
int get_ec_is_trusted(void)
diff --git a/src/mainboard/google/dedede/chromeos.c b/src/mainboard/google/dedede/chromeos.c
index ad37b20..5c99371 100644
--- a/src/mainboard/google/dedede/chromeos.c
+++ b/src/mainboard/google/dedede/chromeos.c
@@ -1,12 +1,10 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#include <baseboard/gpio.h>
-#include <baseboard/variants.h>
#include <bootmode.h>
#include <boot/coreboot_tables.h>
#include <gpio.h>
#include <types.h>
-#include <vendorcode/google/chromeos/chromeos.h>
void fill_lb_gpios(struct lb_gpios *gpios)
{
@@ -24,15 +22,6 @@
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);
-}
-
int get_ec_is_trusted(void)
{
/* EC is trusted if not in RW. */
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 778eccb..589d6c0 100644
--- a/src/mainboard/google/deltaur/chromeos.c
+++ b/src/mainboard/google/deltaur/chromeos.c
@@ -1,6 +1,5 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
-#include <baseboard/variants.h>
#include <baseboard/gpio.h>
#include <bootmode.h>
#include <boot/coreboot_tables.h>
@@ -42,15 +41,6 @@
return !gpio_get(GPIO_REC_MODE);
}
-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_recovery_mode_switch(void)
{
diff --git a/src/mainboard/google/deltaur/variants/baseboard/include/baseboard/gpio.h b/src/mainboard/google/deltaur/variants/baseboard/include/baseboard/gpio.h
index aadbbec..682ff7f 100644
--- a/src/mainboard/google/deltaur/variants/baseboard/include/baseboard/gpio.h
+++ b/src/mainboard/google/deltaur/variants/baseboard/include/baseboard/gpio.h
@@ -28,7 +28,5 @@
const struct pad_config *override_gpio_table(size_t *num);
const struct pad_config *override_early_gpio_table(size_t *num);
-struct cros_gpio;
-const struct cros_gpio *override_cros_gpios(size_t *num);
#endif
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 6804ef6..f3a4059 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(FSPM_UPD *mupd);
diff --git a/src/mainboard/google/drallion/chromeos.c b/src/mainboard/google/drallion/chromeos.c
index 0891f87..4c5c8b8b 100644
--- a/src/mainboard/google/drallion/chromeos.c
+++ b/src/mainboard/google/drallion/chromeos.c
@@ -40,15 +40,6 @@
return !gpio_get(GPP_E8);
}
-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_recovery_mode_switch(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 bc458de..fadec40 100644
--- a/src/mainboard/google/eve/chromeos.c
+++ b/src/mainboard/google/eve/chromeos.c
@@ -32,9 +32,10 @@
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;
}
int get_ec_is_trusted(void)
diff --git a/src/mainboard/google/fizz/chromeos.c b/src/mainboard/google/fizz/chromeos.c
index d10a59f..59105ce 100644
--- a/src/mainboard/google/fizz/chromeos.c
+++ b/src/mainboard/google/fizz/chromeos.c
@@ -3,10 +3,8 @@
#include <bootmode.h>
#include <boot/coreboot_tables.h>
#include <gpio.h>
-#include <baseboard/variants.h>
#include <soc/gpio.h>
#include <types.h>
-#include <vendorcode/google/chromeos/chromeos.h>
#include <variant/gpio.h>
@@ -28,15 +26,6 @@
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);
-}
-
int get_ec_is_trusted(void)
{
/* EC is trusted if not in RW. */
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 1adaed4..c90d12d 100644
--- a/src/mainboard/google/glados/chromeos.c
+++ b/src/mainboard/google/glados/chromeos.c
@@ -31,9 +31,10 @@
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;
}
int get_ec_is_trusted(void)
diff --git a/src/mainboard/google/guybrush/chromeos.c b/src/mainboard/google/guybrush/chromeos.c
index 9875554..c5530db 100644
--- a/src/mainboard/google/guybrush/chromeos.c
+++ b/src/mainboard/google/guybrush/chromeos.c
@@ -23,9 +23,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;
}
int get_ec_is_trusted(void)
diff --git a/src/mainboard/google/hatch/chromeos.c b/src/mainboard/google/hatch/chromeos.c
index bbca895..9c5e19d 100644
--- a/src/mainboard/google/hatch/chromeos.c
+++ b/src/mainboard/google/hatch/chromeos.c
@@ -1,13 +1,11 @@
/* SPDX-License-Identifier: GPL-2.0-only */
-#include <baseboard/variants.h>
#include <bootmode.h>
#include <boot/coreboot_tables.h>
#include <ec/google/chromeec/ec.h>
#include <gpio.h>
#include <variant/gpio.h>
#include <types.h>
-#include <vendorcode/google/chromeos/chromeos.h>
void fill_lb_gpios(struct lb_gpios *gpios)
{
@@ -26,16 +24,6 @@
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);
-}
-
int get_ec_is_trusted(void)
{
/* EC is trusted if not in RW. */
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 239134b..c5ebc72 100644
--- a/src/mainboard/google/jecht/chromeos.c
+++ b/src/mainboard/google/jecht/chromeos.c
@@ -72,9 +72,10 @@
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;
}
int get_ec_is_trusted(void)
diff --git a/src/mainboard/google/kahlee/chromeos.c b/src/mainboard/google/kahlee/chromeos.c
index 690a9e3..c7f7671 100644
--- a/src/mainboard/google/kahlee/chromeos.c
+++ b/src/mainboard/google/kahlee/chromeos.c
@@ -30,9 +30,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;
}
int get_ec_is_trusted(void)
diff --git a/src/mainboard/google/link/chromeos.c b/src/mainboard/google/link/chromeos.c
index f544167..a1ac2d6 100644
--- a/src/mainboard/google/link/chromeos.c
+++ b/src/mainboard/google/link/chromeos.c
@@ -37,9 +37,10 @@
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;
}
int get_ec_is_trusted(void)
diff --git a/src/mainboard/google/octopus/chromeos.c b/src/mainboard/google/octopus/chromeos.c
index 82599ac..42eeeee 100644
--- a/src/mainboard/google/octopus/chromeos.c
+++ b/src/mainboard/google/octopus/chromeos.c
@@ -1,12 +1,10 @@
/* SPDX-License-Identifier: GPL-2.0-only */
-#include <baseboard/variants.h>
#include <bootmode.h>
#include <boot/coreboot_tables.h>
#include <ec/google/chromeec/ec.h>
#include <gpio.h>
#include <types.h>
-#include <vendorcode/google/chromeos/chromeos.h>
#include <soc/gpio.h>
#include <variant/gpio.h>
@@ -27,15 +25,6 @@
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);
-}
-
int get_ec_is_trusted(void)
{
/* EC is trusted if not in RW. */
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 4efcb4c..dc476f9 100644
--- a/src/mainboard/google/parrot/chromeos.c
+++ b/src/mainboard/google/parrot/chromeos.c
@@ -51,9 +51,10 @@
CROS_GPIO_WP_AL(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;
}
int get_ec_is_trusted(void)
diff --git a/src/mainboard/google/poppy/chromeos.c b/src/mainboard/google/poppy/chromeos.c
index 3c267ca..2ed2828 100644
--- a/src/mainboard/google/poppy/chromeos.c
+++ b/src/mainboard/google/poppy/chromeos.c
@@ -1,12 +1,10 @@
/* SPDX-License-Identifier: GPL-2.0-only */
-#include <baseboard/variants.h>
#include <bootmode.h>
#include <boot/coreboot_tables.h>
#include <gpio.h>
#include <soc/gpio.h>
#include <types.h>
-#include <vendorcode/google/chromeos/chromeos.h>
#include <variant/gpio.h>
@@ -31,15 +29,6 @@
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);
-}
-
int get_ec_is_trusted(void)
{
/* EC is trusted if not in RW. */
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 d76c5e4..eae2357f 100644
--- a/src/mainboard/google/rambi/chromeos.c
+++ b/src/mainboard/google/rambi/chromeos.c
@@ -43,9 +43,10 @@
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;
}
int get_ec_is_trusted(void)
diff --git a/src/mainboard/google/reef/chromeos.c b/src/mainboard/google/reef/chromeos.c
index 1d1c990..ca3de03 100644
--- a/src/mainboard/google/reef/chromeos.c
+++ b/src/mainboard/google/reef/chromeos.c
@@ -1,11 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0-only */
-#include <baseboard/variants.h>
#include <bootmode.h>
#include <boot/coreboot_tables.h>
#include <gpio.h>
#include <types.h>
-#include <vendorcode/google/chromeos/chromeos.h>
#include <soc/gpio.h>
#include <variant/gpio.h>
@@ -27,15 +25,6 @@
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);
-}
-
int get_ec_is_trusted(void)
{
/* EC is trusted if not in RW. */
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 180a98e..8cdd15c 100644
--- a/src/mainboard/google/sarien/chromeos.c
+++ b/src/mainboard/google/sarien/chromeos.c
@@ -38,15 +38,6 @@
return !gpio_get(GPP_E8);
}
-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_recovery_mode_switch(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/skyrim/chromeos.c b/src/mainboard/google/skyrim/chromeos.c
index 67107d1..347e9d0 100644
--- a/src/mainboard/google/skyrim/chromeos.c
+++ b/src/mainboard/google/skyrim/chromeos.c
@@ -20,7 +20,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/slippy/chromeos.c b/src/mainboard/google/slippy/chromeos.c
index 634e563..9e0ab0c 100644
--- a/src/mainboard/google/slippy/chromeos.c
+++ b/src/mainboard/google/slippy/chromeos.c
@@ -28,9 +28,10 @@
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;
}
int get_ec_is_trusted(void)
diff --git a/src/mainboard/google/stout/chromeos.c b/src/mainboard/google/stout/chromeos.c
index 2fbddc2..2f3ae8c 100644
--- a/src/mainboard/google/stout/chromeos.c
+++ b/src/mainboard/google/stout/chromeos.c
@@ -79,7 +79,8 @@
CROS_GPIO_WP_AL(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/volteer/chromeos.c b/src/mainboard/google/volteer/chromeos.c
index 9b8e2f5..1b6f7ba 100644
--- a/src/mainboard/google/volteer/chromeos.c
+++ b/src/mainboard/google/volteer/chromeos.c
@@ -1,12 +1,10 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
-#include <baseboard/variants.h>
#include <bootmode.h>
#include <boot/coreboot_tables.h>
#include <gpio.h>
#include <variant/gpio.h>
#include <types.h>
-#include <vendorcode/google/chromeos/chromeos.h>
void fill_lb_gpios(struct lb_gpios *gpios)
{
@@ -26,15 +24,6 @@
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);
-}
-
int get_ec_is_trusted(void)
{
/* EC is trusted if not in RW. */
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 d649193..a975099 100644
--- a/src/mainboard/google/zork/chromeos.c
+++ b/src/mainboard/google/zork/chromeos.c
@@ -29,9 +29,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;
}
int get_ec_is_trusted(void)
diff --git a/src/mainboard/intel/adlrvp/chromeos.c b/src/mainboard/intel/adlrvp/chromeos.c
index d7e55a9..56fbc50 100644
--- a/src/mainboard/intel/adlrvp/chromeos.c
+++ b/src/mainboard/intel/adlrvp/chromeos.c
@@ -1,12 +1,10 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <baseboard/gpio.h>
-#include <baseboard/variants.h>
#include <bootmode.h>
#include <boot/coreboot_tables.h>
#include <gpio.h>
#include <types.h>
-#include <vendorcode/google/chromeos/chromeos.h>
void fill_lb_gpios(struct lb_gpios *gpios)
{
@@ -42,15 +40,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);
-}
-
#if (CONFIG(BOARD_INTEL_ADLRVP_P_EXT_EC) || CONFIG(BOARD_INTEL_ADLRVP_M_EXT_EC) ||\
CONFIG(BOARD_INTEL_ADLRVP_N_EXT_EC))
int get_ec_is_trusted(void)
diff --git a/src/mainboard/intel/adlrvp/gpio_m.c b/src/mainboard/intel/adlrvp/gpio_m.c
index 62ae0f3..33b5a1d 100644
--- a/src/mainboard/intel/adlrvp/gpio_m.c
+++ b/src/mainboard/intel/adlrvp/gpio_m.c
@@ -2,6 +2,8 @@
#include <baseboard/gpio.h>
#include <baseboard/variants.h>
+#include <commonlib/helpers.h>
+#include <vendorcode/google/chromeos/chromeos.h>
/* Pad configuration in ramstage */
static const struct pad_config gpio_table[] = {
diff --git a/src/mainboard/intel/adlrvp/gpio_n.c b/src/mainboard/intel/adlrvp/gpio_n.c
index 6f4e4a5..364deac 100644
--- a/src/mainboard/intel/adlrvp/gpio_n.c
+++ b/src/mainboard/intel/adlrvp/gpio_n.c
@@ -3,6 +3,7 @@
#include <baseboard/gpio.h>
#include <baseboard/variants.h>
#include <commonlib/helpers.h>
+#include <vendorcode/google/chromeos/chromeos.h>
/* Pad configuration in ramstage*/
static const struct pad_config gpio_table[] = {
diff --git a/src/mainboard/intel/adlrvp/include/baseboard/variants.h b/src/mainboard/intel/adlrvp/include/baseboard/variants.h
index 143679a..4ae1011 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 */
@@ -28,9 +27,6 @@
ADL_N_LP5 = 0x7,
};
-/* 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 d4408f4..05280b15 100644
--- a/src/mainboard/intel/baskingridge/chromeos.c
+++ b/src/mainboard/intel/baskingridge/chromeos.c
@@ -47,7 +47,8 @@
CROS_GPIO_WP_AL(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/intel/coffeelake_rvp/chromeos.c b/src/mainboard/intel/coffeelake_rvp/chromeos.c
index 5c5003b..b2ea87f 100644
--- a/src/mainboard/intel/coffeelake_rvp/chromeos.c
+++ b/src/mainboard/intel/coffeelake_rvp/chromeos.c
@@ -1,13 +1,11 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <acpi/acpi.h>
-#include <baseboard/variants.h>
#include <bootmode.h>
#include <boot/coreboot_tables.h>
#include <gpio.h>
#include <soc/gpio.h>
#include <types.h>
-#include <vendorcode/google/chromeos/chromeos.h>
void fill_lb_gpios(struct lb_gpios *gpios)
{
@@ -35,12 +33,3 @@
/* No write protect */
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 2d0e2e1..621ecfd 100644
--- a/src/mainboard/intel/emeraldlake2/chromeos.c
+++ b/src/mainboard/intel/emeraldlake2/chromeos.c
@@ -44,7 +44,8 @@
CROS_GPIO_WP_AL(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/intel/glkrvp/chromeos.c b/src/mainboard/intel/glkrvp/chromeos.c
index 7a14c86..bc27b27 100644
--- a/src/mainboard/intel/glkrvp/chromeos.c
+++ b/src/mainboard/intel/glkrvp/chromeos.c
@@ -1,12 +1,10 @@
/* SPDX-License-Identifier: GPL-2.0-only */
-#include <baseboard/variants.h>
#include <bootmode.h>
#include <boot/coreboot_tables.h>
#include <ec/google/chromeec/ec.h>
#include <gpio.h>
#include <types.h>
-#include <vendorcode/google/chromeos/chromeos.h>
#include <soc/gpio.h>
#include <variant/gpio.h>
@@ -26,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 6df26af..2b1f9af 100644
--- a/src/mainboard/intel/icelake_rvp/chromeos.c
+++ b/src/mainboard/intel/icelake_rvp/chromeos.c
@@ -2,12 +2,10 @@
#include <acpi/acpi.h>
#include <baseboard/gpio.h>
-#include <baseboard/variants.h>
#include <bootmode.h>
#include <boot/coreboot_tables.h>
#include <gpio.h>
#include <types.h>
-#include <vendorcode/google/chromeos/chromeos.h>
void fill_lb_gpios(struct lb_gpios *gpios)
{
@@ -35,12 +33,3 @@
/* No write protect */
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 bf9a7bf..ef0d7ec 100644
--- a/src/mainboard/intel/jasperlake_rvp/chromeos.c
+++ b/src/mainboard/intel/jasperlake_rvp/chromeos.c
@@ -1,12 +1,10 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <baseboard/gpio.h>
-#include <baseboard/variants.h>
#include <bootmode.h>
#include <boot/coreboot_tables.h>
#include <gpio.h>
#include <types.h>
-#include <vendorcode/google/chromeos/chromeos.h>
void fill_lb_gpios(struct lb_gpios *gpios)
{
@@ -37,12 +35,3 @@
/* No write protect */
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 afc27cd..f64f5bd 100644
--- a/src/mainboard/intel/kblrvp/chromeos.c
+++ b/src/mainboard/intel/kblrvp/chromeos.c
@@ -60,9 +60,10 @@
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;
}
int get_ec_is_trusted(void)
diff --git a/src/mainboard/intel/kunimitsu/chromeos.c b/src/mainboard/intel/kunimitsu/chromeos.c
index 87a0e01..2bb59fb 100644
--- a/src/mainboard/intel/kunimitsu/chromeos.c
+++ b/src/mainboard/intel/kunimitsu/chromeos.c
@@ -31,9 +31,10 @@
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;
}
int get_ec_is_trusted(void)
diff --git a/src/mainboard/intel/shadowmountain/chromeos.c b/src/mainboard/intel/shadowmountain/chromeos.c
index 0858754..1e7c7d9 100644
--- a/src/mainboard/intel/shadowmountain/chromeos.c
+++ b/src/mainboard/intel/shadowmountain/chromeos.c
@@ -1,12 +1,10 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#include <baseboard/gpio.h>
-#include <baseboard/variants.h>
#include <bootmode.h>
#include <boot/coreboot_tables.h>
#include <gpio.h>
#include <types.h>
-#include <vendorcode/google/chromeos/chromeos.h>
void fill_lb_gpios(struct lb_gpios *gpios)
{
@@ -26,15 +24,6 @@
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);
-}
-
int get_ec_is_trusted(void)
{
/* EC is trusted if not in RW. */
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 91ce9ae..a6a0af2 100644
--- a/src/mainboard/intel/strago/chromeos.c
+++ b/src/mainboard/intel/strago/chromeos.c
@@ -38,7 +38,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 dd6c666..779c9a0 100644
--- a/src/mainboard/intel/tglrvp/chromeos.c
+++ b/src/mainboard/intel/tglrvp/chromeos.c
@@ -1,12 +1,10 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <baseboard/gpio.h>
-#include <baseboard/variants.h>
#include <bootmode.h>
#include <boot/coreboot_tables.h>
#include <gpio.h>
#include <types.h>
-#include <vendorcode/google/chromeos/chromeos.h>
void fill_lb_gpios(struct lb_gpios *gpios)
{
@@ -39,15 +37,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 get_ec_is_trusted(void)
{
/* Do not have a Chrome EC involved in entering recovery mode;
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 5e01910..49da437 100644
--- a/src/mainboard/intel/wtm2/chromeos.c
+++ b/src/mainboard/intel/wtm2/chromeos.c
@@ -36,7 +36,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 f8b0afc..e5c8d30 100644
--- a/src/mainboard/samsung/lumpy/chromeos.c
+++ b/src/mainboard/samsung/lumpy/chromeos.c
@@ -90,7 +90,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 b845a91..95801c1 100644
--- a/src/mainboard/samsung/stumpy/chromeos.c
+++ b/src/mainboard/samsung/stumpy/chromeos.c
@@ -83,7 +83,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 da25617..34a9f57 100644
--- a/src/vendorcode/google/chromeos/chromeos.h
+++ b/src/vendorcode/google/chromeos/chromeos.h
@@ -38,16 +38,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 */
@@ -104,4 +97,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 33389b4e..faaa646 100644
--- a/src/vendorcode/google/chromeos/gnvs.c
+++ b/src/vendorcode/google/chromeos/gnvs.c
@@ -98,6 +98,5 @@
acpigen_write_opregion(&cnvs_op);
acpigen_pop_len();
- /* Usually this creates OIPG package for GPIOs. */
- mainboard_chromeos_acpi_generate();
+ chromeos_acpi_gpio_generate();
}