blob: 189a51b93627d60e77599198769ea803cadb4e8a [file] [log] [blame]
developer1966afb2023-08-08 16:02:18 +08001# 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
6include $(TOPDIR)/rules.mk
7include $(INCLUDE_DIR)/kernel.mk
8
9PKG_NAME:=pce
10PKG_RELEASE:=1
11
12include $(INCLUDE_DIR)/package.mk
13include $(INCLUDE_DIR)/package-defaults.mk
14
15EXTRA_KCONFIG+= \
16 CONFIG_MTK_PCE=m
17
18EXTRA_CFLAGS+= \
19 $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(EXTRA_KCONFIG)))) \
20 $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG))))
21
22EXTRA_CFLAGS+= -Wall -Werror
23
24define Build/Prepare
25 mkdir -p $(PKG_BUILD_DIR)
26 $(CP) -r src/* $(PKG_BUILD_DIR)/
27endef
28
29define 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
36endef
37
38# pce kernel package configuration
39define 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
47endef
48
49define 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.
56endef
57
58define 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
66endef
67
68define KernelPackage/pce-autoload/description
69 Support for Mediatek Packet Classification Engine auto load on system
70 boot process.
71endef
72
73$(eval $(call KernelPackage,pce))
74$(eval $(call KernelPackage,pce-autoload))