summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Mojík2023-10-26 11:46:11 +0000
committerRobert Marko2024-08-02 20:11:05 +0000
commit17ecd37c6aa08710993305e72c78bb3f25d5ced0 (patch)
treecf62deb797f7ed3c957a0775c21ab196615316d2
parent56706d33cf446335bf341512c58957a437208466 (diff)
downloadopenwrt-17ecd37c6aa08710993305e72c78bb3f25d5ced0.tar.gz
utils: Add the omnia-mcutool utility
Add a new utility, omnia-mcutool, which main purpose is to upgrade the firmware on the microcontroller on the Turris Omnia router. Depends on omnia-mcu-firmware, and the upgrade process is pretty simple: omnia-mcutool --upgrade Besides firmware upgrade, the utility can be used to show and configure various firmware settings. Signed-off-by: Marek Mojík <marek.mojik@nic.cz> Signed-off-by: Marek Behún <kabel@kernel.org> Link: https://github.com/openwrt/openwrt/pull/13799 Signed-off-by: Robert Marko <robimarko@gmail.com>
-rw-r--r--package/utils/omnia-mcutool/Makefile52
-rw-r--r--target/linux/mvebu/image/cortexa9.mk2
2 files changed, 53 insertions, 1 deletions
diff --git a/package/utils/omnia-mcutool/Makefile b/package/utils/omnia-mcutool/Makefile
new file mode 100644
index 0000000000..d34ad014ae
--- /dev/null
+++ b/package/utils/omnia-mcutool/Makefile
@@ -0,0 +1,52 @@
+#
+# Copyright (C) 2016-2024 CZ.NIC z.s.p.o. (http://www.nic.cz/)
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=omnia-mcutool
+PKG_VERSION:=0.3-rc2
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/$(PKG_NAME)/-/archive/$(PKG_VERSION)/
+PKG_HASH:=68e407fca16ccaf4bd87401f710d6a4061029b4d474ac10c4c3253af73c242ac
+
+PKG_MAINTAINER:=Marek Mojik <marek.mojik@nic.cz>
+PKG_LICENSE:=GPL-2.0-or-later
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/omnia-mcutool
+ SECTION:=utils
+ CATEGORY:=Utilities
+ URL:=https://gitlab.nic.cz/turris/$(PKG_NAME)
+ TITLE:=CZ.NIC Turris Omnia MCU utility
+ DEPENDS:=+libopenssl +omnia-mcu-firmware @TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia
+endef
+
+define Package/omnia-mcutool/description
+The omnia-mcutool utility is mainly used to upgrade the firmware on the
+microcontroller on the Turris Omnia router. It can also show state of MCU
+settings and configure MCU options (GPIOs, LEDs, power).
+endef
+
+TARGET_LDFLAGS += -lcrypto
+
+define Build/Compile
+ $(MAKE) -C $(PKG_BUILD_DIR) \
+ CC="$(TARGET_CC)" \
+ CFLAGS="$(TARGET_CFLAGS) -Wall" \
+ LDFLAGS="$(TARGET_LDFLAGS)" \
+ MCUTOOL_VERSION="$(PKG_VERSION)"
+endef
+
+define Package/omnia-mcutool/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/omnia-mcutool $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,omnia-mcutool))
diff --git a/target/linux/mvebu/image/cortexa9.mk b/target/linux/mvebu/image/cortexa9.mk
index 73a4c631ba..a396b48675 100644
--- a/target/linux/mvebu/image/cortexa9.mk
+++ b/target/linux/mvebu/image/cortexa9.mk
@@ -107,7 +107,7 @@ define Device/cznic_turris-omnia
mkf2fs e2fsprogs kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 \
wpad-basic-mbedtls kmod-ath9k kmod-ath10k-ct ath10k-firmware-qca988x-ct \
kmod-mt7915-firmware partx-utils kmod-i2c-mux-pca954x kmod-leds-turris-omnia \
- kmod-turris-omnia-mcu kmod-gpio-button-hotplug omnia-mcu-firmware
+ kmod-turris-omnia-mcu kmod-gpio-button-hotplug omnia-mcu-firmware omnia-mcutool
IMAGES := sysupgrade.img.gz
IMAGE/sysupgrade.img.gz := boot-scr | boot-img | sdcard-img | gzip | append-metadata
SUPPORTED_DEVICES += armada-385-turris-omnia