]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
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 054ead960f983a99a9f241ce1427fe0e1cd6cb8a..f006b3c69247385b6b12887061578347cb075757 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 807a7d06c2a0825bed8f8ea8c1d9d8c7eb5f8be6..05ecc004de867a5d24ea251cd84649476c21efdc 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 7b3fd0995a1647fdb81a8e0daaf6642020ba86bf..63e89e75639bd0e3fffe7fb6e9852cb93f153bc4 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 3b9af4766cdf101d50480b293b70f44192514eb6..43c695d83f03467eb89e316d29d213385a80b85d 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 abf5f88778f4ed120d0ea0a1c6c87dff6e95f7d0..1b0ade06f204e667847fa4e86452373b9fa7c53c 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 b02ae7699842c382fdfbe9af1a2c81f85b19325d..35dc5d419b6f2351b93c7af6b44097b4202d7bf1 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 1e89cfefbf68fe3dcabddca50a22fb518f514279..3e88f67dd5217965d3da344b6f9d51d59b8a50cf 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 cac16c4b0df3eb6232b75cb7237091a5fda8f95e..f0646ac7586826a2fc16ad216b8640419f889cee 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 80feb635120fc72283da432b08ba1f6eed8aa9dd..745f4907e69b8c0784ae5554a82dd7bc17376b7f 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 bb2ee73d9e0217b72c82c51191269f692a592592..fd4999388ff1fa9d223c50d0d8527e94efa14266 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 54513c5338119c81f2f6dcc4d17cf9b381cb0cc4..4064e7c747156999b122b427e1dd24b47375fcd7 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>