All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konstantin Kletschke <konstantin.kletschke@inside-m2m.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: Reset on Beaglebone Black has become unreliable/broken
Date: Tue, 7 Jan 2025 14:12:58 +0100	[thread overview]
Message-ID: <Z30oWivcXTQmw9ZO@hephaistos> (raw)
In-Reply-To: <76532287-74b7-42ca-860c-b2e6bda8484e@pengutronix.de>

On Tue, Jan 07, 2025 at 12:17:03PM +0100, Ahmad Fatoum wrote:

> Thanks for the follow-up.

Of course, my pleasure :)

I used "pio device monitor" from platformio and added a custom filter
searching for ">" in the reveived stream and if true adds
seconds.microseconds timestamp.

With this:

diff --git a/arch/arm/boards/beaglebone/lowlevel.c b/arch/arm/boards/beaglebone/lowlevel.c
index 5dc49dfaaf..db1c464a27 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.
  *
@@ -111,6 +117,8 @@ static noinline int beaglebone_sram_init(void)
        uint32_t sdram_size;
        void *fdt;

+       int k;
+
        fdt = __dtb_z_am335x_bone_common_start;

        if (is_beaglebone_black())
@@ -134,6 +142,11 @@ static noinline int beaglebone_sram_init(void)
        am33xx_uart_soft_reset((void *)AM33XX_UART0_BASE);
        am33xx_enable_uart0_pin_mux();
        omap_debug_ll_init();
+
+       putc_ll('>');
+       for (k = 0; k < 1000; k++) {
+               __udelay(1000);
+       }
        putc_ll('>');

        barebox_arm_entry(0x80000000, sdram_size, fdt);

This gives me this:

44.412429
>
46.284478
>

If I calculated correct this are 1.8 seconds.
So without the surrounding 1000 loop this final result here:

diff --git a/arch/arm/boards/beaglebone/lowlevel.c b/arch/arm/boards/beaglebone/lowlevel.c
index 5dc49dfaaf..ccae1d1122 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.
  *
@@ -135,6 +141,7 @@ static noinline int beaglebone_sram_init(void)
        am33xx_enable_uart0_pin_mux();
        omap_debug_ll_init();
        putc_ll('>');
+       __udelay(1000); // Adding delay of 1.8ms

        barebox_arm_entry(0x80000000, sdram_size, fdt);
 }

Should add a delay of 1.8ms. Is this feasible?


> 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.

Yes, I agree to the not fully yet understood part.
What me holds back from lowering the speed is the following:

I went into production with the final result part above and reflashe all
our BBB devices which failed warm start without the additional delay and
all passed 100% flawlessly after the modficication. So it is tested upon
roughly 30 devices which failed before.

Kind Regards
Konstantin



-- 
INSIDE M2M GmbH
Konstantin Kletschke
Berenbosteler Straße 76 B
30823 Garbsen

Telefon: +49 (0) 5137 90950136
Mobil: +49 (0) 151 15256238
Fax: +49 (0) 5137 9095010

konstantin.kletschke@inside-m2m.de
http://www.inside-m2m.de 

Geschäftsführung: Michael Emmert, Derek Uhlig
HRB: 111204, AG Hannover




  reply	other threads:[~2025-01-07 13:19 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-28  9:07 Reset on Beaglebone Black has become unreliable/broken 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
2025-01-07 13:12                                 ` Konstantin Kletschke [this message]
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=Z30oWivcXTQmw9ZO@hephaistos \
    --to=konstantin.kletschke@inside-m2m.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.