[U-Boot-Users] Best place to implement custom "bootdelay" functionnality

Laurent Pinchart laurent.pinchart at tbox.biz
Mon Jul 17 17:33:37 CEST 2006


Hi everybody,

I've ported U-Boot to a custom board without major problems, and I'm currently 
adding the few features I still miss.

Our board has a reset switch which can be held in the reset position to stop 
the automatic boot procedure. When the button is pushed to the reset 
position, a short reset pulse is generated by a CPLD to reset the CPU and run 
U-Boot. I then would like to check if the button is held in the reset 
position (which can easily be done by reading the CPLD status byte) and blink 
a LED until the button is released. The number of times the LED blinks before 
the user releases the reset button determines the boot options.

If the button has been held long enough, I would like to stop the U-Boot 
automatic boot process, much like a character on the serial port does.

I thought I would implement the button check and LED blink code in 
last_stage_init(void). I'd like to get advices regarding the best way to then 
tell U-Boot not to run bootcmd automatically.

On a side note, I have to program a Xilinx FPGA to make the LED blink (I know, 
this could have been put into the CPLD, that's probably a small design 
mistake). fpga_load() can easily be called from last_stage_init(), but I 
wonder if there is a public API to load the FPGA configuration file from a 
CramFS partition much like the fsload command does. I'd like to avoid 
duplicate code as much as possible.

Thanks in advance for your help.

Laurent Pinchart




More information about the U-Boot mailing list