mirror of
https://github.com/brain-hackers/linux-brain.git
synced 2024-06-09 23:36:23 +09:00
SSI-87: soc: imx: secvio: Add support for SNVS secvio and tamper via SCFW
The driver register an IRQ handle to SCU for security violation interrupt. When an interruption is fired, the driver inform the user. Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
This commit is contained in:
parent
4b87e5c882
commit
4f977a4fb8
|
@ -220,6 +220,10 @@
|
|||
compatible = "fsl,imx-sc-rtc";
|
||||
};
|
||||
|
||||
secvio: secvio {
|
||||
compatible = "fsl,imx-sc-secvio";
|
||||
};
|
||||
|
||||
timer {
|
||||
compatible = "arm,armv8-timer";
|
||||
interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(6) | IRQ_TYPE_LEVEL_LOW)>, /* Physical Secure */
|
||||
|
|
|
@ -713,6 +713,7 @@ CONFIG_ARM_SMMU_V3=y
|
|||
CONFIG_RPMSG_QCOM_SMD=y
|
||||
CONFIG_RASPBERRYPI_POWER=y
|
||||
CONFIG_ARCH_MXC_ARM64=y
|
||||
CONFIG_SECVIO_SC=y
|
||||
CONFIG_QCOM_SMEM=y
|
||||
CONFIG_QCOM_SMD_RPM=y
|
||||
CONFIG_QCOM_SMP2P=y
|
||||
|
|
|
@ -52,4 +52,14 @@ config HAVE_IMX_RPMSG
|
|||
select RPMSG_VIRTIO
|
||||
select RPMSG
|
||||
bool
|
||||
|
||||
config SECVIO_SC
|
||||
bool "NXP SC secvio support"
|
||||
depends on ARCH_FSL_IMX8QXP || ARCH_FSL_IMX8QM
|
||||
help
|
||||
If you say yes here you get support for the NXP SNVS security violation module. It includes the possibility to read information
|
||||
related to security violations and tampers. It also gives the
|
||||
possibility to register user callbacks when a security violation
|
||||
occurs.
|
||||
|
||||
endmenu
|
||||
|
|
|
@ -6,3 +6,4 @@ obj-$(CONFIG_ARCH_FSL_IMX8QM) += pm-domains.o
|
|||
obj-$(CONFIG_ARCH_FSL_IMX8MQ) += busfreq-imx8mq.o gpc-psci.o
|
||||
obj-$(CONFIG_ARCH_FSL_IMX8MM) += gpc-psci.o
|
||||
obj-$(CONFIG_HAVE_IMX8_SOC) += soc-imx8.o
|
||||
obj-$(CONFIG_SECVIO_SC) += imx-secvio-sc.o
|
||||
|
|
1191
drivers/soc/imx/imx-secvio-sc.c
Normal file
1191
drivers/soc/imx/imx-secvio-sc.c
Normal file
File diff suppressed because it is too large
Load Diff
83
include/soc/imx8/imx-secvio-sc.h
Normal file
83
include/soc/imx8/imx-secvio-sc.h
Normal file
|
@ -0,0 +1,83 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/* Copyright 2019 NXP */
|
||||
|
||||
#ifndef _MISC_IMX_SECVIO_SC_H_
|
||||
#define _MISC_IMX_SECVIO_SC_H_
|
||||
|
||||
#define HPSVS__LP_SEC_VIO__MASK BIT(31)
|
||||
#define HPSVS__SW_LPSV__MASK BIT(15)
|
||||
#define HPSVS__SW_FSV__MASK BIT(14)
|
||||
#define HPSVS__SW_SV__MASK BIT(13)
|
||||
#define HPSVS__SV5__MASK BIT(5)
|
||||
#define HPSVS__SV4__MASK BIT(4)
|
||||
#define HPSVS__SV3__MASK BIT(3)
|
||||
#define HPSVS__SV2__MASK BIT(2)
|
||||
#define HPSVS__SV1__MASK BIT(1)
|
||||
#define HPSVS__SV0__MASK BIT(0)
|
||||
|
||||
#define HPSVS__ALL_SV__MASK (HPSVS__LP_SEC_VIO__MASK | \
|
||||
HPSVS__SW_LPSV__MASK | \
|
||||
HPSVS__SW_FSV__MASK | \
|
||||
HPSVS__SW_SV__MASK | \
|
||||
HPSVS__SV5__MASK | \
|
||||
HPSVS__SV4__MASK | \
|
||||
HPSVS__SV3__MASK | \
|
||||
HPSVS__SV2__MASK | \
|
||||
HPSVS__SV1__MASK | \
|
||||
HPSVS__SV0__MASK)
|
||||
|
||||
#define LPS__ESVD__MASK BIT(16)
|
||||
#define LPS__ET2D__MASK BIT(10)
|
||||
#define LPS__ET1D__MASK BIT(9)
|
||||
#define LPS__WMT2D__MASK BIT(8)
|
||||
#define LPS__WMT1D__MASK BIT(7)
|
||||
#define LPS__VTD__MASK BIT(6)
|
||||
#define LPS__TTD__MASK BIT(5)
|
||||
#define LPS__CTD__MASK BIT(4)
|
||||
#define LPS__PGD__MASK BIT(3)
|
||||
#define LPS__MCR__MASK BIT(2)
|
||||
#define LPS__SRTCR__MASK BIT(1)
|
||||
#define LPS__LPTA__MASK BIT(0)
|
||||
|
||||
#define LPS__ALL_TP__MASK (LPS__ESVD__MASK | \
|
||||
LPS__ET2D__MASK | \
|
||||
LPS__ET1D__MASK | \
|
||||
LPS__WMT2D__MASK | \
|
||||
LPS__WMT1D__MASK | \
|
||||
LPS__VTD__MASK | \
|
||||
LPS__TTD__MASK | \
|
||||
LPS__CTD__MASK | \
|
||||
LPS__PGD__MASK | \
|
||||
LPS__MCR__MASK | \
|
||||
LPS__SRTCR__MASK | \
|
||||
LPS__LPTA__MASK)
|
||||
|
||||
#define LPTDS__ET10D__MASK BIT(7)
|
||||
#define LPTDS__ET9D__MASK BIT(6)
|
||||
#define LPTDS__ET8D__MASK BIT(5)
|
||||
#define LPTDS__ET7D__MASK BIT(4)
|
||||
#define LPTDS__ET6D__MASK BIT(3)
|
||||
#define LPTDS__ET5D__MASK BIT(2)
|
||||
#define LPTDS__ET4D__MASK BIT(1)
|
||||
#define LPTDS__ET3D__MASK BIT(0)
|
||||
|
||||
#define LPTDS__ALL_TP__MASK (LPTDS__ET10D__MASK | \
|
||||
LPTDS__ET9D__MASK | \
|
||||
LPTDS__ET8D__MASK | \
|
||||
LPTDS__ET7D__MASK | \
|
||||
LPTDS__ET6D__MASK | \
|
||||
LPTDS__ET5D__MASK | \
|
||||
LPTDS__ET4D__MASK | \
|
||||
LPTDS__ET3D__MASK)
|
||||
|
||||
/* Struct for notification */
|
||||
struct notifier_info {
|
||||
u32 sv_status; /* From HPSVS */
|
||||
u32 tp_status_1; /* From LPS */
|
||||
u32 tp_status_2; /* From LPTDS */
|
||||
};
|
||||
|
||||
int register_imx_secvio_sc_notifier(struct notifier_block *nb);
|
||||
int unregister_imx_secvio_sc_notifier(struct notifier_block *nb);
|
||||
|
||||
#endif /* _MISC_IMX_SECVIO_SC_H_ */
|
Loading…
Reference in New Issue
Block a user