board/BuR/brppt1: implement more flexible boot process
With this commit we do: - set the bootdelay in all brppt1 defconfigs to 0, this makes development easier, since we can break into serial console. - move CONFIG_BOOTCOMMAND from header file to defconfig - introduce b_mode variable for selecting the final boot-target. This b_mode represents the boot-switch, which can found on most b&r targets. On the brppt1 this boot-switch is derived from some gpio and the bootcounter within the RTC block, making it so possible to force a boot-target (as example for repair-case). - refactor the environment for booting new flexible way primary we want to get some bootscr.img within the mass-storage, this script then loads everything needed for the boot. For legacy reason we implement the t30lgcy#x boot targets, booting the already delivered linux-images. - make space for the cfgscr within mtdparts on brppt1_nand Signed-off-by: Hannes Schmelzer <oe5hpm@oevsv.at>
This commit is contained in:
committed by
Tom Rini
parent
d63f7130ce
commit
73e9db22ab
@@ -140,11 +140,33 @@ int board_init(void)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BOARD_LATE_INIT
|
||||
static char *bootmodeascii[16] = {
|
||||
"BOOT", "reserved", "reserved", "reserved",
|
||||
"RUN", "reserved", "reserved", "reserved",
|
||||
"reserved", "reserved", "reserved", "reserved",
|
||||
"PME", "reserved", "reserved", "DIAG",
|
||||
};
|
||||
|
||||
int board_late_init(void)
|
||||
{
|
||||
if (0 == gpio_get_value(REPSWITCH)) {
|
||||
env_set("bootcmd", "run netconsole");
|
||||
}
|
||||
unsigned char bmode = 0;
|
||||
ulong bootcount = 0;
|
||||
|
||||
bootcount = bootcount_load() & 0xF;
|
||||
|
||||
if (gpio_get_value(REPSWITCH) == 0 || bootcount == 12)
|
||||
bmode = 12;
|
||||
else if (bootcount > 0)
|
||||
bmode = 0;
|
||||
else
|
||||
bmode = 4;
|
||||
|
||||
printf("Mode: %s\n", bootmodeascii[bmode & 0x0F]);
|
||||
env_set_ulong("b_mode", bmode);
|
||||
|
||||
/* get sure that bootcmd isn't affected by any bootcount value */
|
||||
env_set_ulong("bootlimit", 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_BOARD_LATE_INIT */
|
||||
|
||||
Reference in New Issue
Block a user