RobertCNelson / Bootloader-Builder

create sanity in the insanity
www.rcn-ee.com
29 stars 22 forks source link

Added patch for writing "delay" to enter u-boot prompt instead of any-key. Also increased bootdelay to 3 seconds to give time to enter the string properly. #3

Closed plopp closed 6 years ago

plopp commented 9 years ago

Maybe the patch should be selectable via an argument to the build.sh script or something similar.

I've tested these patched builds on my BBB revB with 4GB NAND:

am335x_evm-v2014.10-r3 - works am335x_evm-v2015.01-rc2-r1 - works am335x_evm-v2015.01-rc2-72-g85bafb6-r1 - does not work and I have not investigated why, the unit keeps rebooting in a loop, any clue why this build doesn't work?:

U-Boot 2015.01-rc2-00089-ga5259bf (Nov 29 2014 - 12:02:51)

   Watchdog enabled

I2C: ready DRAM: 512 MiB MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1 Using default environment

Net: not set. Validating first E-fuse MAC cpsw, usb_ether Type in 3 seconds to get to U-boot-prompt gpio: pin 53 (gpio 53) value is 1 Card did not respond to voltage select! Card did not respond to voltage select! gpio: pin 56 (gpio 56) value is 0 gpio: pin 55 (gpio 55) value is 0 gpio: pin 54 (gpio 54) value is 0 switch to partitions #0, OK mmc1(part 0) is current device gpio: pin 54 (gpio 54) value is 1 Checking for: /uEnv.txt ... Checking for: /boot.scr ... Checking for: /boot/boot.scr ... Checking for: /boot/uEnv.txt ... gpio: pin 55 (gpio 55) value is 1 764 bytes read in 14 ms (52.7 KiB/s) Loaded environment from /boot/uEnv.txt Checking if uname_r is set in /boot/uEnv.txt... gpio: pin 56 (gpio 56) value is 1 Running uname_boot ... loading /boot/vmlinuz-3.8.13-bone67 ... 5605472 bytes read in 324 ms (16.5 MiB/s) loading /boot/dtbs/3.8.13-bone67/am335x-boneblack.dtb ... 26098 bytes read in 22 ms (1.1 MiB/s) loading /boot/initrd.img-3.8.13-bone67 ... 2289346 bytes read in 143 ms (15.3 MiB/s) debug: [console=ttyO0,115200n8 root=UUID=2b4f2f03-f32c-4bc7-b099-9e4b7de4f4b5 ro rootfstype=ext4 rootwait fixrtc quiet init=/lib/systemd/systemd] ... debug: [bootz 0x82000000 0x88080000:22eec2 0x88000000] ... Kernel image @ 0x82000000 [ 0x000000 - 0x558860 ]

Flattened Device Tree blob at 88000000

Booting using the fdt blob at 0x88000000 Loading Ramdisk to 8fdd1000, end 8ffffec2 ... OK Loading Device Tree to 8fdc7000, end 8fdd05f1 ... OK data abort pc : [<9f758464>] lr : [<9f78befc>] sp : 9e72d678 ip : 9e72d680 fp : 9f74f06c r10: 00000001 r9 : 9e72ded8 r8 : 9e72d6b8 r7 : 9e72d6b0 r6 : 00000001 r5 : 8fdc7000 r4 : 00000214 r3 : 9e72d680 r2 : 00000020 r1 : 9e72d681 r0 : 00000001 Flags: Nzcv IRQs off FIQs on Mode SVC_32 Resetting CPU ...

resetting ...

RobertCNelson commented 9 years ago

This looks 100% correct, but i can't actually merge it. Our goal with bb.org is to boot within 15 seconds (login prompt). With wheezy we have that, but with jessie we are a little bit over. Sorry I just can't sacrifice 2 more seconds to u-boot...

Thanks for the test on head of u-boot, i'd like to get v2015.01-rcX installed by default asap.

Regards,

plopp commented 9 years ago

Ok, I see your point, however, in my case the main purpose of my patch is to make the device boot properly and not go into u-boot-prompt unintentionally, as it does when there is spurious disturbances on the Rx-pin. What if I keep the boot delay on one second and make the string shorter, such as "uu" or whatever that is easy to write within one second? Would that work?

RobertCNelson commented 9 years ago

Right now 'any key' would stop the u-boot prompt. I'm guessing you've muxed another device to the same serial port, thus the noise from that device is stopping u-boot?

RobertCNelson commented 9 years ago

As long we make it verbose and common.. (grub uses left shift, can't use that here for serial ports..) redboot use's ctrl-c, i'd go for that, as it's common and we do the same with applications... Don't worry about a full patch to intergrate into my build systemd, just against v2015.01-rc2 is fine, i'll do the rest..

RobertCNelson commented 9 years ago

humm... ctrl-c might already be supported.. http://processors.wiki.ti.com/index.php/Change_U-Boot_bootdelay_setting

plopp commented 9 years ago

Ok! I think Ctrl-C sounds good. The problem is the "any-key". On most, if not all, my BBBs there is a problem with the device not booting maybe 10% of the times. I've seen reports from other people on anything from 1-10% boot failures. Some people solved it by hardware means, but I solve it with this fix. No there is nothing connected to the ports. Now I have practically 0% boot failures.

plopp commented 9 years ago

Seems you can put the delay to 0 seconds as well and still make it get into the prompt...that will cut another second on the precious boot-times...

RobertCNelson commented 9 years ago

Bingo: http://git.denx.de/?p=u-boot.git;a=blob;f=doc/README.autoboot;hb=HEAD#l139

plopp commented 9 years ago

Indeed! I will have to try that and also set bootdelay=0 and see how that works..

plopp commented 9 years ago

A reasonable fix for the boot issue could also be to use the CONFIG_BOOT_RETRY_TIME and make it retry booting after a certain idle time in the U-Boot console.

plopp commented 6 years ago

This seems to have been solved in U-boot by looking for a SPACE, relevant settings are here: https://github.com/RobertCNelson/u-boot/blob/9f8cf76be256a83643ee05de6cffaeb452ed0931/configs/am335x_boneblack_defconfig

Closed.