public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] arm: dts: rockchip: Fix eMMC write on RK3528
@ 2025-06-13 22:43 Jonas Karlman
  2025-06-15 18:02 ` Tom Rini
  2025-10-30 18:12 ` Tianling Shen
  0 siblings, 2 replies; 6+ messages in thread
From: Jonas Karlman @ 2025-06-13 22:43 UTC (permalink / raw)
  To: Kever Yang, Simon Glass, Philipp Tomsich, Jonas Karlman, Tom Rini
  Cc: Yao Zi, Chukun Pan, u-boot

Writing to eMMC on RK3528 is affected with the same or a similar issue
as on RK3588, where eMMC must init to HS200 at least once to fully work.

Trying to write u-boot-rockchip.bin to eMMC fails with:

  => mmc write $fileaddr 40 5000
  MMC write: dev # 0, block # 64, count 20480 ... mmc write failed
  0 blocks written: ERROR

For U-Boot to enable HS200 mode the mmc-hs200-1_8v prop must be defined
in the device tree. Linux does not seem to be affected and is able to
detect and use HS200 without this prop.

Enable use of HS200 and fix eMMC write on RK3528 by adding the missing
mmc-hs200-1_8v prop for affected boards:

  => mmc write $fileaddr 40 5000
  MMC write: dev # 0, block # 64, count 20480 ... 20480 blocks written: OK

Fixes: b112a44531cb ("board: rockchip: Add minimal generic RK3528 board")
Fixes: ccbddf645310 ("board: rockchip: Add Radxa E20C")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
---
Kever, Tom: Please consider this for the v2025.07 release as support for
RK3528 was added in v2025.07-rc1.
---
 arch/arm/dts/rk3528-generic.dts            | 1 +
 arch/arm/dts/rk3528-radxa-e20c-u-boot.dtsi | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/arch/arm/dts/rk3528-generic.dts b/arch/arm/dts/rk3528-generic.dts
index 792d3e04a4cb..3f6f0bed108d 100644
--- a/arch/arm/dts/rk3528-generic.dts
+++ b/arch/arm/dts/rk3528-generic.dts
@@ -18,6 +18,7 @@
 &sdhci {
 	bus-width = <8>;
 	cap-mmc-highspeed;
+	mmc-hs200-1_8v;
 	no-sd;
 	no-sdio;
 	non-removable;
diff --git a/arch/arm/dts/rk3528-radxa-e20c-u-boot.dtsi b/arch/arm/dts/rk3528-radxa-e20c-u-boot.dtsi
index 9c2f03a786cf..1372d8f1e38a 100644
--- a/arch/arm/dts/rk3528-radxa-e20c-u-boot.dtsi
+++ b/arch/arm/dts/rk3528-radxa-e20c-u-boot.dtsi
@@ -2,6 +2,10 @@
 
 #include "rk3528-u-boot.dtsi"
 
+&sdhci {
+	mmc-hs200-1_8v;
+};
+
 &sdmmc {
 	bus-width = <4>;
 	cap-mmc-highspeed;
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] arm: dts: rockchip: Fix eMMC write on RK3528
  2025-06-13 22:43 [PATCH] arm: dts: rockchip: Fix eMMC write on RK3528 Jonas Karlman
@ 2025-06-15 18:02 ` Tom Rini
  2025-10-30 18:12 ` Tianling Shen
  1 sibling, 0 replies; 6+ messages in thread
From: Tom Rini @ 2025-06-15 18:02 UTC (permalink / raw)
  To: Kever Yang, Simon Glass, Philipp Tomsich, Jonas Karlman
  Cc: Yao Zi, Chukun Pan, u-boot

On Fri, 13 Jun 2025 22:43:40 +0000, Jonas Karlman wrote:

> Writing to eMMC on RK3528 is affected with the same or a similar issue
> as on RK3588, where eMMC must init to HS200 at least once to fully work.
> 
> Trying to write u-boot-rockchip.bin to eMMC fails with:
> 
>   => mmc write $fileaddr 40 5000
>   MMC write: dev # 0, block # 64, count 20480 ... mmc write failed
>   0 blocks written: ERROR
> 
> [...]

Applied to u-boot/master, thanks!

[1/1] arm: dts: rockchip: Fix eMMC write on RK3528
      commit: f8cb3fde935ed003ad1d7cf6a06d59586fe65cd5
-- 
Tom



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] arm: dts: rockchip: Fix eMMC write on RK3528
  2025-06-13 22:43 [PATCH] arm: dts: rockchip: Fix eMMC write on RK3528 Jonas Karlman
  2025-06-15 18:02 ` Tom Rini
@ 2025-10-30 18:12 ` Tianling Shen
  2025-10-30 19:41   ` Jonas Karlman
  1 sibling, 1 reply; 6+ messages in thread
From: Tianling Shen @ 2025-10-30 18:12 UTC (permalink / raw)
  To: Jonas Karlman, Kever Yang, Simon Glass, Philipp Tomsich, Tom Rini; +Cc: u-boot

Hi Jonas,

On 2025/6/14 6:43, Jonas Karlman wrote:
> Writing to eMMC on RK3528 is affected with the same or a similar issue
> as on RK3588, where eMMC must init to HS200 at least once to fully work.
> 
> Trying to write u-boot-rockchip.bin to eMMC fails with:
> 
>    => mmc write $fileaddr 40 5000
>    MMC write: dev # 0, block # 64, count 20480 ... mmc write failed
>    0 blocks written: ERROR
> 
> For U-Boot to enable HS200 mode the mmc-hs200-1_8v prop must be defined
> in the device tree. Linux does not seem to be affected and is able to
> detect and use HS200 without this prop.
> 
> Enable use of HS200 and fix eMMC write on RK3528 by adding the missing
> mmc-hs200-1_8v prop for affected boards:
> 
>    => mmc write $fileaddr 40 5000
>    MMC write: dev # 0, block # 64, count 20480 ... 20480 blocks written: OK
> 

Sorry for the noise.

I recently got an E20C board, and I ran into a very stange issue, the 
U-Boot throw errors with any mmc r/w operation, like `boot` or `mmc erase`:

```
=> boot
Scanning for bootflows in all bootdevs
Seq  Method       State   Uclass    Part  Name                      Filename
---  -----------  ------  --------  ----  ------------------------ 
----------------
Scanning global bootmeth 'efi_mgr':
  ** fs_devread read error - block
  ** fs_devread read error - block
Card did not respond to voltage select! : -110
Cannot persist EFI variables without system partition
   0  efi_mgr      ready   (none)       0  <NULL>
** Booting bootflow '<NULL>' with efi_mgr
Loading Boot0000 'mmc 0' failed
EFI boot manager: Cannot load any image
Boot failed (err=-14)
Scanning bootdev 'mmc@ffc30000.bootdev':
Card did not respond to voltage select! : -110
Card did not respond to voltage select! : -110
Card did not respond to voltage select! : -110
Card did not respond to voltage select! : -110
Scanning bootdev 'mmc@ffbf0000.bootdev':
  ** fs_devread read error - block
  ** fs_devread read error - block
  ** fs_devread read error - block
Unknown uclass 'nvme' in label
Unknown uclass 'scsi' in label
No USB controllers found
Scanning bootdev 'ethernet@ffbe0000.bootdev':
ethernet@ffbe0000 Waiting for PHY auto negotiation to complete..user 
interrupt!
phy_startup() failed: -4
FAILED: -4
BOOTP broadcast 1

=> mmc read $loadaddr 0x40 0x4000
MMC read: dev # 0, block # 64, count 16384 ... 0 blocks read: ERROR

=> mmc erase 0x40 0x4000
MMC erase: dev # 0, block # 64, count 16384 ... mmc erase failed
0 blocks erased: ERROR

=> mmc part

Partition Map for mmc device 0  --   Partition Type: DOS

Part	Start Sector	Num Sectors	UUID		Type
** Can't read partition table on 0:0 **
```

By checking the mmc information:
```
=> mmc info
Device: mmc@ffbf0000
Manufacturer ID: ef
OEM: 0
Name: TLi16G
Bus Speed: 200000000
Mode: HS200 (200MHz)
Rd Block Len: 512
MMC version 5.1
High Capacity: Yes
Capacity: 14.7 GiB
Bus Width: 4-bit
Erase Group Size: 512 KiB
HC WP Group Size: 128 MiB
User Capacity: 14.7 GiB WRREL
Boot Capacity: 4 MiB ENH
RPMB Capacity: 4 MiB ENH
```

I found the bus width is not corrent, and no "Boot area X is not write 
protected" tip.

This is the working `mmc info` output:
```
Device: mmc@ffbf0000
Manufacturer ID: ef
OEM: 0
Name: TLi16G
Bus Speed: 200000000
Mode: HS200 (200MHz)
Rd Block Len: 512
MMC version 5.1
High Capacity: Yes
Capacity: 14.7 GiB
Bus Width: 8-bit
Erase Group Size: 512 KiB
HC WP Group Size: 128 MiB
User Capacity: 14.7 GiB WRREL
Boot Capacity: 4 MiB ENH
RPMB Capacity: 4 MiB ENH
Boot area 0 is not write protected
Boot area 1 is not write protected
```

I tried to use the generic-rk3528 configuration, and it seems to work.
After making some tests (about 50 times reboot/reset), I found the eMMC 
works fine if `CONFIG_REGULATOR_PWM=y` is disabled.
This is a bit weird. Maybe disabling this option just hides the real issue?

Here's the build information:
U-Boot commit: 4cad9faf8d28 ("MAINTAINERS: update my email address")
rkbin commit: 74213af1e952 ("rv1126b: bl31: update version to v1.07")
Build command:
make CROSS_COMPILE=aarch64-linux-musl- 
BL31=../rkbin/bin/rk35/rk3528_bl31_v1.20.elf 
ROCKCHIP_TPL=../rkbin/bin/rk35/rk3528_ddr_1056MHz_v1.11.bin

Any help will be greatly appreciated!

Thanks,
Tianling.

> Fixes: b112a44531cb ("board: rockchip: Add minimal generic RK3528 board")
> Fixes: ccbddf645310 ("board: rockchip: Add Radxa E20C")
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
> ---
> Kever, Tom: Please consider this for the v2025.07 release as support for
> RK3528 was added in v2025.07-rc1.
> ---
>   arch/arm/dts/rk3528-generic.dts            | 1 +
>   arch/arm/dts/rk3528-radxa-e20c-u-boot.dtsi | 4 ++++
>   2 files changed, 5 insertions(+)
> 
> diff --git a/arch/arm/dts/rk3528-generic.dts b/arch/arm/dts/rk3528-generic.dts
> index 792d3e04a4cb..3f6f0bed108d 100644
> --- a/arch/arm/dts/rk3528-generic.dts
> +++ b/arch/arm/dts/rk3528-generic.dts
> @@ -18,6 +18,7 @@
>   &sdhci {
>   	bus-width = <8>;
>   	cap-mmc-highspeed;
> +	mmc-hs200-1_8v;
>   	no-sd;
>   	no-sdio;
>   	non-removable;
> diff --git a/arch/arm/dts/rk3528-radxa-e20c-u-boot.dtsi b/arch/arm/dts/rk3528-radxa-e20c-u-boot.dtsi
> index 9c2f03a786cf..1372d8f1e38a 100644
> --- a/arch/arm/dts/rk3528-radxa-e20c-u-boot.dtsi
> +++ b/arch/arm/dts/rk3528-radxa-e20c-u-boot.dtsi
> @@ -2,6 +2,10 @@
>   
>   #include "rk3528-u-boot.dtsi"
>   
> +&sdhci {
> +	mmc-hs200-1_8v;
> +};
> +
>   &sdmmc {
>   	bus-width = <4>;
>   	cap-mmc-highspeed;


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] arm: dts: rockchip: Fix eMMC write on RK3528
  2025-10-30 18:12 ` Tianling Shen
@ 2025-10-30 19:41   ` Jonas Karlman
  2025-10-31  9:40     ` Tianling Shen
  0 siblings, 1 reply; 6+ messages in thread
From: Jonas Karlman @ 2025-10-30 19:41 UTC (permalink / raw)
  To: Tianling Shen; +Cc: Kever Yang, Simon Glass, Philipp Tomsich, Tom Rini, u-boot

Hi Tianling,

On 10/30/2025 7:12 PM, Tianling Shen wrote:
> Hi Jonas,
> 
> On 2025/6/14 6:43, Jonas Karlman wrote:
>> Writing to eMMC on RK3528 is affected with the same or a similar issue
>> as on RK3588, where eMMC must init to HS200 at least once to fully work.
>>
>> Trying to write u-boot-rockchip.bin to eMMC fails with:
>>
>>    => mmc write $fileaddr 40 5000
>>    MMC write: dev # 0, block # 64, count 20480 ... mmc write failed
>>    0 blocks written: ERROR
>>
>> For U-Boot to enable HS200 mode the mmc-hs200-1_8v prop must be defined
>> in the device tree. Linux does not seem to be affected and is able to
>> detect and use HS200 without this prop.
>>
>> Enable use of HS200 and fix eMMC write on RK3528 by adding the missing
>> mmc-hs200-1_8v prop for affected boards:
>>
>>    => mmc write $fileaddr 40 5000
>>    MMC write: dev # 0, block # 64, count 20480 ... 20480 blocks written: OK
>>
> 
> Sorry for the noise.
> 
> I recently got an E20C board, and I ran into a very stange issue, the 
> U-Boot throw errors with any mmc r/w operation, like `boot` or `mmc erase`:
> 
> ```
> => boot
> Scanning for bootflows in all bootdevs
> Seq  Method       State   Uclass    Part  Name                      Filename
> ---  -----------  ------  --------  ----  ------------------------ 
> ----------------
> Scanning global bootmeth 'efi_mgr':
>   ** fs_devread read error - block
>   ** fs_devread read error - block
> Card did not respond to voltage select! : -110
> Cannot persist EFI variables without system partition
>    0  efi_mgr      ready   (none)       0  <NULL>
> ** Booting bootflow '<NULL>' with efi_mgr
> Loading Boot0000 'mmc 0' failed
> EFI boot manager: Cannot load any image
> Boot failed (err=-14)
> Scanning bootdev 'mmc@ffc30000.bootdev':
> Card did not respond to voltage select! : -110
> Card did not respond to voltage select! : -110
> Card did not respond to voltage select! : -110
> Card did not respond to voltage select! : -110
> Scanning bootdev 'mmc@ffbf0000.bootdev':
>   ** fs_devread read error - block
>   ** fs_devread read error - block
>   ** fs_devread read error - block
> Unknown uclass 'nvme' in label
> Unknown uclass 'scsi' in label
> No USB controllers found
> Scanning bootdev 'ethernet@ffbe0000.bootdev':
> ethernet@ffbe0000 Waiting for PHY auto negotiation to complete..user 
> interrupt!
> phy_startup() failed: -4
> FAILED: -4
> BOOTP broadcast 1
> 
> => mmc read $loadaddr 0x40 0x4000
> MMC read: dev # 0, block # 64, count 16384 ... 0 blocks read: ERROR
> 
> => mmc erase 0x40 0x4000
> MMC erase: dev # 0, block # 64, count 16384 ... mmc erase failed
> 0 blocks erased: ERROR
> 
> => mmc part
> 
> Partition Map for mmc device 0  --   Partition Type: DOS
> 
> Part	Start Sector	Num Sectors	UUID		Type
> ** Can't read partition table on 0:0 **
> ```
> 
> By checking the mmc information:
> ```
> => mmc info
> Device: mmc@ffbf0000
> Manufacturer ID: ef
> OEM: 0
> Name: TLi16G
> Bus Speed: 200000000
> Mode: HS200 (200MHz)
> Rd Block Len: 512
> MMC version 5.1
> High Capacity: Yes
> Capacity: 14.7 GiB
> Bus Width: 4-bit
> Erase Group Size: 512 KiB
> HC WP Group Size: 128 MiB
> User Capacity: 14.7 GiB WRREL
> Boot Capacity: 4 MiB ENH
> RPMB Capacity: 4 MiB ENH
> ```
> 
> I found the bus width is not corrent, and no "Boot area X is not write 
> protected" tip.
> 
> This is the working `mmc info` output:
> ```
> Device: mmc@ffbf0000
> Manufacturer ID: ef
> OEM: 0
> Name: TLi16G
> Bus Speed: 200000000
> Mode: HS200 (200MHz)
> Rd Block Len: 512
> MMC version 5.1
> High Capacity: Yes
> Capacity: 14.7 GiB
> Bus Width: 8-bit
> Erase Group Size: 512 KiB
> HC WP Group Size: 128 MiB
> User Capacity: 14.7 GiB WRREL
> Boot Capacity: 4 MiB ENH
> RPMB Capacity: 4 MiB ENH
> Boot area 0 is not write protected
> Boot area 1 is not write protected
> ```
> 
> I tried to use the generic-rk3528 configuration, and it seems to work.
> After making some tests (about 50 times reboot/reset), I found the eMMC 
> works fine if `CONFIG_REGULATOR_PWM=y` is disabled.
> This is a bit weird. Maybe disabling this option just hides the real issue?

Interesting information and thanks for testing!

Without REGULATOR_PWM=y the cpu and logic regulators will keep their reset
init values instead of U-Boot trying to configure these pwm regulators.

The generic-rk3528 target does not include information about any of these
regulators so they would keep using the reset init values.

There could be two issues related to this, first both the pwm regulator
and rk pwm driver are not fully aligned with Linux and round values a
little bit different. I have some local work-in-progress patches that I
should complete and send out to fix this discrepancy.

The second issue could be that the logic regulator should be configured
with a higher regulator-init-microvolt value so that U-Boot do not
re-configure the regulator with a lower voltage than it has after reset.

Did your testing also include the "mmc: rockchip_sdhci: Set xx_TAP_VALUE
for RK3528" [1] patch?

> 
> Here's the build information:
> U-Boot commit: 4cad9faf8d28 ("MAINTAINERS: update my email address")
> rkbin commit: 74213af1e952 ("rv1126b: bl31: update version to v1.07")
> Build command:
> make CROSS_COMPILE=aarch64-linux-musl- 
> BL31=../rkbin/bin/rk35/rk3528_bl31_v1.20.elf 
> ROCKCHIP_TPL=../rkbin/bin/rk35/rk3528_ddr_1056MHz_v1.11.bin

I will make some runtime test on my E20C using these as a base and see
if I can replicate a similar issue.

I have also pushed my local pwm-regulator/rk-pwm relates patches to [2],
they need some re-work before being ready to be sent out.

[1] https://lore.kernel.org/u-boot/20250714203410.1782783-1-jonas@kwiboo.se/
[2] https://source.denx.de/u-boot/contributors/kwiboo/u-boot/-/commits/rk3528

Regards,
Jonas

> 
> Any help will be greatly appreciated!
> 
> Thanks,
> Tianling.
> 
>> Fixes: b112a44531cb ("board: rockchip: Add minimal generic RK3528 board")
>> Fixes: ccbddf645310 ("board: rockchip: Add Radxa E20C")
>> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
>> ---
>> Kever, Tom: Please consider this for the v2025.07 release as support for
>> RK3528 was added in v2025.07-rc1.
>> ---
>>   arch/arm/dts/rk3528-generic.dts            | 1 +
>>   arch/arm/dts/rk3528-radxa-e20c-u-boot.dtsi | 4 ++++
>>   2 files changed, 5 insertions(+)
>>
>> diff --git a/arch/arm/dts/rk3528-generic.dts b/arch/arm/dts/rk3528-generic.dts
>> index 792d3e04a4cb..3f6f0bed108d 100644
>> --- a/arch/arm/dts/rk3528-generic.dts
>> +++ b/arch/arm/dts/rk3528-generic.dts
>> @@ -18,6 +18,7 @@
>>   &sdhci {
>>   	bus-width = <8>;
>>   	cap-mmc-highspeed;
>> +	mmc-hs200-1_8v;
>>   	no-sd;
>>   	no-sdio;
>>   	non-removable;
>> diff --git a/arch/arm/dts/rk3528-radxa-e20c-u-boot.dtsi b/arch/arm/dts/rk3528-radxa-e20c-u-boot.dtsi
>> index 9c2f03a786cf..1372d8f1e38a 100644
>> --- a/arch/arm/dts/rk3528-radxa-e20c-u-boot.dtsi
>> +++ b/arch/arm/dts/rk3528-radxa-e20c-u-boot.dtsi
>> @@ -2,6 +2,10 @@
>>   
>>   #include "rk3528-u-boot.dtsi"
>>   
>> +&sdhci {
>> +	mmc-hs200-1_8v;
>> +};
>> +
>>   &sdmmc {
>>   	bus-width = <4>;
>>   	cap-mmc-highspeed;
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] arm: dts: rockchip: Fix eMMC write on RK3528
  2025-10-30 19:41   ` Jonas Karlman
@ 2025-10-31  9:40     ` Tianling Shen
  2025-11-06  9:22       ` Tianling Shen
  0 siblings, 1 reply; 6+ messages in thread
From: Tianling Shen @ 2025-10-31  9:40 UTC (permalink / raw)
  To: Jonas Karlman; +Cc: Kever Yang, Simon Glass, Philipp Tomsich, Tom Rini, u-boot

On 2025/10/31 3:41, Jonas Karlman wrote:
> Hi Tianling,
> 
> On 10/30/2025 7:12 PM, Tianling Shen wrote:
>> Hi Jonas,
>>
>> On 2025/6/14 6:43, Jonas Karlman wrote:
>>> Writing to eMMC on RK3528 is affected with the same or a similar issue
>>> as on RK3588, where eMMC must init to HS200 at least once to fully work.
>>>
>>> Trying to write u-boot-rockchip.bin to eMMC fails with:
>>>
>>>     => mmc write $fileaddr 40 5000
>>>     MMC write: dev # 0, block # 64, count 20480 ... mmc write failed
>>>     0 blocks written: ERROR
>>>
>>> For U-Boot to enable HS200 mode the mmc-hs200-1_8v prop must be defined
>>> in the device tree. Linux does not seem to be affected and is able to
>>> detect and use HS200 without this prop.
>>>
>>> Enable use of HS200 and fix eMMC write on RK3528 by adding the missing
>>> mmc-hs200-1_8v prop for affected boards:
>>>
>>>     => mmc write $fileaddr 40 5000
>>>     MMC write: dev # 0, block # 64, count 20480 ... 20480 blocks written: OK
>>>
>>
>> Sorry for the noise.
>>
>> I recently got an E20C board, and I ran into a very stange issue, the
>> U-Boot throw errors with any mmc r/w operation, like `boot` or `mmc erase`:
>>

<snip>

>>
>> I tried to use the generic-rk3528 configuration, and it seems to work.
>> After making some tests (about 50 times reboot/reset), I found the eMMC
>> works fine if `CONFIG_REGULATOR_PWM=y` is disabled.
>> This is a bit weird. Maybe disabling this option just hides the real issue?
> 
> Interesting information and thanks for testing!
> 
> Without REGULATOR_PWM=y the cpu and logic regulators will keep their reset
> init values instead of U-Boot trying to configure these pwm regulators.
> 
> The generic-rk3528 target does not include information about any of these
> regulators so they would keep using the reset init values.
> 
> There could be two issues related to this, first both the pwm regulator
> and rk pwm driver are not fully aligned with Linux and round values a
> little bit different. I have some local work-in-progress patches that I
> should complete and send out to fix this discrepancy.
> 
> The second issue could be that the logic regulator should be configured
> with a higher regulator-init-microvolt value so that U-Boot do not
> re-configure the regulator with a lower voltage than it has after reset.
> 
> Did your testing also include the "mmc: rockchip_sdhci: Set xx_TAP_VALUE
> for RK3528" [1] patch?

Thank you for the quick reply!

I tested this patch and it works like a charm (30 times soft reboot + 10 
times cold boot).

> 
>>
>> Here's the build information:
>> U-Boot commit: 4cad9faf8d28 ("MAINTAINERS: update my email address")
>> rkbin commit: 74213af1e952 ("rv1126b: bl31: update version to v1.07")
>> Build command:
>> make CROSS_COMPILE=aarch64-linux-musl-
>> BL31=../rkbin/bin/rk35/rk3528_bl31_v1.20.elf
>> ROCKCHIP_TPL=../rkbin/bin/rk35/rk3528_ddr_1056MHz_v1.11.bin
> 
> I will make some runtime test on my E20C using these as a base and see
> if I can replicate a similar issue.
> 
> I have also pushed my local pwm-regulator/rk-pwm relates patches to [2],
> they need some re-work before being ready to be sent out.

I have tested this patchset, and the eMMC works as well even without the 
rockchip_sdhci patch/commit applied.

I will make more tests these days and report then ;)
Many thanks again!

Thanks,
Tianling.

> 
> [1] https://lore.kernel.org/u-boot/20250714203410.1782783-1-jonas@kwiboo.se/
> [2] https://source.denx.de/u-boot/contributors/kwiboo/u-boot/-/commits/rk3528
> 
> Regards,
> Jonas
> 
>>
>> Any help will be greatly appreciated!
>>
>> Thanks,
>> Tianling.
>>
>>> Fixes: b112a44531cb ("board: rockchip: Add minimal generic RK3528 board")
>>> Fixes: ccbddf645310 ("board: rockchip: Add Radxa E20C")
>>> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
>>> ---
>>> Kever, Tom: Please consider this for the v2025.07 release as support for
>>> RK3528 was added in v2025.07-rc1.
>>> ---
>>>    arch/arm/dts/rk3528-generic.dts            | 1 +
>>>    arch/arm/dts/rk3528-radxa-e20c-u-boot.dtsi | 4 ++++
>>>    2 files changed, 5 insertions(+)
>>>
>>> diff --git a/arch/arm/dts/rk3528-generic.dts b/arch/arm/dts/rk3528-generic.dts
>>> index 792d3e04a4cb..3f6f0bed108d 100644
>>> --- a/arch/arm/dts/rk3528-generic.dts
>>> +++ b/arch/arm/dts/rk3528-generic.dts
>>> @@ -18,6 +18,7 @@
>>>    &sdhci {
>>>    	bus-width = <8>;
>>>    	cap-mmc-highspeed;
>>> +	mmc-hs200-1_8v;
>>>    	no-sd;
>>>    	no-sdio;
>>>    	non-removable;
>>> diff --git a/arch/arm/dts/rk3528-radxa-e20c-u-boot.dtsi b/arch/arm/dts/rk3528-radxa-e20c-u-boot.dtsi
>>> index 9c2f03a786cf..1372d8f1e38a 100644
>>> --- a/arch/arm/dts/rk3528-radxa-e20c-u-boot.dtsi
>>> +++ b/arch/arm/dts/rk3528-radxa-e20c-u-boot.dtsi
>>> @@ -2,6 +2,10 @@
>>>    
>>>    #include "rk3528-u-boot.dtsi"
>>>    
>>> +&sdhci {
>>> +	mmc-hs200-1_8v;
>>> +};
>>> +
>>>    &sdmmc {
>>>    	bus-width = <4>;
>>>    	cap-mmc-highspeed;
>>
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] arm: dts: rockchip: Fix eMMC write on RK3528
  2025-10-31  9:40     ` Tianling Shen
@ 2025-11-06  9:22       ` Tianling Shen
  0 siblings, 0 replies; 6+ messages in thread
From: Tianling Shen @ 2025-11-06  9:22 UTC (permalink / raw)
  To: Jonas Karlman; +Cc: Kever Yang, Simon Glass, Philipp Tomsich, Tom Rini, u-boot

On 2025/10/31 17:40, Tianling Shen wrote:
> On 2025/10/31 3:41, Jonas Karlman wrote:
>> Hi Tianling,
>>
>> On 10/30/2025 7:12 PM, Tianling Shen wrote:
>>> Hi Jonas,
>>>
>>> On 2025/6/14 6:43, Jonas Karlman wrote:
>>>> Writing to eMMC on RK3528 is affected with the same or a similar issue
>>>> as on RK3588, where eMMC must init to HS200 at least once to fully 
>>>> work.
>>>>
>>>> Trying to write u-boot-rockchip.bin to eMMC fails with:
>>>>
>>>>     => mmc write $fileaddr 40 5000
>>>>     MMC write: dev # 0, block # 64, count 20480 ... mmc write failed
>>>>     0 blocks written: ERROR
>>>>
>>>> For U-Boot to enable HS200 mode the mmc-hs200-1_8v prop must be defined
>>>> in the device tree. Linux does not seem to be affected and is able to
>>>> detect and use HS200 without this prop.
>>>>
>>>> Enable use of HS200 and fix eMMC write on RK3528 by adding the missing
>>>> mmc-hs200-1_8v prop for affected boards:
>>>>
>>>>     => mmc write $fileaddr 40 5000
>>>>     MMC write: dev # 0, block # 64, count 20480 ... 20480 blocks 
>>>> written: OK
>>>>
>>>
>>> Sorry for the noise.
>>>
>>> I recently got an E20C board, and I ran into a very stange issue, the
>>> U-Boot throw errors with any mmc r/w operation, like `boot` or `mmc 
>>> erase`:
>>>
> 
> <snip>
> 
>>>
>>> I tried to use the generic-rk3528 configuration, and it seems to work.
>>> After making some tests (about 50 times reboot/reset), I found the eMMC
>>> works fine if `CONFIG_REGULATOR_PWM=y` is disabled.
>>> This is a bit weird. Maybe disabling this option just hides the real 
>>> issue?
>>
>> Interesting information and thanks for testing!
>>
>> Without REGULATOR_PWM=y the cpu and logic regulators will keep their 
>> reset
>> init values instead of U-Boot trying to configure these pwm regulators.
>>
>> The generic-rk3528 target does not include information about any of these
>> regulators so they would keep using the reset init values.
>>
>> There could be two issues related to this, first both the pwm regulator
>> and rk pwm driver are not fully aligned with Linux and round values a
>> little bit different. I have some local work-in-progress patches that I
>> should complete and send out to fix this discrepancy.
>>
>> The second issue could be that the logic regulator should be configured
>> with a higher regulator-init-microvolt value so that U-Boot do not
>> re-configure the regulator with a lower voltage than it has after reset.
>>
>> Did your testing also include the "mmc: rockchip_sdhci: Set xx_TAP_VALUE
>> for RK3528" [1] patch?
> 
> Thank you for the quick reply!
> 
> I tested this patch and it works like a charm (30 times soft reboot + 10 
> times cold boot).
> 
>>
>>>
>>> Here's the build information:
>>> U-Boot commit: 4cad9faf8d28 ("MAINTAINERS: update my email address")
>>> rkbin commit: 74213af1e952 ("rv1126b: bl31: update version to v1.07")
>>> Build command:
>>> make CROSS_COMPILE=aarch64-linux-musl-
>>> BL31=../rkbin/bin/rk35/rk3528_bl31_v1.20.elf
>>> ROCKCHIP_TPL=../rkbin/bin/rk35/rk3528_ddr_1056MHz_v1.11.bin
>>
>> I will make some runtime test on my E20C using these as a base and see
>> if I can replicate a similar issue.
>>
>> I have also pushed my local pwm-regulator/rk-pwm relates patches to [2],
>> they need some re-work before being ready to be sent out.
> 
> I have tested this patchset, and the eMMC works as well even without the 
> rockchip_sdhci patch/commit applied.
> 
> I will make more tests these days and report then ;)

After 300 times soft reboot/reset, 70 times cold boot and 30 times mmc 
write + erase operations, the eMMC works very stable with the 
pwm-regulator/rk-pwm patches (with commit e34dd9146b29 "mmc: 
rockchip_sdhci: Set xx_TAP_VALUE for RK3528" reverted).

For the pwm series:
Tested-by: Tianling Shen <cnsztl@gmail.com>

Thanks,
Tianling.

> Many thanks again!
> 
> Thanks,
> Tianling.
> 
>>
>> [1] https://lore.kernel.org/u-boot/20250714203410.1782783-1- 
>> jonas@kwiboo.se/
>> [2] https://source.denx.de/u-boot/contributors/kwiboo/u-boot/-/ 
>> commits/rk3528
>>
>> Regards,
>> Jonas
>>
>>>
>>> Any help will be greatly appreciated!
>>>
>>> Thanks,
>>> Tianling.
>>>
>>>> Fixes: b112a44531cb ("board: rockchip: Add minimal generic RK3528 
>>>> board")
>>>> Fixes: ccbddf645310 ("board: rockchip: Add Radxa E20C")
>>>> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
>>>> ---
>>>> Kever, Tom: Please consider this for the v2025.07 release as support 
>>>> for
>>>> RK3528 was added in v2025.07-rc1.
>>>> ---
>>>>    arch/arm/dts/rk3528-generic.dts            | 1 +
>>>>    arch/arm/dts/rk3528-radxa-e20c-u-boot.dtsi | 4 ++++
>>>>    2 files changed, 5 insertions(+)
>>>>
>>>> diff --git a/arch/arm/dts/rk3528-generic.dts b/arch/arm/dts/rk3528- 
>>>> generic.dts
>>>> index 792d3e04a4cb..3f6f0bed108d 100644
>>>> --- a/arch/arm/dts/rk3528-generic.dts
>>>> +++ b/arch/arm/dts/rk3528-generic.dts
>>>> @@ -18,6 +18,7 @@
>>>>    &sdhci {
>>>>        bus-width = <8>;
>>>>        cap-mmc-highspeed;
>>>> +    mmc-hs200-1_8v;
>>>>        no-sd;
>>>>        no-sdio;
>>>>        non-removable;
>>>> diff --git a/arch/arm/dts/rk3528-radxa-e20c-u-boot.dtsi b/arch/arm/ 
>>>> dts/rk3528-radxa-e20c-u-boot.dtsi
>>>> index 9c2f03a786cf..1372d8f1e38a 100644
>>>> --- a/arch/arm/dts/rk3528-radxa-e20c-u-boot.dtsi
>>>> +++ b/arch/arm/dts/rk3528-radxa-e20c-u-boot.dtsi
>>>> @@ -2,6 +2,10 @@
>>>>    #include "rk3528-u-boot.dtsi"
>>>> +&sdhci {
>>>> +    mmc-hs200-1_8v;
>>>> +};
>>>> +
>>>>    &sdmmc {
>>>>        bus-width = <4>;
>>>>        cap-mmc-highspeed;
>>>
>>
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-11-06  9:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-13 22:43 [PATCH] arm: dts: rockchip: Fix eMMC write on RK3528 Jonas Karlman
2025-06-15 18:02 ` Tom Rini
2025-10-30 18:12 ` Tianling Shen
2025-10-30 19:41   ` Jonas Karlman
2025-10-31  9:40     ` Tianling Shen
2025-11-06  9:22       ` Tianling Shen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox