Hello Konstantin, On 20.12.24 12:05, Konstantin Kletschke wrote: > I found the minimum change required to make barebox warm restart every > time I hot S1, write warm restart register, type reset or linux kernel > reboot. > I needed to figure out to realize in my yocto the MLO stage is another > package to test my changes in this vanilla defconfig part carefully. > > My barebox-pbl stage package calls the defconfig am335x_mlo_defconfig, I > apply only this patch on top on my 2022.04 version: Thanks for the follow-up. > diff --git a/arch/arm/boards/beaglebone/lowlevel.c b/arch/arm/boards/beaglebone/lowlevel.c > index 544e396e03..329d7a9150 100644 > --- a/arch/arm/boards/beaglebone/lowlevel.c > +++ b/arch/arm/boards/beaglebone/lowlevel.c > @@ -97,6 +97,12 @@ extern char __dtb_z_am335x_boneblack_start[]; > extern char __dtb_z_am335x_bone_common_start[]; > extern char __dtb_z_am335x_bone_start[]; > > +static void __udelay(int us) > +{ > + volatile int i; > + for (i = 0; i < us * 3; i++); > +} > + > /** > * @brief The basic entry point for board initialization. > * > @@ -142,6 +148,7 @@ static noinline int beaglebone_sram_init(void) > omap_uart_lowlevel_init((void *)AM33XX_UART0_BASE); > putc_ll('>'); > > + __udelay(1000); > barebox_arm_entry(0x80000000, sdram_size, fdt); > } > > > This delay loop (side quest: how do I calculate how long it waits?) Try multiplying it by 1 000 or 1 000 000 and print a character before and after and measure this time difference, e.g. with grabserial[0] or ts(1) and then divide by the factor you first used for multiplication. [0]: https://elinux.org/Grabserial > on its own with no changes in CONFIG or debugging or whatsoever > fixes everything. If it's indeed just a millisecond, I am in favor of adding this to barebox upstream with a comment explaining what this fixes, even if we don't fully understand it yet. Cheers, Ahmad > > Regards > Konstantin > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |