ramips: add mt7621 hwcrypto engine support

This commit is contained in:
AmadeusGhost
2020-07-12 18:08:03 +08:00
parent fc4afdfaa9
commit 518e5e5c00
2 changed files with 65 additions and 0 deletions

View File

@@ -0,0 +1,57 @@
#
# Copyright (C) 2006-2019 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=mtk-eip93
PKG_RELEASE:=1.2
PKG_SOURCE_URL:=https://github.com/vschagen/mtk-eip93.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=ae6492aba2388de54afa52700fcc21c3a6e6f1ad
MAKE_PATH:=src
include $(INCLUDE_DIR)/package.mk
define KernelPackage/crypto-hw-eip93
SECTION:=kernel
CATEGORY:=Kernel modules
SUBMENU:=Cryptographic API modules
DEPENDS:= \
@TARGET_ramips_mt7621 \
+kmod-crypto-authenc \
+kmod-crypto-des \
+kmod-crypto-md5 \
+kmod-crypto-sha1 \
+kmod-crypto-sha256 \
@LINUX_5_4
KCONFIG:=
TITLE:=MTK EIP93 crypto module.
FILES:=$(PKG_BUILD_DIR)/src/crypto-hw-eip93.ko
AUTOLOAD:=$(call AutoProbe,crypto-hw-eip93)
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
MAKE_OPTS:= \
$(KERNEL_MAKE_FLAGS) \
M="$(PKG_BUILD_DIR)/src"
define Build/Compile
$(MAKE) -C "$(LINUX_DIR)" \
$(MAKE_OPTS) \
modules
endef
$(eval $(call KernelPackage,crypto-hw-eip93))

View File

@@ -442,6 +442,14 @@
clock-names = "nfi_clk";
};
crypto@1e004000 {
compatible = "mediatek,mtk-eip93";
reg = <0x1e004000 0x1000>;
interrupt-parent = <&gic>;
interrupts = <GIC_SHARED 19 IRQ_TYPE_LEVEL_HIGH>;
};
ethsys: syscon@1e000000 {
compatible = "mediatek,mt7621-ethsys",
"syscon";