developer | 1966afb | 2023-08-08 16:02:18 +0800 | [diff] [blame^] | 1 | # SPDX-License-Identifier: GPL-2.0-or-later |
| 2 | # |
| 3 | # Copyright (c) 2023, Mediatek Inc. All Rights Reserved. |
| 4 | # Author: Ren-Ting.Wang <ren-ting.wang@mediatek.com> |
| 5 | |
| 6 | include $(TOPDIR)/rules.mk |
| 7 | include $(INCLUDE_DIR)/kernel.mk |
| 8 | |
| 9 | PKG_NAME:=pce |
| 10 | PKG_RELEASE:=1 |
| 11 | |
| 12 | include $(INCLUDE_DIR)/package.mk |
| 13 | include $(INCLUDE_DIR)/package-defaults.mk |
| 14 | |
| 15 | EXTRA_KCONFIG+= \ |
| 16 | CONFIG_MTK_PCE=m |
| 17 | |
| 18 | EXTRA_CFLAGS+= \ |
| 19 | $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(EXTRA_KCONFIG)))) \ |
| 20 | $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) |
| 21 | |
| 22 | EXTRA_CFLAGS+= -Wall -Werror |
| 23 | |
| 24 | define Build/Prepare |
| 25 | mkdir -p $(PKG_BUILD_DIR) |
| 26 | $(CP) -r src/* $(PKG_BUILD_DIR)/ |
| 27 | endef |
| 28 | |
| 29 | define Build/Compile |
| 30 | $(MAKE) -C "$(LINUX_DIR)" \ |
| 31 | $(KERNEL_MAKE_FLAGS) \ |
| 32 | M="$(PKG_BUILD_DIR)" \ |
| 33 | EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ |
| 34 | $(EXTRA_KCONFIG) \ |
| 35 | modules |
| 36 | endef |
| 37 | |
| 38 | # pce kernel package configuration |
| 39 | define KernelPackage/pce |
| 40 | CATEGORY:=MTK Properties |
| 41 | SUBMENU:=Drivers |
| 42 | TITLE:= MTK Packet Classification Engine Driver |
| 43 | FILES+=$(PKG_BUILD_DIR)/pce.ko |
| 44 | KCONFIG:= |
| 45 | DEPENDS:= \ |
| 46 | kmod-mediatek_hnat |
| 47 | endef |
| 48 | |
| 49 | define KernelPackage/pce/description |
| 50 | Support for Mediatek Packet Classification Engine. The HW provides abilities |
| 51 | to redirect specific packet type to different Mediatek HW offload engine. |
| 52 | In addition, the HW can be configured with multiple rules, such as IP protocol, |
| 53 | destination IP address, Layer 4 header or data, to match with the inbound packet. |
| 54 | Support HW offload engine includes tunnel offload engine, inline crypto offload |
| 55 | engine. |
| 56 | endef |
| 57 | |
| 58 | define KernelPackage/pce-autoload |
| 59 | CATEGORY:=MTK Properties |
| 60 | SUBMENU:=Drivers |
| 61 | TITLE:= MTK Packet Classification Engine Auto Load |
| 62 | AUTOLOAD:=$(call AutoLoad,50,pce) |
| 63 | KCONFIG:= |
| 64 | DEPENDS:= \ |
| 65 | kmod-pce |
| 66 | endef |
| 67 | |
| 68 | define KernelPackage/pce-autoload/description |
| 69 | Support for Mediatek Packet Classification Engine auto load on system |
| 70 | boot process. |
| 71 | endef |
| 72 | |
| 73 | $(eval $(call KernelPackage,pce)) |
| 74 | $(eval $(call KernelPackage,pce-autoload)) |