blob: 283d46651ff5144994f7dd3d60db6eb2e9953c0f [file] [log] [blame]
developer94c513e2023-08-21 17:33:25 +08001# SPDX-Liscense-Identifier: GPL-2.0-or-later
2#
3# Copyright (C) 2023 MediaTek Inc.
4#
5# Author: Chris.Chou <chris.chou@mediatek.com>
6# Ren-Ting Wang <ren-ting.wang@mediatek.com>
7
8# Configure for crypto-eip top makefile
9EIP_KERNEL_PKGS+= \
10 crypto-eip \
developer328d9e92024-05-23 17:54:24 +080011 crypto-eip-inline \
12 crypto-eip-autoload
developer94c513e2023-08-21 17:33:25 +080013
14ifeq ($(CONFIG_PACKAGE_kmod-crypto-eip),y)
15EXTRA_KCONFIG+= \
16 CONFIG_CRYPTO_OFFLOAD_INLINE=$(CONFIG_CRYPTO_OFFLOAD_INLINE)
17endif
18
19ifeq ($(CONFIG_CRYPTO_OFFLOAD_INLINE),y)
20EXTRA_KCONFIG+= \
21 CONFIG_MTK_CRYPTO_EIP_INLINE=m \
developer49489b82024-03-28 15:18:08 +080022 CONFIG_CRYPTO_XFRM_OFFLOAD_MTK_PCE=$(CONFIG_CRYPTO_XFRM_OFFLOAD_MTK_PCE) \
23 CONFIG_MTK_TOPS_CAPWAP_DTLS=$(CONFIG_MTK_TOPS_CAPWAP_DTLS)
developer94c513e2023-08-21 17:33:25 +080024
25EXTRA_CFLAGS+= \
26 -I$(LINUX_DIR)/drivers/net/ethernet/mediatek/ \
27 -I$(KERNEL_BUILD_DIR)/pce/inc/
28endif
29
developer49489b82024-03-28 15:18:08 +080030ifeq ($(CONFIG_MTK_TOPS_CAPWAP_DTLS),y)
31EXTRA_CFLAGS += \
32 -DCONFIG_TOPS_TNL_NUM=$(CONFIG_TOPS_TNL_NUM)
33endif
34
developer94c513e2023-08-21 17:33:25 +080035# crypto-eip kernel package configuration
36define KernelPackage/crypto-eip
37 CATEGORY:=MTK Properties
38 SUBMENU:=Drivers
39 TITLE:= EIP-197 Crypto Engine Driver
40 DEFAULT:=y
41 KCONFIG:= \
42 CONFIG_CRYPTO_HW=y \
43 CONFIG_CRYPTO_AUTHENC=y \
44 CONFIG_CRYPTO_AES=y \
45 CONFIG_CRYPTO_AEAD=y \
46 CONFIG_CRYPTO_DES=y \
47 CONFIG_CRYPTO_MD5=y \
48 CONFIG_CRYPTO_SHA1=y \
49 CONFIG_CRYPTO_SHA256=y \
50 CONFIG_CRYPTO_SHA512=y \
51 CONFIG_CRYPTO_SHA3=y \
52 CONFIG_CRYPTO_HMAC=y \
developer081f2e62024-09-19 15:33:31 +080053 CONFIG_INET_ESP=y \
54 CONFIG_INET_ESP_OFFLOAD=y
developer94c513e2023-08-21 17:33:25 +080055 DEPENDS:= \
56 @TARGET_mediatek \
57 +strongswan \
58 +strongswan-default
59 $(call AddDepends/crypto)
60endef
61
62define KernelPackage/crypto-eip/description
63 Enable crypto engine to accelerate encrypt/decrypt. Support look aside
64 mode (semi-HW) and inline mode (pure-HW). Look aside mode is bind with
65 Linux Crypto API and support AES, DES, SHA1, and SHA2 algorithms. In-
66 line mode only support ESP Tunnel mode (single tunnel) now.
67endef
68
69define KernelPackage/crypto-eip/config
70 source "$(SOURCE)/Config.in"
71endef
72
73define KernelPackage/crypto-eip-inline
74 CATEGORY:=MTK Properties
75 SUBMENU:=Drivers
76 TITLE:= EIP-197 Crypto Engine Inline Driver
developer081f2e62024-09-19 15:33:31 +080077 KCONFIG:=
developer94c513e2023-08-21 17:33:25 +080078 DEPENDS:= \
79 @CRYPTO_OFFLOAD_INLINE \
80 kmod-crypto-eip \
81 kmod-crypto-eip-ddk \
developer4b649a92024-10-07 15:27:03 +080082 kmod-crypto-eip-ddk-ksupport \
83 kmod-crypto-eip-ddk-ctrl \
84 kmod-crypto-eip-ddk-ctrl-app \
85 kmod-crypto-eip-ddk-engine \
developer49489b82024-03-28 15:18:08 +080086 +kmod-pce \
87 +MTK_TOPS_CAPWAP_DTLS:kmod-tops
developer94c513e2023-08-21 17:33:25 +080088 FILES:=$(PKG_BUILD_DIR)/crypto-eip-inline.ko
89 $(call AddDepends/crypto)
90endef
91
92define KernelPackage/crypto-eip-inline/description
93 EIP197 inline mode. HW offload for IPsec ESP Tunnel mode.
94endef
developer328d9e92024-05-23 17:54:24 +080095
96define KernelPackage/crypto-eip-autoload
97 CATEGORY:=MTK Properties
98 SUBMENU:=Drivers
99 TITLE:= EIP-197 Crypto Engine Driver Autoload
100 AUTOLOAD:=$(call AutoLoad,90,crypto-eip-inline)
101 KCONFIG:=
102 DEPENDS:= kmod-crypto-eip-inline
103endef
104
105define KernelPackage/crypto-eip-autoload/description
106 EIP197 Driver Autoload.
107endef