LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH] soc: rockchip: grf: Fix SDMMC not working on RK3588 with bus-width > 1
@ 2023-06-19  1:09 Ondřej Jirman
  2023-07-11 14:48 ` Heiko Stuebner
  2024-01-26  2:56 ` Kever Yang
  0 siblings, 2 replies; 3+ messages in thread
From: Ondřej Jirman @ 2023-06-19  1:09 UTC (permalink / raw
  To: linux-rockchip
  Cc: Ondrej Jirman, Heiko Stuebner,
	moderated list:ARM/Rockchip SoC support, open list

From: Ondrej Jirman <megi@xff.cz>

RK3588 has the same issue as other earlier RK SoCs. JTAG
functionality muxed to some SDMMC data pins causes issues with SDMMC
interface. Without this patch, I can only use SDMMC inteface
with bus-width = <1>. (JTAG is muxed to data pins D2 and D3)

Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
 drivers/soc/rockchip/grf.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/soc/rockchip/grf.c b/drivers/soc/rockchip/grf.c
index 15a3970e3509..d768c5a70174 100644
--- a/drivers/soc/rockchip/grf.c
+++ b/drivers/soc/rockchip/grf.c
@@ -121,6 +121,17 @@ static const struct rockchip_grf_info rk3566_pipegrf __initconst = {
 	.num_values = ARRAY_SIZE(rk3566_defaults),
 };
 
+#define RK3588_GRF_SOC_CON6		0x0318
+
+static const struct rockchip_grf_value rk3588_defaults[] __initconst = {
+	{ "jtag switching", RK3588_GRF_SOC_CON6, HIWORD_UPDATE(0, 1, 14) },
+};
+
+static const struct rockchip_grf_info rk3588_sysgrf __initconst = {
+	.values = rk3588_defaults,
+	.num_values = ARRAY_SIZE(rk3588_defaults),
+};
+
 
 static const struct of_device_id rockchip_grf_dt_match[] __initconst = {
 	{
@@ -147,6 +158,9 @@ static const struct of_device_id rockchip_grf_dt_match[] __initconst = {
 	}, {
 		.compatible = "rockchip,rk3566-pipe-grf",
 		.data = (void *)&rk3566_pipegrf,
+	}, {
+		.compatible = "rockchip,rk3588-sys-grf",
+		.data = (void *)&rk3588_sysgrf,
 	},
 	{ /* sentinel */ },
 };
-- 
2.41.0


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

* Re: [PATCH] soc: rockchip: grf: Fix SDMMC not working on RK3588 with bus-width > 1
  2023-06-19  1:09 [PATCH] soc: rockchip: grf: Fix SDMMC not working on RK3588 with bus-width > 1 Ondřej Jirman
@ 2023-07-11 14:48 ` Heiko Stuebner
  2024-01-26  2:56 ` Kever Yang
  1 sibling, 0 replies; 3+ messages in thread
From: Heiko Stuebner @ 2023-07-11 14:48 UTC (permalink / raw
  To: linux-rockchip, Ondřej Jirman
  Cc: Heiko Stuebner, open list,
	moderated list:ARM/Rockchip SoC support

On Mon, 19 Jun 2023 03:09:58 +0200, Ondřej Jirman wrote:
> From: Ondrej Jirman <megi@xff.cz>
> 
> RK3588 has the same issue as other earlier RK SoCs. JTAG
> functionality muxed to some SDMMC data pins causes issues with SDMMC
> interface. Without this patch, I can only use SDMMC inteface
> with bus-width = <1>. (JTAG is muxed to data pins D2 and D3)
> 
> [...]

Applied, thanks!

[1/1] soc: rockchip: grf: Fix SDMMC not working on RK3588 with bus-width > 1
      commit: 8813520a80efe3e7d280637bb1d47a9d473fd24d

Best regards,
-- 
Heiko Stuebner <heiko@sntech.de>

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

* Re: [PATCH] soc: rockchip: grf: Fix SDMMC not working on RK3588 with bus-width > 1
  2023-06-19  1:09 [PATCH] soc: rockchip: grf: Fix SDMMC not working on RK3588 with bus-width > 1 Ondřej Jirman
  2023-07-11 14:48 ` Heiko Stuebner
@ 2024-01-26  2:56 ` Kever Yang
  1 sibling, 0 replies; 3+ messages in thread
From: Kever Yang @ 2024-01-26  2:56 UTC (permalink / raw
  To: Ondřej Jirman, linux-rockchip
  Cc: Heiko Stuebner, moderated list:ARM/Rockchip SoC support,
	open list

Hi Ondrej,

On 2023/6/19 09:09, Ondřej Jirman wrote:
> From: Ondrej Jirman <megi@xff.cz>
>
> RK3588 has the same issue as other earlier RK SoCs. JTAG
> functionality muxed to some SDMMC data pins causes issues with SDMMC
> interface. Without this patch, I can only use SDMMC inteface
> with bus-width = <1>. (JTAG is muxed to data pins D2 and D3)
Which board did you met this issue?

The force jtag function should be work if all the iomux and hardware 
setting is corret:
     All the IO for SDMMC signal including SDMMC_DET, should set the 
iomux/pinctrl to mmc function
instead of GPIO function.

Seems like you are working on rk3588-quartzpro64, when I check its dts, 
I found below setting in sdmmc node:
cd-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;
Since quartzpro64 is using the correct IO and there is already a 
&sdmmc_det in sdmmc node,
you don't need to overwrite it with "cd-gpios".

Could you help to revert this patch and remove "cd-gpios" in dts sdmmc, 
and test sdmmc function again?
It should work with SD card 4 line mode and force jtag available when 
people need it.

Thanks,
- Kever
>
> Signed-off-by: Ondrej Jirman <megi@xff.cz>
> ---
>   drivers/soc/rockchip/grf.c | 14 ++++++++++++++
>   1 file changed, 14 insertions(+)
>
> diff --git a/drivers/soc/rockchip/grf.c b/drivers/soc/rockchip/grf.c
> index 15a3970e3509..d768c5a70174 100644
> --- a/drivers/soc/rockchip/grf.c
> +++ b/drivers/soc/rockchip/grf.c
> @@ -121,6 +121,17 @@ static const struct rockchip_grf_info rk3566_pipegrf __initconst = {
>   	.num_values = ARRAY_SIZE(rk3566_defaults),
>   };
>   
> +#define RK3588_GRF_SOC_CON6		0x0318
> +
> +static const struct rockchip_grf_value rk3588_defaults[] __initconst = {
> +	{ "jtag switching", RK3588_GRF_SOC_CON6, HIWORD_UPDATE(0, 1, 14) },
> +};
> +
> +static const struct rockchip_grf_info rk3588_sysgrf __initconst = {
> +	.values = rk3588_defaults,
> +	.num_values = ARRAY_SIZE(rk3588_defaults),
> +};
> +
>   
>   static const struct of_device_id rockchip_grf_dt_match[] __initconst = {
>   	{
> @@ -147,6 +158,9 @@ static const struct of_device_id rockchip_grf_dt_match[] __initconst = {
>   	}, {
>   		.compatible = "rockchip,rk3566-pipe-grf",
>   		.data = (void *)&rk3566_pipegrf,
> +	}, {
> +		.compatible = "rockchip,rk3588-sys-grf",
> +		.data = (void *)&rk3588_sysgrf,
>   	},
>   	{ /* sentinel */ },
>   };

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

end of thread, other threads:[~2024-01-26  7:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-19  1:09 [PATCH] soc: rockchip: grf: Fix SDMMC not working on RK3588 with bus-width > 1 Ondřej Jirman
2023-07-11 14:48 ` Heiko Stuebner
2024-01-26  2:56 ` Kever Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).