diff options
author | Arthur Heymans <arthur@aheymans.xyz> | 2021-10-27 18:27:58 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2021-10-28 17:39:37 +0000 |
commit | 59a348b75a43d41411dfd7fc4f5d6d1f26404381 (patch) | |
tree | bbbb91d1adab0f377f8301aaa2ed8cd34715c476 | |
parent | ea9425504fa0abdca3a15146deb1337e241d6ce5 (diff) |
drivers/net/r8168.c: Guard against generating power resource
Not all platforms need to generate power resources, but the code does
not get optimized out at build time because the devicetree gets
compiled into a linked list. As this code pulls in some heavy ACPI
dependencies that is even implemented with weak empty function it
makes sense to optimize out this code using a Kconfig constant.
This saves 1.5K in ramstage size on gigabyte/ga-945gcm-s2l.
Change-Id: I82289aa7e6e82318417f3b827b86182891dfc2a6
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58657
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r-- | src/drivers/net/Kconfig | 7 | ||||
-rw-r--r-- | src/drivers/net/r8168.c | 2 | ||||
-rw-r--r-- | src/mainboard/google/hatch/Kconfig | 1 |
3 files changed, 9 insertions, 1 deletions
diff --git a/src/drivers/net/Kconfig b/src/drivers/net/Kconfig index 7e111f6569..875b7095fa 100644 --- a/src/drivers/net/Kconfig +++ b/src/drivers/net/Kconfig @@ -38,6 +38,13 @@ config RT8168_SET_LED_MODE Configuration for details. With this flag enabled, the customized_leds variable will be read from devicetree setting. +config RT8168_GEN_ACPI_POWER_RESOURCE + bool + default n + depends on REALTEK_8168_RESET + help + Select this if an ACPI power resource needs to be generated. + config ATHEROS_ATL1E_SETMAC bool help diff --git a/src/drivers/net/r8168.c b/src/drivers/net/r8168.c index 1fd6eddbb3..18e2aff7c5 100644 --- a/src/drivers/net/r8168.c +++ b/src/drivers/net/r8168.c @@ -317,7 +317,7 @@ static void r8168_net_fill_ssdt(const struct device *dev) acpigen_write_name_string("_DDN", dev->chip_ops->name); /* Power Resource */ - if (config->has_power_resource) { + if (CONFIG(RT8168_GEN_ACPI_POWER_RESOURCE) && config->has_power_resource) { const struct acpi_power_res_params power_res_params = { .stop_gpio = &config->stop_gpio, .stop_delay_ms = config->stop_delay_ms, diff --git a/src/mainboard/google/hatch/Kconfig b/src/mainboard/google/hatch/Kconfig index 6fe44e0282..de68d855ef 100644 --- a/src/mainboard/google/hatch/Kconfig +++ b/src/mainboard/google/hatch/Kconfig @@ -9,6 +9,7 @@ config BOARD_GOOGLE_BASEBOARD_PUFF select BOARD_GOOGLE_HATCH_COMMON select RT8168_GET_MAC_FROM_VPD select RT8168_SET_LED_MODE + select RT8168_GEN_ACPI_POWER_RESOURCE select ROMSTAGE_SPD_SMBUS select SPD_READ_BY_WORD select SOC_INTEL_CSE_LITE_SKU |