Skip to content

Commit 749a433

Browse files
elkablorobimarko
authored andcommitted
utils: Add the omnia-eeprom utility
Add a new utility, `omnia-eeprom`, which can be used to print / set EEPROM fields on Turris Omnia. One example when this utility might be useful is if the board experiences random crashes due to newer versions of the DDR training algorithm in newer U-Boot. The user can change the DDR speed from 1600K to 1333H to solve these issues, with ``` omnia-eeprom set ddr_speed 1333H ``` Signed-off-by: Marek Behún <[email protected]> Link: openwrt/openwrt#16264 Signed-off-by: Robert Marko <[email protected]>
1 parent 8c018dc commit 749a433

File tree

2 files changed

+58
-1
lines changed

2 files changed

+58
-1
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#
2+
# Copyright (C) 2024 Marek Behún <[email protected]>
3+
#
4+
# This is free software, licensed under the GNU General Public License v2.
5+
# See /LICENSE for more information.
6+
#
7+
8+
include $(TOPDIR)/rules.mk
9+
10+
PKG_NAME:=omnia-eeprom
11+
PKG_VERSION:=0.1
12+
PKG_RELEASE:=1
13+
14+
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-v$(PKG_VERSION)
15+
PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.bz2
16+
PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/omnia-eeprom/-/archive/v$(PKG_VERSION)/
17+
PKG_HASH:=6f949d0b8080adca8bae088774ce615b563ba6ec2807cce97ee6769b4eee7bbf
18+
19+
PKG_MAINTAINER:=Marek Behun <[email protected]>
20+
PKG_LICENSE:=GPL-2.0-or-later
21+
22+
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
23+
24+
include $(INCLUDE_DIR)/package.mk
25+
26+
define Package/omnia-eeprom
27+
SECTION:=utils
28+
CATEGORY:=Utilities
29+
URL:=https://gitlab.nic.cz/turris/omnia-eeprom
30+
TITLE:=CZ.NIC Turris Omnia EEPROM accessing utility
31+
DEPENDS:=@TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia +kmod-eeprom-at24
32+
endef
33+
34+
define Package/omnia-eeprom/description
35+
This package contains the omnia-eeprom utility, which allows you to display
36+
and update EEPROM fields on the Turris Omnia router.
37+
The EEPROM is normally not meant to be updated by users, but there are some
38+
exceptions where it might be useful.
39+
One such example is to change the DDR3 speed from the default 1600K mode to
40+
1333H mode, in order to solve random crashes that occur on some boards with
41+
newer versions of the U-Boot bootloader (because of bugs in newer versions of
42+
the DDR training algorithm).
43+
endef
44+
45+
MAKE_VARS += OMNIA_EEPROM_VERSION="v$(PKG_VERSION)"
46+
47+
TARGET_CFLAGS += -Wall
48+
49+
Build/Compile = $(Build/Compile/Default)
50+
51+
define Package/omnia-eeprom/install
52+
$(INSTALL_DIR) $(1)/usr/bin
53+
$(INSTALL_BIN) $(PKG_BUILD_DIR)/omnia-eeprom $(1)/usr/bin/
54+
endef
55+
56+
$(eval $(call BuildPackage,omnia-eeprom))

target/linux/mvebu/image/cortexa9.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ define Device/cznic_turris-omnia
107107
mkf2fs e2fsprogs kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 \
108108
wpad-basic-mbedtls kmod-ath9k kmod-ath10k-ct ath10k-firmware-qca988x-ct \
109109
kmod-mt7915-firmware partx-utils kmod-i2c-mux-pca954x kmod-leds-turris-omnia \
110-
kmod-turris-omnia-mcu kmod-gpio-button-hotplug omnia-mcu-firmware omnia-mcutool
110+
kmod-turris-omnia-mcu kmod-gpio-button-hotplug omnia-eeprom omnia-mcu-firmware \
111+
omnia-mcutool
111112
IMAGES := sysupgrade.img.gz
112113
IMAGE/sysupgrade.img.gz := boot-scr | boot-img | sdcard-img | gzip | append-metadata
113114
SUPPORTED_DEVICES += armada-385-turris-omnia

0 commit comments

Comments
 (0)