This patch refactors the 'sdhci_fdt.c' driver by moving all vendor
specific routines into separate files and making the base 'sdhci_fdt'
driver subclassable. The goal is to make adding new FDT-based drivers
easier and more maintainable. No functional change intended.
Details
The refactored module builds for the armv7 and riscv64 targets.
I tested the changes on a Milk-V Duo S board and found no issues.
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
sys/dev/sdhci/sdhci_fdt_rockchip.c | ||
---|---|---|
5 | Also mav@ likely didn't do the rockchip part, I think that rockchip code was me, ganbold@ and probably some others. |
Generally, this is good, though I +1 the comments that manu@ made
sys/dev/sdhci/sdhci_fdt.c | ||
---|---|---|
77 | why do these remain? | |
203 | This also defers setting certain attributes to attach. |
sys/dev/sdhci/sdhci_fdt.c | ||
---|---|---|
77 | I think that's ok to have compatible that do not require custom clock/blah/whatever methods in the main driver, but we should probably move the quirks that they have in the ofw_compat_data (this can be done in a later commit). |
sys/arm/mv/files.arm7 | ||
---|---|---|
19 | Right, added it back in. | |
sys/dev/sdhci/sdhci_fdt.c | ||
77 | yeah, that was I was thinking as well, if a device doesn't need custom methods it stays here. | |
sys/dev/sdhci/sdhci_fdt_rockchip.c | ||
5 | I've added you and ganbold@ here, please let me know if the dates are okay. | |
112 | Right, however I kept this here because I wanted avoid splitting out duplicated code since this device shares most of its init code in the attach method with rk3399. |
sys/arm/mv/files.arm7 | ||
---|---|---|
19 | Didn't realized that it was mv/files.arm7, sdhci_fdt_rockchip.c should be added in sys/arm/rockchip/files.rk32xx | |
sys/dev/sdhci/sdhci_fdt_rockchip.c | ||
5 | Looking at some git blame it seems that @ganbold aded rk3399 support in b24594e544c20 @sos added support for rk3568 in e00774a917503 and I added support for zynqmp in b426119a45d09. | |
112 | I think that a few routines should still lives in sdhci_fdt.c : Those are really generic method for any properly supported hardware, and for now only rockchip and zynqmp are properly supported (in term of fdt bindings). |