Page MenuHomeFreeBSD

Add support for AMD eMMC controller HS400 mode
AbandonedPublic

Authored by marius on Oct 22 2018, 10:24 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 11, 6:57 PM
Unknown Object (File)
Thu, Apr 11, 6:57 PM
Unknown Object (File)
Jan 13 2024, 11:38 AM
Unknown Object (File)
Dec 20 2023, 5:30 AM
Unknown Object (File)
Apr 25 2023, 6:37 PM
Unknown Object (File)
Apr 7 2023, 4:36 PM
Subscribers

Details

Summary

This patch attempts to port the following Linux change in order to add HS400 mode support for AMD eMMC 5.0 controller:
https://patchwork.kernel.org/patch/10086747/

In order to switch to HS mode from HS200 while going to HS400 mode, the tuning bit needs to be reset.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Unfortunately I haven't touched this area for several years and don't know details of modern transfer modes.

marius requested changes to this revision.Oct 23 2018, 10:09 PM
marius added inline comments.
sys/dev/sdhci/sdhci.c
904

Given that this appears to be specific to this particular AMD ACPI-based SDHCI controller (AMD PCI-based SDHCI controllers require different workarounds according to Linux), setting MMC_CAP_MMC_HS400 in slot->host.caps should go to sdhci_acpi_attach() based on HID and UID. That way sdhci_init_slot() only needs to be changed to or in host_caps and SDHCI_QUIRK_AMD_SET_MMC_HS400 is superfluous (see also below).

1181

This function is only called once, so its 3 lines of code should be inlined in an sdhci_acpi_set_uhs_timing() (see also below) instead.

1233

Likewise, given that this workaround appears to be specific to this particular AMD ACPI-based SDHCI controller, this code should go to an sdhci_acpi_set_uhs_timing() in sdhci_acpi.c, i. e. not to sdhci_generic_set_uhs_timing(), and be based on HID and UID of this controller instead of SDHCI_QUIRK_AMD_SET_MMC_HS400. The sdhci_acpi_set_uhs_timing() needs to be hooked up as sdhci_set_uhs_timing method in sdhci_methods of sdhci_acpi.c and wrap around sdhci_generic_set_uhs_timing() (similar to amd_set_ios() being the set_ios method for this controller in the Linux sdhci-acpi.c and with amd_set_ios() wrapping around sdhci_set_ios() there).

sys/dev/sdhci/sdhci.h
336 โ†—(On Diff #49432)

This should go to sdhci_acpi.c (see also below). The space after #define needs to be a tab according to style(9).

This revision now requires changes to proceed.Oct 23 2018, 10:09 PM
shreyankamartya229_gmail.com marked 4 inline comments as done.
shreyankamartya229_gmail.com removed a reviewer: mav.

Made requested changes as per comments.

sys/dev/sdhci/sdhci.c
904

Just to confirm, I take that you mean the only change in sdhci_init_slot would be to OR the host caps instead of assigning it.

1181

Done.

1233

Done.

sys/dev/sdhci/sdhci.h
336 โ†—(On Diff #49432)

Aah, sorry about that. Missed one.

@marius : Hi, Can you please review the latest changes.

@marius : I know that you must be really busy with the upcoming release. Please review this if possible, I've made the necessary changes that you requested in the last review.

marius abandoned this revision.
marius edited reviewers, added: shreyankamartya229_gmail.com; removed: marius.

Close; obsoleted by r340543; thanks for the original patch!