OSDN Git Service

firmware: Move Trusted Foundations support
authorThierry Reding <treding@nvidia.com>
Wed, 10 Apr 2019 08:47:28 +0000 (10:47 +0200)
committerThierry Reding <treding@nvidia.com>
Wed, 17 Apr 2019 14:43:03 +0000 (16:43 +0200)
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 <treding@nvidia.com>
13 files changed:
arch/arm/Kconfig
arch/arm/Makefile
arch/arm/firmware/Kconfig [deleted file]
arch/arm/firmware/Makefile [deleted file]
arch/arm/mach-tegra/Kconfig
arch/arm/mach-tegra/cpuidle-tegra114.c
arch/arm/mach-tegra/pm.c
arch/arm/mach-tegra/reset.c
arch/arm/mach-tegra/tegra.c
drivers/firmware/Kconfig
drivers/firmware/Makefile
drivers/firmware/trusted_foundations.c [moved from arch/arm/firmware/trusted_foundations.c with 98% similarity]
include/linux/firmware/trusted_foundations.h [moved from arch/arm/include/asm/trusted_foundations.h with 97% similarity]

index 054ead9..f006b3c 100644 (file)
@@ -899,8 +899,6 @@ config PLAT_PXA
 config PLAT_VERSATILE
        bool
 
-source "arch/arm/firmware/Kconfig"
-
 source "arch/arm/mm/Kconfig"
 
 config IWMMXT
index 807a7d0..05ecc00 100644 (file)
@@ -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 (file)
index ad396af..0000000
+++ /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 (file)
index 6e41336..0000000
+++ /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
index 7b3fd09..63e89e7 100644 (file)
@@ -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
index 3b9af47..43c695d 100644 (file)
 #include <linux/kernel.h>
 #include <linux/module.h>
 
+#include <linux/firmware/trusted_foundations.h>
+
 #include <asm/cpuidle.h>
 #include <asm/smp_plat.h>
 #include <asm/suspend.h>
-#include <asm/trusted_foundations.h>
 #include <asm/psci.h>
 
 #include "cpuidle.h"
index abf5f88..1b0ade0 100644 (file)
@@ -27,6 +27,8 @@
 #include <linux/spinlock.h>
 #include <linux/suspend.h>
 
+#include <linux/firmware/trusted_foundations.h>
+
 #include <soc/tegra/flowctrl.h>
 #include <soc/tegra/fuse.h>
 #include <soc/tegra/pm.h>
@@ -39,7 +41,6 @@
 #include <asm/smp_plat.h>
 #include <asm/suspend.h>
 #include <asm/tlbflush.h>
-#include <asm/trusted_foundations.h>
 
 #include "iomap.h"
 #include "pm.h"
index b02ae76..35dc5d4 100644 (file)
 #include <linux/init.h>
 #include <linux/io.h>
 
+#include <linux/firmware/trusted_foundations.h>
+
 #include <soc/tegra/fuse.h>
 
 #include <asm/cacheflush.h>
 #include <asm/firmware.h>
 #include <asm/hardware/cache-l2x0.h>
-#include <asm/trusted_foundations.h>
 
 #include "iomap.h"
 #include "irammap.h"
index 1e89cfe..3e88f67 100644 (file)
@@ -35,6 +35,8 @@
 #include <linux/sys_soc.h>
 #include <linux/usb/tegra_usb_phy.h>
 
+#include <linux/firmware/trusted_foundations.h>
+
 #include <soc/tegra/fuse.h>
 #include <soc/tegra/pmc.h>
 
@@ -44,7 +46,6 @@
 #include <asm/mach/time.h>
 #include <asm/mach-types.h>
 #include <asm/setup.h>
-#include <asm/trusted_foundations.h>
 
 #include "board.h"
 #include "common.h"
index cac16c4..f0646ac 100644 (file)
@@ -267,6 +267,22 @@ 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"
+       depends on ARM
+       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
 
index 80feb63..745f490 100644 (file)
@@ -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/
similarity index 98%
rename from arch/arm/firmware/trusted_foundations.c
rename to drivers/firmware/trusted_foundations.c
index bb2ee73..fd49993 100644 (file)
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/of.h>
+
+#include <linux/firmware/trusted_foundations.h>
+
 #include <asm/firmware.h>
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/outercache.h>
-#include <asm/trusted_foundations.h>
 
 #define TF_CACHE_MAINT         0xfffff100
 
similarity index 97%
rename from arch/arm/include/asm/trusted_foundations.h
rename to include/linux/firmware/trusted_foundations.h
index 54513c5..4064e7c 100644 (file)
@@ -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 <linux/printk.h>
 #include <linux/bug.h>