* Re: [PATCH v2 7/7] riscv: dts: spacemit: k1-orangepi-rv2: add SD card support with UHS modes
@ 2026-03-12 3:18 kernel test robot
0 siblings, 0 replies; 11+ messages in thread
From: kernel test robot @ 2026-03-12 3:18 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp
::::::
:::::: Manual check reason: "dtcheck: binding changes may go via different trees"
::::::
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20260309-orangepi-sd-card-uhs-v2-7-5bb2b574df5d@gmail.com>
References: <20260309-orangepi-sd-card-uhs-v2-7-5bb2b574df5d@gmail.com>
TO: Iker Pedrosa <ikerpedrosam@gmail.com>
TO: Ulf Hansson <ulf.hansson@linaro.org>
TO: Rob Herring <robh@kernel.org>
TO: Krzysztof Kozlowski <krzk@kernel.org>
TO: Conor Dooley <conor+dt@kernel.org>
TO: Adrian Hunter <adrian.hunter@intel.com>
TO: Paul Walmsley <pjw@kernel.org>
TO: Palmer Dabbelt <palmer@dabbelt.com>
TO: Albert Ou <aou@eecs.berkeley.edu>
TO: Alexandre Ghiti <alex@ghiti.fr>
TO: Yixun Lan <dlan@kernel.org>
CC: Michael Opdenacker <michael.opdenacker@rootcommit.com>
CC: Javier Martinez Canillas <javierm@redhat.com>
CC: linux-mmc@vger.kernel.org
CC: devicetree@vger.kernel.org
CC: linux-riscv@lists.infradead.org
CC: spacemit@lists.linux.dev
CC: linux-kernel@vger.kernel.org
CC: Iker Pedrosa <ikerpedrosam@gmail.com>
Hi Iker,
kernel test robot noticed the following build warnings:
[auto build test WARNING on ec1fb4e55df47ed043ab2ccc6787e39b9d67e49b]
url: https://github.com/intel-lab-lkp/linux/commits/Iker-Pedrosa/mmc-sdhci-of-k1-enable-essential-clock-infrastructure-for-SD-operation/20260309-194400
base: ec1fb4e55df47ed043ab2ccc6787e39b9d67e49b
patch link: https://lore.kernel.org/r/20260309-orangepi-sd-card-uhs-v2-7-5bb2b574df5d%40gmail.com
patch subject: [PATCH v2 7/7] riscv: dts: spacemit: k1-orangepi-rv2: add SD card support with UHS modes
:::::: branch date: 3 days ago
:::::: commit date: 3 days ago
config: riscv-randconfig-2051-20260311 (https://download.01.org/0day-ci/archive/20260312/202603120455.ZuF5ZSOi-lkp@intel.com/config)
compiler: riscv64-linux-gcc (GCC) 8.5.0
dtschema: 2025.13.dev8+g0515abdd9
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260312/202603120455.ZuF5ZSOi-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/202603120455.ZuF5ZSOi-lkp@intel.com/
dtcheck warnings: (new ones prefixed by >>)
>> arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dtb: mmc@d4280000 (spacemit,k1-sdhci): Unevaluated properties are not allowed ('reset-names', 'resets' were unexpected)
from schema $id: http://devicetree.org/schemas/mmc/spacemit,sdhci.yaml
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH v2 0/7] riscv: spacemit: enable SD card support with UHS modes for OrangePi RV2
@ 2026-03-09 11:40 Iker Pedrosa
2026-03-09 11:40 ` Iker Pedrosa
0 siblings, 1 reply; 11+ messages in thread
From: Iker Pedrosa @ 2026-03-09 11:40 UTC (permalink / raw)
To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Adrian Hunter, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Alexandre Ghiti, Yixun Lan, Yixun Lan
Cc: Michael Opdenacker, Javier Martinez Canillas, linux-mmc,
devicetree, linux-riscv, spacemit, linux-kernel, Iker Pedrosa
This series enables complete SD card support for the Spacemit K1-based
OrangePi RV2 board, including UHS (Ultra High Speed) modes for
high-performance SD card operation.
Background
The Spacemit K1 SoC includes an SDHCI controller capable of supporting
SD cards up to UHS-I speeds (SDR104 at 208MHz). However, mainline
currently lacks basic SD controller configuration, SDHCI driver
enhancements for voltage switching and tuning, and power management
infrastructure.
Implementation
The series enables SD card support through coordinated layers:
- Hardware infrastructure (patches 1-2): Device tree bindings for voltage
switching hardware and essential clock infrastructure.
- SDHCI driver enhancements (patches 3-7): Regulator framework
integration, pinctrl state switching for voltage domains, AIB register
programming, and comprehensive SDR tuning support for reliable UHS
operation.
- SoC and board integration (patches 8-10): Complete K1 SoC controller
definitions, PMIC power infrastructure, and OrangePi RV2 board enablement
with full UHS support.
This transforms the OrangePi RV2 from having no SD card support to full
UHS-I capability, enabling high-performance storage up to 208MHz.
Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com>
---
Changes in v2:
- Removed custom AIB voltage switching code per maintainer feedback. The
existing pinctrl driver already handles AIB voltage switching
automatically via power-source property changes during UHS mode
transitions. This eliminates code duplication.
- Squashed regulator and pinctrl commits into single voltage switching
implementation.
- Moved voltage switching callback from dynamic probe assignment to
static sdhci_ops declaration. Removed redundant SDHCI core call since
the framework handles standard voltage switching automatically.
- Made clock override (SDHC_OVRRD_CLK_OEN | SDHC_FORCE_CLK_ON)
conditional for SD/SDIO cards only. This follows vendor driver pattern
of differentiating SD and eMMC card handling.
- Include no-mmc property for SD card.
- Link to v1: https://lore.kernel.org/r/20260302-orangepi-sd-card-uhs-v1-0-89c219973c0c@gmail.com
---
Iker Pedrosa (7):
mmc: sdhci-of-k1: enable essential clock infrastructure for SD operation
mmc: sdhci-of-k1: add regulator and pinctrl voltage switching support
mmc: sdhci-of-k1: add SDR tuning infrastructure
mmc: sdhci-of-k1: add comprehensive SDR tuning support
riscv: dts: spacemit: k1: add SD card controller and pinctrl support
riscv: dts: spacemit: k1-orangepi-rv2: add PMIC and power infrastructure
riscv: dts: spacemit: k1-orangepi-rv2: add SD card support with UHS modes
arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts | 67 ++++++
arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi | 40 ++++
arch/riscv/boot/dts/spacemit/k1.dtsi | 13 ++
drivers/mmc/host/sdhci-of-k1.c | 252 +++++++++++++++++++++++
4 files changed, 372 insertions(+)
---
base-commit: ec1fb4e55df47ed043ab2ccc6787e39b9d67e49b
change-id: 20260226-orangepi-sd-card-uhs-0ecb05839b0c
Best regards,
--
Iker Pedrosa <ikerpedrosam@gmail.com>
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH v2 7/7] riscv: dts: spacemit: k1-orangepi-rv2: add SD card support with UHS modes 2026-03-09 11:40 [PATCH v2 0/7] riscv: spacemit: enable SD card support with UHS modes for OrangePi RV2 Iker Pedrosa @ 2026-03-09 11:40 ` Iker Pedrosa 0 siblings, 0 replies; 11+ messages in thread From: Iker Pedrosa @ 2026-03-09 11:40 UTC (permalink / raw) To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Adrian Hunter, Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan, Yixun Lan Cc: Michael Opdenacker, Javier Martinez Canillas, linux-mmc, devicetree, linux-riscv, spacemit, linux-kernel, Iker Pedrosa Add complete SD card controller support with UHS high-speed modes. - Enable sdhci0 controller with 4-bit bus width - Configure card detect GPIO with inversion - 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 This enables full SD card functionality including high-speed UHS modes for improved performance. Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com> --- arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts index 414b03f5e6480f05f5d7eeaaa0afb4e86425ae36..361135269801f436703b6f1d768c91325a52f07f 100644 --- a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts +++ b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts @@ -140,3 +140,22 @@ sd_vqmmc: aldo1 { }; }; }; + +&sdhci0 { + pinctrl-names = "default", "state_uhs"; + pinctrl-0 = <&mmc1_cfg>; + pinctrl-1 = <&mmc1_uhs_cfg>; + bus-width = <4>; + cd-gpios = <&gpio K1_GPIO(80) GPIO_ACTIVE_HIGH>; + cd-inverted; + no-mmc; + no-sdio; + disable-wp; + cap-sd-highspeed; + vmmc-supply = <&sd_vmmc>; + vqmmc-supply = <&sd_vqmmc>; + sd-uhs-sdr25; + sd-uhs-sdr50; + sd-uhs-sdr104; + status = "okay"; +}; -- 2.53.0 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 7/7] riscv: dts: spacemit: k1-orangepi-rv2: add SD card support with UHS modes @ 2026-03-09 11:40 ` Iker Pedrosa 0 siblings, 0 replies; 11+ messages in thread From: Iker Pedrosa @ 2026-03-09 11:40 UTC (permalink / raw) To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Adrian Hunter, Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan, Yixun Lan Cc: Michael Opdenacker, Javier Martinez Canillas, linux-mmc, devicetree, linux-riscv, spacemit, linux-kernel, Iker Pedrosa Add complete SD card controller support with UHS high-speed modes. - Enable sdhci0 controller with 4-bit bus width - Configure card detect GPIO with inversion - 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 This enables full SD card functionality including high-speed UHS modes for improved performance. Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com> --- arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts index 414b03f5e6480f05f5d7eeaaa0afb4e86425ae36..361135269801f436703b6f1d768c91325a52f07f 100644 --- a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts +++ b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts @@ -140,3 +140,22 @@ sd_vqmmc: aldo1 { }; }; }; + +&sdhci0 { + pinctrl-names = "default", "state_uhs"; + pinctrl-0 = <&mmc1_cfg>; + pinctrl-1 = <&mmc1_uhs_cfg>; + bus-width = <4>; + cd-gpios = <&gpio K1_GPIO(80) GPIO_ACTIVE_HIGH>; + cd-inverted; + no-mmc; + no-sdio; + disable-wp; + cap-sd-highspeed; + vmmc-supply = <&sd_vmmc>; + vqmmc-supply = <&sd_vqmmc>; + sd-uhs-sdr25; + sd-uhs-sdr50; + sd-uhs-sdr104; + status = "okay"; +}; -- 2.53.0 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2 7/7] riscv: dts: spacemit: k1-orangepi-rv2: add SD card support with UHS modes 2026-03-09 11:40 ` Iker Pedrosa @ 2026-03-13 11:20 ` Anand Moon -1 siblings, 0 replies; 11+ messages in thread From: Anand Moon @ 2026-03-13 11:20 UTC (permalink / raw) To: Iker Pedrosa Cc: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Adrian Hunter, Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan, Michael Opdenacker, Javier Martinez Canillas, linux-mmc, devicetree, linux-riscv, spacemit, linux-kernel Hi Iker, On Mon, 9 Mar 2026 at 17:11, Iker Pedrosa <ikerpedrosam@gmail.com> wrote: > > Add complete SD card controller support with UHS high-speed modes. > > - Enable sdhci0 controller with 4-bit bus width > - Configure card detect GPIO with inversion > - 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 > > This enables full SD card functionality including high-speed UHS modes > for improved performance. > > Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com> Can you add the same node for k1-bananapi-f3.dts in the next version? Thanks -Anand ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 7/7] riscv: dts: spacemit: k1-orangepi-rv2: add SD card support with UHS modes @ 2026-03-13 11:20 ` Anand Moon 0 siblings, 0 replies; 11+ messages in thread From: Anand Moon @ 2026-03-13 11:20 UTC (permalink / raw) To: Iker Pedrosa Cc: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Adrian Hunter, Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan, Michael Opdenacker, Javier Martinez Canillas, linux-mmc, devicetree, linux-riscv, spacemit, linux-kernel Hi Iker, On Mon, 9 Mar 2026 at 17:11, Iker Pedrosa <ikerpedrosam@gmail.com> wrote: > > Add complete SD card controller support with UHS high-speed modes. > > - Enable sdhci0 controller with 4-bit bus width > - Configure card detect GPIO with inversion > - 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 > > This enables full SD card functionality including high-speed UHS modes > for improved performance. > > Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com> Can you add the same node for k1-bananapi-f3.dts in the next version? Thanks -Anand _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 7/7] riscv: dts: spacemit: k1-orangepi-rv2: add SD card support with UHS modes 2026-03-09 11:40 ` Iker Pedrosa @ 2026-03-13 13:54 ` Trevor Gamblin -1 siblings, 0 replies; 11+ messages in thread From: Trevor Gamblin @ 2026-03-13 13:54 UTC (permalink / raw) To: Iker Pedrosa, Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Adrian Hunter, Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan Cc: Michael Opdenacker, Javier Martinez Canillas, linux-mmc, devicetree, linux-riscv, spacemit, linux-kernel On 2026-03-09 07:40, Iker Pedrosa wrote: > Add complete SD card controller support with UHS high-speed modes. > > - Enable sdhci0 controller with 4-bit bus width > - Configure card detect GPIO with inversion > - 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 > > This enables full SD card functionality including high-speed UHS modes > for improved performance. > > Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com> > --- > arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > > diff --git a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts > index 414b03f5e6480f05f5d7eeaaa0afb4e86425ae36..361135269801f436703b6f1d768c91325a52f07f 100644 > --- a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts > +++ b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts > @@ -140,3 +140,22 @@ sd_vqmmc: aldo1 { > }; > }; > }; > + > +&sdhci0 { > + pinctrl-names = "default", "state_uhs"; > + pinctrl-0 = <&mmc1_cfg>; > + pinctrl-1 = <&mmc1_uhs_cfg>; > + bus-width = <4>; > + cd-gpios = <&gpio K1_GPIO(80) GPIO_ACTIVE_HIGH>; > + cd-inverted; > + no-mmc; > + no-sdio; > + disable-wp; > + cap-sd-highspeed; > + vmmc-supply = <&sd_vmmc>; > + vqmmc-supply = <&sd_vqmmc>; > + sd-uhs-sdr25; > + sd-uhs-sdr50; > + sd-uhs-sdr104; > + status = "okay"; > +}; > Hello again, Thanks for doing this work. My colleagues and I have been testing this on an OrangePi RV2, and also a Muse Pi Pro board (making a similar tweak to this patch in k1-musepi-pro.dts). To do the testing on my end, I'm applying the patch series on top of 6.19 in a Yocto BSP. I've been finding that I see issues with the UHS support on my side (this log comes from an image built and flashed to an SD card): [ 1.072417] sdhci-spacemit d4280000.mmc: Got CD GPIO [ 1.109741] mmc0: SDHCI controller on d4280000.mmc [d4280000.mmc] using ADMA [ 1.114589] clk: Disabling unused clocks [ 1.118421] PM: genpd: Disabling unused power domains [ 1.123249] ALSA device list: [ 1.126[ 1.129949] check access for rdinit=/init failed: -2, ignoring [ 1.133284] Waiting for root device PARTUUID=e94bfdd7-a36f-4315-a480-476e2a12403d... [ 1.176569] mmc0: new UHS-I speed DDR50 SDHC card at address aaaa [ 1.180732] mmcblk0: mmc0:aaaa SS16G 14.8 GiB [ 1.276268] mmcblk0: recovery failed! [ 1.277351] I/O error, dev mmcblk0, sector 0 op 0x0:(READ) flags 0x800000 phys_seg 1 prio class 2 [ 1.286346] Buffer I/O error on dev mmcblk0, logical block 0, async page read [ 1.293891] mmcblk0: recovery failed! [ 1.297289] I/O error, dev mmcblk0, sector 0 op 0x0:(READ) flags 0x800000 phys_seg 1 prio class 2 [ 1.306269] Buffer I/O error on dev mmcblk0, logical block 0, async page read [ 1.313522] mmcblk0: unable to read partition table At first I wondered if maybe there was an issue with the card itself, but by changing the sdhci0 section to this, I'm able to read the SD just fine: &sdhci0 { pinctrl-names = "default"; pinctrl-0 = <&mmc1_cfg>; bus-width = <4>; cd-gpios = <&gpio K1_GPIO(80) GPIO_ACTIVE_HIGH>; cd-inverted; no-mmc; no-sdio; disable-wp; vmmc-supply = <&sd_vmmc>; vqmmc-supply = <&sd_vqmmc>; no-1-8-v; status = "okay"; }; Here's the boot log, for comparison: [ 1.068399] sdhci-spacemit d4280000.mmc: Got CD GPIO [ 1.105952] mmc0: SDHCI controller on d4280000.mmc [d4280000.mmc] using ADMA [ 1.110807] clk: Disabling unused clocks [ 1.114624] PM: genpd: Disabling unused power domains [ 1.119456] ALSA device list: [ 1.122[ 1.126159] check access for rdinit=/init failed: -2, ignoring [ 1.129491] Waiting for root device PARTUUID=e94bfdd7-a36f-4315-a480-476e2a12403d... [ 1.155817] mmc0: new high speed SDHC card at address aaaa [ 1.159367] mmcblk0: mmc0:aaaa SS16G 14.8 GiB [ 1.173666] GPT:Primary header thinks Alt. header is not at the end of the disk. [ 1.178530] GPT:1135739 != 31116287 [ 1.182045] GPT:Alternate GPT header not at the end of the disk. [ 1.188124] GPT:1135739 != 31116287 [ 1.191650] GPT: Use GNU Parted to correct GPT errors. [ 1.196894] mmcblk0: p1 p2 p3 [ 1.375482] EXT4-fs (mmcblk0p3): recovery complete [ 1.379459] EXT4-fs (mmcblk0p3): mounted filesystem ad761819-1030-44fe-9267-f59c53c4b5c4 r/w with ordered data mode. Quota mode: disabled. [ 1.390400] VFS: Mounted root (ext4 filesystem) on device 179:3. To be sure, I tried a different SDXC card with your version and saw: [ 1.064528] sdhci-spacemit d4280000.mmc: Got CD GPIO [ 1.102113] mmc0: SDHCI controller on d4280000.mmc [d4280000.mmc] using ADMA [ 1.106978] clk: Disabling unused clocks [ 1.110792] PM: genpd: Disabling unused power domains [ 1.115622] ALSA device list: [ 1.118[ 1.122325] check access for rdinit=/init failed: -2, ignoring [ 1.125656] Waiting for root device PARTUUID=e94bfdd7-a36f-4315-a480-476e2a12403d... [ 1.215840] sdhci-spacemit d4280000.mmc: Tuning failed: no stable window found [ 1.220520] mmc0: tuning execution failed: -5 [ 1.224931] mmc0: error -5 whilst initialising SD card [ 1.378228] sdhci-spacemit d4280000.mmc: Tuning failed: no stable window found [ 1.382901] mmc0: tuning execution failed: -5 [ 1.506443] mmc0: new high speed SDXC card at address 1388 [ 1.510009] mmcblk0: mmc0:1388 SATC 57.7 GiB [ 1.645467] sdhci-spacemit d4280000.mmc: Tuning failed: no stable window found [ 1.650158] mmc0: tuning execution failed: -5 [ 1.772856] GPT:Primary header thinks Alt. header is not at the end of the disk. [ 1.777718] GPT:1135725 != 120930303 [ 1.781317] GPT:Alternate GPT header not at the end of the disk. [ 1.787397] GPT:1135725 != 120930303 [ 1.791022] GPT: Use GNU Parted to correct GPT errors. [ 1.796238] mmcblk0: p1 p2 p3 [ 1.917789] sdhci-spacemit d4280000.mmc: Tuning failed: no stable window found [ 1.922483] mmc0: tuning execution failed: -5 [ 2.174518] sdhci-spacemit d4280000.mmc: Tuning failed: no stable window found [ 2.179193] mmc0: tuning execution failed: -5 [ 2.337900] EXT4-fs (mmcblk0p3): mounted filesystem d1f9e739-cc74-4c48-a774-390717721c53 r/w with ordered data mode. Quota mode: disabled. [ 2.348031] VFS: Mounted root (ext4 filesystem) on device 179:3. [ 2.492089] sdhci-spacemit d4280000.mmc: Tuning failed: no stable window found [ 2.496771] mmc0: tuning execution failed: -5 [ 2.617641] devtmpfs: mounted [ 2.618771] Freeing unused kernel image (initmem) memory: 2432K [ 2.624085] Run /sbin/init as init process [ 2.749813] sdhci-spacemit d4280000.mmc: Tuning failed: no stable window found [ 2.754492] mmc0: tuning execution failed: -5 [ 3.013665] sdhci-spacemit d4280000.mmc: Tuning failed: no stable window found [ 3.018357] mmc0: tuning execution failed: -5 [ 3.279459] sdhci-spacemit d4280000.mmc: Tuning failed: no stable window found [ 3.284139] mmc0: tuning execution failed: -5 [ 3.541764] sdhci-spacemit d4280000.mmc: Tuning failed: no stable window found [ 3.546450] mmc0: tuning execution failed: -5 [ 3.665967] I/O error, dev mmcblk0, sector 259162 op 0x0:(READ) flags 0x880700 phys_seg 1 prio class 2 [ 3.672894] I/O error, dev mmcblk0, sector 259163 op 0x0:(READ) flags 0x880700 phys_seg 1 prio class 2 [ 3.683275] I/O error, dev mmcblk0, sector 259170 op 0x0:(READ) flags 0x880700 phys_seg 1 prio class 2 [ 3.691878] I/O error, dev mmcblk0, sector 259172 op 0x0:(READ) flags 0x880700 phys_seg 1 prio class 2 [ 3.701516] I/O error, dev mmcblk0, sector 259175 op 0x0:(READ) flags 0x880700 phys_seg 1 prio class 2 [ 3.711067] I/O error, dev mmcblk0, sector 259178 op 0x0:(READ) flags 0x880700 phys_seg 1 prio class 2 [ 3.720183] I/O error, dev mmcblk0, sector 259180 op 0x0:(READ) flags 0x880700 phys_seg 1 prio class 2 [ 3.730004] I/O error, dev mmcblk0, sector 259183 op 0x0:(READ) flags 0x880700 phys_seg 1 prio class 2 [ 3.739010] I/O error, dev mmcblk0, sector 259184 op 0x0:(READ) flags 0x880700 phys_seg 1 prio class 2 [ 3.888355] sdhci-spacemit d4280000.mmc: Tuning failed: no stable window found [ 3.893045] mmc0: tuning execution failed: -5 [ 4.149999] sdhci-spacemit d4280000.mmc: Tuning failed: no stable window found [ 4.154686] mmc0: tuning execution failed: -5 [ 4.283933] I/O error, dev mmcblk0, sector 209865 op 0x0:(READ) flags 0x803000 phys_seg 1 prio class 2 [ 4.290750] EXT4-fs warning (device mmcblk0p3): ext4_dx_find_entry:1726: inode #768: lblock 1: comm swapper/0: error -5 reading directory block [ 4.303879] Starting init: /sbin/init exists but couldn't execute it (error -5) [ 4.311194] Run /etc/init as init process [ 4.316220] Run /bin/init as init process [ 4.319996] Run /bin/sh as init process [ 4.457522] sdhci-spacemit d4280000.mmc: Tuning failed: no stable window found [ 4.462200] mmc0: tuning execution failed: -5 [ 4.719271] sdhci-spacemit d4280000.mmc: Tuning failed: no stable window found [ 4.723945] mmc0: tuning execution failed: -5 [ 4.842487] EXT4-fs warning (device mmcblk0p3): ext4_dx_find_entry:1726: inode #768: lblock 1: comm swapper/0: error -5 reading directory block [ 4.852959] Starting init: /bin/sh exists but couldn't execute it (error -5) [ 4.860044] Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance. [ 4.874394] CPU: 4 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.19.0-00008-ga23b3fad2d87 #1 NONE [ 4.883295] Hardware name: OrangePi RV2 (DT) I don't think I've missed anything between 6.19 and 7.x, but it's possible. It seems like there's a timing issue at play? Let me know if I can help with further testing. I'm also in #spacemit on IRC. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 7/7] riscv: dts: spacemit: k1-orangepi-rv2: add SD card support with UHS modes @ 2026-03-13 13:54 ` Trevor Gamblin 0 siblings, 0 replies; 11+ messages in thread From: Trevor Gamblin @ 2026-03-13 13:54 UTC (permalink / raw) To: Iker Pedrosa, Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Adrian Hunter, Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan Cc: Michael Opdenacker, Javier Martinez Canillas, linux-mmc, devicetree, linux-riscv, spacemit, linux-kernel On 2026-03-09 07:40, Iker Pedrosa wrote: > Add complete SD card controller support with UHS high-speed modes. > > - Enable sdhci0 controller with 4-bit bus width > - Configure card detect GPIO with inversion > - 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 > > This enables full SD card functionality including high-speed UHS modes > for improved performance. > > Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com> > --- > arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > > diff --git a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts > index 414b03f5e6480f05f5d7eeaaa0afb4e86425ae36..361135269801f436703b6f1d768c91325a52f07f 100644 > --- a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts > +++ b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts > @@ -140,3 +140,22 @@ sd_vqmmc: aldo1 { > }; > }; > }; > + > +&sdhci0 { > + pinctrl-names = "default", "state_uhs"; > + pinctrl-0 = <&mmc1_cfg>; > + pinctrl-1 = <&mmc1_uhs_cfg>; > + bus-width = <4>; > + cd-gpios = <&gpio K1_GPIO(80) GPIO_ACTIVE_HIGH>; > + cd-inverted; > + no-mmc; > + no-sdio; > + disable-wp; > + cap-sd-highspeed; > + vmmc-supply = <&sd_vmmc>; > + vqmmc-supply = <&sd_vqmmc>; > + sd-uhs-sdr25; > + sd-uhs-sdr50; > + sd-uhs-sdr104; > + status = "okay"; > +}; > Hello again, Thanks for doing this work. My colleagues and I have been testing this on an OrangePi RV2, and also a Muse Pi Pro board (making a similar tweak to this patch in k1-musepi-pro.dts). To do the testing on my end, I'm applying the patch series on top of 6.19 in a Yocto BSP. I've been finding that I see issues with the UHS support on my side (this log comes from an image built and flashed to an SD card): [ 1.072417] sdhci-spacemit d4280000.mmc: Got CD GPIO [ 1.109741] mmc0: SDHCI controller on d4280000.mmc [d4280000.mmc] using ADMA [ 1.114589] clk: Disabling unused clocks [ 1.118421] PM: genpd: Disabling unused power domains [ 1.123249] ALSA device list: [ 1.126[ 1.129949] check access for rdinit=/init failed: -2, ignoring [ 1.133284] Waiting for root device PARTUUID=e94bfdd7-a36f-4315-a480-476e2a12403d... [ 1.176569] mmc0: new UHS-I speed DDR50 SDHC card at address aaaa [ 1.180732] mmcblk0: mmc0:aaaa SS16G 14.8 GiB [ 1.276268] mmcblk0: recovery failed! [ 1.277351] I/O error, dev mmcblk0, sector 0 op 0x0:(READ) flags 0x800000 phys_seg 1 prio class 2 [ 1.286346] Buffer I/O error on dev mmcblk0, logical block 0, async page read [ 1.293891] mmcblk0: recovery failed! [ 1.297289] I/O error, dev mmcblk0, sector 0 op 0x0:(READ) flags 0x800000 phys_seg 1 prio class 2 [ 1.306269] Buffer I/O error on dev mmcblk0, logical block 0, async page read [ 1.313522] mmcblk0: unable to read partition table At first I wondered if maybe there was an issue with the card itself, but by changing the sdhci0 section to this, I'm able to read the SD just fine: &sdhci0 { pinctrl-names = "default"; pinctrl-0 = <&mmc1_cfg>; bus-width = <4>; cd-gpios = <&gpio K1_GPIO(80) GPIO_ACTIVE_HIGH>; cd-inverted; no-mmc; no-sdio; disable-wp; vmmc-supply = <&sd_vmmc>; vqmmc-supply = <&sd_vqmmc>; no-1-8-v; status = "okay"; }; Here's the boot log, for comparison: [ 1.068399] sdhci-spacemit d4280000.mmc: Got CD GPIO [ 1.105952] mmc0: SDHCI controller on d4280000.mmc [d4280000.mmc] using ADMA [ 1.110807] clk: Disabling unused clocks [ 1.114624] PM: genpd: Disabling unused power domains [ 1.119456] ALSA device list: [ 1.122[ 1.126159] check access for rdinit=/init failed: -2, ignoring [ 1.129491] Waiting for root device PARTUUID=e94bfdd7-a36f-4315-a480-476e2a12403d... [ 1.155817] mmc0: new high speed SDHC card at address aaaa [ 1.159367] mmcblk0: mmc0:aaaa SS16G 14.8 GiB [ 1.173666] GPT:Primary header thinks Alt. header is not at the end of the disk. [ 1.178530] GPT:1135739 != 31116287 [ 1.182045] GPT:Alternate GPT header not at the end of the disk. [ 1.188124] GPT:1135739 != 31116287 [ 1.191650] GPT: Use GNU Parted to correct GPT errors. [ 1.196894] mmcblk0: p1 p2 p3 [ 1.375482] EXT4-fs (mmcblk0p3): recovery complete [ 1.379459] EXT4-fs (mmcblk0p3): mounted filesystem ad761819-1030-44fe-9267-f59c53c4b5c4 r/w with ordered data mode. Quota mode: disabled. [ 1.390400] VFS: Mounted root (ext4 filesystem) on device 179:3. To be sure, I tried a different SDXC card with your version and saw: [ 1.064528] sdhci-spacemit d4280000.mmc: Got CD GPIO [ 1.102113] mmc0: SDHCI controller on d4280000.mmc [d4280000.mmc] using ADMA [ 1.106978] clk: Disabling unused clocks [ 1.110792] PM: genpd: Disabling unused power domains [ 1.115622] ALSA device list: [ 1.118[ 1.122325] check access for rdinit=/init failed: -2, ignoring [ 1.125656] Waiting for root device PARTUUID=e94bfdd7-a36f-4315-a480-476e2a12403d... [ 1.215840] sdhci-spacemit d4280000.mmc: Tuning failed: no stable window found [ 1.220520] mmc0: tuning execution failed: -5 [ 1.224931] mmc0: error -5 whilst initialising SD card [ 1.378228] sdhci-spacemit d4280000.mmc: Tuning failed: no stable window found [ 1.382901] mmc0: tuning execution failed: -5 [ 1.506443] mmc0: new high speed SDXC card at address 1388 [ 1.510009] mmcblk0: mmc0:1388 SATC 57.7 GiB [ 1.645467] sdhci-spacemit d4280000.mmc: Tuning failed: no stable window found [ 1.650158] mmc0: tuning execution failed: -5 [ 1.772856] GPT:Primary header thinks Alt. header is not at the end of the disk. [ 1.777718] GPT:1135725 != 120930303 [ 1.781317] GPT:Alternate GPT header not at the end of the disk. [ 1.787397] GPT:1135725 != 120930303 [ 1.791022] GPT: Use GNU Parted to correct GPT errors. [ 1.796238] mmcblk0: p1 p2 p3 [ 1.917789] sdhci-spacemit d4280000.mmc: Tuning failed: no stable window found [ 1.922483] mmc0: tuning execution failed: -5 [ 2.174518] sdhci-spacemit d4280000.mmc: Tuning failed: no stable window found [ 2.179193] mmc0: tuning execution failed: -5 [ 2.337900] EXT4-fs (mmcblk0p3): mounted filesystem d1f9e739-cc74-4c48-a774-390717721c53 r/w with ordered data mode. Quota mode: disabled. [ 2.348031] VFS: Mounted root (ext4 filesystem) on device 179:3. [ 2.492089] sdhci-spacemit d4280000.mmc: Tuning failed: no stable window found [ 2.496771] mmc0: tuning execution failed: -5 [ 2.617641] devtmpfs: mounted [ 2.618771] Freeing unused kernel image (initmem) memory: 2432K [ 2.624085] Run /sbin/init as init process [ 2.749813] sdhci-spacemit d4280000.mmc: Tuning failed: no stable window found [ 2.754492] mmc0: tuning execution failed: -5 [ 3.013665] sdhci-spacemit d4280000.mmc: Tuning failed: no stable window found [ 3.018357] mmc0: tuning execution failed: -5 [ 3.279459] sdhci-spacemit d4280000.mmc: Tuning failed: no stable window found [ 3.284139] mmc0: tuning execution failed: -5 [ 3.541764] sdhci-spacemit d4280000.mmc: Tuning failed: no stable window found [ 3.546450] mmc0: tuning execution failed: -5 [ 3.665967] I/O error, dev mmcblk0, sector 259162 op 0x0:(READ) flags 0x880700 phys_seg 1 prio class 2 [ 3.672894] I/O error, dev mmcblk0, sector 259163 op 0x0:(READ) flags 0x880700 phys_seg 1 prio class 2 [ 3.683275] I/O error, dev mmcblk0, sector 259170 op 0x0:(READ) flags 0x880700 phys_seg 1 prio class 2 [ 3.691878] I/O error, dev mmcblk0, sector 259172 op 0x0:(READ) flags 0x880700 phys_seg 1 prio class 2 [ 3.701516] I/O error, dev mmcblk0, sector 259175 op 0x0:(READ) flags 0x880700 phys_seg 1 prio class 2 [ 3.711067] I/O error, dev mmcblk0, sector 259178 op 0x0:(READ) flags 0x880700 phys_seg 1 prio class 2 [ 3.720183] I/O error, dev mmcblk0, sector 259180 op 0x0:(READ) flags 0x880700 phys_seg 1 prio class 2 [ 3.730004] I/O error, dev mmcblk0, sector 259183 op 0x0:(READ) flags 0x880700 phys_seg 1 prio class 2 [ 3.739010] I/O error, dev mmcblk0, sector 259184 op 0x0:(READ) flags 0x880700 phys_seg 1 prio class 2 [ 3.888355] sdhci-spacemit d4280000.mmc: Tuning failed: no stable window found [ 3.893045] mmc0: tuning execution failed: -5 [ 4.149999] sdhci-spacemit d4280000.mmc: Tuning failed: no stable window found [ 4.154686] mmc0: tuning execution failed: -5 [ 4.283933] I/O error, dev mmcblk0, sector 209865 op 0x0:(READ) flags 0x803000 phys_seg 1 prio class 2 [ 4.290750] EXT4-fs warning (device mmcblk0p3): ext4_dx_find_entry:1726: inode #768: lblock 1: comm swapper/0: error -5 reading directory block [ 4.303879] Starting init: /sbin/init exists but couldn't execute it (error -5) [ 4.311194] Run /etc/init as init process [ 4.316220] Run /bin/init as init process [ 4.319996] Run /bin/sh as init process [ 4.457522] sdhci-spacemit d4280000.mmc: Tuning failed: no stable window found [ 4.462200] mmc0: tuning execution failed: -5 [ 4.719271] sdhci-spacemit d4280000.mmc: Tuning failed: no stable window found [ 4.723945] mmc0: tuning execution failed: -5 [ 4.842487] EXT4-fs warning (device mmcblk0p3): ext4_dx_find_entry:1726: inode #768: lblock 1: comm swapper/0: error -5 reading directory block [ 4.852959] Starting init: /bin/sh exists but couldn't execute it (error -5) [ 4.860044] Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance. [ 4.874394] CPU: 4 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.19.0-00008-ga23b3fad2d87 #1 NONE [ 4.883295] Hardware name: OrangePi RV2 (DT) I don't think I've missed anything between 6.19 and 7.x, but it's possible. It seems like there's a timing issue at play? Let me know if I can help with further testing. I'm also in #spacemit on IRC. _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 7/7] riscv: dts: spacemit: k1-orangepi-rv2: add SD card support with UHS modes 2026-03-13 13:54 ` Trevor Gamblin @ 2026-03-13 14:42 ` Anand Moon -1 siblings, 0 replies; 11+ messages in thread From: Anand Moon @ 2026-03-13 14:42 UTC (permalink / raw) To: Trevor Gamblin Cc: Iker Pedrosa, Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Adrian Hunter, Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan, Michael Opdenacker, Javier Martinez Canillas, linux-mmc, devicetree, linux-riscv, spacemit, linux-kernel Hi Trevor, On Fri, 13 Mar 2026 at 19:26, Trevor Gamblin <tgamblin@baylibre.com> wrote: > > > On 2026-03-09 07:40, Iker Pedrosa wrote: > > Add complete SD card controller support with UHS high-speed modes. > > > > - Enable sdhci0 controller with 4-bit bus width > > - Configure card detect GPIO with inversion > > - 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 > > > > This enables full SD card functionality including high-speed UHS modes > > for improved performance. > > > > Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com> > > --- > > arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts | 19 +++++++++++++++++++ > > 1 file changed, 19 insertions(+) > > > > diff --git a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts > > index 414b03f5e6480f05f5d7eeaaa0afb4e86425ae36..361135269801f436703b6f1d768c91325a52f07f 100644 > > --- a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts > > +++ b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts > > @@ -140,3 +140,22 @@ sd_vqmmc: aldo1 { > > }; > > }; > > }; > > + > > +&sdhci0 { > > + pinctrl-names = "default", "state_uhs"; > > + pinctrl-0 = <&mmc1_cfg>; > > + pinctrl-1 = <&mmc1_uhs_cfg>; > > + bus-width = <4>; > > + cd-gpios = <&gpio K1_GPIO(80) GPIO_ACTIVE_HIGH>; > > + cd-inverted; > > + no-mmc; > > + no-sdio; > > + disable-wp; > > + cap-sd-highspeed; > > + vmmc-supply = <&sd_vmmc>; > > + vqmmc-supply = <&sd_vqmmc>; > > + sd-uhs-sdr25; > > + sd-uhs-sdr50; > > + sd-uhs-sdr104; > > + status = "okay"; > > +}; > > > Hello again, > > Thanks for doing this work. My colleagues and I have been testing this > on an OrangePi RV2, and also a Muse Pi Pro board (making a similar tweak > to this patch in k1-musepi-pro.dts). To do the testing on my end, I'm > applying the patch series on top of 6.19 in a Yocto BSP. > > I've been finding that I see issues with the UHS support on my side > (this log comes from an image built and flashed to an SD card): > > > [ 1.072417] sdhci-spacemit d4280000.mmc: Got CD GPIO > [ 1.109741] mmc0: SDHCI controller on d4280000.mmc [d4280000.mmc] using > ADMA > [ 1.114589] clk: Disabling unused clocks > [ 1.118421] PM: genpd: Disabling unused power domains > [ 1.123249] ALSA device list: > [ 1.126[ 1.129949] check access for rdinit=/init failed: -2, ignoring > [ 1.133284] Waiting for root device > PARTUUID=e94bfdd7-a36f-4315-a480-476e2a12403d... > [ 1.176569] mmc0: new UHS-I speed DDR50 SDHC card at address aaaa > [ 1.180732] mmcblk0: mmc0:aaaa SS16G 14.8 GiB > [ 1.276268] mmcblk0: recovery failed! > [ 1.277351] I/O error, dev mmcblk0, sector 0 op 0x0:(READ) flags > 0x800000 phys_seg 1 prio class 2 > [ 1.286346] Buffer I/O error on dev mmcblk0, logical block 0, async page > read > [ 1.293891] mmcblk0: recovery failed! > [ 1.297289] I/O error, dev mmcblk0, sector 0 op 0x0:(READ) flags > 0x800000 phys_seg 1 prio class 2 > [ 1.306269] Buffer I/O error on dev mmcblk0, logical block 0, async page > read > [ 1.313522] mmcblk0: unable to read partition table > > > At first I wondered if maybe there was an issue with the card itself, > but by changing the sdhci0 section to this, I'm able to read the SD just > fine: > I used the same example on the K1-OrangePi-RV2 DTS, But it’s slightly different from the one you’re working with. I tested on the latest 7.0-rc3. > &sdhci0 { > pinctrl-names = "default"; > pinctrl-0 = <&mmc1_cfg>; > bus-width = <4>; > cd-gpios = <&gpio K1_GPIO(80) GPIO_ACTIVE_HIGH>; > cd-inverted; > no-mmc; > no-sdio; > disable-wp; > vmmc-supply = <&sd_vmmc>; > vqmmc-supply = <&sd_vqmmc>; > no-1-8-v; > status = "okay"; > }; > + +&sdhci0 { + pinctrl-names = "default", "state_uhs"; + pinctrl-0 = <&mmc1_cfg>; + pinctrl-1 = <&mmc1_uhs_cfg>; + bus-width = <4>; + cd-gpios = <&gpio K1_GPIO(80) GPIO_ACTIVE_HIGH>; + cd-inverted; + no-mmc; + no-sdio; + disable-wp; + cap-sd-highspeed; + vmmc-supply = <&sd_vmmc>; + vqmmc-supply = <&sd_vqmmc>; + sd-uhs-sdr25; + sd-uhs-sdr50; + sd-uhs-sdr104; + status = "okay"; +}; Thanks -Anand ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 7/7] riscv: dts: spacemit: k1-orangepi-rv2: add SD card support with UHS modes @ 2026-03-13 14:42 ` Anand Moon 0 siblings, 0 replies; 11+ messages in thread From: Anand Moon @ 2026-03-13 14:42 UTC (permalink / raw) To: Trevor Gamblin Cc: Iker Pedrosa, Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Adrian Hunter, Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan, Michael Opdenacker, Javier Martinez Canillas, linux-mmc, devicetree, linux-riscv, spacemit, linux-kernel Hi Trevor, On Fri, 13 Mar 2026 at 19:26, Trevor Gamblin <tgamblin@baylibre.com> wrote: > > > On 2026-03-09 07:40, Iker Pedrosa wrote: > > Add complete SD card controller support with UHS high-speed modes. > > > > - Enable sdhci0 controller with 4-bit bus width > > - Configure card detect GPIO with inversion > > - 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 > > > > This enables full SD card functionality including high-speed UHS modes > > for improved performance. > > > > Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com> > > --- > > arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts | 19 +++++++++++++++++++ > > 1 file changed, 19 insertions(+) > > > > diff --git a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts > > index 414b03f5e6480f05f5d7eeaaa0afb4e86425ae36..361135269801f436703b6f1d768c91325a52f07f 100644 > > --- a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts > > +++ b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts > > @@ -140,3 +140,22 @@ sd_vqmmc: aldo1 { > > }; > > }; > > }; > > + > > +&sdhci0 { > > + pinctrl-names = "default", "state_uhs"; > > + pinctrl-0 = <&mmc1_cfg>; > > + pinctrl-1 = <&mmc1_uhs_cfg>; > > + bus-width = <4>; > > + cd-gpios = <&gpio K1_GPIO(80) GPIO_ACTIVE_HIGH>; > > + cd-inverted; > > + no-mmc; > > + no-sdio; > > + disable-wp; > > + cap-sd-highspeed; > > + vmmc-supply = <&sd_vmmc>; > > + vqmmc-supply = <&sd_vqmmc>; > > + sd-uhs-sdr25; > > + sd-uhs-sdr50; > > + sd-uhs-sdr104; > > + status = "okay"; > > +}; > > > Hello again, > > Thanks for doing this work. My colleagues and I have been testing this > on an OrangePi RV2, and also a Muse Pi Pro board (making a similar tweak > to this patch in k1-musepi-pro.dts). To do the testing on my end, I'm > applying the patch series on top of 6.19 in a Yocto BSP. > > I've been finding that I see issues with the UHS support on my side > (this log comes from an image built and flashed to an SD card): > > > [ 1.072417] sdhci-spacemit d4280000.mmc: Got CD GPIO > [ 1.109741] mmc0: SDHCI controller on d4280000.mmc [d4280000.mmc] using > ADMA > [ 1.114589] clk: Disabling unused clocks > [ 1.118421] PM: genpd: Disabling unused power domains > [ 1.123249] ALSA device list: > [ 1.126[ 1.129949] check access for rdinit=/init failed: -2, ignoring > [ 1.133284] Waiting for root device > PARTUUID=e94bfdd7-a36f-4315-a480-476e2a12403d... > [ 1.176569] mmc0: new UHS-I speed DDR50 SDHC card at address aaaa > [ 1.180732] mmcblk0: mmc0:aaaa SS16G 14.8 GiB > [ 1.276268] mmcblk0: recovery failed! > [ 1.277351] I/O error, dev mmcblk0, sector 0 op 0x0:(READ) flags > 0x800000 phys_seg 1 prio class 2 > [ 1.286346] Buffer I/O error on dev mmcblk0, logical block 0, async page > read > [ 1.293891] mmcblk0: recovery failed! > [ 1.297289] I/O error, dev mmcblk0, sector 0 op 0x0:(READ) flags > 0x800000 phys_seg 1 prio class 2 > [ 1.306269] Buffer I/O error on dev mmcblk0, logical block 0, async page > read > [ 1.313522] mmcblk0: unable to read partition table > > > At first I wondered if maybe there was an issue with the card itself, > but by changing the sdhci0 section to this, I'm able to read the SD just > fine: > I used the same example on the K1-OrangePi-RV2 DTS, But it’s slightly different from the one you’re working with. I tested on the latest 7.0-rc3. > &sdhci0 { > pinctrl-names = "default"; > pinctrl-0 = <&mmc1_cfg>; > bus-width = <4>; > cd-gpios = <&gpio K1_GPIO(80) GPIO_ACTIVE_HIGH>; > cd-inverted; > no-mmc; > no-sdio; > disable-wp; > vmmc-supply = <&sd_vmmc>; > vqmmc-supply = <&sd_vqmmc>; > no-1-8-v; > status = "okay"; > }; > + +&sdhci0 { + pinctrl-names = "default", "state_uhs"; + pinctrl-0 = <&mmc1_cfg>; + pinctrl-1 = <&mmc1_uhs_cfg>; + bus-width = <4>; + cd-gpios = <&gpio K1_GPIO(80) GPIO_ACTIVE_HIGH>; + cd-inverted; + no-mmc; + no-sdio; + disable-wp; + cap-sd-highspeed; + vmmc-supply = <&sd_vmmc>; + vqmmc-supply = <&sd_vqmmc>; + sd-uhs-sdr25; + sd-uhs-sdr50; + sd-uhs-sdr104; + status = "okay"; +}; Thanks -Anand _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 7/7] riscv: dts: spacemit: k1-orangepi-rv2: add SD card support with UHS modes 2026-03-13 14:42 ` Anand Moon @ 2026-03-13 17:08 ` Trevor Gamblin -1 siblings, 0 replies; 11+ messages in thread From: Trevor Gamblin @ 2026-03-13 17:08 UTC (permalink / raw) To: Anand Moon Cc: Iker Pedrosa, Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Adrian Hunter, Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan, Michael Opdenacker, Javier Martinez Canillas, linux-mmc, devicetree, linux-riscv, spacemit, linux-kernel On 2026-03-13 10:42, Anand Moon wrote: > Hi Trevor, > > On Fri, 13 Mar 2026 at 19:26, Trevor Gamblin<tgamblin@baylibre.com> wrote: >> On 2026-03-09 07:40, Iker Pedrosa wrote: >>> Add complete SD card controller support with UHS high-speed modes. >>> >>> - Enable sdhci0 controller with 4-bit bus width >>> - Configure card detect GPIO with inversion >>> - 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 >>> >>> This enables full SD card functionality including high-speed UHS modes >>> for improved performance. >>> >>> Signed-off-by: Iker Pedrosa<ikerpedrosam@gmail.com> >>> --- >>> arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts | 19 +++++++++++++++++++ >>> 1 file changed, 19 insertions(+) >>> >>> diff --git a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts >>> index 414b03f5e6480f05f5d7eeaaa0afb4e86425ae36..361135269801f436703b6f1d768c91325a52f07f 100644 >>> --- a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts >>> +++ b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts >>> @@ -140,3 +140,22 @@ sd_vqmmc: aldo1 { >>> }; >>> }; >>> }; >>> + >>> +&sdhci0 { >>> + pinctrl-names = "default", "state_uhs"; >>> + pinctrl-0 = <&mmc1_cfg>; >>> + pinctrl-1 = <&mmc1_uhs_cfg>; >>> + bus-width = <4>; >>> + cd-gpios = <&gpio K1_GPIO(80) GPIO_ACTIVE_HIGH>; >>> + cd-inverted; >>> + no-mmc; >>> + no-sdio; >>> + disable-wp; >>> + cap-sd-highspeed; >>> + vmmc-supply = <&sd_vmmc>; >>> + vqmmc-supply = <&sd_vqmmc>; >>> + sd-uhs-sdr25; >>> + sd-uhs-sdr50; >>> + sd-uhs-sdr104; >>> + status = "okay"; >>> +}; >>> >> Hello again, >> >> Thanks for doing this work. My colleagues and I have been testing this >> on an OrangePi RV2, and also a Muse Pi Pro board (making a similar tweak >> to this patch in k1-musepi-pro.dts). To do the testing on my end, I'm >> applying the patch series on top of 6.19 in a Yocto BSP. >> >> I've been finding that I see issues with the UHS support on my side >> (this log comes from an image built and flashed to an SD card): >> >> >> [ 1.072417] sdhci-spacemit d4280000.mmc: Got CD GPIO >> [ 1.109741] mmc0: SDHCI controller on d4280000.mmc [d4280000.mmc] using >> ADMA >> [ 1.114589] clk: Disabling unused clocks >> [ 1.118421] PM: genpd: Disabling unused power domains >> [ 1.123249] ALSA device list: >> [ 1.126[ 1.129949] check access for rdinit=/init failed: -2, ignoring >> [ 1.133284] Waiting for root device >> PARTUUID=e94bfdd7-a36f-4315-a480-476e2a12403d... >> [ 1.176569] mmc0: new UHS-I speed DDR50 SDHC card at address aaaa >> [ 1.180732] mmcblk0: mmc0:aaaa SS16G 14.8 GiB >> [ 1.276268] mmcblk0: recovery failed! >> [ 1.277351] I/O error, dev mmcblk0, sector 0 op 0x0:(READ) flags >> 0x800000 phys_seg 1 prio class 2 >> [ 1.286346] Buffer I/O error on dev mmcblk0, logical block 0, async page >> read >> [ 1.293891] mmcblk0: recovery failed! >> [ 1.297289] I/O error, dev mmcblk0, sector 0 op 0x0:(READ) flags >> 0x800000 phys_seg 1 prio class 2 >> [ 1.306269] Buffer I/O error on dev mmcblk0, logical block 0, async page >> read >> [ 1.313522] mmcblk0: unable to read partition table >> >> >> At first I wondered if maybe there was an issue with the card itself, >> but by changing the sdhci0 section to this, I'm able to read the SD just >> fine: >> > I used the same example on the K1-OrangePi-RV2 DTS, > But it’s slightly different from the one you’re working with. > I tested on the latest 7.0-rc3. > >> &sdhci0 { >> pinctrl-names = "default"; >> pinctrl-0 = <&mmc1_cfg>; >> bus-width = <4>; >> cd-gpios = <&gpio K1_GPIO(80) GPIO_ACTIVE_HIGH>; >> cd-inverted; >> no-mmc; >> no-sdio; >> disable-wp; >> vmmc-supply = <&sd_vmmc>; >> vqmmc-supply = <&sd_vqmmc>; >> no-1-8-v; >> status = "okay"; >> }; >> > + > +&sdhci0 { > + pinctrl-names = "default", "state_uhs"; > + pinctrl-0 = <&mmc1_cfg>; > + pinctrl-1 = <&mmc1_uhs_cfg>; > + bus-width = <4>; > + cd-gpios = <&gpio K1_GPIO(80) GPIO_ACTIVE_HIGH>; > + cd-inverted; > + no-mmc; > + no-sdio; > + disable-wp; > + cap-sd-highspeed; > + vmmc-supply = <&sd_vmmc>; > + vqmmc-supply = <&sd_vqmmc>; > + sd-uhs-sdr25; > + sd-uhs-sdr50; > + sd-uhs-sdr104; > + status = "okay"; > +}; > > Thanks > -Anand Yes, my mistake - with 7.0-rc3 it works for me: [ 1.071767] sdhci-spacemit d4280000.mmc: Got CD GPIO [ 1.110368] mmc0: SDHCI controller on d4280000.mmc [d4280000.mmc] using ADMA [ 1.115231] clk: Disabling unused clocks [ 1.119072] PM: genpd: Disabling unused power domains [ 1.123875] ALSA device list: [ 1.1268[ 1.130718] Waiting for root device PARTUUID=e94bfdd7-a36f-4315-a480-476e2a12403d... [ 1.181158] mmc0: new UHS-I speed DDR50 SDHC card at address aaaa [ 1.185341] mmcblk0: mmc0:aaaa SS16G 14.8 GiB [ 1.198009] GPT:Primary header thinks Alt. header is not at the end of the disk. [ 1.202874] GPT:1134331 != 31116287 [ 1.206388] GPT:Alternate GPT header not at the end of the disk. [ 1.212468] GPT:1134331 != 31116287 [ 1.215993] GPT: Use GNU Parted to correct GPT errors. [ 1.221230] mmcblk0: p1 p2 p3 [ 1.529978] EXT4-fs (mmcblk0p3): mounted filesystem dbc76877-092e-4f8a-9f06-bf286309d8de r/w with ordered data mode. Quota mode: disabled. [ 1.540069] VFS: Mounted root (ext4 filesystem) on device 179:3. In which case: Tested-by: Trevor Gamblin <tgamblin@baylibre.com> ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 7/7] riscv: dts: spacemit: k1-orangepi-rv2: add SD card support with UHS modes @ 2026-03-13 17:08 ` Trevor Gamblin 0 siblings, 0 replies; 11+ messages in thread From: Trevor Gamblin @ 2026-03-13 17:08 UTC (permalink / raw) To: Anand Moon Cc: Iker Pedrosa, Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Adrian Hunter, Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan, Michael Opdenacker, Javier Martinez Canillas, linux-mmc, devicetree, linux-riscv, spacemit, linux-kernel On 2026-03-13 10:42, Anand Moon wrote: > Hi Trevor, > > On Fri, 13 Mar 2026 at 19:26, Trevor Gamblin<tgamblin@baylibre.com> wrote: >> On 2026-03-09 07:40, Iker Pedrosa wrote: >>> Add complete SD card controller support with UHS high-speed modes. >>> >>> - Enable sdhci0 controller with 4-bit bus width >>> - Configure card detect GPIO with inversion >>> - 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 >>> >>> This enables full SD card functionality including high-speed UHS modes >>> for improved performance. >>> >>> Signed-off-by: Iker Pedrosa<ikerpedrosam@gmail.com> >>> --- >>> arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts | 19 +++++++++++++++++++ >>> 1 file changed, 19 insertions(+) >>> >>> diff --git a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts >>> index 414b03f5e6480f05f5d7eeaaa0afb4e86425ae36..361135269801f436703b6f1d768c91325a52f07f 100644 >>> --- a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts >>> +++ b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts >>> @@ -140,3 +140,22 @@ sd_vqmmc: aldo1 { >>> }; >>> }; >>> }; >>> + >>> +&sdhci0 { >>> + pinctrl-names = "default", "state_uhs"; >>> + pinctrl-0 = <&mmc1_cfg>; >>> + pinctrl-1 = <&mmc1_uhs_cfg>; >>> + bus-width = <4>; >>> + cd-gpios = <&gpio K1_GPIO(80) GPIO_ACTIVE_HIGH>; >>> + cd-inverted; >>> + no-mmc; >>> + no-sdio; >>> + disable-wp; >>> + cap-sd-highspeed; >>> + vmmc-supply = <&sd_vmmc>; >>> + vqmmc-supply = <&sd_vqmmc>; >>> + sd-uhs-sdr25; >>> + sd-uhs-sdr50; >>> + sd-uhs-sdr104; >>> + status = "okay"; >>> +}; >>> >> Hello again, >> >> Thanks for doing this work. My colleagues and I have been testing this >> on an OrangePi RV2, and also a Muse Pi Pro board (making a similar tweak >> to this patch in k1-musepi-pro.dts). To do the testing on my end, I'm >> applying the patch series on top of 6.19 in a Yocto BSP. >> >> I've been finding that I see issues with the UHS support on my side >> (this log comes from an image built and flashed to an SD card): >> >> >> [ 1.072417] sdhci-spacemit d4280000.mmc: Got CD GPIO >> [ 1.109741] mmc0: SDHCI controller on d4280000.mmc [d4280000.mmc] using >> ADMA >> [ 1.114589] clk: Disabling unused clocks >> [ 1.118421] PM: genpd: Disabling unused power domains >> [ 1.123249] ALSA device list: >> [ 1.126[ 1.129949] check access for rdinit=/init failed: -2, ignoring >> [ 1.133284] Waiting for root device >> PARTUUID=e94bfdd7-a36f-4315-a480-476e2a12403d... >> [ 1.176569] mmc0: new UHS-I speed DDR50 SDHC card at address aaaa >> [ 1.180732] mmcblk0: mmc0:aaaa SS16G 14.8 GiB >> [ 1.276268] mmcblk0: recovery failed! >> [ 1.277351] I/O error, dev mmcblk0, sector 0 op 0x0:(READ) flags >> 0x800000 phys_seg 1 prio class 2 >> [ 1.286346] Buffer I/O error on dev mmcblk0, logical block 0, async page >> read >> [ 1.293891] mmcblk0: recovery failed! >> [ 1.297289] I/O error, dev mmcblk0, sector 0 op 0x0:(READ) flags >> 0x800000 phys_seg 1 prio class 2 >> [ 1.306269] Buffer I/O error on dev mmcblk0, logical block 0, async page >> read >> [ 1.313522] mmcblk0: unable to read partition table >> >> >> At first I wondered if maybe there was an issue with the card itself, >> but by changing the sdhci0 section to this, I'm able to read the SD just >> fine: >> > I used the same example on the K1-OrangePi-RV2 DTS, > But it’s slightly different from the one you’re working with. > I tested on the latest 7.0-rc3. > >> &sdhci0 { >> pinctrl-names = "default"; >> pinctrl-0 = <&mmc1_cfg>; >> bus-width = <4>; >> cd-gpios = <&gpio K1_GPIO(80) GPIO_ACTIVE_HIGH>; >> cd-inverted; >> no-mmc; >> no-sdio; >> disable-wp; >> vmmc-supply = <&sd_vmmc>; >> vqmmc-supply = <&sd_vqmmc>; >> no-1-8-v; >> status = "okay"; >> }; >> > + > +&sdhci0 { > + pinctrl-names = "default", "state_uhs"; > + pinctrl-0 = <&mmc1_cfg>; > + pinctrl-1 = <&mmc1_uhs_cfg>; > + bus-width = <4>; > + cd-gpios = <&gpio K1_GPIO(80) GPIO_ACTIVE_HIGH>; > + cd-inverted; > + no-mmc; > + no-sdio; > + disable-wp; > + cap-sd-highspeed; > + vmmc-supply = <&sd_vmmc>; > + vqmmc-supply = <&sd_vqmmc>; > + sd-uhs-sdr25; > + sd-uhs-sdr50; > + sd-uhs-sdr104; > + status = "okay"; > +}; > > Thanks > -Anand Yes, my mistake - with 7.0-rc3 it works for me: [ 1.071767] sdhci-spacemit d4280000.mmc: Got CD GPIO [ 1.110368] mmc0: SDHCI controller on d4280000.mmc [d4280000.mmc] using ADMA [ 1.115231] clk: Disabling unused clocks [ 1.119072] PM: genpd: Disabling unused power domains [ 1.123875] ALSA device list: [ 1.1268[ 1.130718] Waiting for root device PARTUUID=e94bfdd7-a36f-4315-a480-476e2a12403d... [ 1.181158] mmc0: new UHS-I speed DDR50 SDHC card at address aaaa [ 1.185341] mmcblk0: mmc0:aaaa SS16G 14.8 GiB [ 1.198009] GPT:Primary header thinks Alt. header is not at the end of the disk. [ 1.202874] GPT:1134331 != 31116287 [ 1.206388] GPT:Alternate GPT header not at the end of the disk. [ 1.212468] GPT:1134331 != 31116287 [ 1.215993] GPT: Use GNU Parted to correct GPT errors. [ 1.221230] mmcblk0: p1 p2 p3 [ 1.529978] EXT4-fs (mmcblk0p3): mounted filesystem dbc76877-092e-4f8a-9f06-bf286309d8de r/w with ordered data mode. Quota mode: disabled. [ 1.540069] VFS: Mounted root (ext4 filesystem) on device 179:3. In which case: Tested-by: Trevor Gamblin <tgamblin@baylibre.com> _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2026-03-13 17:08 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-03-12 3:18 [PATCH v2 7/7] riscv: dts: spacemit: k1-orangepi-rv2: add SD card support with UHS modes kernel test robot -- strict thread matches above, loose matches on Subject: below -- 2026-03-09 11:40 [PATCH v2 0/7] riscv: spacemit: enable SD card support with UHS modes for OrangePi RV2 Iker Pedrosa 2026-03-09 11:40 ` [PATCH v2 7/7] riscv: dts: spacemit: k1-orangepi-rv2: add SD card support with UHS modes Iker Pedrosa 2026-03-09 11:40 ` Iker Pedrosa 2026-03-13 11:20 ` Anand Moon 2026-03-13 11:20 ` Anand Moon 2026-03-13 13:54 ` Trevor Gamblin 2026-03-13 13:54 ` Trevor Gamblin 2026-03-13 14:42 ` Anand Moon 2026-03-13 14:42 ` Anand Moon 2026-03-13 17:08 ` Trevor Gamblin 2026-03-13 17:08 ` Trevor Gamblin
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.