Page MenuHomeFreeBSD

sdhci_fsl_fdt: Fix tuning code
ClosedPublic

Authored by kd on Jan 25 2022, 8:31 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 6, 3:20 PM
Unknown Object (File)
Sat, Apr 6, 4:16 AM
Unknown Object (File)
Mar 7 2024, 8:15 PM
Unknown Object (File)
Feb 11 2024, 9:02 AM
Unknown Object (File)
Dec 20 2023, 6:01 AM
Unknown Object (File)
Dec 13 2023, 6:11 AM
Unknown Object (File)
Oct 13 2023, 12:29 PM
Unknown Object (File)
Oct 13 2023, 12:26 PM

Details

Summary
  • Some of the register writes were already done in the generic tuning code. Remove them.
  • Increase the polling timeout. The previous value is probably fine, but since timeouts are treated as fatal error giving it 200ms won't hurt.
  • Rework the HS400 switching code. Make sure that the switch happens at the right time. Reset the DLL0 block. We need to do that if u-boot has previously configured the controller in HS400 mode.
  • Check current timing before tuning. The tuning devmethod is always called, even for timings that don't require the tuning procedure.
  • Rework software tuning routine code. Use inner formula for clock divider calculation, as previous one was incorrect.
  • Implement custom re-tune procedure.

Co-authored-by: Hubert Mazur <hum@semihalf.com>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kd requested review of this revision.Jan 25 2022, 8:31 AM
kd created this revision.

Any comments here? I'd like to merge the code this week.

Due to problems with the D32706 I can't verify this on Honeycomb, plus I've never been able to have a working HW tuning. The current state is that this whole series of patches leaves Honeycomb with a non-functioning SD and eMMC. I currently have almost no free time to hack this problem, so everything is taking forever, sorry :(

In other words, HW tuning on the LX2160 is still not working, but this failure may be caused by any of previous patch from this series.

In D34027#775532, @mmel wrote:

Due to problems with the D32706 I can't verify this on Honeycomb, plus I've never been able to have a working HW tuning. The current state is that this whole series of patches leaves Honeycomb with a non-functioning SD and eMMC. I currently have almost no free time to hack this problem, so everything is taking forever, sorry :(

In other words, HW tuning on the LX2160 is still not working, but this failure may be caused by any of previous patch from this series.

Have you tried booting FreeBSD with all of the patches from this series applied?
In order to get the tuning to work on LX2k you'll at least need D34028.
Unfortunately I don't have access to a LX2k board, so I can't test/fix mmc related issues myself.
The driver itself was tested on LS1046A and LS1028A boards.

Yes, I've applied all the patches. The problem is that the HS SD card (i.e. without debugging) also doesn't work and I don't know why.

In D34027#775552, @mmel wrote:

Yes, I've applied all the patches. The problem is that the HS SD card (i.e. without debugging) also doesn't work and I don't know why.

Could you sent me a verbose bootlog with sdhc/mmc debug stuff enabled?
You need to set the following tunables:

boot_verbose=1
hw.sdhci.debug=10
hw.mmc.debug=10
This revision was not accepted when it landed; it landed in state Needs Review.Feb 22 2022, 8:59 AM
Closed by commit rG29cb30dcb08e: sdhci_fsl_fdt: Fix tuning code (authored by kd, committed by wma). · Explain Why
This revision was automatically updated to reflect the committed changes.