Merge pull request #915 from zyp/liblitespi_remove_mode
software/liblitespi: Remove manual mode control.
This commit is contained in:
commit
8085cc3c97
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue