summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mainboard/amd/chausie/chromeos.c10
-rw-r--r--src/mainboard/amd/majolica/chromeos.c10
-rw-r--r--src/mainboard/emulation/qemu-q35/chromeos.c5
-rw-r--r--src/mainboard/google/auron/chromeos.c5
-rw-r--r--src/mainboard/google/beltino/chromeos.c5
-rw-r--r--src/mainboard/google/brya/chromeos.c10
-rw-r--r--src/mainboard/google/brya/variants/baseboard/include/baseboard/variants.h1
-rw-r--r--src/mainboard/google/butterfly/chromeos.c5
-rw-r--r--src/mainboard/google/cyan/chromeos.c5
-rw-r--r--src/mainboard/google/dedede/chromeos.c11
-rw-r--r--src/mainboard/google/dedede/variants/baseboard/include/baseboard/variants.h1
-rw-r--r--src/mainboard/google/deltaur/chromeos.c10
-rw-r--r--src/mainboard/google/deltaur/variants/baseboard/include/baseboard/gpio.h2
-rw-r--r--src/mainboard/google/deltaur/variants/baseboard/include/baseboard/variants.h3
-rw-r--r--src/mainboard/google/drallion/chromeos.c9
-rw-r--r--src/mainboard/google/drallion/variants/drallion/include/variant/gpio.h3
-rw-r--r--src/mainboard/google/eve/chromeos.c5
-rw-r--r--src/mainboard/google/fizz/chromeos.c11
-rw-r--r--src/mainboard/google/fizz/variants/baseboard/include/baseboard/variants.h3
-rw-r--r--src/mainboard/google/glados/chromeos.c5
-rw-r--r--src/mainboard/google/guybrush/chromeos.c5
-rw-r--r--src/mainboard/google/hatch/chromeos.c12
-rw-r--r--src/mainboard/google/hatch/variants/baseboard/include/baseboard/variants.h4
-rw-r--r--src/mainboard/google/jecht/chromeos.c5
-rw-r--r--src/mainboard/google/kahlee/chromeos.c5
-rw-r--r--src/mainboard/google/link/chromeos.c5
-rw-r--r--src/mainboard/google/octopus/chromeos.c11
-rw-r--r--src/mainboard/google/octopus/variants/baseboard/include/baseboard/variants.h3
-rw-r--r--src/mainboard/google/parrot/chromeos.c5
-rw-r--r--src/mainboard/google/poppy/chromeos.c11
-rw-r--r--src/mainboard/google/poppy/variants/baseboard/include/baseboard/variants.h2
-rw-r--r--src/mainboard/google/rambi/chromeos.c5
-rw-r--r--src/mainboard/google/reef/chromeos.c11
-rw-r--r--src/mainboard/google/reef/variants/baseboard/include/baseboard/variants.h4
-rw-r--r--src/mainboard/google/sarien/chromeos.c9
-rw-r--r--src/mainboard/google/sarien/variants/arcada/include/variant/gpio.h3
-rw-r--r--src/mainboard/google/sarien/variants/sarien/include/variant/gpio.h3
-rw-r--r--src/mainboard/google/skyrim/chromeos.c5
-rw-r--r--src/mainboard/google/slippy/chromeos.c5
-rw-r--r--src/mainboard/google/stout/chromeos.c5
-rw-r--r--src/mainboard/google/volteer/chromeos.c11
-rw-r--r--src/mainboard/google/volteer/variants/baseboard/include/baseboard/variants.h3
-rw-r--r--src/mainboard/google/zork/chromeos.c5
-rw-r--r--src/mainboard/intel/adlrvp/chromeos.c11
-rw-r--r--src/mainboard/intel/adlrvp/gpio_m.c2
-rw-r--r--src/mainboard/intel/adlrvp/gpio_n.c1
-rw-r--r--src/mainboard/intel/adlrvp/include/baseboard/variants.h4
-rw-r--r--src/mainboard/intel/baskingridge/chromeos.c5
-rw-r--r--src/mainboard/intel/coffeelake_rvp/chromeos.c11
-rw-r--r--src/mainboard/intel/coffeelake_rvp/variants/baseboard/include/baseboard/variants.h3
-rw-r--r--src/mainboard/intel/emeraldlake2/chromeos.c5
-rw-r--r--src/mainboard/intel/glkrvp/chromeos.c11
-rw-r--r--src/mainboard/intel/glkrvp/variants/baseboard/include/baseboard/variants.h4
-rw-r--r--src/mainboard/intel/icelake_rvp/chromeos.c11
-rw-r--r--src/mainboard/intel/icelake_rvp/variants/baseboard/include/baseboard/variants.h2
-rw-r--r--src/mainboard/intel/jasperlake_rvp/chromeos.c11
-rw-r--r--src/mainboard/intel/jasperlake_rvp/variants/baseboard/include/baseboard/variants.h2
-rw-r--r--src/mainboard/intel/kblrvp/chromeos.c5
-rw-r--r--src/mainboard/intel/kunimitsu/chromeos.c5
-rw-r--r--src/mainboard/intel/shadowmountain/chromeos.c11
-rw-r--r--src/mainboard/intel/shadowmountain/variants/baseboard/include/baseboard/variants.h2
-rw-r--r--src/mainboard/intel/strago/chromeos.c5
-rw-r--r--src/mainboard/intel/tglrvp/chromeos.c11
-rw-r--r--src/mainboard/intel/tglrvp/variants/baseboard/include/baseboard/variants.h2
-rw-r--r--src/mainboard/intel/wtm2/chromeos.c5
-rw-r--r--src/mainboard/samsung/lumpy/chromeos.c5
-rw-r--r--src/mainboard/samsung/stumpy/chromeos.c5
-rw-r--r--src/vendorcode/google/chromeos/acpi.c9
-rw-r--r--src/vendorcode/google/chromeos/chromeos.h11
-rw-r--r--src/vendorcode/google/chromeos/gnvs.c3
70 files changed, 97 insertions, 321 deletions
diff --git a/src/mainboard/amd/chausie/chromeos.c b/src/mainboard/amd/chausie/chromeos.c
index 062fdad290..fffde8dcdc 100644
--- a/src/mainboard/amd/chausie/chromeos.c
+++ b/src/mainboard/amd/chausie/chromeos.c
@@ -18,11 +18,9 @@ int get_write_protect_state(void)
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 14f89d182e..acef8d1ed6 100644
--- a/src/mainboard/amd/majolica/chromeos.c
+++ b/src/mainboard/amd/majolica/chromeos.c
@@ -18,11 +18,9 @@ int get_write_protect_state(void)
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 c4770ffd7d..7fd2add8cd 100644
--- a/src/mainboard/emulation/qemu-q35/chromeos.c
+++ b/src/mainboard/emulation/qemu-q35/chromeos.c
@@ -20,9 +20,10 @@ static const struct cros_gpio cros_gpios[] = {
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 9807acec36..71f50990bf 100644
--- a/src/mainboard/google/auron/chromeos.c
+++ b/src/mainboard/google/auron/chromeos.c
@@ -36,9 +36,10 @@ static const struct cros_gpio cros_gpios[] = {
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 db646495de..df051a8f3e 100644
--- a/src/mainboard/google/beltino/chromeos.c
+++ b/src/mainboard/google/beltino/chromeos.c
@@ -70,9 +70,10 @@ static const struct cros_gpio cros_gpios[] = {
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 cb636c616a..5c99371eb1 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 @@ int get_write_protect_state(void)
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 9accc08f9d..8c79a8a871 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 b4bd5fec06..f31967c23d 100644
--- a/src/mainboard/google/butterfly/chromeos.c
+++ b/src/mainboard/google/butterfly/chromeos.c
@@ -53,9 +53,10 @@ static const struct cros_gpio cros_gpios[] = {
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 a11b6f9f63..6ecab94302 100644
--- a/src/mainboard/google/cyan/chromeos.c
+++ b/src/mainboard/google/cyan/chromeos.c
@@ -60,9 +60,10 @@ static const struct cros_gpio cros_gpios[] = {
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 ad37b204bb..5c99371eb1 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 @@ int get_write_protect_state(void)
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 78e44b4ae0..aef30751cc 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 778eccb0ea..589d6c0e7c 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 @@ static bool raw_get_recovery_mode_switch(void)
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 aadbbec56b..682ff7fbfb 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 6804ef6b19..f3a4059a02 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_base_gpio_table(size_t *num);
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 0891f87c9b..4c5c8b8b6d 100644
--- a/src/mainboard/google/drallion/chromeos.c
+++ b/src/mainboard/google/drallion/chromeos.c
@@ -40,15 +40,6 @@ static bool raw_get_recovery_mode_switch(void)
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 22a2d45d10..db0b3a9466 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 bc458dea77..fadec40a8b 100644
--- a/src/mainboard/google/eve/chromeos.c
+++ b/src/mainboard/google/eve/chromeos.c
@@ -32,9 +32,10 @@ static const struct cros_gpio cros_gpios[] = {
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 d10a59f610..59105ceb55 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 @@ int get_write_protect_state(void)
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 cf2292673e..ae5eeff576 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 1adaed412f..c90d12d870 100644
--- a/src/mainboard/google/glados/chromeos.c
+++ b/src/mainboard/google/glados/chromeos.c
@@ -31,9 +31,10 @@ static const struct cros_gpio cros_gpios[] = {
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 9875554d64..c5530db0df 100644
--- a/src/mainboard/google/guybrush/chromeos.c
+++ b/src/mainboard/google/guybrush/chromeos.c
@@ -23,9 +23,10 @@ static const struct cros_gpio cros_gpios[] = {
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 bbca895340..9c5e19d879 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 @@ int get_write_protect_state(void)
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 2f06a55e6f..125f7388a1 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 @@ const struct pad_config *variant_sleep_gpio_table(u8 slp_typ, size_t *num);
/* 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 239134bc5f..c5ebc72e1d 100644
--- a/src/mainboard/google/jecht/chromeos.c
+++ b/src/mainboard/google/jecht/chromeos.c
@@ -72,9 +72,10 @@ static const struct cros_gpio cros_gpios[] = {
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 690a9e3af3..c7f7671e00 100644
--- a/src/mainboard/google/kahlee/chromeos.c
+++ b/src/mainboard/google/kahlee/chromeos.c
@@ -30,9 +30,10 @@ static const struct cros_gpio cros_gpios[] = {
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 f5441677db..a1ac2d6c63 100644
--- a/src/mainboard/google/link/chromeos.c
+++ b/src/mainboard/google/link/chromeos.c
@@ -37,9 +37,10 @@ static const struct cros_gpio cros_gpios[] = {
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 82599aca73..42eeeeef67 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 @@ int get_write_protect_state(void)
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 5f2c6e25bb..bbc5d567e7 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 @@ extern const struct lpddr4_swizzle_cfg baseboard_lpddr4_swizzle;
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 4efcb4cc71..dc476f9d1d 100644
--- a/src/mainboard/google/parrot/chromeos.c
+++ b/src/mainboard/google/parrot/chromeos.c
@@ -51,9 +51,10 @@ static const struct cros_gpio cros_gpios[] = {
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 3c267cad0f..2ed2828579 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 @@ int get_write_protect_state(void)
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 1fdc32f95f..9d3e7f087f 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_early_gpio_table(size_t *num);
*/
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 d76c5e4c57..eae2357fdb 100644
--- a/src/mainboard/google/rambi/chromeos.c
+++ b/src/mainboard/google/rambi/chromeos.c
@@ -43,9 +43,10 @@ static const struct cros_gpio cros_gpios[] = {
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 1d1c990d73..ca3de03dc8 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 @@ int get_write_protect_state(void)
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 5b08c6aa26..c9b8b9d08e 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 @@ uint8_t variant_board_sku(void);
/* 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 180a98ebab..8cdd15c769 100644
--- a/src/mainboard/google/sarien/chromeos.c
+++ b/src/mainboard/google/sarien/chromeos.c
@@ -38,15 +38,6 @@ static bool raw_get_recovery_mode_switch(void)
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 f56a8b56e6..f56059cdb2 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 f56a8b56e6..f56059cdb2 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 67107d1b41..347e9d0b6a 100644
--- a/src/mainboard/google/skyrim/chromeos.c
+++ b/src/mainboard/google/skyrim/chromeos.c
@@ -20,7 +20,8 @@ static const struct cros_gpio cros_gpios[] = {
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 634e5637e3..9e0ab0ca38 100644
--- a/src/mainboard/google/slippy/chromeos.c
+++ b/src/mainboard/google/slippy/chromeos.c
@@ -28,9 +28,10 @@ static const struct cros_gpio cros_gpios[] = {
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 2fbddc2782..2f3ae8ccc8 100644
--- a/src/mainboard/google/stout/chromeos.c
+++ b/src/mainboard/google/stout/chromeos.c
@@ -79,7 +79,8 @@ static const struct cros_gpio cros_gpios[] = {
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 9b8e2f5296..1b6f7babd6 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 @@ int get_write_protect_state(void)
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 ba4bf7febe..94c39d9003 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_early_gpio_table(size_t *num);
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 d64919316b..a975099541 100644
--- a/src/mainboard/google/zork/chromeos.c
+++ b/src/mainboard/google/zork/chromeos.c
@@ -29,9 +29,10 @@ static const struct cros_gpio cros_gpios[] = {
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 d7e55a91dc..56fbc5057d 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 @@ int get_write_protect_state(void)
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 62ae0f38c0..33b5a1dc37 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 6f4e4a5987..364deaca25 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 143679ac56..4ae10112ce 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 @@ enum adl_boardid {
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 d4408f4d06..05280b1587 100644
--- a/src/mainboard/intel/baskingridge/chromeos.c
+++ b/src/mainboard/intel/baskingridge/chromeos.c
@@ -47,7 +47,8 @@ static const struct cros_gpio cros_gpios[] = {
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 5c5003b7a9..b2ea87f22c 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 @@ int get_write_protect_state(void)
/* 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 b7a1616e46..6ae25d4d84 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 2d0e2e1f44..621ecfdf75 100644
--- a/src/mainboard/intel/emeraldlake2/chromeos.c
+++ b/src/mainboard/intel/emeraldlake2/chromeos.c
@@ -44,7 +44,8 @@ static const struct cros_gpio cros_gpios[] = {
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 7a14c86bd2..bc27b27f31 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 @@ int get_write_protect_state(void)
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 f1df93783d..24c28f9ccd 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 @@ 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;
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 6df26afced..2b1f9aff3a 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 @@ int get_write_protect_state(void)
/* 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 ccbadca56c..48d6c1c738 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 bf9a7bf8b9..ef0d7ec2ab 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 @@ int get_write_protect_state(void)
/* 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 e2e331a295..120833fecf 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 @@ enum jsl_board_id {
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 afc27cd6d5..f64f5bd96c 100644
--- a/src/mainboard/intel/kblrvp/chromeos.c
+++ b/src/mainboard/intel/kblrvp/chromeos.c
@@ -60,9 +60,10 @@ static const struct cros_gpio cros_gpios[] = {
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 87a0e01b41..2bb59fb694 100644
--- a/src/mainboard/intel/kunimitsu/chromeos.c
+++ b/src/mainboard/intel/kunimitsu/chromeos.c
@@ -31,9 +31,10 @@ static const struct cros_gpio cros_gpios[] = {
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 0858754436..1e7c7d9494 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 @@ int get_write_protect_state(void)
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 a145ac9859..e8886d924f 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 91ce9aed27..a6a0af24ae 100644
--- a/src/mainboard/intel/strago/chromeos.c
+++ b/src/mainboard/intel/strago/chromeos.c
@@ -38,7 +38,8 @@ static const struct cros_gpio cros_gpios[] = {
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 dd6c666794..779c9a0f47 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 @@ int get_write_protect_state(void)
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 fbb86f7b00..45ae15e4d6 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 5e01910e48..49da437ed3 100644
--- a/src/mainboard/intel/wtm2/chromeos.c
+++ b/src/mainboard/intel/wtm2/chromeos.c
@@ -36,7 +36,8 @@ static const struct cros_gpio cros_gpios[] = {
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 f8b0afc3a6..e5c8d30e4a 100644
--- a/src/mainboard/samsung/lumpy/chromeos.c
+++ b/src/mainboard/samsung/lumpy/chromeos.c
@@ -90,7 +90,8 @@ static const struct cros_gpio cros_gpios[] = {
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 b845a9172c..95801c1685 100644
--- a/src/mainboard/samsung/stumpy/chromeos.c
+++ b/src/mainboard/samsung/stumpy/chromeos.c
@@ -83,7 +83,8 @@ static const struct cros_gpio cros_gpios[] = {
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 5a54d70527..383cd313f3 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 da25617121..34a9f57a8d 100644
--- a/src/vendorcode/google/chromeos/chromeos.h
+++ b/src/vendorcode/google/chromeos/chromeos.h
@@ -38,16 +38,9 @@ void chromeos_init_chromeos_acpi(void);
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 @@ struct cros_gpio {
#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 33389b4ebf..faaa646b43 100644
--- a/src/vendorcode/google/chromeos/gnvs.c
+++ b/src/vendorcode/google/chromeos/gnvs.c
@@ -98,6 +98,5 @@ void acpi_fill_cnvs(void)
acpigen_write_opregion(&cnvs_op);
acpigen_pop_len();
- /* Usually this creates OIPG package for GPIOs. */
- mainboard_chromeos_acpi_generate();
+ chromeos_acpi_gpio_generate();
}