From 85e9f28461089fbb846f5e69aa220206a67d51c1 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Sat, 29 Dec 2018 13:58:40 +0100 Subject: soc/amd/common: Don't use CAR_GLOBAL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All platforms using this code have NO_CAR_GLOBAL_MIGRATION. Change-Id: I422d5637caa1b55fa6bad30d25f5e34cbba40851 Signed-off-by: Arthur Heymans Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/30509 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Aaron Durbin Reviewed-by: Marshall Dawson --- src/soc/amd/stoneyridge/spi.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'src/soc/amd/stoneyridge') diff --git a/src/soc/amd/stoneyridge/spi.c b/src/soc/amd/stoneyridge/spi.c index 9baf43397e..9d62f67534 100644 --- a/src/soc/amd/stoneyridge/spi.c +++ b/src/soc/amd/stoneyridge/spi.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include @@ -32,36 +31,31 @@ #define SPI_DEBUG_DRIVER IS_ENABLED(CONFIG_DEBUG_SPI_FLASH) -static uintptr_t spibar CAR_GLOBAL; - -static uintptr_t get_spibase(void) -{ - return car_get_var(spibar); -} +static uintptr_t spibar; static void set_spibar(uintptr_t base) { - car_set_var(spibar, base); + spibar = base; } static inline uint8_t spi_read8(uint8_t reg) { - return read8((void *)(get_spibase() + reg)); + return read8((void *)(spibar + reg)); } static inline uint32_t spi_read32(uint8_t reg) { - return read32((void *)(get_spibase() + reg)); + return read32((void *)(spibar + reg)); } static inline void spi_write8(uint8_t reg, uint8_t val) { - write8((void *)(get_spibase() + reg), val); + write8((void *)(spibar + reg), val); } static inline void spi_write32(uint8_t reg, uint32_t val) { - write32((void *)(get_spibase() + reg), val); + write32((void *)(spibar + reg), val); } static void dump_state(const char *str) @@ -75,7 +69,7 @@ static void dump_state(const char *str) printk(BIOS_DEBUG, "TxByteCount: %x\n", spi_read8(SPI_TX_BYTE_COUNT)); printk(BIOS_DEBUG, "RxByteCount: %x\n", spi_read8(SPI_RX_BYTE_COUNT)); printk(BIOS_DEBUG, "CmdCode: %x\n", spi_read8(SPI_CMD_CODE)); - hexdump((void *)(get_spibase() + SPI_FIFO), SPI_FIFO_DEPTH); + hexdump((void *)(spibar + SPI_FIFO), SPI_FIFO_DEPTH); } static int wait_for_ready(void) -- cgit v1.2.3