developer | e5e687d | 2023-08-08 16:05:33 +0800 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0-or-later |
| 2 | # |
| 3 | # Copyright (C) 2023 Mediatek Inc. All Rights Reserved. |
| 4 | # Author: Alvin Kuo <alvin.kuo@mediatek.com> |
| 5 | # |
| 6 | |
| 7 | include $(TOPDIR)/rules.mk |
| 8 | |
| 9 | PKG_NAME:=tops-tool |
| 10 | PKG_RELEASE:=1 |
| 11 | |
| 12 | include $(INCLUDE_DIR)/package.mk |
| 13 | include $(INCLUDE_DIR)/package-defaults.mk |
| 14 | |
| 15 | define Package/tops-tool |
| 16 | TITLE:=Mediatek Tunnel Offload Processor System User Tool |
| 17 | SECTION:=MTK Properties |
| 18 | CATEGORY:=MTK Properties |
| 19 | DEFAULT:=y |
| 20 | SUBMENU:=Applications |
| 21 | DEPENDS:=kmod-tops |
| 22 | endef |
| 23 | |
| 24 | define Package/tops-tool/description |
developer | 8762a19 | 2023-09-04 09:16:22 +0800 | [diff] [blame] | 25 | This package is support for MediaTek tunnel offload processor system user tool. |
| 26 | The tool will monitor TOPS status, such as TOPS core utilization rate and core |
| 27 | debug dump info. Some features are not monitored by default unless user trigger |
| 28 | it to start. The tool will support logging functionality in the future. |
developer | e5e687d | 2023-08-08 16:05:33 +0800 | [diff] [blame] | 29 | endef |
| 30 | |
| 31 | TARGET_CFLAGS += \ |
| 32 | -I$(PKG_BUILD_DIR)/inc |
| 33 | |
| 34 | define Build/Compile |
| 35 | $(MAKE) -C $(PKG_BUILD_DIR) \ |
| 36 | CC="$(TARGET_CC)" \ |
| 37 | CFLAGS="$(TARGET_CFLAGS) -Wall -Wextra" \ |
| 38 | LDFLAGS="$(TARGET_LDFLAGS)" |
| 39 | endef |
| 40 | |
| 41 | define Package/tops-tool/install |
| 42 | $(INSTALL_DIR) $(1)/usr/sbin |
| 43 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/tops-tool $(1)/usr/sbin/ |
developer | 8762a19 | 2023-09-04 09:16:22 +0800 | [diff] [blame] | 44 | endef |
| 45 | |
| 46 | define Package/tops-tool-autoload |
| 47 | TITLE:=Mediatek Tunnel Offload Processor System User Tool Auto Load |
| 48 | CATEGORY:=MTK Properties |
| 49 | SUBMENU:=Applications |
| 50 | DEPENDS:=tops-tool |
| 51 | DEFAULT:=y if PACKAGE_kmod-tops-release-autoload || PACKAGE_kmod-tops-dev-autoload |
| 52 | endef |
| 53 | |
| 54 | define Package/tops-tool-autoload/description |
| 55 | This package is support for MediaTek tunnel offload processor system user tool |
| 56 | autoload. The tool will automatically start monitor TOPS status when system |
| 57 | boot up. |
| 58 | endef |
developer | e5e687d | 2023-08-08 16:05:33 +0800 | [diff] [blame] | 59 | |
developer | 8762a19 | 2023-09-04 09:16:22 +0800 | [diff] [blame] | 60 | define Package/tops-tool-autoload/install |
developer | e5e687d | 2023-08-08 16:05:33 +0800 | [diff] [blame] | 61 | $(INSTALL_DIR) $(1)/etc/init.d |
| 62 | $(INSTALL_BIN) ./files/tops-tool.init $(1)/etc/init.d/tops-tool |
| 63 | endef |
| 64 | |
| 65 | $(eval $(call BuildPackage,tops-tool)) |
developer | 8762a19 | 2023-09-04 09:16:22 +0800 | [diff] [blame] | 66 | $(eval $(call BuildPackage,tops-tool-autoload)) |