From 6eb8a41103881052147893f792c3fa5d6be30b90 Mon Sep 17 00:00:00 2001 From: Tobias Waldekranz Date: Wed, 12 Jun 2024 09:58:08 +0200 Subject: [PATCH] uboot: Import hush fixes from kkit/u-boot-2023.07.y --- ...x-missing-SMI-address-initialization.patch | 2 +- ...et-mv88e6xxx-Add-reset-gpios-support.patch | 2 +- ...pport-clause-45-addressing-on-intern.patch | 2 +- ...-net-mv88e6xxx-Add-support-for-6393X.patch | 2 +- ...05-i2c-pcf8575-Properly-address-chip.patch | 2 +- ...06-arm64-mvebu-a8k-Add-eFuse-support.patch | 2 +- ...ep-Consume-Ctrl-C-when-exiting-early.patch | 55 +++++++++++++++++++ ...ush-Remove-Ctrl-C-detection-in-loops.patch | 41 ++++++++++++++ 8 files changed, 102 insertions(+), 6 deletions(-) create mode 100644 patches/uboot/2023.07.02/0007-cmd-sleep-Consume-Ctrl-C-when-exiting-early.patch create mode 100644 patches/uboot/2023.07.02/0008-hush-Remove-Ctrl-C-detection-in-loops.patch diff --git a/patches/uboot/2023.07.02/0001-net-mv88e6xxx-fix-missing-SMI-address-initialization.patch b/patches/uboot/2023.07.02/0001-net-mv88e6xxx-fix-missing-SMI-address-initialization.patch index e052001f..0a210726 100644 --- a/patches/uboot/2023.07.02/0001-net-mv88e6xxx-fix-missing-SMI-address-initialization.patch +++ b/patches/uboot/2023.07.02/0001-net-mv88e6xxx-fix-missing-SMI-address-initialization.patch @@ -1,7 +1,7 @@ From e4213fc62d3d6a6733e3026b63dd6314a6f09ee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Moj=C3=ADk?= 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 diff --git a/patches/uboot/2023.07.02/0002-net-mv88e6xxx-Add-reset-gpios-support.patch b/patches/uboot/2023.07.02/0002-net-mv88e6xxx-Add-reset-gpios-support.patch index 4fa5c89d..c0346989 100644 --- a/patches/uboot/2023.07.02/0002-net-mv88e6xxx-Add-reset-gpios-support.patch +++ b/patches/uboot/2023.07.02/0002-net-mv88e6xxx-Add-reset-gpios-support.patch @@ -1,7 +1,7 @@ From 80ddeb093f24cf1d8a99e92564e07a7180791f8c Mon Sep 17 00:00:00 2001 From: Tobias Waldekranz 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 diff --git a/patches/uboot/2023.07.02/0003-net-mv88e6xxx-Support-clause-45-addressing-on-intern.patch b/patches/uboot/2023.07.02/0003-net-mv88e6xxx-Support-clause-45-addressing-on-intern.patch index 90830187..488cef6d 100644 --- a/patches/uboot/2023.07.02/0003-net-mv88e6xxx-Support-clause-45-addressing-on-intern.patch +++ b/patches/uboot/2023.07.02/0003-net-mv88e6xxx-Support-clause-45-addressing-on-intern.patch @@ -1,7 +1,7 @@ From c31794d78337da82cf41ffbcb9e696e42759aa12 Mon Sep 17 00:00:00 2001 From: Tobias Waldekranz 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 diff --git a/patches/uboot/2023.07.02/0004-net-mv88e6xxx-Add-support-for-6393X.patch b/patches/uboot/2023.07.02/0004-net-mv88e6xxx-Add-support-for-6393X.patch index e03b4b59..176cab78 100644 --- a/patches/uboot/2023.07.02/0004-net-mv88e6xxx-Add-support-for-6393X.patch +++ b/patches/uboot/2023.07.02/0004-net-mv88e6xxx-Add-support-for-6393X.patch @@ -1,7 +1,7 @@ From c94723526672f1e5555b7545c13256edb7bd7557 Mon Sep 17 00:00:00 2001 From: Tobias Waldekranz 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 diff --git a/patches/uboot/2023.07.02/0005-i2c-pcf8575-Properly-address-chip.patch b/patches/uboot/2023.07.02/0005-i2c-pcf8575-Properly-address-chip.patch index fee82725..176bf842 100644 --- a/patches/uboot/2023.07.02/0005-i2c-pcf8575-Properly-address-chip.patch +++ b/patches/uboot/2023.07.02/0005-i2c-pcf8575-Properly-address-chip.patch @@ -1,7 +1,7 @@ From c39245a2d92d6f851dfcb8f573af873a05d4a5b8 Mon Sep 17 00:00:00 2001 From: Tobias Waldekranz 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 diff --git a/patches/uboot/2023.07.02/0006-arm64-mvebu-a8k-Add-eFuse-support.patch b/patches/uboot/2023.07.02/0006-arm64-mvebu-a8k-Add-eFuse-support.patch index e398f4fe..0cabcef7 100644 --- a/patches/uboot/2023.07.02/0006-arm64-mvebu-a8k-Add-eFuse-support.patch +++ b/patches/uboot/2023.07.02/0006-arm64-mvebu-a8k-Add-eFuse-support.patch @@ -1,7 +1,7 @@ From 967f7f88c88e1a72d7cf389b5b3b6f184788006f Mon Sep 17 00:00:00 2001 From: Tobias Waldekranz 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 diff --git a/patches/uboot/2023.07.02/0007-cmd-sleep-Consume-Ctrl-C-when-exiting-early.patch b/patches/uboot/2023.07.02/0007-cmd-sleep-Consume-Ctrl-C-when-exiting-early.patch new file mode 100644 index 00000000..429f0f84 --- /dev/null +++ b/patches/uboot/2023.07.02/0007-cmd-sleep-Consume-Ctrl-C-when-exiting-early.patch @@ -0,0 +1,55 @@ +From ed733077b87b1f3da6ac956840c927406c268a3d Mon Sep 17 00:00:00 2001 +From: Tobias Waldekranz +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 +--- + 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 + diff --git a/patches/uboot/2023.07.02/0008-hush-Remove-Ctrl-C-detection-in-loops.patch b/patches/uboot/2023.07.02/0008-hush-Remove-Ctrl-C-detection-in-loops.patch new file mode 100644 index 00000000..0e1c0880 --- /dev/null +++ b/patches/uboot/2023.07.02/0008-hush-Remove-Ctrl-C-detection-in-loops.patch @@ -0,0 +1,41 @@ +From 989ef8436df2ee48d308981098c44b1b8257c23b Mon Sep 17 00:00:00 2001 +From: Tobias Waldekranz +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 +--- + 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 +