Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/40257 )
Change subject: soc/amd/stoneyridge: replace get_soc_config with config_of_soc ......................................................................
soc/amd/stoneyridge: replace get_soc_config with config_of_soc
get_soc_config was a reimplementation of config_of_soc.
Change-Id: I73c6a84703e22d6778b830f4bb82419361c85ff7 Signed-off-by: Felix Held felix-coreboot@felixheld.de --- M src/soc/amd/stoneyridge/i2c.c 1 file changed, 5 insertions(+), 20 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/57/40257/1
diff --git a/src/soc/amd/stoneyridge/i2c.c b/src/soc/amd/stoneyridge/i2c.c index bd8fd5b..c4d2986 100644 --- a/src/soc/amd/stoneyridge/i2c.c +++ b/src/soc/amd/stoneyridge/i2c.c @@ -5,6 +5,7 @@ #include <arch/acpi.h> #include <console/console.h> #include <delay.h> +#include <device/device.h> #include <drivers/i2c/designware/dw_i2c.h> #include <amdblocks/acpimmio.h> #include <soc/iomap.h> @@ -34,19 +35,6 @@ return bus < I2C_DEVICE_COUNT ? i2c_bus_address[bus] : 0; }
-static const struct soc_amd_stoneyridge_config *get_soc_config(void) -{ - const struct device *dev = pcidev_path_on_root(GNB_DEVFN); - - if (!dev || !dev->chip_info) { - printk(BIOS_ERR, "%s: Could not find SoC devicetree config!\n", - __func__); - return NULL; - } - - return dev->chip_info; -} - const struct dw_i2c_bus_config *dw_i2c_get_soc_cfg(unsigned int bus) { const struct soc_amd_stoneyridge_config *config; @@ -54,9 +42,8 @@ if (bus >= ARRAY_SIZE(i2c_bus_address)) return NULL;
- config = get_soc_config(); - if (config == NULL) - return NULL; + /* config is not NULL; it it was, config_of_soc calls die() internally */ + config = config_of_soc();
return &config->i2c[bus]; } @@ -97,10 +84,8 @@ size_t i; const struct soc_amd_stoneyridge_config *config;
- config = get_soc_config(); - - if (config == NULL) - return; + /* config is not NULL; it it was, config_of_soc calls die() internally */ + config = config_of_soc();
for (i = 0; i < ARRAY_SIZE(config->i2c); i++) { const struct dw_i2c_bus_config *cfg = &config->i2c[i];
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40257 )
Change subject: soc/amd/stoneyridge: replace get_soc_config with config_of_soc ......................................................................
Patch Set 1:
still needs to be tested on stoneyridge
Hello build bot (Jenkins), Raul Rangel, Marshall Dawson,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/40257
to look at the new patch set (#2).
Change subject: soc/amd/stoneyridge: replace get_soc_config with config_of_soc ......................................................................
soc/amd/stoneyridge: replace get_soc_config with config_of_soc
get_soc_config was a reimplementation of config_of_soc.
Change-Id: I73c6a84703e22d6778b830f4bb82419361c85ff7 Signed-off-by: Felix Held felix-coreboot@felixheld.de --- M src/soc/amd/stoneyridge/i2c.c 1 file changed, 5 insertions(+), 20 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/57/40257/2
Marshall Dawson has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40257 )
Change subject: soc/amd/stoneyridge: replace get_soc_config with config_of_soc ......................................................................
Patch Set 2: Code-Review+2
Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/40257 )
Change subject: soc/amd/stoneyridge: replace get_soc_config with config_of_soc ......................................................................
soc/amd/stoneyridge: replace get_soc_config with config_of_soc
get_soc_config was a reimplementation of config_of_soc.
Change-Id: I73c6a84703e22d6778b830f4bb82419361c85ff7 Signed-off-by: Felix Held felix-coreboot@felixheld.de Reviewed-on: https://review.coreboot.org/c/coreboot/+/40257 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Marshall Dawson marshalldawson3rd@gmail.com --- M src/soc/amd/stoneyridge/i2c.c 1 file changed, 5 insertions(+), 20 deletions(-)
Approvals: build bot (Jenkins): Verified Marshall Dawson: Looks good to me, approved
diff --git a/src/soc/amd/stoneyridge/i2c.c b/src/soc/amd/stoneyridge/i2c.c index bd8fd5b..3f95be7 100644 --- a/src/soc/amd/stoneyridge/i2c.c +++ b/src/soc/amd/stoneyridge/i2c.c @@ -5,6 +5,7 @@ #include <arch/acpi.h> #include <console/console.h> #include <delay.h> +#include <device/device.h> #include <drivers/i2c/designware/dw_i2c.h> #include <amdblocks/acpimmio.h> #include <soc/iomap.h> @@ -34,19 +35,6 @@ return bus < I2C_DEVICE_COUNT ? i2c_bus_address[bus] : 0; }
-static const struct soc_amd_stoneyridge_config *get_soc_config(void) -{ - const struct device *dev = pcidev_path_on_root(GNB_DEVFN); - - if (!dev || !dev->chip_info) { - printk(BIOS_ERR, "%s: Could not find SoC devicetree config!\n", - __func__); - return NULL; - } - - return dev->chip_info; -} - const struct dw_i2c_bus_config *dw_i2c_get_soc_cfg(unsigned int bus) { const struct soc_amd_stoneyridge_config *config; @@ -54,9 +42,8 @@ if (bus >= ARRAY_SIZE(i2c_bus_address)) return NULL;
- config = get_soc_config(); - if (config == NULL) - return NULL; + /* config is not NULL; if it was, config_of_soc calls die() internally */ + config = config_of_soc();
return &config->i2c[bus]; } @@ -97,10 +84,8 @@ size_t i; const struct soc_amd_stoneyridge_config *config;
- config = get_soc_config(); - - if (config == NULL) - return; + /* config is not NULL; if it was, config_of_soc calls die() internally */ + config = config_of_soc();
for (i = 0; i < ARRAY_SIZE(config->i2c); i++) { const struct dw_i2c_bus_config *cfg = &config->i2c[i];
9elements QA has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40257 )
Change subject: soc/amd/stoneyridge: replace get_soc_config with config_of_soc ......................................................................
Patch Set 3:
Automatic boot test returned (PASS/FAIL/TOTAL): 3/0/3 Emulation targets: EMULATION_QEMU_X86_Q35 using payload TianoCore : SUCCESS : https://lava.9esec.io/r/2181 EMULATION_QEMU_X86_Q35 using payload SeaBIOS : SUCCESS : https://lava.9esec.io/r/2180 EMULATION_QEMU_X86_I440FX using payload SeaBIOS : SUCCESS : https://lava.9esec.io/r/2179
Please note: This test is under development and might not be accurate at all!