From f57f690ed39eef7d474efb4f202b78049898525c Mon Sep 17 00:00:00 2001 From: Clement Faure Date: Fri, 13 Apr 2018 11:11:36 +0200 Subject: [PATCH] MLK-18036-1 Add "fsl,optee-lpm-sram" node for optee os power management. This node will be used by the OCRAM driver in optee to: * Get the OCRAM start address for power management in optee. * Add an entry that will overwrite ocrams nodes and dynamically reduce the OCRAM available for mmio-sram in Linux. That way we do not touch the legacy Linux boot and remove the dedicated optee device tree. Signed-off-by: Clement Faure Reviewed-by: Peng Fan (cherry picked from commit e96a3bcd754dee0aef3519bc08979985493be52c) --- arch/arm/boot/dts/imx6dl.dtsi | 7 +++++++ arch/arm/boot/dts/imx6q.dtsi | 7 +++++++ arch/arm/boot/dts/imx6sl.dtsi | 7 +++++++ arch/arm/boot/dts/imx6sll.dtsi | 10 ++++++++-- arch/arm/boot/dts/imx6sx.dtsi | 10 ++++++++++ arch/arm/boot/dts/imx6ul.dtsi | 8 +++++++- arch/arm/boot/dts/imx6ull.dtsi | 8 +++++++- arch/arm/boot/dts/imx7d.dtsi | 11 ++++++++++- 8 files changed, 63 insertions(+), 5 deletions(-) diff --git a/arch/arm/boot/dts/imx6dl.dtsi b/arch/arm/boot/dts/imx6dl.dtsi index 10eca6f10ab6..dcd241522748 100644 --- a/arch/arm/boot/dts/imx6dl.dtsi +++ b/arch/arm/boot/dts/imx6dl.dtsi @@ -1,6 +1,7 @@ /* * Copyright 2013-2015 Freescale Semiconductor, Inc. + * Copyright 2018 NXP * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -120,6 +121,12 @@ clocks = <&clks IMX6QDL_CLK_OCRAM>; }; + ocram_optee: sram@00918000 { + compatible = "fsl,optee-lpm-sram"; + reg = <0x00918000 0x8000>; + overw_reg = <&ocram 0x00905000 0x13000>; + }; + aips1: aips-bus@02000000 { iomuxc: iomuxc@020e0000 { compatible = "fsl,imx6dl-iomuxc"; diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi index 37647331f2c1..b24909ab9177 100644 --- a/arch/arm/boot/dts/imx6q.dtsi +++ b/arch/arm/boot/dts/imx6q.dtsi @@ -1,6 +1,7 @@ /* * Copyright 2013-2015 Freescale Semiconductor, Inc. + * Copyright 2018 NXP * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -139,6 +140,12 @@ clocks = <&clks IMX6QDL_CLK_OCRAM>; }; + ocram_optee: sram@00938000 { + compatible = "fsl,optee-lpm-sram"; + reg = <0x00938000 0x8000>; + overw_reg = <&ocram 0x00905000 0x33000>; + }; + aips-bus@02000000 { /* AIPS1 */ spba-bus@02000000 { ecspi5: ecspi@02018000 { diff --git a/arch/arm/boot/dts/imx6sl.dtsi b/arch/arm/boot/dts/imx6sl.dtsi index a742d7400b0e..ee3f9a0c0c32 100644 --- a/arch/arm/boot/dts/imx6sl.dtsi +++ b/arch/arm/boot/dts/imx6sl.dtsi @@ -1,5 +1,6 @@ /* * Copyright 2013-2016 Freescale Semiconductor, Inc. + * Copyright 2018 NXP * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -167,6 +168,12 @@ clocks = <&clks IMX6SL_CLK_OCRAM>; }; + ocram_optee: sram@00918000 { + compatible = "fsl,optee-lpm-sram"; + reg = <0x00918000 0x8000>; + overw_reg = <&ocram 0x00905000 0x13000>; + }; + L2: l2-cache@00a02000 { compatible = "arm,pl310-cache"; reg = <0x00a02000 0x1000>; diff --git a/arch/arm/boot/dts/imx6sll.dtsi b/arch/arm/boot/dts/imx6sll.dtsi index d76c363ec5af..8b2e72bf61fe 100644 --- a/arch/arm/boot/dts/imx6sll.dtsi +++ b/arch/arm/boot/dts/imx6sll.dtsi @@ -1,6 +1,6 @@ /* * Copyright 2016 Freescale Semiconductor, Inc. - * Copyright 2017 NXP. + * Copyright 2017-2018 NXP * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -167,6 +167,12 @@ reg = <0x00905000 0x1B000>; }; + ocram_optee: sram@00918000 { + compatible = "fsl,optee-lpm-sram"; + reg = <0x00918000 0x8000>; + overw_reg = <&ocram 0x00905000 0x13000>; + }; + L2: l2-cache@00a02000 { compatible = "arm,pl310-cache"; reg = <0x00a02000 0x1000>; @@ -679,7 +685,7 @@ ; clocks = <&clks IMX6SLL_CLK_DCP>; clock-names = "dcp"; - }; + }; }; aips2: aips-bus@02100000 { diff --git a/arch/arm/boot/dts/imx6sx.dtsi b/arch/arm/boot/dts/imx6sx.dtsi index ddb2bc693eb5..0a454d185260 100644 --- a/arch/arm/boot/dts/imx6sx.dtsi +++ b/arch/arm/boot/dts/imx6sx.dtsi @@ -1,5 +1,6 @@ /* * Copyright 2014-2016 Freescale Semiconductor, Inc. + * Copyright 2018 NXP * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -209,6 +210,15 @@ clocks = <&clks IMX6SX_CLK_OCRAM>; }; + ocram_optee { + compatible = "fsl,optee-lpm-sram"; + reg = <0x008f8000 0x4000>; + overw_reg = <&ocrams_ddr 0x00904000 0x1000>, + <&ocram 0x00905000 0x1b000>, + <&ocrams 0x00900000 0x4000>; + overw_clock = <&ocrams &clks IMX6SX_CLK_OCRAM>; + }; + L2: l2-cache@00a02000 { compatible = "arm,pl310-cache"; reg = <0x00a02000 0x1000>; diff --git a/arch/arm/boot/dts/imx6ul.dtsi b/arch/arm/boot/dts/imx6ul.dtsi index 41c30d58661c..bfdfcd7ab680 100644 --- a/arch/arm/boot/dts/imx6ul.dtsi +++ b/arch/arm/boot/dts/imx6ul.dtsi @@ -1,6 +1,6 @@ /* * Copyright 2015-2016 Freescale Semiconductor, Inc. - * Copyright 2017 NXP. + * Copyright 2017-2018 NXP * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -175,6 +175,12 @@ reg = <0x00905000 0x1B000>; }; + ocram_optee: sram@00918000 { + compatible = "fsl,optee-lpm-sram"; + reg = <0x00918000 0x8000>; + overw_reg = <&ocram 0x00905000 0x13000>; + }; + dma_apbh: dma-apbh@01804000 { compatible = "fsl,imx6q-dma-apbh", "fsl,imx28-dma-apbh"; reg = <0x01804000 0x2000>; diff --git a/arch/arm/boot/dts/imx6ull.dtsi b/arch/arm/boot/dts/imx6ull.dtsi index 2253804b8505..54ee30415977 100644 --- a/arch/arm/boot/dts/imx6ull.dtsi +++ b/arch/arm/boot/dts/imx6ull.dtsi @@ -1,6 +1,6 @@ /* * Copyright 2015-2016 Freescale Semiconductor, Inc. - * Copyright 2017 NXP. + * Copyright 2017-2018 NXP * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -184,6 +184,12 @@ reg = <0x00905000 0x1B000>; }; + ocram_optee: sram@00918000 { + compatible = "fsl,optee-lpm-sram"; + reg = <0x00918000 0x8000>; + overw_reg = <&ocram 0x00905000 0x13000>; + }; + dma_apbh: dma-apbh@01804000 { compatible = "fsl,imx6ul-dma-apbh", "fsl,imx28-dma-apbh"; reg = <0x01804000 0x2000>; diff --git a/arch/arm/boot/dts/imx7d.dtsi b/arch/arm/boot/dts/imx7d.dtsi index 3a7535ed10d4..ea58c4f1dfac 100644 --- a/arch/arm/boot/dts/imx7d.dtsi +++ b/arch/arm/boot/dts/imx7d.dtsi @@ -1,7 +1,7 @@ /* * Copyright 2015-2016 Freescale Semiconductor, Inc. * Copyright 2016 Toradex AG - * Copyright 2017 NXP. + * Copyright 2017-2018 NXP * * This file is dual-licensed: you can use it either under the terms * of the GPL or the X11 license, at your option. Note that this dual @@ -160,6 +160,15 @@ clocks = <&clks IMX7D_OCRAM_CLK>; }; + ocram_optee { + compatible = "fsl,optee-lpm-sram"; + reg = <0x00180000 0x8000>; + overw_reg = <&ocrams_ddr 0x00904000 0x1000>, + <&ocram 0x00905000 0x1b000>, + <&ocrams 0x00900000 0x4000>; + overw_clock = <&ocrams &clks IMX7D_OCRAM_CLK>; + }; + dma_apbh: dma-apbh@33000000 { compatible = "fsl,imx7d-dma-apbh", "fsl,imx28-dma-apbh"; reg = <0x33000000 0x2000>; -- 2.17.1