All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rockchip: rk3399: enable spl-fifo-mode for sdmmc
@ 2020-04-15  3:25 Deepak Das
  2020-04-15 13:00 ` Philipp Tomsich
  0 siblings, 1 reply; 3+ messages in thread
From: Deepak Das @ 2020-04-15  3:25 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Deepak Das <deepakdas.linux@gmail.com>
---
 arch/arm/dts/rk3399-u-boot.dtsi | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/dts/rk3399-u-boot.dtsi b/arch/arm/dts/rk3399-u-boot.dtsi
index 8b857ccfc7..3ad824450e 100644
--- a/arch/arm/dts/rk3399-u-boot.dtsi
+++ b/arch/arm/dts/rk3399-u-boot.dtsi
@@ -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 {
-- 
2.17.1

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

* [PATCH] rockchip: rk3399: enable spl-fifo-mode for sdmmc
  2020-04-15  3:25 [PATCH] rockchip: rk3399: enable spl-fifo-mode for sdmmc Deepak Das
@ 2020-04-15 13:00 ` Philipp Tomsich
  2020-04-16 11:18   ` Deepak Das
  0 siblings, 1 reply; 3+ messages in thread
From: Philipp Tomsich @ 2020-04-15 13:00 UTC (permalink / raw)
  To: u-boot

> On 15.04.2020, at 05:25, Deepak Das <deepakdas.linux@gmail.com> wrote:
> 
> 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.
> 
> Signed-off-by: Deepak Das <deepakdas.linux@gmail.com>
> ---
> arch/arm/dts/rk3399-u-boot.dtsi | 3 +++
> 1 file changed, 3 insertions(+)
> 
> diff --git a/arch/arm/dts/rk3399-u-boot.dtsi b/arch/arm/dts/rk3399-u-boot.dtsi
> index 8b857ccfc7..3ad824450e 100644
> --- a/arch/arm/dts/rk3399-u-boot.dtsi
> +++ b/arch/arm/dts/rk3399-u-boot.dtsi
> @@ -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... 

> };
> 
> &spi1 {
> -- 
> 2.17.1
> 

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

* [PATCH] rockchip: rk3399: enable spl-fifo-mode for sdmmc
  2020-04-15 13:00 ` Philipp Tomsich
@ 2020-04-16 11:18   ` Deepak Das
  0 siblings, 0 replies; 3+ messages in thread
From: Deepak Das @ 2020-04-16 11:18 UTC (permalink / raw)
  To: u-boot

Hi Philipp,

On 15/04/20 6:30 pm, Philipp Tomsich wrote:
>> On 15.04.2020, at 05:25, Deepak Das <deepakdas.linux@gmail.com> wrote:
>>
>> 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.
>>
>> Signed-off-by: Deepak Das <deepakdas.linux@gmail.com>
>> ---
>> arch/arm/dts/rk3399-u-boot.dtsi | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/arch/arm/dts/rk3399-u-boot.dtsi b/arch/arm/dts/rk3399-u-boot.dtsi
>> index 8b857ccfc7..3ad824450e 100644
>> --- a/arch/arm/dts/rk3399-u-boot.dtsi
>> +++ b/arch/arm/dts/rk3399-u-boot.dtsi
>> @@ -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.

agreed with you. 

> 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...

>
>> };
>>
>> &spi1 {
>> -- 
>> 2.17.1
>>

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

end of thread, other threads:[~2020-04-16 11:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-15  3:25 [PATCH] rockchip: rk3399: enable spl-fifo-mode for sdmmc Deepak Das
2020-04-15 13:00 ` Philipp Tomsich
2020-04-16 11:18   ` Deepak Das

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.