diff options
author | Raul E Rangel <rrangel@chromium.org> | 2021-04-02 10:55:27 -0600 |
---|---|---|
committer | Raul Rangel <rrangel@chromium.org> | 2021-04-05 16:38:23 +0000 |
commit | 61ac1bc53022f3baa0e5a753bd75d639cb95718a (patch) | |
tree | ddc0136343218a0c50635b0ec7465b2a9206ba7f /src/soc/amd/common/block/lpc | |
parent | c988d0516cd91c9d2d7c8ace8c958fc2226996cc (diff) |
soc/amd: Make espi_configure_decodes private
This is only ever called after espi_setup.
55861 - AMD System Peripheral Bus Overview also says that io ranges
should be configured before enabling the BUS_MASTER bit.
BUG=b:183524609
TEST=Boot guybrush to OS
Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: I074e487d8768a578ee889a125b9948e3aa6c7269
Reviewed-on: https://review.coreboot.org/c/coreboot/+/52059
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/soc/amd/common/block/lpc')
-rw-r--r-- | src/soc/amd/common/block/lpc/espi_util.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/soc/amd/common/block/lpc/espi_util.c b/src/soc/amd/common/block/lpc/espi_util.c index c7269d0a4c..0b690b821b 100644 --- a/src/soc/amd/common/block/lpc/espi_util.c +++ b/src/soc/amd/common/block/lpc/espi_util.c @@ -298,19 +298,22 @@ static const struct espi_config *espi_get_config(void) return &soc_cfg->espi_config; } -void espi_configure_decodes(void) +static int espi_configure_decodes(const struct espi_config *cfg) { - int i; - const struct espi_config *cfg = espi_get_config(); + int i, ret; espi_enable_decode(cfg->std_io_decode_bitmap); for (i = 0; i < ESPI_GENERIC_IO_WIN_COUNT; i++) { if (cfg->generic_io_range[i].size == 0) continue; - espi_open_generic_io_window(cfg->generic_io_range[i].base, - cfg->generic_io_range[i].size); + ret = espi_open_generic_io_window(cfg->generic_io_range[i].base, + cfg->generic_io_range[i].size); + if (ret) + return ret; } + + return 0; } #define ESPI_DN_TX_HDR0 0x00 @@ -966,6 +969,11 @@ int espi_setup(void) return -1; } + if (espi_configure_decodes(cfg) == -1) { + printk(BIOS_ERR, "Error: Configuring decodes failed!\n"); + return -1; + } + /* Enable subtractive decode if configured */ espi_setup_subtractive_decode(cfg); |