Skip to content

RFC mmc: k1: do not require max-frequency in the device tree

Hung-Chun Tseng u-boot 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2mmc: k1: use the io clock rate when max-frequency is absentdrivers/mmc/spacemit_sdhci.c+20 -41 reply
2/2riscv: dts: k1: drop max-frequency from the SD and eMMC nodesarch/riscv/dts/k1-bananapi-f3-u-boot.dtsi arch/riscv/dts/k1-musepi-pro-u-boot.dtsi+0 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/2] mmc: k1: do not require max-frequency in the device tree

The K1 SDHCI driver sets the io clock to cfg.f_max, which is only filled in from a "max-frequency" property, so each K1 board carries max-frequency = <204800000> for the SD and eMMC nodes in its -u-boot.dtsi. E Shattow pointed out that this property is unlikely to be accepted in the upstream device tree and looks like a driver issue [1]. The Linux driver indeed does not need it: it reports the current io clock rate as the maximum.

Patch 1 makes the U-Boot driver do the same when max-frequency is absent. Patch 2 drops the property from the BPI-F3 and MusePi Pro overlays.

This is an RFC because I could only build-test it: spacemit_k1_defconfig builds (SPL and u-boot.itb), and the resulting BPI-F3 and MusePi Pro DTBs no longer carry max-frequency on the MMC nodes. I have not run it on hardware. The open question is what rate the io clock runs at when SPL and U-Boot probe the controllers: if the BootROM or SPL leaves it well below 204.8 MHz, SD and eMMC will still work but run slower, and the driver may need a default rate instead of the current one. A test on a BPI-F3 or MusePi Pro, or a pointer to the expected clock setup, would be very welcome.

[1] https://lore.kernel.org/u-boot/[email protected]/

Hung-Chun Tseng (2):
mmc: k1: use the io clock rate when max-frequency is absent
riscv: dts: k1: drop max-frequency from the SD and eMMC nodes

 arch/riscv/dts/k1-bananapi-f3-u-boot.dtsi |  2 --
 arch/riscv/dts/k1-musepi-pro-u-boot.dtsi  |  2 --
 drivers/mmc/spacemit_sdhci.c              | 24 +++++++++++++++++++----
 3 files changed, 20 insertions(+), 8 deletions(-)
Signature · 1 line
2.43.0