sdmmc/sdio/emmc improvements for RK3328
Subsystems (2)
v3 cover sdmmc/sdio/emmc improvements for RK3328
This is a rebased resend of Alex Bee's prior patches which haven't been merged even though there doesn't seem to be anything wrong with it. These patches have been used in LibreELEC for years, which means I've been using it for years on my Rock64 and I've also added it to my latest 6.10-rc7 build and that worked fine too.
Link to v2:
https://lore.kernel.org/linux-rockchip/[email protected]/
Alex Bee (2):
arm64: dts: rockchip: Add sdmmc_ext for RK3328
arm64: dts: rockchip: Add sdmmc/sdio/emmc reset controls for RK3328
arch/arm64/boot/dts/rockchip/rk3328.dtsi | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
base-commit: d79d713d602e8b32cf935ddfdf61769cb74ba1dc
Signature · 1 line
2.45.2
PATCH v3 1/2 arm64: dts: rockchip: Add sdmmc_ext for RK3328
From: Alex Bee <[email protected]>
RK3328 SoC has a fourth mmc controller called SDMMC_EXT. Some boards have sdio wifi connected to it. In order to use it one would have to add the pinctrls from sdmmc0ext group which is done on board level.
--- arch/arm64/boot/dts/rockchip/rk3328.dtsi | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
arch/arm64/boot/dts/rockchip/rk3328.dtsi +14 -0
@@ -1036,6 +1036,20 @@ usb_host0_ohci: usb@ff5d0000 { status = "disabled"; }; + sdmmc_ext: mmc@ff5f0000 { + compatible = "rockchip,rk3328-dw-mshc", "rockchip,rk3288-dw-mshc"; + reg = <0x0 0xff5f0000 0x0 0x4000>; + interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru HCLK_SDMMC_EXT>, <&cru SCLK_SDMMC_EXT>, + <&cru SCLK_SDMMC_EXT_DRV>, <&cru SCLK_SDMMC_EXT_SAMPLE>; + clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; + fifo-depth = <0x100>; + max-frequency = <150000000>; + resets = <&cru SRST_SDMMCEXT>; + reset-names = "reset"; + status = "disabled"; + }; + usbdrd3: usb@ff600000 { compatible = "rockchip,rk3328-dwc3", "snps,dwc3"; reg = <0x0 0xff600000 0x0 0x100000>;
Signature · 1 line
2.45.2
Re: [PATCH v3 1/2] arm64: dts: rockchip: Add sdmmc_ext for RK3328
Hello Diederik,
Quoted 9 lines · Diederik de Haas
From: Alex Bee <[email protected]>
RK3328 SoC has a fourth mmc controller called
SDMMC_EXT. Some boards have sdio wifi connected to it. In order to use it one would have to add the pinctrls from sdmmc0ext group which is done on board level.Signed-off-by Alex Bee <[email protected]>Signed-off-by Diederik de Haas <[email protected]>
Looking good to me, cross-referencing the RK3328 TRM and the downstream RK3328 SoC dtsi checks out. Though, it will remain inert in our codebase, because no supported boards use it, but that's fine, we're still improving the correctness of the RK3328 SoC dtsi.
Quoted 30 lines
--- arch/arm64/boot/dts/rockchip/rk3328.dtsi | 14 ++++++++++++++ 1 file changed, 14 insertions(+)arch/arm64/boot/dts/rockchip/rk3328.dtsi +14
-0@@ -1036,6 +1036,20 @@ usb_host0_ohci: usb@ff5d0000 { status = "disabled"; }; + sdmmc_ext: mmc@ff5f0000 { + compatible = "rockchip,rk3328-dw-mshc", "rockchip,rk3288-dw-mshc"; + reg = <0x0 0xff5f0000 0x0 0x4000>; + interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru HCLK_SDMMC_EXT>, <&cru SCLK_SDMMC_EXT>, + <&cru SCLK_SDMMC_EXT_DRV>, <&cru SCLK_SDMMC_EXT_SAMPLE>; + clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; + fifo-depth = <0x100>; + max-frequency = <150000000>; + resets = <&cru SRST_SDMMCEXT>; + reset-names = "reset"; + status = "disabled"; + }; + usbdrd3: usb@ff600000 { compatible = "rockchip,rk3328-dwc3", "snps,dwc3"; reg = <0x0 0xff600000 0x0 0x100000>;
Re: [PATCH v3 1/2] arm64: dts: rockchip: Add sdmmc_ext for RK3328
Hi Dragan,
Thanks for the reviews!
Quoted 4 lines · On Saturday, 13 July 2024 15:45:12 CEST Dragan Simic wrote:
Looking good to me, cross-referencing the RK3328 TRM and the downstream RK3328 SoC dtsi checks out. Though, it will remain inert in our codebase, because no supported boards use it, but that's fine, we're still improving the correctness of the RK3328 SoC dtsi.
Indeed. But it's hard to argue with technically correct ;-)
Cheers,
Diederik
Re: [PATCH v3 1/2] arm64: dts: rockchip: Add sdmmc_ext for RK3328
Am 13.07.24 um 16:35 schrieb Diederik de Haas:
Quoted 10 lines
Hi Dragan,
Thanks for the reviews!
Quoted 4 lines · On Saturday, 13 July 2024 15:45:12 CEST Dragan Simic wrote:
Looking good to me, cross-referencing the RK3328 TRM and the downstream RK3328 SoC dtsi checks out. Though, it will remain inert in our codebase, because no supported boards use it, but that's fine, we're still improving the correctness of the RK3328 SoC dtsi.
Indeed. But it's hard to argue with technically correct ;-)
FWIW: (upstream supported) ROC-RK3328-PC has sdio wifi connected to this controller.
Alex
Quoted 2 lines
Cheers,
Diederik
Re: [PATCH v3 1/2] arm64: dts: rockchip: Add sdmmc_ext for RK3328
Hello Alex,
Quoted 6 lines · Alex Bee
Am 13.07.24 um 16:35 schrieb Diederik de Haas:
Quoted 5 lines
Hi Dragan,
Thanks for the reviews!
On Saturday, 13 July 2024 15:45:12 CEST Dragan Simic wrote:
Quoted 8 lines
Quoted 5 lines
Quoted 4 lines
Looking good to me, cross-referencing the RK3328 TRM and the downstream RK3328 SoC dtsi checks out. Though, it will remain inert in our codebase, because no supported boards use it, but that's fine, we're still improving the correctness of the RK3328 SoC dtsi.
Indeed. But it's hard to argue with technically correct ;-)
FWIW: (upstream supported) ROC-RK3328-PC has sdio wifi connected to this controller.
Oh, it does? Good to hear, so the additions to the RK3328 SoC dtsi shouldn't remain inert. :)
PATCH v3 2/2 arm64: dts: rockchip: Add sdmmc/sdio/emmc reset controls for RK3328
In reply to Diederik de HaasFrom: Alex Bee <[email protected]>
The DW MCI controller driver will use them to reset the IP block before initialisation.
--- arch/arm64/boot/dts/rockchip/rk3328.dtsi | 6 ++++++ 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/rockchip/rk3328.dtsi +6 -0
@@ -910,6 +910,8 @@ sdmmc: mmc@ff500000 { clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; fifo-depth = <0x100>; max-frequency = <150000000>; + resets = <&cru SRST_MMC0>; + reset-names = "reset"; status = "disabled"; };
@@ -922,6 +924,8 @@ sdio: mmc@ff510000 { clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; fifo-depth = <0x100>; max-frequency = <150000000>; + resets = <&cru SRST_SDIO>; + reset-names = "reset"; status = "disabled"; };
@@ -934,6 +938,8 @@ emmc: mmc@ff520000 { clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; fifo-depth = <0x100>; max-frequency = <150000000>; + resets = <&cru SRST_EMMC>; + reset-names = "reset"; status = "disabled"; };
Signature · 1 line
2.45.2
Re: [PATCH v3 2/2] arm64: dts: rockchip: Add sdmmc/sdio/emmc reset controls for RK3328
Hello Diederik,
Quoted 9 lines · Diederik de Haas
From: Alex Bee <[email protected]>
The DW MCI controller driver will use them to reset the IP block before initialisation.
Fixes d717f7352ec6 ("arm64: dts: rockchip: add sdmmc/sdio/emmc nodesfor RK3328 SoCs")
Signed-off-by Alex Bee <[email protected]>Signed-off-by Diederik de Haas <[email protected]>
Looking good to me, cross-referencing the RK3328 TRM checks out.
Quoted 35 lines
--- arch/arm64/boot/dts/rockchip/rk3328.dtsi | 6 ++++++ 1 file changed, 6 insertions(+)arch/arm64/boot/dts/rockchip/rk3328.dtsi +6
-0@@ -910,6 +910,8 @@ sdmmc: mmc@ff500000 { clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; fifo-depth = <0x100>; max-frequency = <150000000>; + resets = <&cru SRST_MMC0>; + reset-names = "reset"; status = "disabled"; };@@ -922,6 +924,8 @@ sdio: mmc@ff510000 { clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; fifo-depth = <0x100>; max-frequency = <150000000>; + resets = <&cru SRST_SDIO>; + reset-names = "reset"; status = "disabled"; };@@ -934,6 +938,8 @@ emmc: mmc@ff520000 { clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; fifo-depth = <0x100>; max-frequency = <150000000>; + resets = <&cru SRST_EMMC>; + reset-names = "reset"; status = "disabled"; };
Quoted 10 lines · Diederik de Haas
This is a rebased resend of Alex Bee's prior patches which haven't been merged even though there doesn't seem to be anything wrong with it. These patches have been used in LibreELEC for years, which means I've been using it for years on my Rock64 and I've also added it to my latest 6.10-rc7 build and that worked fine too.
Link to v2:
https://lore.kernel.org/linux-rockchip/[email protected]/[...]
Applied, thanks!
[1/2] arm64: dts: rockchip: Add sdmmc_ext for RK3328
commit: 82e3aaae388199a0aff33e5371db307b3274f77a
[2/2] arm64: dts: rockchip: Add sdmmc/sdio/emmc reset controls for RK3328
commit: bd6e614356d4fc852480cfb14d705da0561d5777Best regards,
Signature · 1 line
Heiko Stuebner <[email protected]>