From: Konstantin Kletschke <konstantin.kletschke@inside-m2m.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: Autoboot when idling at prompt possible?
Date: Fri, 17 Mar 2023 18:35:27 +0100 [thread overview]
Message-ID: <ZBSk37q2IlGI0SXQ@Hephaistos.local> (raw)
In-Reply-To: <9bcfc2f8-72f4-b994-0c61-07e34ccc22a0@pengutronix.de>
Dear Ahmad,
thanks for your kind support.
On Thu, Mar 16, 2023 at 01:51:39PM +0100, Ahmad Fatoum wrote:
> If you keep ctrl+c pressed during boot, you may abort before init runs,
> even if global.autboot_timeout=0.
Interesting, I double checked "my" barebox for this feature, nice to
know.
> You can enable watchdog before init runs, e.g. in your board code, let's
> say with a timeout of 2 minutes. If you have reason to use the shell, you
> run wd -x manually or set global.autoboot=abort and reset.
This sounds neat and not over complicated. Nice Idea, to have a watchdog
enabled at barebox level, why not. The manual required "wd -x" is fine.
I have a beaglebone board, added CONFIG_WATCHDOG and manual enabling
watchdog via "wd 120" and disabling vie "wd -x" works fine. Now I wonder
how to enable at boot up.
Something like
--- a/arch/arm/boards/beaglebone/board.c
+++ b/arch/arm/boards/beaglebone/board.c
@@ -25,6 +25,8 @@
#include <linux/err.h>
#include <mach/bbu.h>
+#include <watchdog.h>
+
#include "beaglebone.h"
static int beaglebone_coredevice_init(void)
@@ -84,6 +86,9 @@ static int beaglebone_devices_init(void)
if (IS_ENABLED(CONFIG_SHELL_NONE))
return am33xx_of_register_bootdevice();
+ struct watchdog *wd = watchdog_get_default();
+ watchdog_set_timeout(wd, 120);
+
return 0;
}
coredevice_initcall(beaglebone_devices_init);
?
I can't test at the moment because I am remote and cant handle a abused
crashing barebox at the moment. It compiles, though!
The passwort entry approach is kinda neat to, I will investigate this
feature too.
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
prev parent reply other threads:[~2023-03-17 17:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-16 12:34 Konstantin Kletschke
2023-03-16 12:51 ` Ahmad Fatoum
2023-03-17 17:35 ` Konstantin Kletschke [this message]
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=ZBSk37q2IlGI0SXQ@Hephaistos.local \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox