Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better support for the Broadcom eMMC2 controller #20

Open
mariobalanica opened this issue Mar 23, 2021 · 5 comments
Open

Better support for the Broadcom eMMC2 controller #20

mariobalanica opened this issue Mar 23, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@mariobalanica
Copy link
Collaborator

The sequential R/W speeds max out at around 23-24 MB/s with a SanDisk Ultra UHS-I A1 card.
The chip can do much better than this, but it is currently constrained by the following issues:

  • DMA is disabled because sdbus doesn't honor the _DMA method in ACPI, so it's not able to do the required address translation without a lower filter driver.

  • UHS-I support is disabled because the controller can't switch the voltage in a standard way, so it's always running at 3.3V.

@mariobalanica mariobalanica added the enhancement New feature or request label Mar 23, 2021
@idigdoug
Copy link
Contributor

idigdoug commented Apr 8, 2021

Work in progress on an sdport-based miniport "SdHostBCME88C" that addresses these issues. UHS-1 is working. I'll probably be able to add support for DMA this week, and then I'll send a PR.

There would still be some open issues to be resolved before switching to SdHostBCME88C over the existing sdbus driver.

  • Right now, if both SdHostBCME88C and bcm2836sdhc are loaded, sometimes the system hangs. I suspect this is a bug in sdport combined with a bug in bcm2836 regarding how interrupts are handled during device initialization. This needs to be resolved before we could enable SdHostBCME88C.
  • SdHostBCME88C is very new and might have other issues. Needs testing.

@mariobalanica
Copy link
Collaborator Author

mariobalanica commented May 16, 2021

Since DMA works out-of-the-box on the C0 stepping with sdbus, it's possible to add the Intel-specific _DSM method in ACPI for voltage switching, set the _CID accordingly and drop bcmemmc2. (B0 will still need it)

@idigdoug
Copy link
Contributor

Intel-specific _DSM is controlled by setting CompatType registry value, not by _CID. CompatType=7 means Medfield. CompatType=11 means BayTrail. I do not know what other side effects are introduced with these settings.

@mariobalanica
Copy link
Collaborator Author

If we give it an Intel _CID, the inbox INF will set the CompatType for us.
I've briefly tested this a month ago and haven't seen any side effects. (but of course, it needs more testing)

@idigdoug
Copy link
Contributor

idigdoug commented Jun 1, 2021

One additional issue that needs some investigation is how to handle RPi's support for 8-bit data bus. I don't have solid info on this, so I may be misguided, but here is what I know:

  • RPi4 controller claims that it is capable of driving an 8-bit data bus.
  • RPi4 and RPi400 have 4 data lines, so 8-bit data bus is not correct for RPi4/RPi400.
  • I understand that RPI compute module 4 does support 8-bit eMMC, so 8-bit data bus may be valid for CM4.
  • I've heard some second-hand reports that UHS-2 SD cards did not work with the bcmemmc2.inf driver.
  • I don't have any UHS-2 cards to test, but since RPi4 and RPi400 definitely do not support 8-bit data, and since this might be causing trouble for UHS-2 cards, I have set both bcmemmc2 and SDHostBRCME88C drivers to disable 8-bit data bus.
  • For now, this does no harm. If CM4 is supported in the future, we will need to revisit this decision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants