Merge pull request #820 from gsomlo/gls-sdcard-fixes
fixes for boot and (single-block, cmd17-only) Linux driver
This commit is contained in:
commit
5291a646d2
|
@ -1480,7 +1480,7 @@ class LiteXSoC(SoC):
|
|||
sdcard_pads = self.platform.request(name)
|
||||
|
||||
# Core
|
||||
self.submodules.sdphy = SDPHY(sdcard_pads, self.platform.device, self.clk_freq)
|
||||
self.submodules.sdphy = SDPHY(sdcard_pads, self.platform.device, self.clk_freq, cmd_timeout=10e-1, data_timeout=10e-1)
|
||||
self.submodules.sdcore = SDCore(self.sdphy)
|
||||
self.csr.add("sdphy", use_loc_if_exists=True)
|
||||
self.csr.add("sdcore", use_loc_if_exists=True)
|
||||
|
|
|
@ -106,6 +106,7 @@ void sdcard_set_clk_freq(uint32_t clk_freq, int show) {
|
|||
uint32_t divider;
|
||||
divider = clk_freq ? CONFIG_CLOCK_FREQUENCY/clk_freq : 256;
|
||||
divider = pow2_round_up(divider);
|
||||
divider <<= 1; /* NOTE: workaround for occasional sdcardboot failure */
|
||||
divider = min(max(divider, 2), 256);
|
||||
#ifdef SDCARD_DEBUG
|
||||
show = 1;
|
||||
|
|
Loading…
Reference in New Issue