Message ID | 20240204205312.2342868-3-jonas@kwiboo.se |
---|---|
State | Accepted |
Delegated to: | Kever Yang |
Headers | show |
Series | rockchip: rk35xx: Fix writing to eMMC | expand |
On 2024/2/5 04:53, Jonas Karlman wrote: > Testing has shown that writing to eMMC using a slower mode then HS200 > typically generate an ERROR on first attempt on RK3588. > > # Rescan using MMC legacy mode > => mmc rescan 0 > > # Write a single block to sector 0x4000 fails with ERROR > => mmc write 20000000 4000 1 > > # Write a single block to sector 0x4000 now works > => mmc write 20000000 4000 1 > > With the MMC_SPEED_MODE_SET Kconfig option enabled. > > Writing to eMMC using HS200 mode work more reliably than slower modes on > RK35xx boards. Enable MMC_HS200_SUPPORT Kconfig option by default to > prefer use of HS200 mode on RK356x and RK3588. > > Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com> Thanks, - Kever > --- > Changes in v2: > - Imply MMC_HS200_SUPPORT and SPL_MMC_HS200_SUPPORT in arch Kconfig > instead of adding to each boards defconfig > - R-b tags not collected because of above change > - Combine changes for rk356x and rk3588 in one patch > - Update commit message > > Link to v1: https://patchwork.ozlabs.org/patch/1891693/ > --- > arch/arm/mach-rockchip/Kconfig | 4 ++++ > configs/nanopi-r5c-rk3568_defconfig | 2 -- > configs/nanopi-r5s-rk3568_defconfig | 2 -- > configs/radxa-e25-rk3568_defconfig | 2 -- > 4 files changed, 4 insertions(+), 6 deletions(-) > > diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig > index 6ff0aa6911e2..946ef5d7023d 100644 > --- a/arch/arm/mach-rockchip/Kconfig > +++ b/arch/arm/mach-rockchip/Kconfig > @@ -292,6 +292,8 @@ config ROCKCHIP_RK3568 > imply OF_LIBFDT_OVERLAY > imply ROCKCHIP_OTP > imply MISC_INIT_R > + imply MMC_HS200_SUPPORT if MMC_SDHCI_ROCKCHIP > + imply SPL_MMC_HS200_SUPPORT if SPL_MMC && MMC_HS200_SUPPORT > help > The Rockchip RK3568 is a ARM-based SoC with quad-core Cortex-A55, > including NEON and GPU, 512K L3 cache, Mali-G52 based graphics, > @@ -317,6 +319,8 @@ config ROCKCHIP_RK3588 > imply OF_LIBFDT_OVERLAY > imply ROCKCHIP_OTP > imply MISC_INIT_R > + imply MMC_HS200_SUPPORT if MMC_SDHCI_ROCKCHIP > + imply SPL_MMC_HS200_SUPPORT if SPL_MMC && MMC_HS200_SUPPORT > imply CLK_SCMI > imply SCMI_FIRMWARE > help > diff --git a/configs/nanopi-r5c-rk3568_defconfig b/configs/nanopi-r5c-rk3568_defconfig > index 833cff0e457d..f5a472d03d78 100644 > --- a/configs/nanopi-r5c-rk3568_defconfig > +++ b/configs/nanopi-r5c-rk3568_defconfig > @@ -58,8 +58,6 @@ CONFIG_ROCKCHIP_GPIO=y > CONFIG_SYS_I2C_ROCKCHIP=y > CONFIG_MISC=y > CONFIG_SUPPORT_EMMC_RPMB=y > -CONFIG_MMC_HS200_SUPPORT=y > -CONFIG_SPL_MMC_HS200_SUPPORT=y > CONFIG_MMC_DW=y > CONFIG_MMC_DW_ROCKCHIP=y > CONFIG_MMC_SDHCI=y > diff --git a/configs/nanopi-r5s-rk3568_defconfig b/configs/nanopi-r5s-rk3568_defconfig > index 2736d382a352..99692d341f44 100644 > --- a/configs/nanopi-r5s-rk3568_defconfig > +++ b/configs/nanopi-r5s-rk3568_defconfig > @@ -58,8 +58,6 @@ CONFIG_ROCKCHIP_GPIO=y > CONFIG_SYS_I2C_ROCKCHIP=y > CONFIG_MISC=y > CONFIG_SUPPORT_EMMC_RPMB=y > -CONFIG_MMC_HS200_SUPPORT=y > -CONFIG_SPL_MMC_HS200_SUPPORT=y > CONFIG_MMC_DW=y > CONFIG_MMC_DW_ROCKCHIP=y > CONFIG_MMC_SDHCI=y > diff --git a/configs/radxa-e25-rk3568_defconfig b/configs/radxa-e25-rk3568_defconfig > index 5a613abe0d2d..fedb137877ab 100644 > --- a/configs/radxa-e25-rk3568_defconfig > +++ b/configs/radxa-e25-rk3568_defconfig > @@ -60,8 +60,6 @@ CONFIG_ROCKCHIP_GPIO=y > CONFIG_SYS_I2C_ROCKCHIP=y > CONFIG_MISC=y > CONFIG_SUPPORT_EMMC_RPMB=y > -CONFIG_MMC_HS200_SUPPORT=y > -CONFIG_SPL_MMC_HS200_SUPPORT=y > CONFIG_MMC_DW=y > CONFIG_MMC_DW_ROCKCHIP=y > CONFIG_MMC_SDHCI=y
On Mon, Feb 5, 2024 at 4:53 AM Jonas Karlman <jonas@kwiboo.se> wrote: > > Testing has shown that writing to eMMC using a slower mode then HS200 > typically generate an ERROR on first attempt on RK3588. > > # Rescan using MMC legacy mode > => mmc rescan 0 > > # Write a single block to sector 0x4000 fails with ERROR > => mmc write 20000000 4000 1 > > # Write a single block to sector 0x4000 now works > => mmc write 20000000 4000 1 > > With the MMC_SPEED_MODE_SET Kconfig option enabled. > > Writing to eMMC using HS200 mode work more reliably than slower modes on > RK35xx boards. Enable MMC_HS200_SUPPORT Kconfig option by default to > prefer use of HS200 mode on RK356x and RK3588. > > Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Weizhao Ouyang <o451686892@gmail.com> BR, Weizhao > --- > Changes in v2: > - Imply MMC_HS200_SUPPORT and SPL_MMC_HS200_SUPPORT in arch Kconfig > instead of adding to each boards defconfig > - R-b tags not collected because of above change > - Combine changes for rk356x and rk3588 in one patch > - Update commit message > > Link to v1: https://patchwork.ozlabs.org/patch/1891693/ > --- > arch/arm/mach-rockchip/Kconfig | 4 ++++ > configs/nanopi-r5c-rk3568_defconfig | 2 -- > configs/nanopi-r5s-rk3568_defconfig | 2 -- > configs/radxa-e25-rk3568_defconfig | 2 -- > 4 files changed, 4 insertions(+), 6 deletions(-) > > diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig > index 6ff0aa6911e2..946ef5d7023d 100644 > --- a/arch/arm/mach-rockchip/Kconfig > +++ b/arch/arm/mach-rockchip/Kconfig > @@ -292,6 +292,8 @@ config ROCKCHIP_RK3568 > imply OF_LIBFDT_OVERLAY > imply ROCKCHIP_OTP > imply MISC_INIT_R > + imply MMC_HS200_SUPPORT if MMC_SDHCI_ROCKCHIP > + imply SPL_MMC_HS200_SUPPORT if SPL_MMC && MMC_HS200_SUPPORT > help > The Rockchip RK3568 is a ARM-based SoC with quad-core Cortex-A55, > including NEON and GPU, 512K L3 cache, Mali-G52 based graphics, > @@ -317,6 +319,8 @@ config ROCKCHIP_RK3588 > imply OF_LIBFDT_OVERLAY > imply ROCKCHIP_OTP > imply MISC_INIT_R > + imply MMC_HS200_SUPPORT if MMC_SDHCI_ROCKCHIP > + imply SPL_MMC_HS200_SUPPORT if SPL_MMC && MMC_HS200_SUPPORT > imply CLK_SCMI > imply SCMI_FIRMWARE > help > diff --git a/configs/nanopi-r5c-rk3568_defconfig b/configs/nanopi-r5c-rk3568_defconfig > index 833cff0e457d..f5a472d03d78 100644 > --- a/configs/nanopi-r5c-rk3568_defconfig > +++ b/configs/nanopi-r5c-rk3568_defconfig > @@ -58,8 +58,6 @@ CONFIG_ROCKCHIP_GPIO=y > CONFIG_SYS_I2C_ROCKCHIP=y > CONFIG_MISC=y > CONFIG_SUPPORT_EMMC_RPMB=y > -CONFIG_MMC_HS200_SUPPORT=y > -CONFIG_SPL_MMC_HS200_SUPPORT=y > CONFIG_MMC_DW=y > CONFIG_MMC_DW_ROCKCHIP=y > CONFIG_MMC_SDHCI=y > diff --git a/configs/nanopi-r5s-rk3568_defconfig b/configs/nanopi-r5s-rk3568_defconfig > index 2736d382a352..99692d341f44 100644 > --- a/configs/nanopi-r5s-rk3568_defconfig > +++ b/configs/nanopi-r5s-rk3568_defconfig > @@ -58,8 +58,6 @@ CONFIG_ROCKCHIP_GPIO=y > CONFIG_SYS_I2C_ROCKCHIP=y > CONFIG_MISC=y > CONFIG_SUPPORT_EMMC_RPMB=y > -CONFIG_MMC_HS200_SUPPORT=y > -CONFIG_SPL_MMC_HS200_SUPPORT=y > CONFIG_MMC_DW=y > CONFIG_MMC_DW_ROCKCHIP=y > CONFIG_MMC_SDHCI=y > diff --git a/configs/radxa-e25-rk3568_defconfig b/configs/radxa-e25-rk3568_defconfig > index 5a613abe0d2d..fedb137877ab 100644 > --- a/configs/radxa-e25-rk3568_defconfig > +++ b/configs/radxa-e25-rk3568_defconfig > @@ -60,8 +60,6 @@ CONFIG_ROCKCHIP_GPIO=y > CONFIG_SYS_I2C_ROCKCHIP=y > CONFIG_MISC=y > CONFIG_SUPPORT_EMMC_RPMB=y > -CONFIG_MMC_HS200_SUPPORT=y > -CONFIG_SPL_MMC_HS200_SUPPORT=y > CONFIG_MMC_DW=y > CONFIG_MMC_DW_ROCKCHIP=y > CONFIG_MMC_SDHCI=y > -- > 2.43.0 >
Hi Jonas, On 2/4/24 21:53, Jonas Karlman wrote: > Testing has shown that writing to eMMC using a slower mode then HS200 > typically generate an ERROR on first attempt on RK3588. > > # Rescan using MMC legacy mode > => mmc rescan 0 > > # Write a single block to sector 0x4000 fails with ERROR > => mmc write 20000000 4000 1 > > # Write a single block to sector 0x4000 now works > => mmc write 20000000 4000 1 > > With the MMC_SPEED_MODE_SET Kconfig option enabled. > > Writing to eMMC using HS200 mode work more reliably than slower modes on > RK35xx boards. Enable MMC_HS200_SUPPORT Kconfig option by default to > prefer use of HS200 mode on RK356x and RK3588. > > Signed-off-by: Jonas Karlman <jonas@kwiboo.se> > --- > Changes in v2: > - Imply MMC_HS200_SUPPORT and SPL_MMC_HS200_SUPPORT in arch Kconfig > instead of adding to each boards defconfig > - R-b tags not collected because of above change > - Combine changes for rk356x and rk3588 in one patch > - Update commit message > > Link to v1: https://patchwork.ozlabs.org/patch/1891693/ > --- > arch/arm/mach-rockchip/Kconfig | 4 ++++ > configs/nanopi-r5c-rk3568_defconfig | 2 -- > configs/nanopi-r5s-rk3568_defconfig | 2 -- > configs/radxa-e25-rk3568_defconfig | 2 -- > 4 files changed, 4 insertions(+), 6 deletions(-) > > diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig > index 6ff0aa6911e2..946ef5d7023d 100644 > --- a/arch/arm/mach-rockchip/Kconfig > +++ b/arch/arm/mach-rockchip/Kconfig > @@ -292,6 +292,8 @@ config ROCKCHIP_RK3568 > imply OF_LIBFDT_OVERLAY > imply ROCKCHIP_OTP > imply MISC_INIT_R > + imply MMC_HS200_SUPPORT if MMC_SDHCI_ROCKCHIP MMC_SDHCI_ROCKCHIP is also required for eMMC on RK3399, which would change the current default, at the very least for Puma RK3399. Doing a: rg -lU --multiline-dotall 'RK3399.*MMC_HS.*' configs/ Only returns: configs/evb-rk3399_defconfig configs/pinebook-pro-rk3399_defconfig and there are 29 defconfigs for RK3399-based boards right now, so maybe that's a bit too big of a change? Cheers, Quentin
Hi Quentin, On 2024-02-05 10:47, Quentin Schulz wrote: > Hi Jonas, > > On 2/4/24 21:53, Jonas Karlman wrote: >> Testing has shown that writing to eMMC using a slower mode then HS200 >> typically generate an ERROR on first attempt on RK3588. >> >> # Rescan using MMC legacy mode >> => mmc rescan 0 >> >> # Write a single block to sector 0x4000 fails with ERROR >> => mmc write 20000000 4000 1 >> >> # Write a single block to sector 0x4000 now works >> => mmc write 20000000 4000 1 >> >> With the MMC_SPEED_MODE_SET Kconfig option enabled. >> >> Writing to eMMC using HS200 mode work more reliably than slower modes on >> RK35xx boards. Enable MMC_HS200_SUPPORT Kconfig option by default to >> prefer use of HS200 mode on RK356x and RK3588. >> >> Signed-off-by: Jonas Karlman <jonas@kwiboo.se> >> --- >> Changes in v2: >> - Imply MMC_HS200_SUPPORT and SPL_MMC_HS200_SUPPORT in arch Kconfig >> instead of adding to each boards defconfig >> - R-b tags not collected because of above change >> - Combine changes for rk356x and rk3588 in one patch >> - Update commit message >> >> Link to v1: https://patchwork.ozlabs.org/patch/1891693/ >> --- >> arch/arm/mach-rockchip/Kconfig | 4 ++++ >> configs/nanopi-r5c-rk3568_defconfig | 2 -- >> configs/nanopi-r5s-rk3568_defconfig | 2 -- >> configs/radxa-e25-rk3568_defconfig | 2 -- >> 4 files changed, 4 insertions(+), 6 deletions(-) >> >> diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig >> index 6ff0aa6911e2..946ef5d7023d 100644 >> --- a/arch/arm/mach-rockchip/Kconfig >> +++ b/arch/arm/mach-rockchip/Kconfig >> @@ -292,6 +292,8 @@ config ROCKCHIP_RK3568 >> imply OF_LIBFDT_OVERLAY >> imply ROCKCHIP_OTP >> imply MISC_INIT_R >> + imply MMC_HS200_SUPPORT if MMC_SDHCI_ROCKCHIP > > MMC_SDHCI_ROCKCHIP is also required for eMMC on RK3399, which would > change the current default, at the very least for Puma RK3399. > > Doing a: > > rg -lU --multiline-dotall 'RK3399.*MMC_HS.*' configs/ > > Only returns: > configs/evb-rk3399_defconfig > configs/pinebook-pro-rk3399_defconfig > > and there are 29 defconfigs for RK3399-based boards right now, so maybe > that's a bit too big of a change? The imply statements added in this patch should only affect ROCKCHIP_RK3568 and ROCKCHIP_RK3588, nothing should change for RK3399, at least not intentionally. Regards, Jonas > > Cheers, > Quentin
Hi Jonas, On 2/5/24 14:05, Jonas Karlman wrote: > Hi Quentin, > > On 2024-02-05 10:47, Quentin Schulz wrote: >> Hi Jonas, >> >> On 2/4/24 21:53, Jonas Karlman wrote: >>> Testing has shown that writing to eMMC using a slower mode then HS200 >>> typically generate an ERROR on first attempt on RK3588. >>> >>> # Rescan using MMC legacy mode >>> => mmc rescan 0 >>> >>> # Write a single block to sector 0x4000 fails with ERROR >>> => mmc write 20000000 4000 1 >>> >>> # Write a single block to sector 0x4000 now works >>> => mmc write 20000000 4000 1 >>> >>> With the MMC_SPEED_MODE_SET Kconfig option enabled. >>> >>> Writing to eMMC using HS200 mode work more reliably than slower modes on >>> RK35xx boards. Enable MMC_HS200_SUPPORT Kconfig option by default to >>> prefer use of HS200 mode on RK356x and RK3588. >>> >>> Signed-off-by: Jonas Karlman <jonas@kwiboo.se> >>> --- >>> Changes in v2: >>> - Imply MMC_HS200_SUPPORT and SPL_MMC_HS200_SUPPORT in arch Kconfig >>> instead of adding to each boards defconfig >>> - R-b tags not collected because of above change >>> - Combine changes for rk356x and rk3588 in one patch >>> - Update commit message >>> >>> Link to v1: https://patchwork.ozlabs.org/patch/1891693/ >>> --- >>> arch/arm/mach-rockchip/Kconfig | 4 ++++ >>> configs/nanopi-r5c-rk3568_defconfig | 2 -- >>> configs/nanopi-r5s-rk3568_defconfig | 2 -- >>> configs/radxa-e25-rk3568_defconfig | 2 -- >>> 4 files changed, 4 insertions(+), 6 deletions(-) >>> >>> diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig >>> index 6ff0aa6911e2..946ef5d7023d 100644 >>> --- a/arch/arm/mach-rockchip/Kconfig >>> +++ b/arch/arm/mach-rockchip/Kconfig >>> @@ -292,6 +292,8 @@ config ROCKCHIP_RK3568 >>> imply OF_LIBFDT_OVERLAY >>> imply ROCKCHIP_OTP >>> imply MISC_INIT_R >>> + imply MMC_HS200_SUPPORT if MMC_SDHCI_ROCKCHIP >> >> MMC_SDHCI_ROCKCHIP is also required for eMMC on RK3399, which would >> change the current default, at the very least for Puma RK3399. >> >> Doing a: >> >> rg -lU --multiline-dotall 'RK3399.*MMC_HS.*' configs/ >> >> Only returns: >> configs/evb-rk3399_defconfig >> configs/pinebook-pro-rk3399_defconfig >> >> and there are 29 defconfigs for RK3399-based boards right now, so maybe >> that's a bit too big of a change? > > The imply statements added in this patch should only affect > ROCKCHIP_RK3568 and ROCKCHIP_RK3588, nothing should change for RK3399, > at least not intentionally. > Clearly misread the patch, sorry for the noise. Reviewed-by: Quentin Schulz <quentin.schulz@theobroma-systems.com> Cheers, Quentin
diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig index 6ff0aa6911e2..946ef5d7023d 100644 --- a/arch/arm/mach-rockchip/Kconfig +++ b/arch/arm/mach-rockchip/Kconfig @@ -292,6 +292,8 @@ config ROCKCHIP_RK3568 imply OF_LIBFDT_OVERLAY imply ROCKCHIP_OTP imply MISC_INIT_R + imply MMC_HS200_SUPPORT if MMC_SDHCI_ROCKCHIP + imply SPL_MMC_HS200_SUPPORT if SPL_MMC && MMC_HS200_SUPPORT help The Rockchip RK3568 is a ARM-based SoC with quad-core Cortex-A55, including NEON and GPU, 512K L3 cache, Mali-G52 based graphics, @@ -317,6 +319,8 @@ config ROCKCHIP_RK3588 imply OF_LIBFDT_OVERLAY imply ROCKCHIP_OTP imply MISC_INIT_R + imply MMC_HS200_SUPPORT if MMC_SDHCI_ROCKCHIP + imply SPL_MMC_HS200_SUPPORT if SPL_MMC && MMC_HS200_SUPPORT imply CLK_SCMI imply SCMI_FIRMWARE help diff --git a/configs/nanopi-r5c-rk3568_defconfig b/configs/nanopi-r5c-rk3568_defconfig index 833cff0e457d..f5a472d03d78 100644 --- a/configs/nanopi-r5c-rk3568_defconfig +++ b/configs/nanopi-r5c-rk3568_defconfig @@ -58,8 +58,6 @@ CONFIG_ROCKCHIP_GPIO=y CONFIG_SYS_I2C_ROCKCHIP=y CONFIG_MISC=y CONFIG_SUPPORT_EMMC_RPMB=y -CONFIG_MMC_HS200_SUPPORT=y -CONFIG_SPL_MMC_HS200_SUPPORT=y CONFIG_MMC_DW=y CONFIG_MMC_DW_ROCKCHIP=y CONFIG_MMC_SDHCI=y diff --git a/configs/nanopi-r5s-rk3568_defconfig b/configs/nanopi-r5s-rk3568_defconfig index 2736d382a352..99692d341f44 100644 --- a/configs/nanopi-r5s-rk3568_defconfig +++ b/configs/nanopi-r5s-rk3568_defconfig @@ -58,8 +58,6 @@ CONFIG_ROCKCHIP_GPIO=y CONFIG_SYS_I2C_ROCKCHIP=y CONFIG_MISC=y CONFIG_SUPPORT_EMMC_RPMB=y -CONFIG_MMC_HS200_SUPPORT=y -CONFIG_SPL_MMC_HS200_SUPPORT=y CONFIG_MMC_DW=y CONFIG_MMC_DW_ROCKCHIP=y CONFIG_MMC_SDHCI=y diff --git a/configs/radxa-e25-rk3568_defconfig b/configs/radxa-e25-rk3568_defconfig index 5a613abe0d2d..fedb137877ab 100644 --- a/configs/radxa-e25-rk3568_defconfig +++ b/configs/radxa-e25-rk3568_defconfig @@ -60,8 +60,6 @@ CONFIG_ROCKCHIP_GPIO=y CONFIG_SYS_I2C_ROCKCHIP=y CONFIG_MISC=y CONFIG_SUPPORT_EMMC_RPMB=y -CONFIG_MMC_HS200_SUPPORT=y -CONFIG_SPL_MMC_HS200_SUPPORT=y CONFIG_MMC_DW=y CONFIG_MMC_DW_ROCKCHIP=y CONFIG_MMC_SDHCI=y
Testing has shown that writing to eMMC using a slower mode then HS200 typically generate an ERROR on first attempt on RK3588. # Rescan using MMC legacy mode => mmc rescan 0 # Write a single block to sector 0x4000 fails with ERROR => mmc write 20000000 4000 1 # Write a single block to sector 0x4000 now works => mmc write 20000000 4000 1 With the MMC_SPEED_MODE_SET Kconfig option enabled. Writing to eMMC using HS200 mode work more reliably than slower modes on RK35xx boards. Enable MMC_HS200_SUPPORT Kconfig option by default to prefer use of HS200 mode on RK356x and RK3588. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> --- Changes in v2: - Imply MMC_HS200_SUPPORT and SPL_MMC_HS200_SUPPORT in arch Kconfig instead of adding to each boards defconfig - R-b tags not collected because of above change - Combine changes for rk356x and rk3588 in one patch - Update commit message Link to v1: https://patchwork.ozlabs.org/patch/1891693/ --- arch/arm/mach-rockchip/Kconfig | 4 ++++ configs/nanopi-r5c-rk3568_defconfig | 2 -- configs/nanopi-r5s-rk3568_defconfig | 2 -- configs/radxa-e25-rk3568_defconfig | 2 -- 4 files changed, 4 insertions(+), 6 deletions(-)