From patchwork Wed Jan 18 16:50:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 9524263 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 4F2C460113 for ; Wed, 18 Jan 2017 16:51:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4428F277D9 for ; Wed, 18 Jan 2017 16:51:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 38F98285E3; Wed, 18 Jan 2017 16:51:40 +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 A3D44277D9 for ; Wed, 18 Jan 2017 16:51:39 +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 1cTtSO-0003Lr-7F; Wed, 18 Jan 2017 16:51:32 +0000 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cTtSA-000312-4K for linux-amlogic@lists.infradead.org; Wed, 18 Jan 2017 16:51:20 +0000 Received: by mail-wm0-x231.google.com with SMTP id r126so253273840wmr.0 for ; Wed, 18 Jan 2017 08:50:57 -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=8pR76Fy2mNxYFqcnSNSPu8HPj7FBTSWlMyQYvVBfM8w=; b=DaopEqzA9uRcuDQjAxIGDwkUunH2fOJHYVoOnKhP30bI/4Dd5OXGzktFB0uWqATEbk +AwtDNcTGat13uXW+tM8/byHToMEXunL0gvRyLZJpdEnE2kRFBl9iKSuWbweTru0IHYR yPAi0moTQi08HIFSGNCDaD3wbGVPugSoofoJ+zx3PhEEJ7L5hnyAm7l/E3y2KeoHRiQx 0KCWH43bvfcxcgxu3b3QCiGJ2Ssae/F5QTFQ+A9EQW6zuJhVwRofS2bnCzu7J3XQr9FD +PgOXr9y2KqNH68plvlqX034O6o6evifLlgZRK5shGMs2tehv1n2k5M/95qkzzbSmgli JtZA== 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=8pR76Fy2mNxYFqcnSNSPu8HPj7FBTSWlMyQYvVBfM8w=; b=BUr1TpVFVdHpOaYJO0yYOxx/FyDmaKUFrtcWNwxlNap0JvGKbSUa66swvRG9iEaebl YG3+hu01Y+mpvPfEFMAEl2KVC65nwyLTOO/CCIzw9RquRTd3htpQ+hIAqYuXPyABHWEy IXmsTvYrqetgZvazhYsHK2WJWEvzTzIWepr8aign1wN39l2XSAhHf9aeu6VX7deXQKwX +8F4wFH3SrpXselMJRJHyo3YxJf5+II8zpZj8RVOOmJ3W+fBhsAon+LtZnOR+Rl8CevN gsx5NCvM1rp0RSdgQonSmffTQs6U4cbE2jBj2GyuObn7vgB60jBC4c335v7m1sjhSMN7 9zow== X-Gm-Message-State: AIkVDXLFyDCpYS6qfDwiInbskgYrFkPlnKeJ4cone0HkhS55hVLVc1Fdez2L9SzqvAXn94TG X-Received: by 10.223.133.132 with SMTP id 4mr4122347wrt.136.1484758256414; Wed, 18 Jan 2017 08:50:56 -0800 (PST) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id y127sm6033366wmg.12.2017.01.18.08.50.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Jan 2017 08:50:55 -0800 (PST) From: Neil Armstrong To: xypron.glpk@gmx.de, khilman@baylibre.com, carlo@caione.org, afaerber@suse.de Subject: [PATCH v5] ARM64: dts: meson-gx: Add firmware reserved memory zones Date: Wed, 18 Jan 2017 17:50:45 +0100 Message-Id: <1484758245-9354-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-20170118_085118_352906_241FBA19 X-CRM114-Status: UNSURE ( 9.78 ) X-CRM114-Notice: Please train this message. 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 these reserved zones. Without such reserved memory zones, running the following stress command : $ stress-ng --vm 16 --vm-bytes 128M --timeout 10s multiple times: Could lead to the following kernel crashes : [ 46.937975] Bad mode in Error handler detected on CPU1, code 0xbf000000 -- SError ... [ 47.058536] Internal error: Attempting to execute userspace memory: 8600000f [#3] PREEMPT SMP ... Instead of the OOM killer. Signed-off-by: Neil Armstrong Reviewed-by: Andreas Färber --- arch/arm64/boot/dts/amlogic/meson-gx.dtsi | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) Changes since v4 at [5]: - Move start of ddr memory to reserved-memory node - Drop memory node move - Fix typo in sizes Changes since resent v2 at [4]: - Fix invalid comment of useable memory attributes 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 [4] http://lkml.kernel.org/r/1484128540-22662-1-git-send-email-narmstrong@baylibre.com [5] http://lkml.kernel.org/r/1484129414-23325-1-git-send-email-narmstrong@baylibre.com diff --git a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi index eada0b5..63d52b7 100644 --- a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi @@ -55,6 +55,24 @@ #address-cells = <2>; #size-cells = <2>; + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + /* 16 MiB reserved for Hardware ROM Firmware */ + hwrom: hwrom { + reg = <0x0 0x0 0x0 0x1000000>; + no-map; + }; + + /* 2 MiB reserved for ARM Trusted Firmware (BL31) */ + secmon: secmon { + reg = <0x0 0x10000000 0x0 0x200000>; + no-map; + }; + }; + cpus { #address-cells = <0x2>; #size-cells = <0x0>;