soc/add_spi_flash: Reduce LiteSPIPHY default divisor to max(2, self.sys_clk_freq/clk_freq).
One small FPGAs running the BIOS from SPI Flash, the default divisor of 9 was slowing down too much BIOS boot time (It was OK on reboot after liblitespi auto-calibration). Reduce the default divisor to avoid this.
This commit is contained in:
parent
14d60661b9
commit
505c8b85d6
|
@ -1514,7 +1514,7 @@ class LiteXSoC(SoC):
|
||||||
self.check_if_exists(name + "_phy")
|
self.check_if_exists(name + "_phy")
|
||||||
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)
|
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_mmap = 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_mmap)
|
||||||
|
|
Loading…
Reference in New Issue