Merge pull request #915 from zyp/liblitespi_remove_mode

software/liblitespi: Remove manual mode control.
This commit is contained in:
enjoy-digital 2021-05-25 08:41:13 +02:00 committed by GitHub
commit 8085cc3c97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 19 deletions

View File

@ -17,16 +17,6 @@
#define DEBUG 0 #define DEBUG 0
#define USER_DEFINED_DUMMY_BITS 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) int spiflash_freq_init(void)
{ {
unsigned int lowest_div = spiflash_phy_clk_divisor_read(); 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); printf("Testing against CRC32: %08x\n\r", crc);
#endif #endif
if(spi_get_mode() != SPI_MODE_MMAP) {
spi_set_mode(SPI_MODE_MMAP);
}
/* Check if block is erased (filled with 0xFF) */ /* Check if block is erased (filled with 0xFF) */
if(crc == CRC32_ERASED_FLASH) { 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); 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);

View File

@ -6,11 +6,6 @@
#define SPI_FLASH_BLOCK_SIZE 256 #define SPI_FLASH_BLOCK_SIZE 256
#define CRC32_ERASED_FLASH 0xFEA8A821 #define CRC32_ERASED_FLASH 0xFEA8A821
typedef enum {
SPI_MODE_MMAP = 0,
SPI_MODE_MASTER = 1,
} spi_mode;
int spiflash_freq_init(void); int spiflash_freq_init(void);
void spiflash_dummy_bits_setup(unsigned int dummy_bits); void spiflash_dummy_bits_setup(unsigned int dummy_bits);
void spiflash_init(void); void spiflash_init(void);