From patchwork Tue Sep 19 18:32:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 113051 Delivered-To: patches@linaro.org Received: by 10.140.106.117 with SMTP id d108csp5244103qgf; Tue, 19 Sep 2017 11:32:27 -0700 (PDT) X-Received: by 10.28.158.208 with SMTP id h199mr1741099wme.47.1505845947546; Tue, 19 Sep 2017 11:32:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505845947; cv=none; d=google.com; s=arc-20160816; b=oEo/8pV3GA9Vz4qKTIwzeEn6LGh3pAW1JXK/CiFbO834go+4FxF0qOt6O8DmpLGkVZ pqsJ7E4t2yjc9pNIW3CKjs12uheYXijW6QuDEJi+kWOQ5Yr6E7+JKpvhyauFYxcrZynp kmhQLJXn5OFNLR7BR8hNmbWfSe7xnSIvNf3U392F8oY7yjmF+2EB1DUFI8b90MgWQVJU VunjZB9YCyB25qkqp0+/cMwnfCn3xBJqab0LcZ+70wn3RQl+7vKtNViidP5g1saX5j8E FdqBxrBoVldxDYbXBhKouoGOEqx2WNgLk4HAxYUeL8FmFpMj6CQNfVZqPsMO7lv3kDft e4XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=6S0NG5jFWgUVizBlTblUT1+pfxuMqoe9iPUSK/7TzmE=; b=XGDWhSLbQlCpEbw17dgU4rdBeZBJUh1sk/jckqrSNrbYBAcoaBxzKeNnHAitABgqbT SGhaNr+ej2VC07Rp/VUYEI3mfFAfynXJJXPhXBrKQ/I5AOiql48S16eIVFNDPk3brcNy 3ufh91sn3/YPVval6Xe60aWuXkA22z6mX+HvULcyB0nx9Cz//ynOlk+6zoEXIC5Aj66V ffBzYdukEg4lMV6t3nzCSawKjF3TQfNG++mIyBvGYzex0e93YmcQrjA6FQyxHIlr2hfX fP7tpdJDpKa6xohIm5N1Av2cKY5pRJEg5cKmQq5H+QVIlxyk+2IvjM3wjzxkewJTE3ik zikg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=haKWC/Tr; spf=pass (google.com: domain of daniel.thompson@linaro.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=daniel.thompson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id p15sor4088619wrc.23.2017.09.19.11.32.27 for (Google Transport Security); Tue, 19 Sep 2017 11:32:27 -0700 (PDT) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=haKWC/Tr; spf=pass (google.com: domain of daniel.thompson@linaro.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=daniel.thompson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6S0NG5jFWgUVizBlTblUT1+pfxuMqoe9iPUSK/7TzmE=; b=haKWC/TrIRKL9JPnYh7DhbmM/kNY1+JLPUf8Wfsfv4PsQxc31RAl5lW+6/QPkBZJRS yU8Nu0hGNmuW1CVaB+26SEVvj0QuRNZs8f/MioBs7v1i64tcEW8y1jx6fYkMjXOMzArl JiHAh45BCv4O5MpDj/JdAMtKrzPUH31jCA+d0= 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:in-reply-to :references; bh=6S0NG5jFWgUVizBlTblUT1+pfxuMqoe9iPUSK/7TzmE=; b=P6Whq8cv+/Ky+XTIUOwEqfUjrD37zRddH4DfbRgTZQmA7h6Fy6Z6AJVfJxI121Na3d U4nEcwBwyFBiFIkhPVfSrBt38IlMm5Ogw9M25TTAoymzQ5UxUHeGR9BKrP2mvvWJEwgm wSLqU4+Ym7kKV/VoiHffqOHyKbGw4V5YsiOlGvJijB33dPVPQWyFPPTakhVo1Wzuh9SG f3tjche2uWDT7V987jLlRGQsBHbRPRnxqkEy7uKtBadWOU7/xH8inMVgKM6H6qGu2EEU 8L4HLuVDBQNYK3HCkfXQw2wKcXG3nsFVLJgIeAQJYw2U2j74tawUTX3QAqvjQPyn3bhT ABRQ== X-Gm-Message-State: AHPjjUgw3jkKQ7F2K3klwVC1VAIC30wYHhVUgpDq3E0fgedEGGdb9ibt UdCUL+5ygIAAQFFMrssHzvGoHYhl X-Google-Smtp-Source: AOwi7QAn0paMsWSPZY1yiJ7FYsqBqP1tW+hQ0X/7/8hYKfTkFZK1T9PPPvcddvSUwnGyoSIfiDge2Q== X-Received: by 10.223.135.155 with SMTP id b27mr2362185wrb.10.1505845946987; Tue, 19 Sep 2017 11:32:26 -0700 (PDT) Return-Path: Received: from wychelm.lan (cpc87211-aztw31-2-0-cust196.18-1.cable.virginm.net. [82.46.60.197]) by smtp.gmail.com with ESMTPSA id u1sm9082818wrd.95.2017.09.19.11.32.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Sep 2017 11:32:25 -0700 (PDT) From: Daniel Thompson To: Liviu Dudau , Sudeep Holla , Lorenzo Pieralisi Cc: Daniel Thompson , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, patches@linaro.org Subject: [PATCH v2] arm64: dts: foundation-v8: Enable PSCI mode Date: Tue, 19 Sep 2017 19:32:04 +0100 Message-Id: <20170919183204.12751-1-daniel.thompson@linaro.org> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20170918153832.16356-1-daniel.thompson@linaro.org> References: <20170918153832.16356-1-daniel.thompson@linaro.org> Currently if the Foundation model is running ARM Trusted Firmware then the kernel, which is configured to use spin tables, cannot start secondary processors or "power off" the simulation. After adding a couple of labels to the include file and splitting out the spin-table configuration into a header, we add a couple of new headers together with two new DTs (GICv2+PSCI and GICv3+PSCI). The new GICv3+PSCI DT has been boot tested, the remaining three (two of which existed prior to this patch) have been "tested" by decompiling the blobs and comparing them against a reference. Acked-by: Mark Rutland Signed-off-by: Daniel Thompson --- arch/arm64/boot/dts/arm/Makefile | 4 +++- arch/arm64/boot/dts/arm/foundation-v8-gicv2.dtsi | 19 +++++++++++++++ .../boot/dts/arm/foundation-v8-gicv3-psci.dts | 9 +++++++ arch/arm64/boot/dts/arm/foundation-v8-gicv3.dts | 25 ++----------------- arch/arm64/boot/dts/arm/foundation-v8-gicv3.dtsi | 28 ++++++++++++++++++++++ arch/arm64/boot/dts/arm/foundation-v8-psci.dts | 9 +++++++ arch/arm64/boot/dts/arm/foundation-v8-psci.dtsi | 28 ++++++++++++++++++++++ .../boot/dts/arm/foundation-v8-spin-table.dtsi | 25 +++++++++++++++++++ arch/arm64/boot/dts/arm/foundation-v8.dts | 16 ++----------- arch/arm64/boot/dts/arm/foundation-v8.dtsi | 16 ++++--------- 10 files changed, 129 insertions(+), 50 deletions(-) create mode 100644 arch/arm64/boot/dts/arm/foundation-v8-gicv2.dtsi create mode 100644 arch/arm64/boot/dts/arm/foundation-v8-gicv3-psci.dts create mode 100644 arch/arm64/boot/dts/arm/foundation-v8-gicv3.dtsi create mode 100644 arch/arm64/boot/dts/arm/foundation-v8-psci.dts create mode 100644 arch/arm64/boot/dts/arm/foundation-v8-psci.dtsi create mode 100644 arch/arm64/boot/dts/arm/foundation-v8-spin-table.dtsi -- 2.9.5 diff --git a/arch/arm64/boot/dts/arm/Makefile b/arch/arm64/boot/dts/arm/Makefile index 75cc2aa10101..25f82c377f67 100644 --- a/arch/arm64/boot/dts/arm/Makefile +++ b/arch/arm64/boot/dts/arm/Makefile @@ -1,4 +1,6 @@ -dtb-$(CONFIG_ARCH_VEXPRESS) += foundation-v8.dtb foundation-v8-gicv3.dtb +dtb-$(CONFIG_ARCH_VEXPRESS) += \ + foundation-v8.dtb foundation-v8-psci.dtb \ + foundation-v8-gicv3.dtb foundation-v8-gicv3-psci.dtb dtb-$(CONFIG_ARCH_VEXPRESS) += juno.dtb juno-r1.dtb juno-r2.dtb dtb-$(CONFIG_ARCH_VEXPRESS) += rtsm_ve-aemv8a.dtb dtb-$(CONFIG_ARCH_VEXPRESS) += vexpress-v2f-1xv7-ca53x2.dtb diff --git a/arch/arm64/boot/dts/arm/foundation-v8-gicv2.dtsi b/arch/arm64/boot/dts/arm/foundation-v8-gicv2.dtsi new file mode 100644 index 000000000000..851abf34fc80 --- /dev/null +++ b/arch/arm64/boot/dts/arm/foundation-v8-gicv2.dtsi @@ -0,0 +1,19 @@ +/* + * ARM Ltd. + * + * ARMv8 Foundation model DTS (GICv2 configuration) + */ + +/ { + gic: interrupt-controller@2c001000 { + compatible = "arm,cortex-a15-gic", "arm,cortex-a9-gic"; + #interrupt-cells = <3>; + #address-cells = <2>; + interrupt-controller; + reg = <0x0 0x2c001000 0 0x1000>, + <0x0 0x2c002000 0 0x2000>, + <0x0 0x2c004000 0 0x2000>, + <0x0 0x2c006000 0 0x2000>; + interrupts = <1 9 0xf04>; + }; +}; diff --git a/arch/arm64/boot/dts/arm/foundation-v8-gicv3-psci.dts b/arch/arm64/boot/dts/arm/foundation-v8-gicv3-psci.dts new file mode 100644 index 000000000000..e096e670bec3 --- /dev/null +++ b/arch/arm64/boot/dts/arm/foundation-v8-gicv3-psci.dts @@ -0,0 +1,9 @@ +/* + * ARM Ltd. + * + * ARMv8 Foundation model DTS (GICv3+PSCI configuration) + */ + +#include "foundation-v8.dtsi" +#include "foundation-v8-gicv3.dtsi" +#include "foundation-v8-psci.dtsi" diff --git a/arch/arm64/boot/dts/arm/foundation-v8-gicv3.dts b/arch/arm64/boot/dts/arm/foundation-v8-gicv3.dts index 35588dfa095c..c5d834d7d0ba 100644 --- a/arch/arm64/boot/dts/arm/foundation-v8-gicv3.dts +++ b/arch/arm64/boot/dts/arm/foundation-v8-gicv3.dts @@ -5,26 +5,5 @@ */ #include "foundation-v8.dtsi" - -/ { - gic: interrupt-controller@2f000000 { - compatible = "arm,gic-v3"; - #interrupt-cells = <3>; - #address-cells = <2>; - #size-cells = <2>; - ranges; - interrupt-controller; - reg = <0x0 0x2f000000 0x0 0x10000>, - <0x0 0x2f100000 0x0 0x200000>, - <0x0 0x2c000000 0x0 0x2000>, - <0x0 0x2c010000 0x0 0x2000>, - <0x0 0x2c02f000 0x0 0x2000>; - interrupts = <1 9 4>; - - its: its@2f020000 { - compatible = "arm,gic-v3-its"; - msi-controller; - reg = <0x0 0x2f020000 0x0 0x20000>; - }; - }; -}; +#include "foundation-v8-gicv3.dtsi" +#include "foundation-v8-spin-table.dtsi" diff --git a/arch/arm64/boot/dts/arm/foundation-v8-gicv3.dtsi b/arch/arm64/boot/dts/arm/foundation-v8-gicv3.dtsi new file mode 100644 index 000000000000..91fc5c60d88b --- /dev/null +++ b/arch/arm64/boot/dts/arm/foundation-v8-gicv3.dtsi @@ -0,0 +1,28 @@ +/* + * ARM Ltd. + * + * ARMv8 Foundation model DTS (GICv3 configuration) + */ + +/ { + gic: interrupt-controller@2f000000 { + compatible = "arm,gic-v3"; + #interrupt-cells = <3>; + #address-cells = <2>; + #size-cells = <2>; + ranges; + interrupt-controller; + reg = <0x0 0x2f000000 0x0 0x10000>, + <0x0 0x2f100000 0x0 0x200000>, + <0x0 0x2c000000 0x0 0x2000>, + <0x0 0x2c010000 0x0 0x2000>, + <0x0 0x2c02f000 0x0 0x2000>; + interrupts = <1 9 4>; + + its: its@2f020000 { + compatible = "arm,gic-v3-its"; + msi-controller; + reg = <0x0 0x2f020000 0x0 0x20000>; + }; + }; +}; diff --git a/arch/arm64/boot/dts/arm/foundation-v8-psci.dts b/arch/arm64/boot/dts/arm/foundation-v8-psci.dts new file mode 100644 index 000000000000..723f23c7cd31 --- /dev/null +++ b/arch/arm64/boot/dts/arm/foundation-v8-psci.dts @@ -0,0 +1,9 @@ +/* + * ARM Ltd. + * + * ARMv8 Foundation model DTS (GICv2+PSCI configuration) + */ + +#include "foundation-v8.dtsi" +#include "foundation-v8-gicv2.dtsi" +#include "foundation-v8-psci.dtsi" diff --git a/arch/arm64/boot/dts/arm/foundation-v8-psci.dtsi b/arch/arm64/boot/dts/arm/foundation-v8-psci.dtsi new file mode 100644 index 000000000000..16cdf395728b --- /dev/null +++ b/arch/arm64/boot/dts/arm/foundation-v8-psci.dtsi @@ -0,0 +1,28 @@ +/* + * ARM Ltd. + * + * ARMv8 Foundation model DTS (PSCI configuration) + */ + +/ { + psci { + compatible = "arm,psci-1.0"; + method = "smc"; + }; +}; + +&cpu0 { + enable-method = "psci"; +}; + +&cpu1 { + enable-method = "psci"; +}; + +&cpu2 { + enable-method = "psci"; +}; + +&cpu3 { + enable-method = "psci"; +}; diff --git a/arch/arm64/boot/dts/arm/foundation-v8-spin-table.dtsi b/arch/arm64/boot/dts/arm/foundation-v8-spin-table.dtsi new file mode 100644 index 000000000000..4d4186ba0e8c --- /dev/null +++ b/arch/arm64/boot/dts/arm/foundation-v8-spin-table.dtsi @@ -0,0 +1,25 @@ +/* + * ARM Ltd. + * + * ARMv8 Foundation model DTS (spin table configuration) + */ + +&cpu0 { + enable-method = "spin-table"; + cpu-release-addr = <0x0 0x8000fff8>; +}; + +&cpu1 { + enable-method = "spin-table"; + cpu-release-addr = <0x0 0x8000fff8>; +}; + +&cpu2 { + enable-method = "spin-table"; + cpu-release-addr = <0x0 0x8000fff8>; +}; + +&cpu3 { + enable-method = "spin-table"; + cpu-release-addr = <0x0 0x8000fff8>; +}; diff --git a/arch/arm64/boot/dts/arm/foundation-v8.dts b/arch/arm64/boot/dts/arm/foundation-v8.dts index 71168077312d..8ff7c86fc929 100644 --- a/arch/arm64/boot/dts/arm/foundation-v8.dts +++ b/arch/arm64/boot/dts/arm/foundation-v8.dts @@ -5,17 +5,5 @@ */ #include "foundation-v8.dtsi" - -/ { - gic: interrupt-controller@2c001000 { - compatible = "arm,cortex-a15-gic", "arm,cortex-a9-gic"; - #interrupt-cells = <3>; - #address-cells = <2>; - interrupt-controller; - reg = <0x0 0x2c001000 0 0x1000>, - <0x0 0x2c002000 0 0x2000>, - <0x0 0x2c004000 0 0x2000>, - <0x0 0x2c006000 0 0x2000>; - interrupts = <1 9 0xf04>; - }; -}; +#include "foundation-v8-gicv2.dtsi" +#include "foundation-v8-spin-table.dtsi" diff --git a/arch/arm64/boot/dts/arm/foundation-v8.dtsi b/arch/arm64/boot/dts/arm/foundation-v8.dtsi index 8ecdd4331980..60f6ab920743 100644 --- a/arch/arm64/boot/dts/arm/foundation-v8.dtsi +++ b/arch/arm64/boot/dts/arm/foundation-v8.dtsi @@ -28,36 +28,28 @@ #address-cells = <2>; #size-cells = <0>; - cpu@0 { + cpu0: cpu@0 { device_type = "cpu"; compatible = "arm,armv8"; reg = <0x0 0x0>; - enable-method = "spin-table"; - cpu-release-addr = <0x0 0x8000fff8>; next-level-cache = <&L2_0>; }; - cpu@1 { + cpu1: cpu@1 { device_type = "cpu"; compatible = "arm,armv8"; reg = <0x0 0x1>; - enable-method = "spin-table"; - cpu-release-addr = <0x0 0x8000fff8>; next-level-cache = <&L2_0>; }; - cpu@2 { + cpu2: cpu@2 { device_type = "cpu"; compatible = "arm,armv8"; reg = <0x0 0x2>; - enable-method = "spin-table"; - cpu-release-addr = <0x0 0x8000fff8>; next-level-cache = <&L2_0>; }; - cpu@3 { + cpu3: cpu@3 { device_type = "cpu"; compatible = "arm,armv8"; reg = <0x0 0x3>; - enable-method = "spin-table"; - cpu-release-addr = <0x0 0x8000fff8>; next-level-cache = <&L2_0>; };