I've been looking into the reason why my wandboard would not boot Fedora reliably. I would typically get one good boot every 3 or 4 tries.
It is late, and I need to stop now, but the following proposed patch to uboot allows my board to boot without errors, at least a dozen times in a row, which it has never done before.
Basically, cmdtp->name is not valid for some reason, so uboot goes off into the weeds. I have not tracked down the explanation, but if anyone else would like to give this a try, I'd very much appreciate the feedback.
Signed-off-by: Steven A. Falco stevenfalco@gmail.com
--
diff -ur BUILD.original/u-boot-2013.07/common/cmd_bootm.c BUILD/u-boot-2013.07/common/cmd_bootm.c --- BUILD.original/u-boot-2013.07/common/cmd_bootm.c 2013-07-23 07:58:13.000000000 -0400 +++ BUILD/u-boot-2013.07/common/cmd_bootm.c 2013-09-21 21:08:10.623374338 -0400 @@ -997,7 +998,7 @@ break; #endif default: - printf("Wrong Image Format for %s command\n", cmdtp->name); + printf("Wrong Image Format for command\n"); bootstage_error(BOOTSTAGE_ID_FIT_KERNEL_INFO); return NULL; }
I can see how you zero in on that area of code as that is where is has "Wrong Image Format". (final words when the kernel does not boot with wandboard quad)
Looking at the 2013.10-rc3 source from the current SRPM, I'm not sure this patch would apply, probably not.
The cmdtp is the so-called "bootm command table" as noted in the comments of cmd_bootm.c So I would imagine cmdtp->cmd would be the string 'bootm' , but could be wrong. Maybe the "cmdtp" is getting trashed somewhere along the line, and poking the variable reveals problem.
My only problem with the patch is the area of code might be helpful on other (working) boards. Then again, I'm inclined to just hardcode the string 'bootm' right there and be done.
It would be interesting to turn on/off CONFIG_FIT or whatever, the ifdef's all around there seems to matter.
-Jon Disnard
On Sat, Sep 21, 2013 at 8:18 PM, Steven Falco stevenfalco@gmail.com wrote:
I've been looking into the reason why my wandboard would not boot Fedora reliably. I would typically get one good boot every 3 or 4 tries.
It is late, and I need to stop now, but the following proposed patch to uboot allows my board to boot without errors, at least a dozen times in a row, which it has never done before.
Basically, cmdtp->name is not valid for some reason, so uboot goes off into the weeds. I have not tracked down the explanation, but if anyone else would like to give this a try, I'd very much appreciate the feedback.
Signed-off-by: Steven A. Falco stevenfalco@gmail.com
--
diff -ur BUILD.original/u-boot-2013.07/common/cmd_bootm.c BUILD/u-boot-2013.07/common/cmd_bootm.c --- BUILD.original/u-boot-2013.07/common/cmd_bootm.c 2013-07-23 07:58:13.000000000 -0400 +++ BUILD/u-boot-2013.07/common/cmd_bootm.c 2013-09-21 21:08:10.623374338 -0400 @@ -997,7 +998,7 @@ break; #endif default:
printf("Wrong Image Format for %s command\n", cmdtp->name);
printf("Wrong Image Format for command\n"); bootstage_error(BOOTSTAGE_ID_FIT_KERNEL_INFO); return NULL; }
arm mailing list arm@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/arm
On Sat, Sep 21, 2013 at 09:18:35PM -0400, Steven Falco wrote:
I've been looking into the reason why my wandboard would not boot Fedora reliably. I would typically get one good boot every 3 or 4 tries.
It is late, and I need to stop now, but the following proposed patch to uboot allows my board to boot without errors, at least a dozen times in a row, which it has never done before.
Basically, cmdtp->name is not valid for some reason, so uboot goes off into the weeds. I have not tracked down the explanation, but if anyone else would like to give this a try, I'd very much appreciate the feedback.
Oh, nice catch. That would explain why the garbage gets printed. I don't know yet when I have time to test this, but I'll add it on my TODO.
This patch would be a workaround and not a final solution. I guess ->name should be set correctly somewhere, or other members of *cmdtp should not overwrite the pointer.
Anyway, it looks like you narrowed down the cause pretty much. Thanks, for sharing!
Niels
Signed-off-by: Steven A. Falco stevenfalco@gmail.com
--
diff -ur BUILD.original/u-boot-2013.07/common/cmd_bootm.c BUILD/u-boot-2013.07/common/cmd_bootm.c --- BUILD.original/u-boot-2013.07/common/cmd_bootm.c 2013-07-23 07:58:13.000000000 -0400 +++ BUILD/u-boot-2013.07/common/cmd_bootm.c 2013-09-21 21:08:10.623374338 -0400 @@ -997,7 +998,7 @@ break; #endif default:
printf("Wrong Image Format for %s command\n", cmdtp->name);
bootstage_error(BOOTSTAGE_ID_FIT_KERNEL_INFO); return NULL; }printf("Wrong Image Format for command\n");
arm mailing list arm@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/arm
On 09/22/2013 06:36 AM, Niels de Vos wrote:
On Sat, Sep 21, 2013 at 09:18:35PM -0400, Steven Falco wrote:
I've been looking into the reason why my wandboard would not boot Fedora reliably. I would typically get one good boot every 3 or 4 tries.
It is late, and I need to stop now, but the following proposed patch to uboot allows my board to boot without errors, at least a dozen times in a row, which it has never done before.
Basically, cmdtp->name is not valid for some reason, so uboot goes off into the weeds. I have not tracked down the explanation, but if anyone else would like to give this a try, I'd very much appreciate the feedback.
Oh, nice catch. That would explain why the garbage gets printed. I don't know yet when I have time to test this, but I'll add it on my TODO.
This patch would be a workaround and not a final solution. I guess ->name should be set correctly somewhere, or other members of *cmdtp should not overwrite the pointer.
Definitely not the final patch - it is just a hack to let the board boot. I have not had time yet to find the root cause. Maybe later today.
But if it works for other people, at least I will know I am on the right track.
There are other problems. I added some debug, and the magic number for the kernel is invalid:
Retrieving file: /vmlinuz-3.11.0-300.fc20.armv7hl 4748528 bytes read in 299 ms (15.1 MiB/s) append: console=ttymxc0,115200 root=UUID=04e54c55-4d1e-4db7-b8df-5bd9defdc4ee ro rhgb quiet LANG=en_US.UTF-8 Retrieving file: /dtb-3.11.0-300.fc20.armv7hl/imx6dl-wandboard.dtb 21000 bytes read in 235 ms (86.9 KiB/s) * kernel: cmdline image address = 0x13000000 genimg_get_format: header at 13000000 magic 0000a0e1 genimg_get_format: fit header at 13000000 magic 0000a0e1 Wrong Image Format for command ERROR: can't get kernel image!
I guess this is because of the vmlinuz format rather than uImage format. I really need to look at how the whole extlinux mechanism works, and what it expects.
I've used uboot on various projects for many years, but the extlinux mechanism is new to me.
Steve
Anyway, it looks like you narrowed down the cause pretty much. Thanks, for sharing!
Niels
Signed-off-by: Steven A. Falco stevenfalco@gmail.com
--
diff -ur BUILD.original/u-boot-2013.07/common/cmd_bootm.c BUILD/u-boot-2013.07/common/cmd_bootm.c --- BUILD.original/u-boot-2013.07/common/cmd_bootm.c 2013-07-23 07:58:13.000000000 -0400 +++ BUILD/u-boot-2013.07/common/cmd_bootm.c 2013-09-21 21:08:10.623374338 -0400 @@ -997,7 +998,7 @@ break; #endif default:
printf("Wrong Image Format for %s command\n", cmdtp->name);
bootstage_error(BOOTSTAGE_ID_FIT_KERNEL_INFO); return NULL; }printf("Wrong Image Format for command\n");
arm mailing list arm@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/arm
On Sat, 2013-09-21 at 21:18 -0400, Steven Falco wrote:
diff -ur BUILD.original/u-boot-2013.07/common/cmd_bootm.c BUILD/u-boot-2013.07/common/cmd_bootm.c --- BUILD.original/u-boot-2013.07/common/cmd_bootm.c 2013-07-23 07:58:13.000000000 -0400 +++ BUILD/u-boot-2013.07/common/cmd_bootm.c 2013-09-21 21:08:10.623374338 -0400 @@ -997,7 +998,7 @@ break; #endif default:
printf("Wrong Image Format for %s command\n", cmdtp->name);
bootstage_error(BOOTSTAGE_ID_FIT_KERNEL_INFO); return NULL; }printf("Wrong Image Format for command\n");
I'm sure you don't need me to confirm you're on the right track, but yes, with the patch, able to boot every time on the Wandboard, rather than a one in five chance.
Clive
On 09/22/2013 09:03 AM, Clive Messer wrote:
On Sat, 2013-09-21 at 21:18 -0400, Steven Falco wrote:
diff -ur BUILD.original/u-boot-2013.07/common/cmd_bootm.c BUILD/u-boot-2013.07/common/cmd_bootm.c --- BUILD.original/u-boot-2013.07/common/cmd_bootm.c 2013-07-23 07:58:13.000000000 -0400 +++ BUILD/u-boot-2013.07/common/cmd_bootm.c 2013-09-21 21:08:10.623374338 -0400 @@ -997,7 +998,7 @@ break; #endif default:
printf("Wrong Image Format for %s command\n", cmdtp->name);
}printf("Wrong Image Format for command\n"); bootstage_error(BOOTSTAGE_ID_FIT_KERNEL_INFO); return NULL;I'm sure you don't need me to confirm you're on the right track, but yes, with the patch, able to boot every time on the Wandboard, rather than a one in five chance.
Clive
Excellent! Thanks for testing. I'll continue to sort this out, and come up with a proper fix.
Steve