Am 16.12.2015 um 08:16 schrieb Siarhei Siamashka:
[...]
After this change, now both "spl" and "uboot" commands always execute
U-Boot in the end :-(

Right now I'm playing with AR100 (an extra OpenRISC core in H3) and a
properly working "spl" command in "sunxi-fel" is quite useful for
initializing DRAM before uploading and running some OpenRISC code.

[...]

Well, last minute changes are always a sort of a lottery. It would
have been a bit nicer if we did not include this bug into a "release
point" ;-)

Ouch. Well, I guess it kind of proves your point... :-P Fix attached.

Regards, B. Nortmann

--
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
>From 7c61032b503ab8cded6dc49e5b960d7030229525 Mon Sep 17 00:00:00 2001
From: Bernhard Nortmann <bernhard.nortm...@web.de>
Date: Wed, 16 Dec 2015 11:25:46 +0100
Subject: [PATCH sunxi-tools] fel: bugfix - revert autostart change from
 d99d59c

Commit d99d59c introduces a bug when the "spl" command is used with a
file that contains a U-Boot binary. "spl" will now try to execute it,
while it's not supposed to. (The command should only start the SPL.)

This patch brings back the `uboot_autostart` flag, which is meant to
remain `false` for the "spl" command, and gets set by "uboot" only.

Signed-off-by: Bernhard Nortmann <bernhard.nortm...@web.de>
---
 fel.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/fel.c b/fel.c
index df96f4d..12eae4d 100644
--- a/fel.c
+++ b/fel.c
@@ -1271,6 +1271,7 @@ static unsigned int file_upload(libusb_device_handle 
*handle, size_t count,
 
 int main(int argc, char **argv)
 {
+       bool uboot_autostart = false; /* flag for "uboot" command = U-Boot 
autostart */
        bool pflag_active = false; /* -p switch, causing "write" to output 
progress */
        int rc;
        libusb_device_handle *handle = NULL;
@@ -1416,7 +1417,8 @@ int main(int argc, char **argv)
                        skip=2;
                } else if (strcmp(argv[1], "uboot") == 0 && argc > 2) {
                        aw_fel_process_spl_and_uboot(handle, argv[2]);
-                       if (!uboot_entry)
+                       uboot_autostart = (uboot_entry > 0 && uboot_size > 0);
+                       if (!uboot_autostart)
                                printf("Warning: \"uboot\" command failed to 
detect image! Can't execute U-Boot.\n");
                        skip=2;
                } else {
@@ -1428,7 +1430,7 @@ int main(int argc, char **argv)
        }
 
        // auto-start U-Boot if requested (by the "uboot" command)
-       if (uboot_entry > 0 && uboot_size > 0) {
+       if (uboot_autostart) {
                pr_info("Starting U-Boot (0x%08X).\n", uboot_entry);
                aw_fel_execute(handle, uboot_entry);
        }
-- 
2.4.6

Reply via email to