blob: b8486466f3bf4ec05cd89bbbd5c354feb5b3abd6 [file] [log] [blame]
developere5e687d2023-08-08 16:05:33 +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#
6
7include $(TOPDIR)/rules.mk
8include $(INCLUDE_DIR)/kernel.mk
9
10PKG_NAME:=tops
11PKG_RELEASE:=1
12
13include $(INCLUDE_DIR)/package.mk
14include $(INCLUDE_DIR)/package-defaults.mk
15
developere5e687d2023-08-08 16:05:33 +080016define Build/Prepare
17 mkdir -p $(PKG_BUILD_DIR)
18 $(CP) ./firmware $(PKG_BUILD_DIR)/firmware
19 $(CP) ./src/* $(PKG_BUILD_DIR)/
20endef
21
22define Package/tops-rebb-fw-release
developer1b2375f2023-08-31 14:38:35 +080023 TITLE:=Mediatek Tunnel Offload Processor System ReBB Release Firmware
developere5e687d2023-08-08 16:05:33 +080024 SECTION:=firmware
25 CATEGORY:=Firmware
developer1b2375f2023-08-31 14:38:35 +080026 DEPENDS:= \
27 @MTK_TOPS_RELEASE_TARGET \
28 kmod-tops-release
developere5e687d2023-08-08 16:05:33 +080029endef
30
31define Package/tops-rebb-fw-release/description
developer1b2375f2023-08-31 14:38:35 +080032 Support for Mediatek Tunnel Offload Processor System ReBB release firmware.
33 The firmware offload and accerlerate APMCU's tunnel protocols traffic.
34 Available offload tunnel include L2oGRE, L2TP.
developere5e687d2023-08-08 16:05:33 +080035endef
36
37define Package/tops-rebb-fw-release/install
38 $(INSTALL_DIR) $(1)/lib/firmware/mediatek
39 $(CP) \
40 $(PKG_BUILD_DIR)/firmware/rebb/mt7988_mgmt/tops-mgmt.img \
41 $(PKG_BUILD_DIR)/firmware/rebb/mt7988_offload/tops-offload.img \
42 $(1)/lib/firmware/mediatek
43endef
44
developer1b2375f2023-08-31 14:38:35 +080045define KernelPackage/tops-release
developere5e687d2023-08-08 16:05:33 +080046 CATEGORY:=MTK Properties
47 SUBMENU:=Drivers
developer1b2375f2023-08-31 14:38:35 +080048 TITLE:= MTK Tunnel Offload Processor System Kernel Driver
developere5e687d2023-08-08 16:05:33 +080049 FILES+=$(PKG_BUILD_DIR)/tops.ko
50 KCONFIG:=
developere5e687d2023-08-08 16:05:33 +080051 DEPENDS:= \
developer1b2375f2023-08-31 14:38:35 +080052 @MTK_TOPS_RELEASE_TARGET \
developere5e687d2023-08-08 16:05:33 +080053 kmod-mediatek_hnat \
developer1b2375f2023-08-31 14:38:35 +080054 kmod-tops \
developere5e687d2023-08-08 16:05:33 +080055 +kmod-pce \
56 +@KERNEL_RELAY
57endef
58
developer1b2375f2023-08-31 14:38:35 +080059define KernelPackage/tops-release/description
60 Support for MTK Tunnel Offload Processor System Released Driver. The driver
61 controls the TOPS system to reduce the loading of tunnel protocol processing
62 in APMCU.
developere5e687d2023-08-08 16:05:33 +080063endef
64
developer1b2375f2023-08-31 14:38:35 +080065define KernelPackage/tops-release-autoload
developere5e687d2023-08-08 16:05:33 +080066 CATEGORY:=MTK Properties
67 SUBMENU:=Drivers
68 TITLE:= MTK Tunnel Offload Processor System Auto Load
69 AUTOLOAD:=$(call AutoLoad,51,tops)
70 KCONFIG:=
71 DEPENDS:= \
developer1b2375f2023-08-31 14:38:35 +080072 kmod-tops-release \
developere5e687d2023-08-08 16:05:33 +080073 +kmod-pce-autoload
74endef
75
developer1b2375f2023-08-31 14:38:35 +080076define KernelPackage/tops-release-autoload/description
developere5e687d2023-08-08 16:05:33 +080077 Support for MTK Tunnel Offload Processor System auto load on system
78 boot process.
79endef
80
developer1b2375f2023-08-31 14:38:35 +080081define KernelPackage/tops
82 CATEGORY:=MTK Properties
83 TITLE:=Mediatek Tunnel Offload Processor System
84 SUBMENU:=Drivers
85 DEFAULT:=y
86 DEPENDS:= \
87 @TARGET_mediatek_mt7988
88endef
89
90define KernelPackage/tops/config
91 source "$(SOURCE)/Config.in"
92endef
93
94define KernelPackage/tops/description
95 Support for MTK Tunnel Offload Processor System. This system reduces the
96 loading of APMCU's tunnel protocol overhead and improve tunnel protocol's
97 throughput.
98endef
99
developere5e687d2023-08-08 16:05:33 +0800100define Build/Compile
101 $(MAKE) -C "$(LINUX_DIR)" \
102 $(KERNEL_MAKE_FLAGS) \
103 M="$(PKG_BUILD_DIR)" \
104 EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
105 $(EXTRA_KCONFIG) \
106 modules
107endef
108
developer1b2375f2023-08-31 14:38:35 +0800109include tops.mk
110include $(filter-out tops.mk,$(wildcard *.mk))
111
developere5e687d2023-08-08 16:05:33 +0800112$(eval $(call BuildPackage,tops-rebb-fw-release))
113$(eval $(call KernelPackage,tops))
developer1b2375f2023-08-31 14:38:35 +0800114$(eval $(call KernelPackage,tops-release))
115$(eval $(call KernelPackage,tops-release-autoload))