MFC r349584, r349728, r349731, r350440, r350443, r351185, r353493, r353575…


MFC r349584, r349728, r349731, r350440, r350443, r351185, r353493, r353575, r355625, r355627, r355629, r356813

Since r349571 we need all the accessor to be present for set or get
otherwise we panic.
dwmmc don't handle VCCQ (voltage for the IO line of the SD/eMMC) or
Add the needed accessor in the {read,write}_ivar functions.

Reviewed by: imp (previous version)

r349728 by imp:
Implement missing MMCBR ivars

All MMCBR bridges have to implement all the MMCBR variables. This
implements them for everybody that currently doesn't.

A common routine for this should be written.

r349731 by imp:
Fix cut-and-pasto that slipped through my testing.

r350440 by br:
Add support for the SD/MMC controller found in Terasic DE10-Pro
(an Intel Stratix 10 GX/SX FPGA Development Kit).

Set the bus speed manually due to lack of clock management support.

Sponsored by: DARPA, AFRL

r350443 by br:
Fix MMCCAM kernel build.

Sponsored by: DARPA, AFRL

r351185 by mmel:
Enhance support of extres in dwmmc driver.
Handle all clocks, regulators and resets defined by dwmmc bindings.

r353493 by br:
Fix the driver attachment in cases when the external resource devices
(resets, regulators, clocks) are not available.

Rely on a system initialization done by a bootloader in that cases.

This fixes operation on Terasic DE10-Pro (an Intel Stratix 10
development kit).

Sponsored by: DARPA, AFRL

r353575 by br:
Fix dwmmc(4) driver attachment when ext_resources are not present.

Ignore only ENOENT (no DTS properties found) and ENODEV (driver not
present) non-zero return values from ext_resources.

Reviewed by: manu
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D22043

dwmmc: Add a detach method

This method will disable the regulators, clocks and assert the reset of
the module. It will also detach it's children (the mmc device) and release
it's resources.
While here enable the regulators on attach as we need them to power up
the sdcard or emmc.

dwmmc: Handle the card detect interrupt

The driver used to always add the mmc device as it's child even
it no card was detected. Add a function that will detect if the
card is present or not and that will attach/detach the mmc device.
The function is either call on attach (as we won't have the interrupt
fired) or from two taskqueues. The first taskqueue will directly call
the function when the sdcard was present and is now removed and the other
one will delay a bit the attach when we didn't had a card and now have one.
This is mostly based on comments from the sdhci driver where it describe
a situation when the CD pin is detected before the others pins are connected.

dwmmc: Use device_delete_children

Instead of first detaching the children(s) and then delete them,
use the device_delete_children function that does all of that.

Suggested by: ian

dwmmc: Remove max_hz from the softc

We never use it so directly set the value to the mmc host structure.


manuAuthored on
Differential Revision
D22043: Fix dwmmc(4) attachment
rS362343: hw.bus.info: rework handler