diff mbox series

[U-Boot] rockchip: px30: enable fifo mode for both emmc and sdmmc on evb

Message ID 20191119100321.13879-1-heiko@sntech.de
State Superseded
Delegated to: Kever Yang
Headers show
Series [U-Boot] rockchip: px30: enable fifo mode for both emmc and sdmmc on evb | expand

Commit Message

Heiko Stuebner Nov. 19, 2019, 10:03 a.m. UTC
From: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>

As part of loading trustedfirmware, the SPL is required to place portions
of code into the socs sram but the mmc controllers can only do dma
transfers into the regular memory, not sram.

The results of this are not directly visible in u-boot itself, but
manifest as security-relate cpu aborts during boot of for example Linux.

There were a number of attempts to solve this elegantly but so far
discussion is still ongoing, so to make the board at least boot correctly
put both mmc controllers into fifo-mode, which also circumvents the
issue for now.

Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
---
 arch/arm/dts/px30-evb-u-boot.dtsi | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Philipp Tomsich Nov. 19, 2019, 10:06 a.m. UTC | #1
Heiko,

> On 19.11.2019, at 11:03, Heiko Stuebner <heiko@sntech.de> wrote:
> 
> From: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
> 
> As part of loading trustedfirmware, the SPL is required to place portions
> of code into the socs sram but the mmc controllers can only do dma
> transfers into the regular memory, not sram.
> 
> The results of this are not directly visible in u-boot itself, but
> manifest as security-relate cpu aborts during boot of for example Linux.
> 
> There were a number of attempts to solve this elegantly but so far
> discussion is still ongoing, so to make the board at least boot correctly
> put both mmc controllers into fifo-mode, which also circumvents the
> issue for now.
> 
> Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
> ---
> arch/arm/dts/px30-evb-u-boot.dtsi | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/dts/px30-evb-u-boot.dtsi b/arch/arm/dts/px30-evb-u-boot.dtsi
> index 3de9c7068e..27b8364e6c 100644
> --- a/arch/arm/dts/px30-evb-u-boot.dtsi
> +++ b/arch/arm/dts/px30-evb-u-boot.dtsi
> @@ -31,12 +31,15 @@
> &sdmmc {
> 	u-boot,dm-pre-reloc;
> 
> -	/* temporary till I find out why dma mode doesn't work */
> +	/* mmc to sram can't do dma, prevent aborts transfering TF-A parts */
> 	fifo-mode;

Could you add a u-boot,spl-fifo-mode property to the driver?
Otherwise we force the controllers back to fifo-mode even for full U-Boot with
the associated performance impact.

Thanks,
Philipp.

> };
> 
> &emmc {
> 	u-boot,dm-pre-reloc;
> +
> +	/* mmc to sram can't do dma, prevent aborts transfering TF-A parts */
> +	fifo-mode;
> };
> 
> &grf {
> -- 
> 2.24.0
>
diff mbox series

Patch

diff --git a/arch/arm/dts/px30-evb-u-boot.dtsi b/arch/arm/dts/px30-evb-u-boot.dtsi
index 3de9c7068e..27b8364e6c 100644
--- a/arch/arm/dts/px30-evb-u-boot.dtsi
+++ b/arch/arm/dts/px30-evb-u-boot.dtsi
@@ -31,12 +31,15 @@ 
 &sdmmc {
 	u-boot,dm-pre-reloc;
 
-	/* temporary till I find out why dma mode doesn't work */
+	/* mmc to sram can't do dma, prevent aborts transfering TF-A parts */
 	fifo-mode;
 };
 
 &emmc {
 	u-boot,dm-pre-reloc;
+
+	/* mmc to sram can't do dma, prevent aborts transfering TF-A parts */
+	fifo-mode;
 };
 
 &grf {