summaryrefslogtreecommitdiff
path: root/src/soc/amd
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/amd')
-rw-r--r--src/soc/amd/picasso/Makefile.inc1
-rw-r--r--src/soc/amd/picasso/cfg_util.c20
-rw-r--r--src/soc/amd/picasso/i2c.c12
3 files changed, 5 insertions, 28 deletions
diff --git a/src/soc/amd/picasso/Makefile.inc b/src/soc/amd/picasso/Makefile.inc
index 6b32c6e8e2..2f4f00bc04 100644
--- a/src/soc/amd/picasso/Makefile.inc
+++ b/src/soc/amd/picasso/Makefile.inc
@@ -77,7 +77,6 @@ ramstage-y += tsc_freq.c
ramstage-y += finalize.c
ramstage-y += soc_util.c
-all-y += cfg_util.c
all-y += reset.c
smm-y += smihandler.c
diff --git a/src/soc/amd/picasso/cfg_util.c b/src/soc/amd/picasso/cfg_util.c
deleted file mode 100644
index b0b06522da..0000000000
--- a/src/soc/amd/picasso/cfg_util.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/* This file is part of the coreboot project. */
-
-#include <console/console.h>
-#include <device/device.h>
-#include <soc/pci_devs.h>
-#include "chip.h"
-
-const config_t *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;
-}
diff --git a/src/soc/amd/picasso/i2c.c b/src/soc/amd/picasso/i2c.c
index 6bbc7a7adc..dec409f060 100644
--- a/src/soc/amd/picasso/i2c.c
+++ b/src/soc/amd/picasso/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>
@@ -37,9 +38,8 @@ const struct dw_i2c_bus_config *dw_i2c_get_soc_cfg(unsigned int bus)
if (bus < APU_I2C_MIN_BUS || bus > APU_I2C_MAX_BUS)
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];
}
@@ -80,10 +80,8 @@ static void dw_i2c_soc_init(bool is_early_init)
uint32_t pad_ctrl;
int misc_reg;
- 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];