From 17887d08fee6d10bc4ff8758694b88435365e5d7 Mon Sep 17 00:00:00 2001 From: Kyösti Mälkki Date: Tue, 23 Jul 2019 19:08:01 +0300 Subject: mb/*/chromeos.c: Remove some ENV_RAMSTAGE and __SIMPLE_DEVICE__ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use explicit simple PCI config accessors here. Change-Id: Ifa3814fdd7795479ca5fdbfc4deb3fe8db9805f3 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/34519 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Furquan Shaikh --- src/mainboard/google/beltino/chromeos.c | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) (limited to 'src/mainboard/google/beltino') diff --git a/src/mainboard/google/beltino/chromeos.c b/src/mainboard/google/beltino/chromeos.c index e695ab5f08..1039707ec3 100644 --- a/src/mainboard/google/beltino/chromeos.c +++ b/src/mainboard/google/beltino/chromeos.c @@ -15,6 +15,7 @@ #include #include +#include #include #include #include @@ -27,9 +28,6 @@ #define FLAG_SPI_WP 0 #define FLAG_REC_MODE 1 -#if ENV_RAMSTAGE -#include - void fill_lb_gpios(struct lb_gpios *gpios) { struct lb_gpio chromeos_gpios[] = { @@ -43,36 +41,23 @@ void fill_lb_gpios(struct lb_gpios *gpios) }; lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios)); } -#endif int get_write_protect_state(void) { -#ifdef __SIMPLE_DEVICE__ pci_devfn_t dev = PCI_DEV(0, 0x1f, 2); -#else - struct device *dev = pcidev_on_root(0x1f, 2); -#endif - return (pci_read_config32(dev, SATA_SP) >> FLAG_SPI_WP) & 1; + return (pci_s_read_config32(dev, SATA_SP) >> FLAG_SPI_WP) & 1; } int get_recovery_mode_switch(void) { -#ifdef __SIMPLE_DEVICE__ pci_devfn_t dev = PCI_DEV(0, 0x1f, 2); -#else - struct device *dev = pcidev_on_root(0x1f, 2); -#endif - return (pci_read_config32(dev, SATA_SP) >> FLAG_REC_MODE) & 1; + return (pci_s_read_config32(dev, SATA_SP) >> FLAG_REC_MODE) & 1; } void init_bootmode_straps(void) { u32 flags = 0; -#ifdef __SIMPLE_DEVICE__ pci_devfn_t dev = PCI_DEV(0, 0x1f, 2); -#else - struct device *dev = pcidev_on_root(0x1f, 2); -#endif /* Write Protect: GPIO58 = GPIO_SPI_WP, active high */ if (get_gpio(GPIO_SPI_WP)) @@ -84,7 +69,7 @@ void init_bootmode_straps(void) /* Developer: Virtual */ - pci_write_config32(dev, SATA_SP, flags); + pci_s_write_config32(dev, SATA_SP, flags); } static const struct cros_gpio cros_gpios[] = { -- cgit v1.2.3