developer | 4f0d2ba | 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 \ |
| 11 | crypto-eip-inline |
| 12 | |
| 13 | ifeq ($(CONFIG_PACKAGE_kmod-crypto-eip),y) |
| 14 | EXTRA_KCONFIG+= \ |
| 15 | CONFIG_CRYPTO_OFFLOAD_INLINE=$(CONFIG_CRYPTO_OFFLOAD_INLINE) |
| 16 | endif |
| 17 | |
| 18 | ifeq ($(CONFIG_CRYPTO_OFFLOAD_INLINE),y) |
| 19 | EXTRA_KCONFIG+= \ |
| 20 | CONFIG_MTK_CRYPTO_EIP_INLINE=m \ |
| 21 | CONFIG_CRYPTO_XFRM_OFFLOAD_MTK_PCE=$(CONFIG_CRYPTO_XFRM_OFFLOAD_MTK_PCE) |
| 22 | |
| 23 | EXTRA_CFLAGS+= \ |
| 24 | -I$(LINUX_DIR)/drivers/net/ethernet/mediatek/ \ |
| 25 | -I$(KERNEL_BUILD_DIR)/pce/inc/ |
| 26 | endif |
| 27 | |
| 28 | # crypto-eip kernel package configuration |
| 29 | define KernelPackage/crypto-eip |
| 30 | CATEGORY:=MTK Properties |
| 31 | SUBMENU:=Drivers |
| 32 | TITLE:= EIP-197 Crypto Engine Driver |
| 33 | DEFAULT:=y |
| 34 | KCONFIG:= \ |
| 35 | CONFIG_CRYPTO_HW=y \ |
| 36 | CONFIG_CRYPTO_AUTHENC=y \ |
| 37 | CONFIG_CRYPTO_AES=y \ |
| 38 | CONFIG_CRYPTO_AEAD=y \ |
| 39 | CONFIG_CRYPTO_DES=y \ |
| 40 | CONFIG_CRYPTO_MD5=y \ |
| 41 | CONFIG_CRYPTO_SHA1=y \ |
| 42 | CONFIG_CRYPTO_SHA256=y \ |
| 43 | CONFIG_CRYPTO_SHA512=y \ |
| 44 | CONFIG_CRYPTO_SHA3=y \ |
| 45 | CONFIG_CRYPTO_HMAC=y \ |
| 46 | CONFIG_INET_ESP=y |
| 47 | DEPENDS:= \ |
| 48 | @TARGET_mediatek \ |
| 49 | +strongswan \ |
| 50 | +strongswan-default |
| 51 | $(call AddDepends/crypto) |
| 52 | endef |
| 53 | |
| 54 | define KernelPackage/crypto-eip/description |
| 55 | Enable crypto engine to accelerate encrypt/decrypt. Support look aside |
| 56 | mode (semi-HW) and inline mode (pure-HW). Look aside mode is bind with |
| 57 | Linux Crypto API and support AES, DES, SHA1, and SHA2 algorithms. In- |
| 58 | line mode only support ESP Tunnel mode (single tunnel) now. |
| 59 | endef |
| 60 | |
| 61 | define KernelPackage/crypto-eip/config |
| 62 | source "$(SOURCE)/Config.in" |
| 63 | endef |
| 64 | |
| 65 | define KernelPackage/crypto-eip-inline |
| 66 | CATEGORY:=MTK Properties |
| 67 | SUBMENU:=Drivers |
| 68 | TITLE:= EIP-197 Crypto Engine Inline Driver |
| 69 | KCONFIG:= \ |
| 70 | CONFIG_INET_ESP_OFFLOAD=y |
| 71 | DEPENDS:= \ |
| 72 | @CRYPTO_OFFLOAD_INLINE \ |
| 73 | kmod-crypto-eip \ |
| 74 | kmod-crypto-eip-ddk \ |
| 75 | +kmod-pce |
| 76 | FILES:=$(PKG_BUILD_DIR)/crypto-eip-inline.ko |
| 77 | $(call AddDepends/crypto) |
| 78 | endef |
| 79 | |
| 80 | define KernelPackage/crypto-eip-inline/description |
| 81 | EIP197 inline mode. HW offload for IPsec ESP Tunnel mode. |
| 82 | endef |