Skip to content
Snippets Groups Projects
Verified Commit b12dbac8 authored by Josef Schlehofer's avatar Josef Schlehofer
Browse files

patches/openwrt: backport U-boot patches to fix A38x cache and more

This commit backports commits from U-boot repository, which was done by
@prohar and they were commited on 13th September 2022.
parent 6632f44b
Branches
2 merge requests!569Turris OS 6.0 (HBK),!561patches/openwrt: backport U-boot patches to fix A38x cache and more
Pipeline #104276 passed with stages
in 6 minutes and 51 seconds
From f5e73f05d9bb0f40cc33e55021242ae9bbeead4b Mon Sep 17 00:00:00 2001
From: Josef Schlehofer <pepe.schlehofer@gmail.com>
Date: Mon, 5 Sep 2022 23:07:41 +0200
Subject: [PATCH] uboot-mvebu: update to version 2022.10-rc4
---
package/boot/uboot-mvebu/Makefile | 24 +++++-----
...nux.h-Fix-compilation-on-non-glibc-s.patch | 44 +++++++++++++++++++
.../patches/210-link-libcrypto-static.patch | 14 ------
3 files changed, 56 insertions(+), 26 deletions(-)
create mode 100644 package/boot/uboot-mvebu/patches/0001-tools-termios_linux.h-Fix-compilation-on-non-glibc-s.patch
delete mode 100644 package/boot/uboot-mvebu/patches/210-link-libcrypto-static.patch
diff --git a/package/boot/uboot-mvebu/Makefile b/package/boot/uboot-mvebu/Makefile
index 37e93d1f51..36cee26bdd 100644
--- a/package/boot/uboot-mvebu/Makefile
+++ b/package/boot/uboot-mvebu/Makefile
@@ -8,10 +8,10 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
-PKG_VERSION:=2021.01
-PKG_RELEASE:=1
+PKG_VERSION:=2022.10-rc4
+PKG_RELEASE:=$(AUTORELEASE)
-PKG_HASH:=b407e1510a74e863b8b5cb42a24625344f0e0c2fc7582d8c866bd899367d0454
+PKG_HASH:=81598cac40028a552e535dd417b3495e43e89630567c22ce85d950d78a90d5a1
include $(INCLUDE_DIR)/u-boot.mk
include $(INCLUDE_DIR)/package.mk
@@ -36,6 +36,14 @@ define U-Boot/helios4
UBOOT_IMAGE:=u-boot-spl.kwb
endef
+define U-Boot/omnia
+ NAME:=Turris Omnia
+ BUILD_DEVICES:=cznic_turris-omnia
+ BUILD_SUBTARGET:=cortexa9
+ UBOOT_CONFIG:=turris_omnia
+ UBOOT_IMAGE:=u-boot-spl.kwb
+endef
+
define U-Boot/espressobin
NAME:=Marvell ESPRESSObin
BUILD_SUBTARGET:=cortexa53
@@ -50,18 +58,10 @@ endef
UBOOT_TARGETS:= \
clearfog \
helios4 \
+ omnia \
espressobin \
uDPU
-Build/Exports:=$(Host/Exports)
-
-define Build/Configure
- # enable additional options beyond <device>_defconfig
- echo CONFIG_CMD_SETEXPR=y >> $(PKG_BUILD_DIR)/configs/$(UBOOT_CONFIG)_defconfig
-
- $(call Build/Configure/U-Boot)
-endef
-
define Package/u-boot/install
$(if $(findstring cortexa53,$(BUILD_SUBTARGET)),,$(Package/u-boot/install/default))
endef
diff --git a/package/boot/uboot-mvebu/patches/0001-tools-termios_linux.h-Fix-compilation-on-non-glibc-s.patch b/package/boot/uboot-mvebu/patches/0001-tools-termios_linux.h-Fix-compilation-on-non-glibc-s.patch
new file mode 100644
index 0000000000..ef352bf9ca
--- /dev/null
+++ b/package/boot/uboot-mvebu/patches/0001-tools-termios_linux.h-Fix-compilation-on-non-glibc-s.patch
@@ -0,0 +1,44 @@
+From bac7078b7e574420232921873ce60fa0ae871314 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali@kernel.org>
+Date: Fri, 9 Sep 2022 16:04:06 +0200
+Subject: [PATCH] tools: termios_linux.h: Fix compilation on non-glibc systems
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+TCGETS2 is defined in header file asm/ioctls.h provided by linux kernel.
+On glib systems it is automatically included by some other glibc include
+header file and therefore TCGETS2 is present in termios_linux.h when
+linux kernel provides it.
+
+On non-glibc systems (e.g. musl) asm/ioctls.h is not automatically included
+which results in the strange error that BOTHER is supported, TCGETS2 not
+defined and struct termios does not provide c_ispeed member.
+
+ tools/kwboot.c: In function 'kwboot_tty_change_baudrate':
+ tools/kwboot.c:662:6: error: 'struct termios' has no member named 'c_ospeed'
+ 662 | tio.c_ospeed = tio.c_ispeed = baudrate;
+ | ^
+
+Fix this issue by explicitly including asm/ioctls.h file which provides
+TCGETS2 macro (if supported on selected architecture) to not depending on
+glibc auto-include behavior and because termios_linux.h requires it.
+
+With this change it is possible compile kwboot with musl libc.
+
+Reported-by: Michal Vasilek <michal.vasilek at nic.cz>
+Signed-off-by: Pali Rohár <pali at kernel.org>
+---
+ tools/termios_linux.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/tools/termios_linux.h
++++ b/tools/termios_linux.h
+@@ -29,6 +29,7 @@
+ #include <errno.h>
+ #include <sys/ioctl.h>
+ #include <sys/types.h>
++#include <asm/ioctls.h>
+ #include <asm/termbits.h>
+
+ #if defined(BOTHER) && defined(TCGETS2)
diff --git a/package/boot/uboot-mvebu/patches/210-link-libcrypto-static.patch b/package/boot/uboot-mvebu/patches/210-link-libcrypto-static.patch
deleted file mode 100644
index eb0b05e4c6..0000000000
--- a/package/boot/uboot-mvebu/patches/210-link-libcrypto-static.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-OpenWrt links the libressl statically against mkimage, make sure all the
-needed dependencies are added too.
-
---- a/tools/Makefile
-+++ b/tools/Makefile
-@@ -158,7 +158,7 @@ ifneq ($(CONFIG_MX23)$(CONFIG_MX28)$(CON
- HOSTCFLAGS_kwbimage.o += \
- $(shell pkg-config --cflags libssl libcrypto 2> /dev/null || echo "")
- HOSTLDLIBS_mkimage += \
-- $(shell pkg-config --libs libssl libcrypto 2> /dev/null || echo "-lssl -lcrypto")
-+ $(shell pkg-config --libs --static libssl libcrypto 2> /dev/null || echo "-lssl -lpthread -lcrypto")
-
- # OS X deprecate openssl in favour of CommonCrypto, supress deprecation
- # warnings on those systems
--
2.34.1
This diff is collapsed.
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment