developer | 94c513e | 2023-08-21 17:33:25 +0800 | [diff] [blame] | 1 | # 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 |
| 9 | EIP_KERNEL_PKGS+= \ |
| 10 | crypto-eip \ |
developer | 328d9e9 | 2024-05-23 17:54:24 +0800 | [diff] [blame] | 11 | crypto-eip-inline \ |
| 12 | crypto-eip-autoload |
developer | 94c513e | 2023-08-21 17:33:25 +0800 | [diff] [blame] | 13 | |
| 14 | ifeq ($(CONFIG_PACKAGE_kmod-crypto-eip),y) |
| 15 | EXTRA_KCONFIG+= \ |
| 16 | CONFIG_CRYPTO_OFFLOAD_INLINE=$(CONFIG_CRYPTO_OFFLOAD_INLINE) |
| 17 | endif |
| 18 | |
| 19 | ifeq ($(CONFIG_CRYPTO_OFFLOAD_INLINE),y) |
| 20 | EXTRA_KCONFIG+= \ |
| 21 | CONFIG_MTK_CRYPTO_EIP_INLINE=m \ |
developer | 49489b8 | 2024-03-28 15:18:08 +0800 | [diff] [blame] | 22 | CONFIG_CRYPTO_XFRM_OFFLOAD_MTK_PCE=$(CONFIG_CRYPTO_XFRM_OFFLOAD_MTK_PCE) \ |
| 23 | CONFIG_MTK_TOPS_CAPWAP_DTLS=$(CONFIG_MTK_TOPS_CAPWAP_DTLS) |
developer | 94c513e | 2023-08-21 17:33:25 +0800 | [diff] [blame] | 24 | |
| 25 | EXTRA_CFLAGS+= \ |
| 26 | -I$(LINUX_DIR)/drivers/net/ethernet/mediatek/ \ |
| 27 | -I$(KERNEL_BUILD_DIR)/pce/inc/ |
| 28 | endif |
| 29 | |
developer | 49489b8 | 2024-03-28 15:18:08 +0800 | [diff] [blame] | 30 | ifeq ($(CONFIG_MTK_TOPS_CAPWAP_DTLS),y) |
| 31 | EXTRA_CFLAGS += \ |
| 32 | -DCONFIG_TOPS_TNL_NUM=$(CONFIG_TOPS_TNL_NUM) |
| 33 | endif |
| 34 | |
developer | 94c513e | 2023-08-21 17:33:25 +0800 | [diff] [blame] | 35 | # crypto-eip kernel package configuration |
| 36 | define 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 \ |
developer | 081f2e6 | 2024-09-19 15:33:31 +0800 | [diff] [blame] | 53 | CONFIG_INET_ESP=y \ |
| 54 | CONFIG_INET_ESP_OFFLOAD=y |
developer | 94c513e | 2023-08-21 17:33:25 +0800 | [diff] [blame] | 55 | DEPENDS:= \ |
| 56 | @TARGET_mediatek \ |
| 57 | +strongswan \ |
| 58 | +strongswan-default |
| 59 | $(call AddDepends/crypto) |
| 60 | endef |
| 61 | |
| 62 | define 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. |
| 67 | endef |
| 68 | |
| 69 | define KernelPackage/crypto-eip/config |
| 70 | source "$(SOURCE)/Config.in" |
| 71 | endef |
| 72 | |
| 73 | define KernelPackage/crypto-eip-inline |
| 74 | CATEGORY:=MTK Properties |
| 75 | SUBMENU:=Drivers |
| 76 | TITLE:= EIP-197 Crypto Engine Inline Driver |
developer | 081f2e6 | 2024-09-19 15:33:31 +0800 | [diff] [blame] | 77 | KCONFIG:= |
developer | 94c513e | 2023-08-21 17:33:25 +0800 | [diff] [blame] | 78 | DEPENDS:= \ |
| 79 | @CRYPTO_OFFLOAD_INLINE \ |
| 80 | kmod-crypto-eip \ |
| 81 | kmod-crypto-eip-ddk \ |
developer | 4b649a9 | 2024-10-07 15:27:03 +0800 | [diff] [blame] | 82 | kmod-crypto-eip-ddk-ksupport \ |
| 83 | kmod-crypto-eip-ddk-ctrl \ |
| 84 | kmod-crypto-eip-ddk-ctrl-app \ |
| 85 | kmod-crypto-eip-ddk-engine \ |
developer | 49489b8 | 2024-03-28 15:18:08 +0800 | [diff] [blame] | 86 | +kmod-pce \ |
| 87 | +MTK_TOPS_CAPWAP_DTLS:kmod-tops |
developer | 94c513e | 2023-08-21 17:33:25 +0800 | [diff] [blame] | 88 | FILES:=$(PKG_BUILD_DIR)/crypto-eip-inline.ko |
| 89 | $(call AddDepends/crypto) |
| 90 | endef |
| 91 | |
| 92 | define KernelPackage/crypto-eip-inline/description |
| 93 | EIP197 inline mode. HW offload for IPsec ESP Tunnel mode. |
| 94 | endef |
developer | 328d9e9 | 2024-05-23 17:54:24 +0800 | [diff] [blame] | 95 | |
| 96 | define 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 |
| 103 | endef |
| 104 | |
| 105 | define KernelPackage/crypto-eip-autoload/description |
| 106 | EIP197 Driver Autoload. |
| 107 | endef |