diff mbox

[U-Boot,PATCHV5,2/6] ARMv8: add the secure monitor firmware framework

Message ID 1465108175-35114-2-git-send-email-Zhiqiang.Hou@nxp.com
State Superseded
Delegated to: York Sun
Headers show

Commit Message

Z.Q. Hou June 5, 2016, 6:29 a.m. UTC
From: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>

The sec_firmware.h is the common header file for secure monitor
firmware under ARMv8. The declaration of common APIs can be
added to this file. And the implementation of common APIs will
be abstracted to sec_firmware.c, up to now there are some weak
implementations.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
---
V5:
 - Added c file sec_firmware.c.
 - Added declaration of sec_firmware_init().
 - Renamed the func sec_firmware_validate().

V4:
 - Reordered this patch.
 - Removed the FSL PPA related items.

 arch/arm/cpu/armv8/Makefile               |  1 +
 arch/arm/cpu/armv8/sec_firmware.c         | 25 +++++++++++++++++++++++++
 arch/arm/include/asm/armv8/sec_firmware.h | 16 ++++++++++++++++
 3 files changed, 42 insertions(+)
 create mode 100644 arch/arm/cpu/armv8/sec_firmware.c
 create mode 100644 arch/arm/include/asm/armv8/sec_firmware.h
diff mbox

Patch

diff --git a/arch/arm/cpu/armv8/Makefile b/arch/arm/cpu/armv8/Makefile
index 1c85aa9..667572b 100644
--- a/arch/arm/cpu/armv8/Makefile
+++ b/arch/arm/cpu/armv8/Makefile
@@ -15,6 +15,7 @@  obj-y	+= cache.o
 obj-y	+= tlb.o
 obj-y	+= transition.o
 obj-y	+= fwcall.o
+obj-$(CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT) += sec_firmware.o
 
 obj-$(CONFIG_FSL_LAYERSCAPE) += fsl-layerscape/
 obj-$(CONFIG_ARCH_ZYNQMP) += zynqmp/
diff --git a/arch/arm/cpu/armv8/sec_firmware.c b/arch/arm/cpu/armv8/sec_firmware.c
new file mode 100644
index 0000000..90d89e7
--- /dev/null
+++ b/arch/arm/cpu/armv8/sec_firmware.c
@@ -0,0 +1,25 @@ 
+/*
+ * Copyright 2016 NXP Semiconductor, Inc.
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/armv8/sec_firmware.h>
+
+__weak int sec_firmware_init(void)
+{
+	return -1;
+}
+
+__weak bool sec_firmware_is_valid(void)
+{
+	return false;
+}
+
+#if defined(CONFIG_ARMV8_PSCI)
+__weak unsigned int sec_firmware_support_psci_version(void)
+{
+	return 0;
+}
+#endif
diff --git a/arch/arm/include/asm/armv8/sec_firmware.h b/arch/arm/include/asm/armv8/sec_firmware.h
new file mode 100644
index 0000000..e2591aa
--- /dev/null
+++ b/arch/arm/include/asm/armv8/sec_firmware.h
@@ -0,0 +1,16 @@ 
+/*
+ * Copyright 2016 NXP Semiconductor, Inc.
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef __SEC_FIRMWARE_H_
+#define __SEC_FIRMWARE_H_
+
+int sec_firmware_init(void);
+bool sec_firmware_is_valid(void);
+#ifdef CONFIG_ARMV8_PSCI
+unsigned int sec_firmware_support_psci_version(void);
+#endif
+
+#endif /* __SEC_FIRMWARE_H_ */