blob: 37724facc2572f7bdc7e7387c97d04785138d3d6 [file] [log] [blame]
developer953cd0a2024-08-19 17:53:40 +08001SUMMARY = "Mediatek EIP-197 Driver"
2LICENSE = "GPL-2.0"
3LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
4
5inherit module
6
7SRC_URI = "git://gerrit.mediatek.inc/openwrt/feeds/mtk_openwrt_feeds;protocol=https;branch=master;destsuffix=git"
8SRCREV = "${AUTOREV}"
9
10S = "${WORKDIR}/git/feed/kernel/crypto-eip/src"
11
12DEPENDS += "pce"
13DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'capwap-dtls', 'tops', '', d)}"
14
15do_configure[noexec] = "1"
16
17# Include Paths
18INCLUDE_FLAGS_ALL=" \
19 -I${S}/ddk/inc \
20 -I${S}/ddk/inc/crypto-eip/ddk \
21 -I${S}/ddk/inc/crypto-eip/ddk/configs \
22 -I${S}/ddk/inc/crypto-eip/ddk/device \
23 -I${S}/ddk/inc/crypto-eip/ddk/device/lkm \
24 -I${S}/ddk/inc/crypto-eip/ddk/device/lkm/of \
25 -I${S}/ddk/inc/crypto-eip/ddk/dmares \
26 -I${S}/ddk/inc/crypto-eip/ddk/firmware_api \
27 -I${S}/ddk/inc/crypto-eip/ddk/kit/builder/sa \
28 -I${S}/ddk/inc/crypto-eip/ddk/kit/builder/token \
29 -I${S}/ddk/inc/crypto-eip/ddk/kit/eip197 \
30 -I${S}/ddk/inc/crypto-eip/ddk/kit/iotoken \
31 -I${S}/ddk/inc/crypto-eip/ddk/kit/list \
32 -I${S}/ddk/inc/crypto-eip/ddk/kit/ring \
33 -I${S}/ddk/inc/crypto-eip/ddk/libc \
34 -I${S}/ddk/inc/crypto-eip/ddk/log \
35 -I${S}/ddk/inc/crypto-eip/ddk/shdevxs \
36 -I${S}/ddk/inc/crypto-eip/ddk/slad \
37 -I${S}/ddk/inc/crypto-eip/ddk/slad/lkm \
developeread0bad2024-10-24 10:50:28 +080038 -I${S}/ddk/inc/crypto-eip/ddk/shdevxs \
39 -I${S}/ddk/inc/crypto-eip/ddk/umdevxs \
developer953cd0a2024-08-19 17:53:40 +080040 -I${STAGING_KERNEL_BUILDDIR}/source/drivers/net/ethernet/mediatek/ \
41 -I${STAGING_KERNEL_BUILDDIR}/source/include \
42 "
43
44PKG_MAKE_FLAGS = " \
45 CONFIG_MTK_CRYPTO_EIP_INLINE=m \
46 CONFIG_RAMBUS_DDK=m \
47 CONFIG_CRYPTO_XFRM_OFFLOAD_MTK_PCE=y \
48 CONFIG_CRYPTO_OFFLOAD_INLINE=y \
49 CONFIG_INET_ESP_OFFLOAD=y \
50 CONFIG_CRYPTO_HW=y \
51 CONFIG_CRYPTO_AUTHENC=y \
52 CONFIG_CRYPTO_AES=y \
53 CONFIG_CRYPTO_AEAD=y \
54 CONFIG_CRYPTO_DES=y \
55 CONFIG_CRYPTO_MD5=y \
56 CONFIG_CRYPTO_SHA1=y \
57 CONFIG_CRYPTO_SHA256=y \
58 CONFIG_CRYPTO_SHA512=y \
59 CONFIG_CRYPTO_SHA3=y \
60 CONFIG_CRYPTO_HMAC=y \
61 CONFIG_INET_ESP=y \
62 "
63
64EXTRA_CFLAGS+=" \
65 ${INCLUDE_FLAGS_ALL} \
66 -DEIP197_BUS_VERSION_AXI3 \
67 -DDRIVER_64BIT_HOST \
68 -DDRIVER_64BIT_DEVICE \
69 -DADAPTER_AUTO_TOKENBUILDER \
70 -DCONFIG_XFRM_OFFLOAD \
71 -DCONFIG_CRYPTO_XFRM_OFFLOAD_MTK_PCE \
72 -DMODULE \
73 "
74
75include ${@bb.utils.contains('DISTRO_FEATURES', 'capwap-dtls', 'files/custom/eip-197-capwap-dtls.inc', '', d)}
76
77EXTRA_OEMAKE = " \
78 -C ${STAGING_KERNEL_BUILDDIR}/ \
79 M=${S} \
80 ${PKG_MAKE_FLAGS} \
81 EXTRA_CFLAGS='${EXTRA_CFLAGS}' \
82 modules \
83 "
84
85do_install_append() {
86 install -d ${D}/${base_libdir}/modules/${KERNEL_VERSION}/extra/
87 install -m 0755 ${S}/crypto-eip-inline.ko ${D}/${base_libdir}/modules/${KERNEL_VERSION}/
developeread0bad2024-10-24 10:50:28 +080088 install -m 0755 ${S}/ddk/build/ksupport/crypto-eip-ddk-ksupport.ko ${D}/${base_libdir}/modules/${KERNEL_VERSION}/
89 install -m 0755 ${S}/ddk/build/ctrl/crypto-eip-ddk-ctrl.ko ${D}/${base_libdir}/modules/${KERNEL_VERSION}/
90 install -m 0755 ${S}/ddk/build/app/crypto-eip-ddk-ctrl-app.ko ${D}/${base_libdir}/modules/${KERNEL_VERSION}/
91 install -m 0755 ${S}/ddk/build/engine/crypto-eip-ddk-engine.ko ${D}/${base_libdir}/modules/${KERNEL_VERSION}/
developer953cd0a2024-08-19 17:53:40 +080092 # copy firmware and install
93 install -d ${D}/${base_libdir}/firmware
94 install -m 0755 ${S}/../firmware/bin/firmware_eip207_ifpp.bin ${D}/${base_libdir}/firmware/
95 install -m 0755 ${S}/../firmware/bin/firmware_eip207_ipue.bin ${D}/${base_libdir}/firmware/
96 install -m 0755 ${S}/../firmware/bin/firmware_eip207_ofpp.bin ${D}/${base_libdir}/firmware/
97 install -m 0755 ${S}/../firmware/bin/firmware_eip207_opue.bin ${D}/${base_libdir}/firmware/
98}
99
100FILES_${PN} += "${base_libdir}/firmware/*"