From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E556C10F11 for ; Wed, 10 Apr 2019 08:57:42 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5E9F8206B6 for ; Wed, 10 Apr 2019 08:57:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="uQ9VKyUi"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Xsdj1Vx6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5E9F8206B6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HnOgBUr0jvUX2/QkdMCfxFAS+Xncf5/PgM7AJ19d8fw=; b=uQ9VKyUiK/8le8 mxZbjyDrCjDp51tRIN9w1nWrP1qH/cTG4fY8qmm93MKYFOQRPqS4ZBVsBmbcJhSqZjBILtdlLXukx 7LxtmFzTJUNoW8QKA0tb1wrVuNQbypwSQNpcADeLetx2OMt9iCwW3pwGdrVAHYLAzYoWplugAYUnP R++g4IgiJvkL+voZQ053I9KdfsBCias61u0GSyr1HAy8KUGRbkKJD+Ye9hIG0gy35doK/QFbZNoHG yU/NHxFRJ3gCLnGtm9D9L2+p/WyJ4dp4NFUG5JO6KEjNMMVum9+o4WWr71mFrtQtN5wNCReW83p8a oTEKkmDj+Z8AfrW+bUTA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hE936-0006yv-Tb; Wed, 10 Apr 2019 08:57:40 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hE92f-0006MP-G2 for linux-arm-kernel@lists.infradead.org; Wed, 10 Apr 2019 08:57:15 +0000 Received: by mail-wr1-x441.google.com with SMTP id h4so1916761wre.7 for ; Wed, 10 Apr 2019 01:57:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gL/d83uUuOca8nVES7WGiKqAauX+97UXho8l6vqOBME=; b=Xsdj1Vx6lGndc12Rip8SC3uh7pXs2XieGC32DrTnv1kUDMTJ+goNDpxgfcTYrCL+7c VfxNE4bio1jx/ugycUGCF9auVT6861oAaubQ7ftBS4SBtQvL/TZPX4o+hTmC9tLZjtI8 x36qgRyw7Shk1oyCHr5S3Q4IrmWg6jma1rg9P2OBgfEMJ3tFFZw6WhHsbDaerhZEu5YS riEFr67/I6djNKvV8cRPKrgkECjOLSoV2R+H5azpleNv4ncx3y5s324QUknB4hXPPhIH mGv6rhTxK91rc4Q58eb3jlYKC6vAM4gHzxtu/28azNQPBkdEc2wxTmRNNKTdSDbmuOVU 6iZw== 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:mime-version:content-transfer-encoding; bh=gL/d83uUuOca8nVES7WGiKqAauX+97UXho8l6vqOBME=; b=ufau7nBb06id4rdg/lgzbkptYSkdMAg7N+F3aN36UYNaqa1TtozI39wYU+Fxnbelb2 NMhfbGHQtl9HykT+inGbYQFNfekZnhrT6SwMO4i+Tug+AcYxOvyuTqCpVeHTYKbJ60Mx wNDoSRo/99axUMv7MMhFWCkbzSSTb2V+i4IhA/7EeaFNDB6tRiIMy6Nsm4NuE1WxTqfO GKxTfdQoUWoDGxcRF9xLjEAtsdu6RoTHHkUJ3WSd4Z2NN9Te+LJMB4s+Dunl2RyDX24D W7/pQAOTmriDtDHJ6/+gCZr41t3G/s6EH1/YqIQxXP5g6qjGSmltxAaiCk0YFUkp78NH sBCA== X-Gm-Message-State: APjAAAVl2+WWoBs3pB7901/3agC2A1qXmk6vx+oNk1s9h4A1Cq/5tRpD QQpDzgYlq453Hugp4/m2Wlw= X-Google-Smtp-Source: APXvYqwC07daYst5ImUjPrXoZwYpErlRtMxFg4a7c5zAYOXbI7cPWhk3ucLq6SHlOEuDLG3CvtdwIQ== X-Received: by 2002:adf:cf0e:: with SMTP id o14mr25287728wrj.182.1554886631609; Wed, 10 Apr 2019 01:57:11 -0700 (PDT) Received: from localhost (pD9E51B25.dip0.t-ipconnect.de. [217.229.27.37]) by smtp.gmail.com with ESMTPSA id v17sm1397965wmc.30.2019.04.10.01.57.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Apr 2019 01:57:11 -0700 (PDT) From: Thierry Reding To: Thierry Reding Subject: [PATCH 2/2] firmware: Move Trusted Foundations support Date: Wed, 10 Apr 2019 10:57:08 +0200 Message-Id: <20190410085708.10798-2-thierry.reding@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190410085708.10798-1-thierry.reding@gmail.com> References: <20190410085708.10798-1-thierry.reding@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190410_015713_561587_F3B8A826 X-CRM114-Status: GOOD ( 19.78 ) X-BeenThere: linux-arm-kernel@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-tegra@vger.kernel.org, Dmitry Osipenko , Russell King , linux-arm-kernel@lists.infradead.org, Jon Hunter Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Thierry Reding Move the Trusted Foundations support out of arch/arm/firmware and into drivers/firmware where most other firmware support implementations are located. Signed-off-by: Thierry Reding --- arch/arm/Kconfig | 2 -- arch/arm/Makefile | 1 - arch/arm/firmware/Kconfig | 29 ------------------- arch/arm/firmware/Makefile | 4 --- arch/arm/mach-tegra/Kconfig | 2 +- arch/arm/mach-tegra/cpuidle-tegra114.c | 3 +- arch/arm/mach-tegra/pm.c | 3 +- arch/arm/mach-tegra/reset.c | 3 +- arch/arm/mach-tegra/tegra.c | 3 +- drivers/firmware/Kconfig | 15 ++++++++++ drivers/firmware/Makefile | 1 + .../firmware/trusted_foundations.c | 4 ++- .../linux/firmware}/trusted_foundations.h | 4 +-- 13 files changed, 30 insertions(+), 44 deletions(-) delete mode 100644 arch/arm/firmware/Kconfig delete mode 100644 arch/arm/firmware/Makefile rename {arch/arm => drivers}/firmware/trusted_foundations.c (98%) rename {arch/arm/include/asm => include/linux/firmware}/trusted_foundations.h (97%) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 054ead960f98..f006b3c69247 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -899,8 +899,6 @@ config PLAT_PXA config PLAT_VERSATILE bool -source "arch/arm/firmware/Kconfig" - source "arch/arm/mm/Kconfig" config IWMMXT diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 807a7d06c2a0..05ecc004de86 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -290,7 +290,6 @@ core-y += arch/arm/kernel/ arch/arm/mm/ arch/arm/common/ core-y += arch/arm/probes/ core-y += arch/arm/net/ core-y += arch/arm/crypto/ -core-y += arch/arm/firmware/ core-y += $(machdirs) $(platdirs) drivers-$(CONFIG_OPROFILE) += arch/arm/oprofile/ diff --git a/arch/arm/firmware/Kconfig b/arch/arm/firmware/Kconfig deleted file mode 100644 index ad396af68e47..000000000000 --- a/arch/arm/firmware/Kconfig +++ /dev/null @@ -1,29 +0,0 @@ -config ARCH_SUPPORTS_FIRMWARE - bool - -config ARCH_SUPPORTS_TRUSTED_FOUNDATIONS - bool - select ARCH_SUPPORTS_FIRMWARE - -menu "Firmware options" - depends on ARCH_SUPPORTS_FIRMWARE - -config TRUSTED_FOUNDATIONS - bool "Trusted Foundations secure monitor support" - depends on ARCH_SUPPORTS_TRUSTED_FOUNDATIONS - default y - help - Some devices (including most Tegra-based consumer devices on the - market) are booted with the Trusted Foundations secure monitor - active, requiring some core operations to be performed by the secure - monitor instead of the kernel. - - This option allows the kernel to invoke the secure monitor whenever - required on devices using Trusted Foundations. See - arch/arm/include/asm/trusted_foundations.h or the - tlm,trusted-foundations device tree binding documentation for details - on how to use it. - - Say n if you don't know what this is about. - -endmenu diff --git a/arch/arm/firmware/Makefile b/arch/arm/firmware/Makefile deleted file mode 100644 index 6e41336b0bc4..000000000000 --- a/arch/arm/firmware/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -obj-$(CONFIG_TRUSTED_FOUNDATIONS) += trusted_foundations.o - -# tf_generic_smc() fails to build with -fsanitize-coverage=trace-pc -KCOV_INSTRUMENT := n diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig index 7b3fd0995a16..cbad7823f602 100644 --- a/arch/arm/mach-tegra/Kconfig +++ b/arch/arm/mach-tegra/Kconfig @@ -3,7 +3,6 @@ menuconfig ARCH_TEGRA bool "NVIDIA Tegra" depends on ARCH_MULTI_V7 select ARCH_HAS_RESET_CONTROLLER - select ARCH_SUPPORTS_TRUSTED_FOUNDATIONS select ARM_AMBA select ARM_GIC select CLKSRC_MMIO @@ -14,6 +13,7 @@ menuconfig ARCH_TEGRA select PM_OPP select RESET_CONTROLLER select SOC_BUS + select TRUSTED_FOUNDATIONS select ZONE_DMA if ARM_LPAE help This enables support for NVIDIA Tegra based systems. diff --git a/arch/arm/mach-tegra/cpuidle-tegra114.c b/arch/arm/mach-tegra/cpuidle-tegra114.c index 3b9af4766cdf..43c695d83f03 100644 --- a/arch/arm/mach-tegra/cpuidle-tegra114.c +++ b/arch/arm/mach-tegra/cpuidle-tegra114.c @@ -21,10 +21,11 @@ #include #include +#include + #include #include #include -#include #include #include "cpuidle.h" diff --git a/arch/arm/mach-tegra/pm.c b/arch/arm/mach-tegra/pm.c index abf5f88778f4..1b0ade06f204 100644 --- a/arch/arm/mach-tegra/pm.c +++ b/arch/arm/mach-tegra/pm.c @@ -27,6 +27,8 @@ #include #include +#include + #include #include #include @@ -39,7 +41,6 @@ #include #include #include -#include #include "iomap.h" #include "pm.h" diff --git a/arch/arm/mach-tegra/reset.c b/arch/arm/mach-tegra/reset.c index b02ae7699842..35dc5d419b6f 100644 --- a/arch/arm/mach-tegra/reset.c +++ b/arch/arm/mach-tegra/reset.c @@ -19,12 +19,13 @@ #include #include +#include + #include #include #include #include -#include #include "iomap.h" #include "irammap.h" diff --git a/arch/arm/mach-tegra/tegra.c b/arch/arm/mach-tegra/tegra.c index 1e89cfefbf68..3e88f67dd521 100644 --- a/arch/arm/mach-tegra/tegra.c +++ b/arch/arm/mach-tegra/tegra.c @@ -35,6 +35,8 @@ #include #include +#include + #include #include @@ -44,7 +46,6 @@ #include #include #include -#include #include "board.h" #include "common.h" diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig index cac16c4b0df3..d1b1108aee72 100644 --- a/drivers/firmware/Kconfig +++ b/drivers/firmware/Kconfig @@ -267,6 +267,21 @@ config TI_SCI_PROTOCOL This protocol library is used by client drivers to use the features provided by the system controller. +config TRUSTED_FOUNDATIONS + bool "Trusted Foundations secure monitor support" + help + Some devices (including most early Tegra-based consumer devices on + the market) are booted with the Trusted Foundations secure monitor + active, requiring some core operations to be performed by the secure + monitor instead of the kernel. + + This option allows the kernel to invoke the secure monitor whenever + required on devices using Trusted Foundations. See the functions and + comments in linux/firmware/trusted_foundations.h or the device tree + bindings for "tlm,trusted-foundations" for details on how to use it. + + Choose N if you don't know what this is about. + config HAVE_ARM_SMCCC bool diff --git a/drivers/firmware/Makefile b/drivers/firmware/Makefile index 80feb635120f..745f4907e69b 100644 --- a/drivers/firmware/Makefile +++ b/drivers/firmware/Makefile @@ -23,6 +23,7 @@ obj-$(CONFIG_QCOM_SCM_64) += qcom_scm-64.o obj-$(CONFIG_QCOM_SCM_32) += qcom_scm-32.o CFLAGS_qcom_scm-32.o :=$(call as-instr,.arch armv7-a\n.arch_extension sec,-DREQUIRES_SEC=1) -march=armv7-a obj-$(CONFIG_TI_SCI_PROTOCOL) += ti_sci.o +obj-$(CONFIG_TRUSTED_FOUNDATIONS) += trusted_foundations.o obj-$(CONFIG_ARM_SCMI_PROTOCOL) += arm_scmi/ obj-y += broadcom/ diff --git a/arch/arm/firmware/trusted_foundations.c b/drivers/firmware/trusted_foundations.c similarity index 98% rename from arch/arm/firmware/trusted_foundations.c rename to drivers/firmware/trusted_foundations.c index bb2ee73d9e02..fd4999388ff1 100644 --- a/arch/arm/firmware/trusted_foundations.c +++ b/drivers/firmware/trusted_foundations.c @@ -17,10 +17,12 @@ #include #include #include + +#include + #include #include #include -#include #define TF_CACHE_MAINT 0xfffff100 diff --git a/arch/arm/include/asm/trusted_foundations.h b/include/linux/firmware/trusted_foundations.h similarity index 97% rename from arch/arm/include/asm/trusted_foundations.h rename to include/linux/firmware/trusted_foundations.h index 54513c533811..4064e7c74715 100644 --- a/arch/arm/include/asm/trusted_foundations.h +++ b/include/linux/firmware/trusted_foundations.h @@ -23,8 +23,8 @@ * PSCI standard. */ -#ifndef __ASM_ARM_TRUSTED_FOUNDATIONS_H -#define __ASM_ARM_TRUSTED_FOUNDATIONS_H +#ifndef __FIRMWARE_TRUSTED_FOUNDATIONS_H +#define __FIRMWARE_TRUSTED_FOUNDATIONS_H #include #include -- 2.21.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel