Page MenuHomeFreeBSD

mmc_fdt: handle broken-cd property
ClosedPublic

Authored by mhorne on Mon, Nov 3, 3:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 4, 7:07 AM
Unknown Object (File)
Tue, Nov 4, 5:05 AM
Unknown Object (File)
Tue, Nov 4, 1:37 AM
Unknown Object (File)
Mon, Nov 3, 11:53 PM
Unknown Object (File)
Mon, Nov 3, 11:50 PM
Unknown Object (File)
Mon, Nov 3, 11:40 PM
Unknown Object (File)
Mon, Nov 3, 7:34 PM
Unknown Object (File)
Mon, Nov 3, 7:30 PM

Details

Summary

The documented properties [1] for card-detection are one of:

  • cd-gpios
  • non-removable
  • broken-cd

In cd_setup() we handle the first two, but not the latter, resulting in
a silently undetected card on an affected system.

To work around this, force cd_disabled when broken-cd is specified, so
that the card detect helper function gets to run. A more complete
solution would implement some kind of polling mechanism to detect the
card's presence or removal.

Some variants of the Allwinner D1, such as the Lichee Rv, specify this
property in the mmc0 device node.

[1] sys/contrib/device-tree/Bindings/mmc/mmc-controller.yaml

Diff Detail

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

Event Timeline

mhorne requested review of this revision.Mon, Nov 3, 3:18 PM

Most likely, this same treatment should be applied to the similar cd_detect() function in sys/dev/sdhci/sdhci_fdt_gpio.c.

However, I don't have any device with which to test the sdhci fdt driver.

This revision is now accepted and ready to land.Mon, Nov 3, 9:56 PM

I've tested it on the Lichee RV Dock, and it boots the system properly. Thanks to mhorne.

This revision was automatically updated to reflect the committed changes.