From 422c35693084d0f4d84b9415f8f52390bea00541 Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Mon, 17 May 2021 13:36:22 +0200 Subject: [PATCH] software/liblitespi: Remove manual mode control. --- litex/soc/software/liblitespi/spiflash.c | 14 -------------- litex/soc/software/liblitespi/spiflash.h | 5 ----- 2 files changed, 19 deletions(-) diff --git a/litex/soc/software/liblitespi/spiflash.c b/litex/soc/software/liblitespi/spiflash.c index ed5a4fbb5..3d325358e 100644 --- a/litex/soc/software/liblitespi/spiflash.c +++ b/litex/soc/software/liblitespi/spiflash.c @@ -17,16 +17,6 @@ #define DEBUG 0 #define USER_DEFINED_DUMMY_BITS 0 -static spi_mode spi_get_mode(void) -{ - return (spi_mode)spiflash_mmap_cfg_read(); -} - -static void spi_set_mode(spi_mode mode) -{ - spiflash_mmap_cfg_write((unsigned char)mode); -} - int spiflash_freq_init(void) { unsigned int lowest_div = spiflash_phy_clk_divisor_read(); @@ -37,10 +27,6 @@ int spiflash_freq_init(void) printf("Testing against CRC32: %08x\n\r", crc); #endif - if(spi_get_mode() != SPI_MODE_MMAP) { - spi_set_mode(SPI_MODE_MMAP); - } - /* Check if block is erased (filled with 0xFF) */ if(crc == CRC32_ERASED_FLASH) { printf("Block of size %d, started on address 0x%lx is erased. Cannot proceed with SPI frequency test.\n\r", SPI_FLASH_BLOCK_SIZE, SPIFLASH_BASE); diff --git a/litex/soc/software/liblitespi/spiflash.h b/litex/soc/software/liblitespi/spiflash.h index f72867603..fd846aced 100644 --- a/litex/soc/software/liblitespi/spiflash.h +++ b/litex/soc/software/liblitespi/spiflash.h @@ -6,11 +6,6 @@ #define SPI_FLASH_BLOCK_SIZE 256 #define CRC32_ERASED_FLASH 0xFEA8A821 -typedef enum { - SPI_MODE_MMAP = 0, - SPI_MODE_MASTER = 1, -} spi_mode; - int spiflash_freq_init(void); void spiflash_dummy_bits_setup(unsigned int dummy_bits); void spiflash_init(void);