soc/add_spi_flash: Rename spiflash_mmap to spi_flash_core (since LiteSPI inclule MMAP and Master Interface).
This commit is contained in:
parent
505c8b85d6
commit
c5b5abd103
|
@ -1515,11 +1515,11 @@ class LiteXSoC(SoC):
|
||||||
self.check_if_exists(name + "_mmap")
|
self.check_if_exists(name + "_mmap")
|
||||||
spiflash_pads = self.platform.request(name if mode == "1x" else name + mode)
|
spiflash_pads = self.platform.request(name if mode == "1x" else name + mode)
|
||||||
spiflash_phy = LiteSPIPHY(spiflash_pads, module, default_divisor=max(int(self.sys_clk_freq/clk_freq), 2))
|
spiflash_phy = LiteSPIPHY(spiflash_pads, module, default_divisor=max(int(self.sys_clk_freq/clk_freq), 2))
|
||||||
spiflash_mmap = LiteSPI(spiflash_phy, clk_freq=clk_freq, mmap_endianness=self.cpu.endianness, **kwargs)
|
spiflash_core = LiteSPI(spiflash_phy, clk_freq=clk_freq, mmap_endianness=self.cpu.endianness, **kwargs)
|
||||||
setattr(self.submodules, name + "_phy", spiflash_phy)
|
setattr(self.submodules, name + "_phy", spiflash_phy)
|
||||||
setattr(self.submodules, name + "_mmap", spiflash_mmap)
|
setattr(self.submodules, name + "_mmap", spiflash_core)
|
||||||
spiflash_region = SoCRegion(origin=self.mem_map.get(name, None), size=module.total_size, cached=False)
|
spiflash_region = SoCRegion(origin=self.mem_map.get(name, None), size=module.total_size, cached=False)
|
||||||
self.bus.add_slave(name=name, slave=spiflash_mmap.bus, region=spiflash_region)
|
self.bus.add_slave(name=name, slave=spiflash_core.bus, region=spiflash_region)
|
||||||
|
|
||||||
# Add SPI SDCard -------------------------------------------------------------------------------
|
# Add SPI SDCard -------------------------------------------------------------------------------
|
||||||
def add_spi_sdcard(self, name="spisdcard", spi_clk_freq=400e3, software_debug=False):
|
def add_spi_sdcard(self, name="spisdcard", spi_clk_freq=400e3, software_debug=False):
|
||||||
|
|
|
@ -145,7 +145,7 @@ int main(int i, char **c)
|
||||||
|
|
||||||
sdr_ok = 1;
|
sdr_ok = 1;
|
||||||
|
|
||||||
#if defined(CSR_ETHMAC_BASE) || defined(CSR_SDRAM_BASE) || defined(CSR_SPIFLASH_MMAP_BASE)
|
#if defined(CSR_ETHMAC_BASE) || defined(CSR_SDRAM_BASE) || defined(CSR_SPIFLASH_CORE_BASE)
|
||||||
printf("--========== \e[1mInitialization\e[0m ============--\n");
|
printf("--========== \e[1mInitialization\e[0m ============--\n");
|
||||||
#ifdef CSR_ETHMAC_BASE
|
#ifdef CSR_ETHMAC_BASE
|
||||||
eth_init();
|
eth_init();
|
||||||
|
@ -160,7 +160,7 @@ int main(int i, char **c)
|
||||||
if (sdr_ok != 1)
|
if (sdr_ok != 1)
|
||||||
printf("Memory initialization failed\n");
|
printf("Memory initialization failed\n");
|
||||||
#endif
|
#endif
|
||||||
#ifdef CSR_SPIFLASH_MMAP_BASE
|
#ifdef CSR_SPIFLASH_CORE_BASE
|
||||||
spiflash_init();
|
spiflash_init();
|
||||||
#endif
|
#endif
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
#include "spiflash.h"
|
#include "spiflash.h"
|
||||||
|
|
||||||
#if defined(CSR_SPIFLASH_PHY_BASE) && defined(CSR_SPIFLASH_MMAP_BASE)
|
#if defined(CSR_SPIFLASH_PHY_BASE) && defined(CSR_SPIFLASH_CORE_BASE)
|
||||||
|
|
||||||
#define DEBUG 0
|
#define DEBUG 0
|
||||||
#define USER_DEFINED_DUMMY_BITS 0
|
#define USER_DEFINED_DUMMY_BITS 0
|
||||||
|
@ -41,7 +41,7 @@ int spiflash_freq_init(void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
lowest_div++;
|
lowest_div++;
|
||||||
printf("SPIFlash freq configured to %d MHz\n", (spiflash_mmap_sys_clk_freq_read()/(2*(1 + lowest_div)))/1000000);
|
printf("SPIFlash freq configured to %d MHz\n", (spiflash_core_sys_clk_freq_read()/(2*(1 + lowest_div)))/1000000);
|
||||||
|
|
||||||
spiflash_phy_clk_divisor_write(lowest_div);
|
spiflash_phy_clk_divisor_write(lowest_div);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue