From patchwork Wed Jan 11 09:55:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 9509729 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8522060231 for ; Wed, 11 Jan 2017 09:56:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A5C22858F for ; Wed, 11 Jan 2017 09:56:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6ED6F2859A; Wed, 11 Jan 2017 09:56:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B99A52858F for ; Wed, 11 Jan 2017 09:56:17 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cRFdb-0001Mx-Mk; Wed, 11 Jan 2017 09:56:11 +0000 Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cRFdY-0001HQ-4w for linux-amlogic@lists.infradead.org; Wed, 11 Jan 2017 09:56:10 +0000 Received: by mail-wm0-x230.google.com with SMTP id r144so22952651wme.1 for ; Wed, 11 Jan 2017 01:55:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=QjfMPsJAykHqdXP5WJqyuvsw3xAwsuFuVe1knXlL9/A=; b=KN636NWs0nD6Yzk0CSlUUN4p0XYzLlf2IM5+Na3qycfFKTh/6szPOsRhU2w2D+9d8o XlnVdBl8e41lF5CnoNB+qRx1DNbAzB1hKAqnWewggcIwmfAJaKAwbWmbDS2B5FsBljT2 Ag0XCM3ZO+InXLaBrQyWknxWrXx9685uTvaklU8jFHORfHME4T879yrjnsHM5IRIidl1 KLi5yg4gUhq8tnynT+TiUPmMHwF6LeAyaQmOPoncriTj56EA0l6lKaNJzu9IPbWW1sJE zjSIX0u7gsdh1qddJ5HxiRhYoqdM/K5dxf2XmQuWOOOPJ0fUSoBfVgoZsEwrepw5sueJ aKLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=QjfMPsJAykHqdXP5WJqyuvsw3xAwsuFuVe1knXlL9/A=; b=MXrdfJQ4ucuV5NrZAwAcfj1gNeh+INXPfuLP6IikL7eGRdSe9GfWiwv8bntFZVgS+M FkE7CUNHA+yJgVz2x7XcU+hJpbCdbL2mUeIWFUV//eWeVIgVTNqckePXvx58q4/IXQpR Yy+HNnY8uP+laTbryY/99GojJaPk3gh5Jp5EByiDoDkeLlBEpKWzXEJZY5jXCQkTpESi aXHxBFhk15MZIjYV4O07yJhC8rLBMdz6dfQeatYWlye0f8nAOhS97gR9EXxoNE2B9Vc9 l/sAlALkjjmkh59u3Pc0UKhST+cehrJiTouUCV6bIPrOPSAvMfFG0sVkggiE41T7yHZw ghmw== X-Gm-Message-State: AIkVDXJsdc5RTqBUfDeUCz1sY4ZsS8/RjPo730AEhC0goRgruHDOZdb+PQ/vlc5rRPOLZGQS X-Received: by 10.28.109.218 with SMTP id b87mr4187815wmi.52.1484128546308; Wed, 11 Jan 2017 01:55:46 -0800 (PST) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id e5sm28945068wma.12.2017.01.11.01.55.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Jan 2017 01:55:45 -0800 (PST) From: Neil Armstrong To: xypron.glpk@gmx.de, khilman@baylibre.com, carlo@caione.org Subject: [RESEND PATCH v3] ARM64: dts: meson-gx: Add reserved memory zone and usable memory range Date: Wed, 11 Jan 2017 10:55:40 +0100 Message-Id: <1484128540-22662-1-git-send-email-narmstrong@baylibre.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170111_015608_512028_ABBBC8A8 X-CRM114-Status: GOOD ( 11.32 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Neil Armstrong MIME-Version: 1.0 Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The Amlogic Meson GXBB/GXL/GXM secure monitor uses part of the memory space, this patch adds this reserved zone and redefines the usable memory range. The memory node is also moved from the dtsi files into the proper dts files to handle variants memory sizes. This patch also fixes the memory sizes for the following platforms : - gxl-s905x-p212 : 1GiB instead of 2GiB, a proper 2GiB dts should be pushed - gxm-s912-q201 : 1GiB instead of 2GiB, a proper 2GiB dts should be pushed - gxl-s905d-p231 : 1GiB instead of 2GiB, a proper 2GiB dts should be pushed - gxl-nexbox-a95x : 1GiB instead of 2GiB, a proper 2GiB dts should be pushed Signed-off-by: Neil Armstrong --- arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi | 5 ----- arch/arm64/boot/dts/amlogic/meson-gx.dtsi | 12 ++++++++++++ arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts | 6 +++++- arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 6 +++++- arch/arm64/boot/dts/amlogic/meson-gxbb-p200.dts | 9 +++++++++ arch/arm64/boot/dts/amlogic/meson-gxbb-p201.dts | 9 +++++++++ arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi | 5 ----- arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-meta.dts | 6 +++++- arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-pro.dts | 6 +++++- arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-telos.dts | 6 +++++- arch/arm64/boot/dts/amlogic/meson-gxl-nexbox-a95x.dts | 6 +++++- arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p230.dts | 9 +++++++++ arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p231.dts | 9 +++++++++ arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dts | 6 +++++- arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts | 6 +++++- arch/arm64/boot/dts/amlogic/meson-gxm-s912-q200.dts | 9 +++++++++ arch/arm64/boot/dts/amlogic/meson-gxm-s912-q201.dts | 9 +++++++++ 17 files changed, 106 insertions(+), 18 deletions(-) Changes since original v2 at [3]: - Typo in commit 2GiB -> 1GiB, 4GiB -> 2GiB Changes since v2 at [2]: - Moved all memory node out of dtsi - Added comment about useable memory - Fixed comment about secmon reserved zone Changes since v1 at [1] : - Renamed reg into linux,usable-memory to ovveride u-boot memory - only kept secmon memory zone [1] http://lkml.kernel.org/r/20161212101801.28491-1-narmstrong@baylibre.com [2] http://lkml.kernel.org/r/1483105232-6242-1-git-send-email-narmstrong@baylibre.com [3] http://lkml.kernel.org/r/1484128128-22454-1-git-send-email-narmstrong@baylibre.com diff --git a/arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi b/arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi index 7a078be..360ec0d 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi @@ -54,11 +54,6 @@ stdout-path = "serial0:115200n8"; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x0 0x0 0x80000000>; - }; - vddio_boot: regulator-vddio_boot { compatible = "regulator-fixed"; regulator-name = "VDDIO_BOOT"; diff --git a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi index eada0b5..66677b5 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi @@ -55,6 +55,18 @@ #address-cells = <2>; #size-cells = <2>; + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + /* 2MiB reserved for ARM Trusted Firmware (BL31) */ + secmon: secmon { + reg = <0x0 0x10000000 0x0 0x200000>; + no-map; + }; + }; + cpus { #address-cells = <0x2>; #size-cells = <0x0>; diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts index 4cbd626..adcaf0b 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts @@ -62,7 +62,11 @@ memory@0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x40000000>; + /* + * The first 16MiB and last 16MiB of the DDR memory + * are reserved to the Hardware ROM Firmware + */ + linux,usable-memory = <0x0 0x1000000 0x0 0x3f000000>; }; leds { diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts index 238fbea..9d45fe6 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts @@ -61,7 +61,11 @@ memory@0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x80000000>; + /* + * The first 16MiB and last 16MiB of the DDR memory + * are reserved to the Hardware ROM Firmware + */ + linux,usable-memory = <0x0 0x1000000 0x0 0x7f000000>; }; usb_otg_pwr: regulator-usb-pwrs { diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-p200.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-p200.dts index 03e3d76..8ce7cc1 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxbb-p200.dts +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-p200.dts @@ -49,6 +49,15 @@ / { compatible = "amlogic,p200", "amlogic,meson-gxbb"; model = "Amlogic Meson GXBB P200 Development Board"; + + memory@0 { + device_type = "memory"; + /* + * The first 16MiB and last 16MiB of the DDR memory + * are reserved to the Hardware ROM Firmware + */ + linux,usable-memory = <0x0 0x1000000 0x0 0x3f000000>; + }; }; &i2c_B { diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-p201.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-p201.dts index 39bb037..0de22c7 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxbb-p201.dts +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-p201.dts @@ -49,4 +49,13 @@ / { compatible = "amlogic,p201", "amlogic,meson-gxbb"; model = "Amlogic Meson GXBB P201 Development Board"; + + memory@0 { + device_type = "memory"; + /* + * The first 16MiB and last 16MiB of the DDR memory + * are reserved to the Hardware ROM Firmware + */ + linux,usable-memory = <0x0 0x1000000 0x0 0x3f000000>; + }; }; diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi index 4a96e0f..8052a39 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi @@ -53,11 +53,6 @@ stdout-path = "serial0:115200n8"; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x0 0x0 0x40000000>; - }; - usb_pwr: regulator-usb-pwrs { compatible = "regulator-fixed"; diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-meta.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-meta.dts index 62fb496..9d27e4f 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-meta.dts +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-meta.dts @@ -50,6 +50,10 @@ memory@0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x80000000>; + /* + * The first 16MiB and last 16MiB of the DDR memory + * are reserved to the Hardware ROM Firmware + */ + linux,usable-memory = <0x0 0x1000000 0x0 0x7f000000>; }; }; diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-pro.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-pro.dts index 9a9663a..0112205 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-pro.dts +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-pro.dts @@ -50,6 +50,10 @@ memory@0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x40000000>; + /* + * The first 16MiB and last 16MiB of the DDR memory + * are reserved to the Hardware ROM Firmware + */ + linux,usable-memory = <0x0 0x1000000 0x0 0x3f000000>; }; }; diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-telos.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-telos.dts index 2fe167b..16bad57 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-telos.dts +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95-telos.dts @@ -50,6 +50,10 @@ memory@0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x80000000>; + /* + * The first 16MiB and last 16MiB of the DDR memory + * are reserved to the Hardware ROM Firmware + */ + linux,usable-memory = <0x0 0x1000000 0x0 0x7f000000>; }; }; diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-nexbox-a95x.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-nexbox-a95x.dts index cea4a3e..b9a354a 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxl-nexbox-a95x.dts +++ b/arch/arm64/boot/dts/amlogic/meson-gxl-nexbox-a95x.dts @@ -60,7 +60,11 @@ memory@0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x80000000>; + /* + * The first 16MiB and last 16MiB of the DDR memory + * are reserved to the Hardware ROM Firmware + */ + linux,usable-memory = <0x0 0x1000000 0x0 0x3f000000>; }; vddio_card: gpio-regulator { diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p230.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p230.dts index f66939c..d96d0c3 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p230.dts +++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p230.dts @@ -49,6 +49,15 @@ / { compatible = "amlogic,p230", "amlogic,s905d", "amlogic,meson-gxl"; model = "Amlogic Meson GXL (S905D) P230 Development Board"; + + memory@0 { + device_type = "memory"; + /* + * The first 16MiB and last 16MiB of the DDR memory + * are reserved to the Hardware ROM Firmware + */ + linux,usable-memory = <0x0 0x1000000 0x0 0x7f000000>; + }; }; /* P230 has exclusive choice between internal or external PHY */ diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p231.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p231.dts index 95992cf..e21d3ff 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p231.dts +++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p231.dts @@ -49,6 +49,15 @@ / { compatible = "amlogic,p231", "amlogic,s905d", "amlogic,meson-gxl"; model = "Amlogic Meson GXL (S905D) P231 Development Board"; + + memory@0 { + device_type = "memory"; + /* + * The first 16MiB and last 16MiB of the DDR memory + * are reserved to the Hardware ROM Firmware + */ + linux,usable-memory = <0x0 0x1000000 0x0 0x3f000000>; + }; }; /* P231 has only internal PHY port */ diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dts index 9639f01..71c5a40 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dts +++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dts @@ -59,7 +59,11 @@ memory@0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x80000000>; + /* + * The first 16MiB and last 16MiB of the DDR memory + * are reserved to the Hardware ROM Firmware + */ + linux,usable-memory = <0x0 0x1000000 0x0 0x3f000000>; }; }; diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts index 5a337d3..2568e33 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts +++ b/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts @@ -62,7 +62,11 @@ memory@0 { device_type = "memory"; - reg = <0x0 0x0 0x0 0x80000000>; + /* + * The first 16MiB and last 16MiB of the DDR memory + * are reserved to the Hardware ROM Firmware + */ + linux,usable-memory = <0x0 0x1000000 0x0 0x7f000000>; }; vddio_boot: regulator-vddio-boot { diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-s912-q200.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-s912-q200.dts index 5dbc660..2ef5e20 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxm-s912-q200.dts +++ b/arch/arm64/boot/dts/amlogic/meson-gxm-s912-q200.dts @@ -49,6 +49,15 @@ / { compatible = "amlogic,q200", "amlogic,s912", "amlogic,meson-gxm"; model = "Amlogic Meson GXM (S912) Q200 Development Board"; + + memory@0 { + device_type = "memory"; + /* + * The first 16MiB and last 16MiB of the DDR memory + * are reserved to the Hardware ROM Firmware + */ + linux,usable-memory = <0x0 0x1000000 0x0 0x7f000000>; + }; }; /* Q200 has exclusive choice between internal or external PHY */ diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-s912-q201.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-s912-q201.dts index 95e11d7..017b9af 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gxm-s912-q201.dts +++ b/arch/arm64/boot/dts/amlogic/meson-gxm-s912-q201.dts @@ -49,6 +49,15 @@ / { compatible = "amlogic,q201", "amlogic,s912", "amlogic,meson-gxm"; model = "Amlogic Meson GXM (S912) Q201 Development Board"; + + memory@0 { + device_type = "memory"; + /* + * The first 16MiB and last 16MiB of the DDR memory + * are reserved to the Hardware ROM Firmware + */ + linux,usable-memory = <0x0 0x1000000 0x0 0x3f000000>; + }; }; /* Q201 has only internal PHY port */