From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Konstantin Kletschke <konstantin.kletschke@inside-m2m.de>
Cc: barebox@lists.infradead.org
Subject: Re: Reset on Beaglebone Black has become unreliable/broken
Date: Tue, 7 Jan 2025 12:17:03 +0100 [thread overview]
Message-ID: <76532287-74b7-42ca-860c-b2e6bda8484e@pengutronix.de> (raw)
In-Reply-To: <Z2VPgRnxah5lc09X@hephaistos>
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 |
next prev parent reply other threads:[~2025-01-07 11:17 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-28 9:07 Konstantin Kletschke
2024-11-28 9:23 ` Ahmad Fatoum
2024-11-28 9:46 ` Konstantin Kletschke
2024-11-28 11:18 ` Ahmad Fatoum
2024-11-28 12:02 ` Konstantin Kletschke
2024-11-28 15:25 ` Konstantin Kletschke
2024-12-02 12:41 ` Ahmad Fatoum
2024-12-02 14:15 ` Konstantin Kletschke
2024-12-03 18:28 ` Ahmad Fatoum
2024-12-03 18:51 ` Konstantin Kletschke
2024-12-03 20:28 ` Ahmad Fatoum
2024-12-03 21:45 ` Konstantin Kletschke
2024-12-04 6:14 ` Ahmad Fatoum
2024-12-04 16:29 ` Konstantin Kletschke
2024-12-10 21:52 ` Ahmad Fatoum
2024-12-11 14:52 ` Konstantin Kletschke
2024-12-20 11:05 ` Konstantin Kletschke
2025-01-07 11:17 ` Ahmad Fatoum [this message]
2025-01-07 13:12 ` Konstantin Kletschke
2025-01-07 14:29 ` Konstantin Kletschke
2025-01-07 14:35 ` Ahmad Fatoum
2025-01-07 15:03 ` Konstantin Kletschke
2024-12-03 18:34 ` Konstantin Kletschke
2024-12-03 18:46 ` Ahmad Fatoum
2024-12-03 19:03 ` Konstantin Kletschke
2024-12-04 11:07 ` Konstantin Kletschke
2024-12-04 11:20 ` Konstantin Kletschke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=76532287-74b7-42ca-860c-b2e6bda8484e@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=konstantin.kletschke@inside-m2m.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox