Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

firmware: Move Trusted Foundations support

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>

+30 -44
-2
arch/arm/Kconfig
··· 899 899 config PLAT_VERSATILE 900 900 bool 901 901 902 - source "arch/arm/firmware/Kconfig" 903 - 904 902 source "arch/arm/mm/Kconfig" 905 903 906 904 config IWMMXT
-1
arch/arm/Makefile
··· 290 290 core-y += arch/arm/probes/ 291 291 core-y += arch/arm/net/ 292 292 core-y += arch/arm/crypto/ 293 - core-y += arch/arm/firmware/ 294 293 core-y += $(machdirs) $(platdirs) 295 294 296 295 drivers-$(CONFIG_OPROFILE) += arch/arm/oprofile/
-29
arch/arm/firmware/Kconfig
··· 1 - config ARCH_SUPPORTS_FIRMWARE 2 - bool 3 - 4 - config ARCH_SUPPORTS_TRUSTED_FOUNDATIONS 5 - bool 6 - select ARCH_SUPPORTS_FIRMWARE 7 - 8 - menu "Firmware options" 9 - depends on ARCH_SUPPORTS_FIRMWARE 10 - 11 - config TRUSTED_FOUNDATIONS 12 - bool "Trusted Foundations secure monitor support" 13 - depends on ARCH_SUPPORTS_TRUSTED_FOUNDATIONS 14 - default y 15 - help 16 - Some devices (including most Tegra-based consumer devices on the 17 - market) are booted with the Trusted Foundations secure monitor 18 - active, requiring some core operations to be performed by the secure 19 - monitor instead of the kernel. 20 - 21 - This option allows the kernel to invoke the secure monitor whenever 22 - required on devices using Trusted Foundations. See 23 - arch/arm/include/asm/trusted_foundations.h or the 24 - tlm,trusted-foundations device tree binding documentation for details 25 - on how to use it. 26 - 27 - Say n if you don't know what this is about. 28 - 29 - endmenu
-4
arch/arm/firmware/Makefile
··· 1 - obj-$(CONFIG_TRUSTED_FOUNDATIONS) += trusted_foundations.o 2 - 3 - # tf_generic_smc() fails to build with -fsanitize-coverage=trace-pc 4 - KCOV_INSTRUMENT := n
+3 -1
arch/arm/firmware/trusted_foundations.c drivers/firmware/trusted_foundations.c
··· 17 17 #include <linux/kernel.h> 18 18 #include <linux/init.h> 19 19 #include <linux/of.h> 20 + 21 + #include <linux/firmware/trusted_foundations.h> 22 + 20 23 #include <asm/firmware.h> 21 24 #include <asm/hardware/cache-l2x0.h> 22 25 #include <asm/outercache.h> 23 - #include <asm/trusted_foundations.h> 24 26 25 27 #define TF_CACHE_MAINT 0xfffff100 26 28
+2 -2
arch/arm/include/asm/trusted_foundations.h include/linux/firmware/trusted_foundations.h
··· 23 23 * PSCI standard. 24 24 */ 25 25 26 - #ifndef __ASM_ARM_TRUSTED_FOUNDATIONS_H 27 - #define __ASM_ARM_TRUSTED_FOUNDATIONS_H 26 + #ifndef __FIRMWARE_TRUSTED_FOUNDATIONS_H 27 + #define __FIRMWARE_TRUSTED_FOUNDATIONS_H 28 28 29 29 #include <linux/printk.h> 30 30 #include <linux/bug.h>
-1
arch/arm/mach-tegra/Kconfig
··· 3 3 bool "NVIDIA Tegra" 4 4 depends on ARCH_MULTI_V7 5 5 select ARCH_HAS_RESET_CONTROLLER 6 - select ARCH_SUPPORTS_TRUSTED_FOUNDATIONS 7 6 select ARM_AMBA 8 7 select ARM_GIC 9 8 select CLKSRC_MMIO
+2 -1
arch/arm/mach-tegra/cpuidle-tegra114.c
··· 21 21 #include <linux/kernel.h> 22 22 #include <linux/module.h> 23 23 24 + #include <linux/firmware/trusted_foundations.h> 25 + 24 26 #include <asm/cpuidle.h> 25 27 #include <asm/smp_plat.h> 26 28 #include <asm/suspend.h> 27 - #include <asm/trusted_foundations.h> 28 29 #include <asm/psci.h> 29 30 30 31 #include "cpuidle.h"
+2 -1
arch/arm/mach-tegra/pm.c
··· 27 27 #include <linux/spinlock.h> 28 28 #include <linux/suspend.h> 29 29 30 + #include <linux/firmware/trusted_foundations.h> 31 + 30 32 #include <soc/tegra/flowctrl.h> 31 33 #include <soc/tegra/fuse.h> 32 34 #include <soc/tegra/pm.h> ··· 41 39 #include <asm/smp_plat.h> 42 40 #include <asm/suspend.h> 43 41 #include <asm/tlbflush.h> 44 - #include <asm/trusted_foundations.h> 45 42 46 43 #include "iomap.h" 47 44 #include "pm.h"
+2 -1
arch/arm/mach-tegra/reset.c
··· 19 19 #include <linux/init.h> 20 20 #include <linux/io.h> 21 21 22 + #include <linux/firmware/trusted_foundations.h> 23 + 22 24 #include <soc/tegra/fuse.h> 23 25 24 26 #include <asm/cacheflush.h> 25 27 #include <asm/firmware.h> 26 28 #include <asm/hardware/cache-l2x0.h> 27 - #include <asm/trusted_foundations.h> 28 29 29 30 #include "iomap.h" 30 31 #include "irammap.h"
+2 -1
arch/arm/mach-tegra/tegra.c
··· 35 35 #include <linux/sys_soc.h> 36 36 #include <linux/usb/tegra_usb_phy.h> 37 37 38 + #include <linux/firmware/trusted_foundations.h> 39 + 38 40 #include <soc/tegra/fuse.h> 39 41 #include <soc/tegra/pmc.h> 40 42 ··· 46 44 #include <asm/mach/time.h> 47 45 #include <asm/mach-types.h> 48 46 #include <asm/setup.h> 49 - #include <asm/trusted_foundations.h> 50 47 51 48 #include "board.h" 52 49 #include "common.h"
+16
drivers/firmware/Kconfig
··· 267 267 This protocol library is used by client drivers to use the features 268 268 provided by the system controller. 269 269 270 + config TRUSTED_FOUNDATIONS 271 + bool "Trusted Foundations secure monitor support" 272 + depends on ARM 273 + help 274 + Some devices (including most early Tegra-based consumer devices on 275 + the market) are booted with the Trusted Foundations secure monitor 276 + active, requiring some core operations to be performed by the secure 277 + monitor instead of the kernel. 278 + 279 + This option allows the kernel to invoke the secure monitor whenever 280 + required on devices using Trusted Foundations. See the functions and 281 + comments in linux/firmware/trusted_foundations.h or the device tree 282 + bindings for "tlm,trusted-foundations" for details on how to use it. 283 + 284 + Choose N if you don't know what this is about. 285 + 270 286 config HAVE_ARM_SMCCC 271 287 bool 272 288
+1
drivers/firmware/Makefile
··· 23 23 obj-$(CONFIG_QCOM_SCM_32) += qcom_scm-32.o 24 24 CFLAGS_qcom_scm-32.o :=$(call as-instr,.arch armv7-a\n.arch_extension sec,-DREQUIRES_SEC=1) -march=armv7-a 25 25 obj-$(CONFIG_TI_SCI_PROTOCOL) += ti_sci.o 26 + obj-$(CONFIG_TRUSTED_FOUNDATIONS) += trusted_foundations.o 26 27 27 28 obj-$(CONFIG_ARM_SCMI_PROTOCOL) += arm_scmi/ 28 29 obj-y += broadcom/