riscv: dts: spacemit: improve Milk-V Jupiter device tree
Subsystems (3)
cover riscv: dts: spacemit: improve Milk-V Jupiter device tree
This patchset updates the Milk-V Jupiter device tree to align with the changes recently done for other SpacemiT K1 based boards.
In addition the last patch enables SD card support, but it depends on the SD card support series for the K1 SoC to be merged first:
https://lore.kernel.org/linux-riscv/[email protected]/
Aurelien Jarno (4):
riscv: dts: spacemit: set console baud rate on Milk-V Jupiter
riscv: dts: spacemit: sort aliases on Milk-V Jupiter
riscv: dts: spacemit: enable eMMC on Milk-V Jupiter
riscv: dts: spacemit: enable SD card support on Milk-V Jupiter
.../boot/dts/spacemit/k1-milkv-jupiter.dts | 35 +++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-)
Signature · 1 line
2.53.0
PATCH 1/4 riscv: dts: spacemit: set console baud rate on Milk-V Jupiter
Because the default console's baud rate is not set, defconfig kernels do not have any serial output on this platform. Set the baud rate to 115200, matching what is used by U-Boot etc on this platform.
See-also: 24c12ca43b12c ("dts: spacemit: set console baud rate on bpif3")
--- arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts +1 -1
@@ -21,7 +21,7 @@ aliases { }; chosen { - stdout-path = "serial0"; + stdout-path = "serial0:115200n8"; }; leds {
Signature · 1 line
2.53.0
PATCH 2/4 riscv: dts: spacemit: sort aliases on Milk-V Jupiter
In reply to Aurelien JarnoBefore adding more aliases, just sort them.
--- arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts +1 -1
@@ -15,9 +15,9 @@ / { aliases { ethernet0 = ð0; ethernet1 = ð1; - serial0 = &uart0; i2c2 = &i2c2; i2c8 = &i2c8; + serial0 = &uart0; }; chosen {
Signature · 1 line
2.53.0
PATCH 3/4 riscv: dts: spacemit: enable eMMC on Milk-V Jupiter
In reply to Aurelien JarnoThe Milk-V Jupiter board has a connector for an eMMC module. Add an entry for it in the device tree and alias it mmc0. As it is not populated by default, do no mark it as non-removable.
--- arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts | 10 ++++++++++ 1 file changed, 10 insertions(+)
arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts +10 -0
@@ -17,6 +17,7 @@ aliases { ethernet1 = ð1; i2c2 = &i2c2; i2c8 = &i2c8; + mmc0 = &emmc; serial0 = &uart0; };
@@ -138,6 +139,15 @@ &cpu_7 { cpu-supply = <&buck1_3v45>; }; +&emmc { + bus-width = <8>; + mmc-hs400-1_8v; + mmc-hs400-enhanced-strobe; + no-sd; + no-sdio; + status = "okay"; +}; + ð0 { phy-handle = <&rgmii0>; phy-mode = "rgmii-id";
Signature · 1 line
2.53.0
Re: [PATCH 3/4] riscv: dts: spacemit: enable eMMC on Milk-V Jupiter
Quoted 4 lines · Aurelien Jarno
The Milk-V Jupiter board has a connector for an eMMC module. Add an entry for it in the device tree and alias it mmc0. As it is not populated by default, do no mark it as non-removable.
The meaning of "non-removable" here is whether it is expected to be added and removed during use, requiring to be probed again; not whether it is a user configurable module or soldered down part.
Quoted 23 lines
Signed-off-by Aurelien Jarno <[email protected]>--- arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts | 10 ++++++++++ 1 file changed, 10 insertions(+)arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts +3
-0@@ -17,6 +17,7 @@ aliases { ethernet1 = ð1; i2c2 = &i2c2; i2c8 = &i2c8; + mmc0 = &emmc; serial0 = &uart0; };@@ -138,6 +139,15 @@ &cpu_7 { cpu-supply = <&buck1_3v45>; }; +&emmc { + bus-width = <8>;
arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts &cpu_7 { · line 153
Quoted 10 lines
arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts +7
-0+ mmc-hs400-1_8v; + mmc-hs400-enhanced-strobe; + no-sd; + no-sdio; + status = "okay"; +}; + ð0 { phy-handle = <&rgmii0>; phy-mode = "rgmii-id";
With that, LGTM
(no R-by tag, I would want to test this I do not have the hardware though)
-E
Re: [PATCH 3/4] riscv: dts: spacemit: enable eMMC on Milk-V Jupiter
Quoted 9 lines · E Shattow
Quoted 4 lines · Aurelien Jarno
The Milk-V Jupiter board has a connector for an eMMC module. Add an entry for it in the device tree and alias it mmc0. As it is not populated by default, do no mark it as non-removable.
The meaning of "non-removable" here is whether it is expected to be added and removed during use, requiring to be probed again; not whether it is a user configurable module or soldered down part.
Not connecting the eMMC module and larking it as non-removable causes this info message to appears in the logs:
mmc0: SDHCI controller on d4281000.mmc [d4281000.mmc] using ADMA
mmc0: Failed to initialize a non-removable card
Regards
Aurelien
Signature · 2 lines
Aurelien Jarno GPG: 4096R/1DDD8C9B [email protected] http://aurel32.net
Yixun Lan
maintainerRe: [PATCH 3/4] riscv: dts: spacemit: enable eMMC on Milk-V Jupiter
Hi Aurelien,
Quoted 11 lines · Aurelien Jarno
Quoted 9 lines · E Shattow
Quoted 4 lines · Aurelien Jarno
The Milk-V Jupiter board has a connector for an eMMC module. Add an entry for it in the device tree and alias it mmc0. As it is not populated by default, do no mark it as non-removable.
The meaning of "non-removable" here is whether it is expected to be added and removed during use, requiring to be probed again; not whether it is a user configurable module or soldered down part.
Quoted 6 lines
Not connecting the eMMC module and larking it as non-removable causes this info message to appears in the logs:
mmc0: SDHCI controller on d4281000.mmc [d4281000.mmc] using ADMA
mmc0: Failed to initialize a non-removable card
I'm with E Shattow here, and would prefer to add "non-removable" property, Unlike SD card, the eMMC has no CD pin, some logic may be handled slightly differently.
For that failure message, I have no idea how to deal with it but might just ignore it.. Guess it's the price that have to pay if enabling the eMMC in DT but has no module soldered or plugged in?
Signature · 1 line
Yixun Lan (dlan)
Re: [PATCH 3/4] riscv: dts: spacemit: enable eMMC on Milk-V Jupiter
Quoted 21 lines · Yixun Lan
Hi Aurelien,
Quoted 11 lines · Aurelien Jarno
Quoted 9 lines · E Shattow
Quoted 4 lines · Aurelien Jarno
The Milk-V Jupiter board has a connector for an eMMC module. Add an entry for it in the device tree and alias it mmc0. As it is not populated by default, do no mark it as non-removable.
The meaning of "non-removable" here is whether it is expected to be added and removed during use, requiring to be probed again; not whether it is a user configurable module or soldered down part.
Quoted 6 lines
Not connecting the eMMC module and larking it as non-removable causes this info message to appears in the logs:
mmc0: SDHCI controller on d4281000.mmc [d4281000.mmc] using ADMA
mmc0: Failed to initialize a non-removable card
Quoted 8 lines
I'm with E Shattow here, and would prefer to add "non-removable" property, Unlike SD card, the eMMC has no CD pin, some logic may be handled slightly differently.
For that failure message, I have no idea how to deal with it but might just ignore it.. Guess it's the price that have to pay if enabling the eMMC in DT but has no module soldered or plugged in?
Yes in this situation the ideal measure would need an overlay to set the status = "okay" or status = "disabled" dependent on the presence or absence of the module, correctly representing the state of the hardware
- there is no module attached with which to configure. That is no trivial amount of work though and the easier (and I think we agree acceptable) approach is the driver will do what it does and inform that the module is not initialized. I would agree that an error message is the more useful outcome even if we would like to silence the error message it is at least accurate information.
For comparison, Pine64 Star64 boot messages when SD Card is present and eMMC module is not populated, as follows.
U-Boot:
Working FDT set to ff731a10
Hit any key to stop autoboot: 0
Card did not respond to voltage select! : -110
** Booting bootflow '<NULL>' with efi_mgr
Booting: Debian
Linux kernel (reverse timeline log):dwmmc_starfive 16020000.mmc: IDMAC supports 32-bit address mode. dwmmc_starfive 16020000.mmc: Using internal DMA controller. dwmmc_starfive 16020000.mmc: Version ID is 290a dwmmc_starfive 16020000.mmc: DW MMC controller at irq 26,32 bit host data width,32 deep fifodwmmc_starfive 16020000.mmc: Got CD GPIOdwmmc_starfive 16010000.mmc: IDMAC supports 32-bit address mode. dwmmc_starfive 16010000.mmc: Using internal DMA controller. dwmmc_starfive 16010000.mmc: Version ID is 290a dwmmc_starfive 16010000.mmc: DW MMC controller at irq 25,32 bit host data width,32 deep fifommc_host mmc1: Bus speed (slot 0) = 45511111Hz (slot req 400000Hz, actual 399220HZ div = 57)mmc_host mmc0: Bus speed (slot 0) = 45511111Hz (slot req 400000Hz, actual 399220HZ div = 57)mmc_host mmc0: Bus speed (slot 0) = 45511111Hz (slot req 300000Hz, actual 299415HZ div = 76)mmc_host mmc1: Bus speed (slot 0) = 45511111Hz (slot req 50000000Hz, actual 45511111HZ div = 0)
mmc1: new high speed SDXC card at address 0001mmc_host mmc0: Bus speed (slot 0) = 45511111Hz (slot req 200000Hz, actual 199610HZ div = 114)mmc_host mmc0: Bus speed (slot 0) = 45511111Hz (slot req 100000Hz, actual 99805HZ div = 228)
There "Card did not respond to voltage select! : -110" is repeated each mmc interface that does not have media presently; mmc1 is the eMMC connection. This driver (for JH-7110 designware MMC controller) does not complain about the eMMC module that is not attached.
I don't have an answer what should be done about that error message and no opinion on making the driver less verbose or leaning into suggesting an overlay (which is not trivial, so... feel free to ignore me on that) however reporting on what is commonly true of 'non-removable' property.
Best regards,
-E
PATCH 4/4 riscv: dts: spacemit: enable SD card support on Milk-V Jupiter
In reply to Aurelien JarnoAdd complete SD card controller support with UHS high-speed modes.
- Enable sdhci0 controller with 4-bit bus width
- Configure card detect GPIO with pull-up
- Connect vmmc-supply to buck4 for 3.3V card power
- Connect vqmmc-supply to aldo1 for 1.8V/3.3V I/O switching
- Add dual pinctrl states for voltage-dependent pin configuration
- Support UHS-I SDR25, SDR50, and SDR104 modes
- Alias it as mmc1
--- .../boot/dts/spacemit/k1-milkv-jupiter.dts | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-)
arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts +20 -1
@@ -18,6 +18,7 @@ aliases { i2c2 = &i2c2; i2c8 = &i2c8; mmc0 = &emmc; + mmc1 = &sdhci0; serial0 = &uart0; };
@@ -282,7 +283,7 @@ buck6 { regulator-always-on; }; - aldo1 { + aldo1: aldo1 { regulator-min-microvolt = <500000>; regulator-max-microvolt = <3400000>; regulator-boot-on;
@@ -417,6 +418,24 @@ uboot@a00000 { }; }; +&sdhci0 { + pinctrl-names = "default", "uhs"; + pinctrl-0 = <&mmc1_cfg>; + pinctrl-1 = <&mmc1_uhs_cfg>; + bus-width = <4>; + cd-gpios = <&gpio K1_GPIO(80) (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + no-mmc; + no-sdio; + disable-wp; + cap-sd-highspeed; + vmmc-supply = <&buck4_3v3>; + vqmmc-supply = <&aldo1>; + sd-uhs-sdr25; + sd-uhs-sdr50; + sd-uhs-sdr104; + status = "okay"; +}; + &uart0 { pinctrl-names = "default"; pinctrl-0 = <&uart0_2_cfg>;
Signature · 1 line
2.53.0