From 7ba14406c30f90cebde9f539f1987348cfc998e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Thu, 7 Feb 2019 12:44:00 +0200 Subject: intel/spi: Switch to native PCI config accessors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: If7190ac105b2a65a9576709955c3cc840b95dcdf Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/31270 Tested-by: build bot (Jenkins) Reviewed-by: Werner Zeh Reviewed-by: Nico Huber Reviewed-by: Matt DeVillier Reviewed-by: Angel Pons --- src/soc/intel/braswell/spi.c | 34 +++------------------------------- 1 file changed, 3 insertions(+), 31 deletions(-) (limited to 'src/soc/intel/braswell') diff --git a/src/soc/intel/braswell/spi.c b/src/soc/intel/braswell/spi.c index 66eb53a8f3..14d1087006 100644 --- a/src/soc/intel/braswell/spi.c +++ b/src/soc/intel/braswell/spi.c @@ -19,6 +19,8 @@ #include #include #include +#include +#include #include #include #include @@ -27,36 +29,6 @@ #include #include -#if ENV_SMM -#define pci_read_config_byte(dev, reg, targ)\ - *(targ) = pci_read_config8(dev, reg) -#define pci_read_config_word(dev, reg, targ)\ - *(targ) = pci_read_config16(dev, reg) -#define pci_read_config_dword(dev, reg, targ)\ - *(targ) = pci_read_config32(dev, reg) -#define pci_write_config_byte(dev, reg, val)\ - pci_write_config8(dev, reg, val) -#define pci_write_config_word(dev, reg, val)\ - pci_write_config16(dev, reg, val) -#define pci_write_config_dword(dev, reg, val)\ - pci_write_config32(dev, reg, val) -#else /* ENV_SMM */ -#include -#include -#define pci_read_config_byte(dev, reg, targ)\ - *(targ) = pci_read_config8(dev, reg) -#define pci_read_config_word(dev, reg, targ)\ - *(targ) = pci_read_config16(dev, reg) -#define pci_read_config_dword(dev, reg, targ)\ - *(targ) = pci_read_config32(dev, reg) -#define pci_write_config_byte(dev, reg, val)\ - pci_write_config8(dev, reg, val) -#define pci_write_config_word(dev, reg, val)\ - pci_write_config16(dev, reg, val) -#define pci_write_config_dword(dev, reg, val)\ - pci_write_config32(dev, reg, val) -#endif /* ENV_SMM */ - typedef struct spi_slave ich_spi_slave; static int ichspi_lock = 0; @@ -242,7 +214,7 @@ static ich9_spi_regs *spi_regs(void) return NULL; } - pci_read_config_dword(dev, SBASE, &sbase); + sbase = pci_read_config32(dev, SBASE); sbase &= ~0x1ff; return (void *)sbase; -- cgit v1.2.3