blob: 2421cb2d4391ab16dadde0fc2435f46290c6c77b [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
developer5ece98b2024-11-04 17:15:01 +080015# There is dependency issue in this package.
16# For now, we jsut disable parallel building as a workaround.
17PARALLEL_MAKE = ""
18BB_NUMBER_THREADS = "1"
19
developer953cd0a2024-08-19 17:53:40 +080020do_configure[noexec] = "1"
21
22# Include Paths
23INCLUDE_FLAGS_ALL=" \
24 -I${S}/ddk/inc \
25 -I${S}/ddk/inc/crypto-eip/ddk \
26 -I${S}/ddk/inc/crypto-eip/ddk/configs \
developer5ece98b2024-11-04 17:15:01 +080027 -I${S}/ddk/inc/crypto-eip/ddk/shdevxs \
28 -I${S}/ddk/inc/crypto-eip/ddk/umdevxs \
developer953cd0a2024-08-19 17:53:40 +080029 -I${S}/ddk/inc/crypto-eip/ddk/device \
30 -I${S}/ddk/inc/crypto-eip/ddk/device/lkm \
31 -I${S}/ddk/inc/crypto-eip/ddk/device/lkm/of \
32 -I${S}/ddk/inc/crypto-eip/ddk/dmares \
33 -I${S}/ddk/inc/crypto-eip/ddk/firmware_api \
34 -I${S}/ddk/inc/crypto-eip/ddk/kit/builder/sa \
35 -I${S}/ddk/inc/crypto-eip/ddk/kit/builder/token \
36 -I${S}/ddk/inc/crypto-eip/ddk/kit/eip197 \
37 -I${S}/ddk/inc/crypto-eip/ddk/kit/iotoken \
38 -I${S}/ddk/inc/crypto-eip/ddk/kit/list \
39 -I${S}/ddk/inc/crypto-eip/ddk/kit/ring \
40 -I${S}/ddk/inc/crypto-eip/ddk/libc \
41 -I${S}/ddk/inc/crypto-eip/ddk/log \
developer953cd0a2024-08-19 17:53:40 +080042 -I${S}/ddk/inc/crypto-eip/ddk/slad \
43 -I${S}/ddk/inc/crypto-eip/ddk/slad/lkm \
44 -I${STAGING_KERNEL_BUILDDIR}/source/drivers/net/ethernet/mediatek/ \
45 -I${STAGING_KERNEL_BUILDDIR}/source/include \
46 "
47
48PKG_MAKE_FLAGS = " \
49 CONFIG_MTK_CRYPTO_EIP_INLINE=m \
50 CONFIG_RAMBUS_DDK=m \
51 CONFIG_CRYPTO_XFRM_OFFLOAD_MTK_PCE=y \
52 CONFIG_CRYPTO_OFFLOAD_INLINE=y \
53 CONFIG_INET_ESP_OFFLOAD=y \
54 CONFIG_CRYPTO_HW=y \
55 CONFIG_CRYPTO_AUTHENC=y \
56 CONFIG_CRYPTO_AES=y \
57 CONFIG_CRYPTO_AEAD=y \
58 CONFIG_CRYPTO_DES=y \
59 CONFIG_CRYPTO_MD5=y \
60 CONFIG_CRYPTO_SHA1=y \
61 CONFIG_CRYPTO_SHA256=y \
62 CONFIG_CRYPTO_SHA512=y \
63 CONFIG_CRYPTO_SHA3=y \
64 CONFIG_CRYPTO_HMAC=y \
65 CONFIG_INET_ESP=y \
66 "
67
68EXTRA_CFLAGS+=" \
69 ${INCLUDE_FLAGS_ALL} \
70 -DEIP197_BUS_VERSION_AXI3 \
71 -DDRIVER_64BIT_HOST \
72 -DDRIVER_64BIT_DEVICE \
73 -DADAPTER_AUTO_TOKENBUILDER \
74 -DCONFIG_XFRM_OFFLOAD \
75 -DCONFIG_CRYPTO_XFRM_OFFLOAD_MTK_PCE \
76 -DMODULE \
77 "
78
79include ${@bb.utils.contains('DISTRO_FEATURES', 'capwap-dtls', 'files/custom/eip-197-capwap-dtls.inc', '', d)}
80
81EXTRA_OEMAKE = " \
82 -C ${STAGING_KERNEL_BUILDDIR}/ \
83 M=${S} \
84 ${PKG_MAKE_FLAGS} \
85 EXTRA_CFLAGS='${EXTRA_CFLAGS}' \
86 modules \
87 "
88
89do_install_append() {
90 install -d ${D}/${base_libdir}/modules/${KERNEL_VERSION}/extra/
91 install -m 0755 ${S}/crypto-eip-inline.ko ${D}/${base_libdir}/modules/${KERNEL_VERSION}/
developeread0bad2024-10-24 10:50:28 +080092 install -m 0755 ${S}/ddk/build/ksupport/crypto-eip-ddk-ksupport.ko ${D}/${base_libdir}/modules/${KERNEL_VERSION}/
93 install -m 0755 ${S}/ddk/build/ctrl/crypto-eip-ddk-ctrl.ko ${D}/${base_libdir}/modules/${KERNEL_VERSION}/
94 install -m 0755 ${S}/ddk/build/app/crypto-eip-ddk-ctrl-app.ko ${D}/${base_libdir}/modules/${KERNEL_VERSION}/
95 install -m 0755 ${S}/ddk/build/engine/crypto-eip-ddk-engine.ko ${D}/${base_libdir}/modules/${KERNEL_VERSION}/
developer953cd0a2024-08-19 17:53:40 +080096 # copy firmware and install
97 install -d ${D}/${base_libdir}/firmware
98 install -m 0755 ${S}/../firmware/bin/firmware_eip207_ifpp.bin ${D}/${base_libdir}/firmware/
99 install -m 0755 ${S}/../firmware/bin/firmware_eip207_ipue.bin ${D}/${base_libdir}/firmware/
100 install -m 0755 ${S}/../firmware/bin/firmware_eip207_ofpp.bin ${D}/${base_libdir}/firmware/
101 install -m 0755 ${S}/../firmware/bin/firmware_eip207_opue.bin ${D}/${base_libdir}/firmware/
102}
103
104FILES_${PN} += "${base_libdir}/firmware/*"