Page MenuHomeFreeBSD

Add support for RK3399 emmc
ClosedPublic

Authored by ganbold on May 4 2019, 11:21 AM.
Tags
None
Referenced Files
F105808597: D20156.id59956.diff
Sat, Dec 21, 12:13 AM
F105807834: D20156.id59861.diff
Fri, Dec 20, 11:54 PM
F105807711: D20156.id59873.diff
Fri, Dec 20, 11:52 PM
F105798315: D20156.diff
Fri, Dec 20, 8:39 PM
Unknown Object (File)
Thu, Dec 19, 10:20 AM
Unknown Object (File)
Wed, Dec 18, 4:47 AM
Unknown Object (File)
Wed, Dec 11, 6:14 AM
Unknown Object (File)
Sun, Dec 8, 2:14 PM

Details

Summary

Add emmc support for Rockchip RK3399 SoC.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

manu requested changes to this revision.May 4 2019, 11:35 AM

It missed the phy, so currently this works because u-boot already setup it for us.

sys/dev/sdhci/sdhci_fdt.c
57 ↗(On Diff #57033)

This needs to be undef ifdef EXT_RESOURCES.
Same comment for most of the thing below.

This revision now requires changes to proceed.May 4 2019, 11:35 AM
andrew added inline comments.
sys/dev/sdhci/sdhci_fdt.c
289 ↗(On Diff #57033)

This should be moved from probe to attach.

Updated. In case pf phy, we first maybe need separate driver for emmc-phy.

For rockchip there is a clock exposed (via the clock-output-names property) but you don't register it and you try to get it in the emmc-phy review (D20840).

This means that the sdhci driver should first expose the clock, wait for the phy driver with the help of newpass to be attached and then resume the work on sd/emmc detection.
I also think that you should subclass the driver since this will add a lot of rockchip related code.

sys/dev/sdhci/sdhci_fdt.c
161 ↗(On Diff #59802)

You should validate that this was the emmcclock that was requested based on the cells content and return ENXIO if it wasn't

481 ↗(On Diff #59802)

phy_init(sc->phy);

Looks like phydev_if.h is not needed, and no other functional changes.

manu requested changes to this revision.Jul 18 2019, 8:39 AM
manu added inline comments.
sys/dev/sdhci/sdhci_fdt.c
492 ↗(On Diff #59861)

I would prefer this block to be in a deticated rockchip function.

161 ↗(On Diff #59802)

You still don't validate the clock id based on cells[0] content.

This revision now requires changes to proceed.Jul 18 2019, 8:39 AM

Added ncells check in rk3399_ofw_map() function according to comment.
Moved rk3399 sdhci init related codes into sdhci_init_rk3399() function so that it looks more clean.

This revision is now accepted and ready to land.Jul 19 2019, 5:59 PM
This revision was automatically updated to reflect the committed changes.