Skip to content

Commit

Permalink
ramips: add support for mtk eip93 crypto engine
Browse files Browse the repository at this point in the history
Mediatek EIP93 Crypto engine is a crypto accelerator which
is available in the Mediatek MT7621 SoC.

Signed-off-by: Aviana Cruz <[email protected]>
Co-authored-by: Richard van Schagen <[email protected]>
Co-authored-by: Chukun Pan <[email protected]>
  • Loading branch information
3 people authored and Ansuel committed Sep 12, 2023
1 parent 47d56ae commit 46d6730
Show file tree
Hide file tree
Showing 4 changed files with 3,314 additions and 1 deletion.
29 changes: 29 additions & 0 deletions package/kernel/linux/modules/crypto.mk
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,35 @@ endef

$(eval $(call KernelPackage,crypto-hw-talitos))

define KernelPackage/crypto-hw-eip93
TITLE:=MTK EIP93 crypto module
DEPENDS:=@TARGET_ramips_mt7621 \
+kmod-crypto-authenc \
+kmod-crypto-des \
+kmod-crypto-md5 \
+kmod-crypto-sha1 \
+kmod-crypto-sha256
KCONFIG:= \
CONFIG_CRYPTO_HW=y \
CONFIG_CRYPTO_DEV_EIP93 \
CONFIG_CRYPTO_DEV_EIP93_AES=y \
CONFIG_CRYPTO_DEV_EIP93_DES=y \
CONFIG_CRYPTO_DEV_EIP93_AEAD=y \
CONFIG_CRYPTO_DEV_EIP93_GENERIC_SW_MAX_LEN=256 \
CONFIG_CRYPTO_DEV_EIP93_AES_128_SW_MAX_LEN=512
FILES:=$(LINUX_DIR)/drivers/crypto/mtk-eip93/crypto-hw-eip93.ko
AUTOLOAD:=$(call AutoLoad,09,crypto-hw-eip93)
$(call AddDepends/crypto)
endef

define KernelPackage/crypto-hw-eip93/description
Kernel module to enable EIP-93 Crypto engine as found
in the Mediatek MT7621 SoC.
It enables DES/3DES/AES ECB/CBC/CTR and
IPSEC offload with authenc(hmac(sha1/sha256), aes/cbc/rfc3686)
endef

$(eval $(call KernelPackage,crypto-hw-eip93))

define KernelPackage/crypto-kpp
TITLE:=Key-agreement Protocol Primitives
Expand Down
8 changes: 8 additions & 0 deletions target/linux/ramips/dts/mt7621.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,14 @@
clock-names = "nfi_clk";
};

crypto: crypto@1e004000 {
compatible = "mediatek,mtk-eip93";
reg = <0x1e004000 0x1000>;

interrupt-parent = <&gic>;
interrupts = <GIC_SHARED 19 IRQ_TYPE_LEVEL_HIGH>;
};

ethernet: ethernet@1e100000 {
compatible = "mediatek,mt7621-eth";
reg = <0x1e100000 0x10000>;
Expand Down
2 changes: 1 addition & 1 deletion target/linux/ramips/mt7621/target.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ KERNELNAME:=vmlinux vmlinuz
# make Kernel/CopyImage use $LINUX_DIR/vmlinuz
IMAGES_DIR:=../../..

DEFAULT_PACKAGES += wpad-basic-mbedtls uboot-envtools
DEFAULT_PACKAGES += wpad-basic-mbedtls uboot-envtools kmod-crypto-hw-eip93

define Target/Description
Build firmware images for Ralink MT7621 based boards.
Expand Down
Loading

0 comments on commit 46d6730

Please sign in to comment.