#=============================================================================== # export variables #=============================================================================== ifeq ($(CONFIG_SOCT_KMOD_CFLAGS),) ccflags-y += $(CONFIG_SOCT_KMOD_CFLAGS) endif #=============================================================================== # local variable #=============================================================================== ccflags-y += -Idrivers/drv/ioctl_inc/keyslot ccflags-y += -Idrivers/drv/ioctl_inc/generic ccflags-y += -Idrivers/drv/ioctl_inc/common ccflags-y += -Idrivers/drv/ext_inc/base ccflags-y += -Idrivers/drv/ext_inc/cipher ccflags-y += -Idrivers/drv/ext_inc/osal ccflags-y += -Idrivers/drv/ext_inc/common ccflags-y += -Idrivers/drv/ext_inc/keyslot ccflags-y += -Idrivers/drv/ext_inc/klad ccflags-y += -Idrivers/drv/ext_inc/dftevent ccflags-y += -Idrivers/drv/common/include ccflags-y += -Iinclude/klad/ ccflags-y += -Idrivers/huanglong/tee/tee_tz/tzdriver ccflags-y += -fstack-protector-all ccflags-y += -D_FORTIFY_SOURCE=2 ccflags-y += -Wl,-z,relro ccflags-y += -z now ccflags-y += -Wl,-z,noexecstack ccflags-y += -DCONFIG_SOCT_CIPHER_FMEA_SUPPORT ccflags-y += -DCRYPTO_ERROR_ENV=0x1 MODNAME := soc_cipher ifeq ($(CONFIG_SOCT_DRV_BUILDIN),y) obj-$(CONFIG_SOCT_KEYSLOT_SUPPORT) += $(MODNAME).o else obj-m += $(MODNAME).o endif CIPHER_DIR := drivers/drv/cipher OPENSOURCE_MBEDTLS_DIR_ABSOLUTES := $(VENDOR_DIR)/open_source/mbedtls OPENSOURCE_MBEDTLS_DIR_RELATIVE := ../../../../open_source/mbedtls COMMON_DIR_RELATIVE := ../../../bootloader/source/drivers/cipher_common COMMON_DIR_ABSOLUTES := $(VENDOR_DIR)/huanglong/bootloader/source/drivers/cipher_common CIPHER_OBJS-y := CIPHER_CFLAGS := CRYPTO_UT_TEST_ENABLE := n CRYPTO_DTS_TEST_ENABLE := n ifneq ($(findstring $(CONFIG_SOCT_CHIP_TYPE), "reserved9" "reserved13"),) CRYPTO_CHIP_NAME := reserved9 endif ifneq ($(findstring $(CONFIG_SOCT_CHIP_TYPE), "reserved19" "hi3751v811" "reserved17"),) CRYPTO_CHIP_NAME := reserved19 endif ifeq ($(CRYPTO_CHIP_NAME), reserved9) CRYPTO_TRNG_VERSION := v2 CRYPTO_SYMC_VERSION := v2 CRYPTO_HASH_VERSION := v2 CRYPTO_PKE_VERSION := v2 CRYPTO_HDCP_VERSION := v2 CIPHER_CFLAGS += -DCONFIG_CRYPTO_CHIP_RESERVED9 endif ifeq ($(CRYPTO_CHIP_NAME), reserved19) CRYPTO_TRNG_VERSION := v2 CRYPTO_SYMC_VERSION := v1 CRYPTO_HASH_VERSION := v1 CRYPTO_PKE_VERSION := v1 CRYPTO_HDCP_VERSION := v1 CIPHER_CFLAGS += -DCONFIG_CRYPTO_CHIP_RESERVED19 endif # Platform CIPHER_CFLAGS += -I$(CIPHER_DIR) CIPHER_CFLAGS += -I$(CIPHER_DIR)/include # HDCP CIPHER_OBJS-y += hdcp/hal_hdcp_$(CRYPTO_HDCP_VERSION).o CIPHER_OBJS-y += hdcp/hal_hdcp_common.o CIPHER_OBJS-y += hdcp/drv_hdcp.o CIPHER_OBJS-y += hdcp/kapi_hdcp.o CIPHER_CFLAGS += -I$(CIPHER_DIR)/hdcp CIPHER_CFLAGS += -I$(COMMON_DIR_ABSOLUTES)/hal_code/spacc_$(CRYPTO_SYMC_VERSION) CIPHER_CFLAGS += -DCONFIG_CRYPTO_CHIP_HDCP_SUPPORT # Crypto_OSAL-Linux CIPHER_OBJS-y += crypto_osal/crypto_osal_lib.o CIPHER_OBJS-y += crypto_osal/crypto_osal_tee.o CIPHER_OBJS-y += crypto_osal/crypto_drv_cipher_ext.o CIPHER_CFLAGS += -I$(CIPHER_DIR)/crypto_osal # Driver-Common CIPHER_OBJS-y += $(COMMON_DIR_RELATIVE)/drv_code/crypto_drv_common.o CIPHER_CFLAGS += -I$(COMMON_DIR_ABSOLUTES)/drv_code # Driver-Dispatch CIPHER_OBJS-y += $(COMMON_DIR_RELATIVE)/dispatch_code/crypto_dispatch.o CIPHER_CFLAGS += -I$(COMMON_DIR_ABSOLUTES)/dispatch_code # Driver-Drv CIPHER_OBJS-y += $(COMMON_DIR_RELATIVE)/drv_code/drv_pbkdf2_soft.o CIPHER_OBJS-y += $(COMMON_DIR_RELATIVE)/drv_code/drv_hash.o CIPHER_OBJS-y += $(COMMON_DIR_RELATIVE)/drv_code/drv_trng.o CIPHER_OBJS-y += $(COMMON_DIR_RELATIVE)/drv_code/drv_symc.o CIPHER_OBJS-y += $(COMMON_DIR_RELATIVE)/drv_code/drv_symc_mac_soft.o CIPHER_OBJS-y += $(COMMON_DIR_RELATIVE)/drv_code/drv_cenc_hard.o CIPHER_OBJS-y += $(COMMON_DIR_RELATIVE)/drv_code/drv_pke.o CIPHER_OBJS-y += $(COMMON_DIR_RELATIVE)/drv_code/drv_pke_rsa.o CIPHER_OBJS-y += $(COMMON_DIR_RELATIVE)/drv_code/drv_pke_ecc.o CIPHER_OBJS-y += $(COMMON_DIR_RELATIVE)/drv_code/drv_pke_ecc_curve.o CIPHER_OBJS-y += $(COMMON_DIR_RELATIVE)/drv_code/fmea/fmea.o CIPHER_CFLAGS += -I$(COMMON_DIR_ABSOLUTES)/drv_code CIPHER_CFLAGS += -I$(COMMON_DIR_ABSOLUTES)/drv_code/fmea # Driver-Init CIPHER_OBJS-y += init/crypto_drv_init.o CIPHER_OBJS-y += init/crypto_proc.o # Driver-Kapi CIPHER_OBJS-y += $(COMMON_DIR_RELATIVE)/kapi_code/kapi_hash.o CIPHER_OBJS-y += $(COMMON_DIR_RELATIVE)/kapi_code/kapi_trng.o CIPHER_OBJS-y += $(COMMON_DIR_RELATIVE)/kapi_code/kapi_symc.o CIPHER_OBJS-y += $(COMMON_DIR_RELATIVE)/kapi_code/kapi_pke.o CIPHER_OBJS-y += $(COMMON_DIR_RELATIVE)/kapi_code/kapi_init.o CIPHER_CFLAGS += -I$(COMMON_DIR_ABSOLUTES)/kapi_code # HAL-SPACC CIPHER_OBJS-y += $(COMMON_DIR_RELATIVE)/hal_code/spacc_$(CRYPTO_HASH_VERSION)/hal_hash.o CIPHER_OBJS-y += $(COMMON_DIR_RELATIVE)/hal_code/spacc_$(CRYPTO_SYMC_VERSION)/hal_symc.o # HAL-TRNG CIPHER_OBJS-y += $(COMMON_DIR_RELATIVE)/hal_code/trng_v2/hal_trng.o # HAL-PKE CIPHER_OBJS-y += $(COMMON_DIR_RELATIVE)/hal_code/pke_$(CRYPTO_PKE_VERSION)/hal_pke.o # Include CIPHER_CFLAGS += -I$(COMMON_DIR_ABSOLUTES)/include/common_include CIPHER_CFLAGS += -I$(COMMON_DIR_ABSOLUTES)/include/hal_include CIPHER_CFLAGS += -I$(COMMON_DIR_ABSOLUTES)/include/kapi_include CIPHER_CFLAGS += -I$(COMMON_DIR_ABSOLUTES)/include/drv_include CIPHER_CFLAGS += -I$(COMMON_DIR_ABSOLUTES)/include/ioctl_include # ext include DRIVERS_DIR := drivers/drv CIPHER_CFLAGS += -I$(DRIVERS_DIR)/include/klad CIPHER_CFLAGS += -I$(DRIVERS_DIR)/include/keyslot CIPHER_CFLAGS += -I$(DRIVERS_DIR)/ioctl_inc/klad CIPHER_CFLAGS += -I$(DRIVERS_DIR)/ext_inc/klad CIPHER_CFLAGS += -I$(DRIVERS_DIR)/ioctl_inc/keyslot CIPHER_CFLAGS += -I$(DRIVERS_DIR)/ext_inc/keyslot # Debug # CIPHER_CFLAGS += -DCRYPTO_DISPATCH_FUNC_TRACE_ENABLE # CIPHER_CFLAGS += -DCRYPTO_KAPI_FUNC_TRACE_ENABLE # CIPHER_CFLAGS += -DCRYPTO_HAL_FUNC_TRACE_ENABLE # CIPHER_CFLAGS += -DCRYPTO_SYMC_HAL_NODE_DEBUG_ENABLE # CIPHER_CFLAGS += -DCRYPTO_DRV_FUNC_TRACE_ENABLE ifeq ($(CONFIG_DEBUG_ENABLE), y) ## DISPATCH CIPHER_CFLAGS += -DCRYPTO_DISPATCH_FUNC_TRACE_ENABLE ## KAPI ## DRV ## HAL CIPHER_CFLAGS += -DCRYPTO_HAL_FUNC_TRACE_ENABLE CIPHER_CFLAGS += -DCRYPTO_SYMC_HAL_NODE_DEBUG_ENABLE CIPHER_CFLAGS += -DCRYPTO_SYMC_HAL_DEBUG_ENABLE endif $(MODNAME)-objs-y += $(CIPHER_OBJS-y) ccflags-y += $(CIPHER_CFLAGS) $(MODNAME)-objs := $($(MODNAME)-objs-y)