Skip to contentSkip to conversation

rockchip: rk3399: enable spl-fifo-mode for sdmmc

PATCH New Deepak Das 2 participants 3 messages Apr 15, 2020 – Apr 16, 2020 Arm (32-bit)

lore
Share & tools
lore

Deepak Das

author
#0 lore raw

PATCH 1/1 rockchip: rk3399: enable spl-fifo-mode for sdmmc

adapting commit fa2047c47310 ("rockchip: rk3328: enable spl-fifo-mode for emmc and sdmmc") for rk3399.
Since mmc to sram can't do dma, add patch to prevent aborts transferring TF-A parts.

---
 arch/arm/dts/rk3399-u-boot.dtsi | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/dts/rk3399-u-boot.dtsi +3 -0
index 8b857ccfc7..3ad824450e 100644
@@ -84,6 +84,9 @@
 
 &sdmmc {
 	u-boot,dm-pre-reloc;
+
+	/* mmc to sram can't do dma, prevent aborts transferring TF-A parts */
+	u-boot,spl-fifo-mode;
 };
 
 &spi1 {
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 rockchip: rk3399: enable spl-fifo-mode for sdmmc

Quoted 17 lines · Deepak Das

adapting commit fa2047c47310 ("rockchip: rk3328: enable spl-fifo-mode for emmc and sdmmc") for rk3399.
Since mmc to sram can't do dma, add patch to prevent aborts transferring TF-A parts.

---
arch/arm/dts/rk3399-u-boot.dtsi | 3 +++

1 file changed, 3 insertions(+)
arch/arm/dts/rk3399-u-boot.dtsi +0 -0
index 8b857ccfc7..3ad824450e 100644

arch/arm/dts/rk3399-u-boot.dtsi line 89

Quoted 6 lines
arch/arm/dts/rk3399-u-boot.dtsi +3 -0
@@ -84,6 +84,9 @@
 
 &sdmmc {
 	u-boot,dm-pre-reloc;
+
+	/* mmc to sram can't do dma, prevent aborts transferring TF-A parts */
+	u-boot,spl-fifo-mode;

Most transfers in SPL mode will occur to RAM (i.e. most of TF-A and the full U-Boot), so this is a heavy-handed solution for a problem affecting only some transfers.

Can?t this be solved using bounce buffers?
You will need to check if the target address cross the inaccessible memory regions and?if and only if?send these payloads through a bounce buffer...

Quoted 6 lines
arch/arm/dts/rk3399-u-boot.dtsi +0 -0
 };
 
 &spi1 {
Signature · 1 line
2.17.1
author
#2 lore raw

PATCH 1/1 rockchip: rk3399: enable spl-fifo-mode for sdmmc

Hi Philipp,

Quoted 18 lines · Philipp Tomsich
Quoted 18 lines · Deepak Das

adapting commit fa2047c47310 ("rockchip: rk3328: enable spl-fifo-mode for emmc and sdmmc") for rk3399.
Since mmc to sram can't do dma, add patch to prevent aborts transferring TF-A parts.

---
arch/arm/dts/rk3399-u-boot.dtsi | 3 +++

1 file changed, 3 insertions(+)
arch/arm/dts/rk3399-u-boot.dtsi +0 -0
index 8b857ccfc7..3ad824450e 100644
@@ -84,6 +84,9 @@
 
Quoted 7 lines

arch/arm/dts/rk3399-u-boot.dtsi line 89

Quoted 5 lines
arch/arm/dts/rk3399-u-boot.dtsi +3 -0
 &sdmmc {
 	u-boot,dm-pre-reloc;
+
+	/* mmc to sram can't do dma, prevent aborts transferring TF-A parts */
+	u-boot,spl-fifo-mode;

Most transfers in SPL mode will occur to RAM (i.e. most of TF-A and the full U-Boot), so this is a heavy-handed solution for a problem affecting only some transfers.

agreed with you.

Quoted 3 lines

Can?t this be solved using bounce buffers?
You will need to check if the target address cross the inaccessible memory regions and?if and only if?send these payloads through a bounce buffer...

Currently bounce buffer apis will use bounce buffer only if target address is not aligned for DMA. so I can see following options:-
1) use miss aligned address for required transfer (hackish workaround).
2) create another set of apis which will use bounce buffer even if the target address is aligned for DMA.
3) un-secure SRAM area since TF-A will anyway resecure it.

we now also need to get the sram area for that specific SOC so that we can compare the same with the target address and act accordingly for option 1&2.

do you have any suggestions ? may be I missed something...

Quoted 7 lines
Quoted 7 lines
arch/arm/dts/rk3399-u-boot.dtsi +0 -0
 };
 
 &spi1 {
Signature · 1 line
2.17.1