• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2021 HiSilicon (Shanghai) Technologies CO., LIMITED.
2#
3# This program is free software; you can redistribute it and/or
4# modify it under the terms of the GNU General Public License
5# as published by the Free Software Foundation; either version 2
6# of the License, or (at your option) any later version.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11# GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License
14# along with this program; if not, write to the Free Software
15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
16
17ifeq ($(PARAM_FILE), )
18        PARAM_FILE:=../../../../mpp/Makefile.param
19        include $(PARAM_FILE)
20endif
21
22ifeq ($(KERNELRELEASE),)
23export CIPHER_BASE_DIR=$(PWD)
24endif
25
26include $(CIPHER_BASE_DIR)/drv/cipher_v1.0/build.mak
27
28MBEDTLS_DIR := $(CIPHER_BASE_DIR)/../mbedtls_prepare
29MBEDTLS_LIB := libmbedcrypto.a
30MBEDTLS_VER := mbedtls-2.16.10
31
32MPP_CFLAGS += $(CIPHER_API_CFLAGS)
33MPP_CFLAGS += $(CIPHER_DRV_CFLAGS)
34MPP_CFLAGS += -I$(CIPHER_BASE_DIR)/../include
35MPP_CFLAGS += -I$(CBB_ROOT)/include
36MPP_CFLAGS += -I$(CBB_ROOT)/base/arch/$(HIARCH)/include/$(HI_SUBARCH)
37
38EXTRA_CFLAGS += $(MPP_CFLAGS)
39EXTRA_CFLAGS += $(DRV_CFLAGS)
40EXTRA_CFLAGS += -I$(MBEDTLS_DIR)/$(MBEDTLS_VER)/include/
41EXTRA_CFLAGS += -DARCH_TYPE_$(ARM_ARCH)
42ifneq ($(filter $(HI_SUBARCH), hi3569v100 hi3568v100), )
43EXTRA_CFLAGS += -DCHIP_TYPE_$(HI_SUBARCH)
44else
45EXTRA_CFLAGS += -DCHIP_TYPE_$(INTER_DRV)
46endif
47ifeq ($(CONFIG_DRIVER_SPACE_TYPE),user_space)
48EXTRA_CFLAGS :=$(subst base/,based/,$(EXTRA_CFLAGS))
49EXTRA_CFLAGS :=$(subst sys/,sysd/,$(EXTRA_CFLAGS))
50MPP_CFLAGS :=$(subst base/,based/,$(MPP_CFLAGS))
51MPP_CFLAGS :=$(subst sys/,sysd/,$(MPP_CFLAGS))
52endif
53CIPHER_INC     := hi_types.h hi_common_cipher.h hi_unf_cipher.h
54CIPHER_DIR_INC := $(patsubst %.h,$(CIPHER_BASE_DIR)/../include/%.h,$(CIPHER_INC))
55CIPHER_REL_INC := $(patsubst %.h,$(REL_INC)/%.h,$(CIPHER_INC))
56
57include $(CIPHER_BASE_DIR)/$(OSTYPE).mak
58