uboot: Import hush fixes from kkit/u-boot-2023.07.y

This commit is contained in:
Tobias Waldekranz
2024-06-17 14:59:27 +02:00
parent 60118fad0d
commit 6eb8a41103
8 changed files with 102 additions and 6 deletions
@@ -1,7 +1,7 @@
From e4213fc62d3d6a6733e3026b63dd6314a6f09ee2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Moj=C3=ADk?= <marek.mojik@nic.cz>
Date: Wed, 6 Dec 2023 15:35:56 +0100
Subject: [PATCH 1/6] net: mv88e6xxx: fix missing SMI address initialization
Subject: [PATCH 1/8] net: mv88e6xxx: fix missing SMI address initialization
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -1,7 +1,7 @@
From 80ddeb093f24cf1d8a99e92564e07a7180791f8c Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Tue, 17 Oct 2023 13:15:58 +0200
Subject: [PATCH 2/6] net: mv88e6xxx: Add reset-gpios support
Subject: [PATCH 2/8] net: mv88e6xxx: Add reset-gpios support
Organization: Addiva Elektronik
If the switch's RESETn signal is under the CPUs control, release it
@@ -1,7 +1,7 @@
From c31794d78337da82cf41ffbcb9e696e42759aa12 Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Tue, 17 Oct 2023 13:20:19 +0200
Subject: [PATCH 3/6] net: mv88e6xxx: Support clause 45 addressing on internal
Subject: [PATCH 3/8] net: mv88e6xxx: Support clause 45 addressing on internal
MDIO bus
Organization: Addiva Elektronik
@@ -1,7 +1,7 @@
From c94723526672f1e5555b7545c13256edb7bd7557 Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Tue, 17 Oct 2023 13:22:00 +0200
Subject: [PATCH 4/6] net: mv88e6xxx: Add support for 6393X
Subject: [PATCH 4/8] net: mv88e6xxx: Add support for 6393X
Organization: Addiva Elektronik
Only built-in copper PHYs are supported as access ports. Support
@@ -1,7 +1,7 @@
From c39245a2d92d6f851dfcb8f573af873a05d4a5b8 Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Fri, 20 Oct 2023 13:19:41 +0200
Subject: [PATCH 5/6] i2c: pcf8575: Properly address chip
Subject: [PATCH 5/8] i2c: pcf8575: Properly address chip
Organization: Addiva Elektronik
These devices hold a simple shift register that is accessed without
@@ -1,7 +1,7 @@
From 967f7f88c88e1a72d7cf389b5b3b6f184788006f Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Tue, 24 Oct 2023 22:23:44 +0200
Subject: [PATCH 6/6] arm64: mvebu: a8k: Add eFuse support
Subject: [PATCH 6/8] arm64: mvebu: a8k: Add eFuse support
Organization: Addiva Elektronik
Add support for reading and burning LD and HD fuses. Use a specialized
@@ -0,0 +1,55 @@
From ed733077b87b1f3da6ac956840c927406c268a3d Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Mon, 10 Jun 2024 12:59:21 +0200
Subject: [PATCH 7/8] cmd/sleep: Consume Ctrl-C when exiting early
Organization: Addiva Elektronik
When sleep aborts early due to Ctrl-C input from the user, that state
is transferred to the exit status of the program and should therefore
be cleared from the global state.
Before this change, the lingering global state would lead to very
unintuitive execution flows in scripts due to the U-Boot specific
modification to the hush interpreter which checks for Ctrl-C in all
loop constructs.
This script, for example...
if sleep 3; then
echo "Had a good night's sleep"
else
echo "That was a rude awakening! I refuse to go on..."
while true; do
true
done
echo "...or maybe I will"
fi
...would just skip over the infinite loop (indeed, all following
loops) when prematurely interrupting the sleep.
Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
---
cmd/sleep.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/cmd/sleep.c b/cmd/sleep.c
index c741b4aa02..b3511e13b8 100644
--- a/cmd/sleep.c
+++ b/cmd/sleep.c
@@ -39,8 +39,10 @@ static int do_sleep(struct cmd_tbl *cmdtp, int flag, int argc,
delay += mdelay;
while (get_timer(start) < delay) {
- if (ctrlc())
+ if (ctrlc()) {
+ clear_ctrlc();
return CMD_RET_FAILURE;
+ }
udelay(100);
}
--
2.34.1
@@ -0,0 +1,41 @@
From 989ef8436df2ee48d308981098c44b1b8257c23b Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Mon, 10 Jun 2024 13:25:31 +0200
Subject: [PATCH 8/8] hush: Remove Ctrl-C detection in loops
Organization: Addiva Elektronik
Assume that the original intent was to emulate SIGINT to a shell. This
only works as expected if the loop in question is the ouermost, and
last, statement. In all other cases, it completely breaks the expected
execution flow. It more or less resurrects Visual Basic's "On Error
Resume Next".
Disable this behavior and delegate the problem of loop termination to
the writer of the script instead.
Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
---
common/cli_hush.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/common/cli_hush.c b/common/cli_hush.c
index 171069f5f4..d6d487893f 100644
--- a/common/cli_hush.c
+++ b/common/cli_hush.c
@@ -1796,13 +1796,6 @@ static int run_list_real(struct pipe *pi)
for (; pi; pi = (flag_restore != 0) ? rpipe : pi->next) {
if (pi->r_mode == RES_WHILE || pi->r_mode == RES_UNTIL ||
pi->r_mode == RES_FOR) {
-#ifdef __U_BOOT__
- /* check Ctrl-C */
- ctrlc();
- if ((had_ctrlc())) {
- return 1;
- }
-#endif
flag_restore = 0;
if (!rpipe) {
flag_rep = 0;
--
2.34.1