[PATCH 2/4] power: reset: reboot-mode: parse barebox,mode-* properties

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Aug 8 23:29:36 PDT 2022


The same syscon may be used both to communicate with the bootrom and
with barebox. In this case, it may be required that not all boot modes
are enabled for the OS as Linux just makes them available in turn
to userspace. Teach barebox to handle the barebox,mode- prefix the
same way it handles mode-. As Linux doesn't parse this new property,
this means that it is unproblematic to fix it up into the Linux
device tree.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 drivers/power/reset/reboot-mode.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/power/reset/reboot-mode.c b/drivers/power/reset/reboot-mode.c
index ab23c32a4370..9a99b4056ff1 100644
--- a/drivers/power/reset/reboot-mode.c
+++ b/drivers/power/reset/reboot-mode.c
@@ -114,6 +114,8 @@ static const char *get_mode_name(const struct property *prop)
 	unsigned prefix_len;
 
 	prefix_len = str_has_prefix(prop->name, "mode-");
+	if (!prefix_len)
+		prefix_len = str_has_prefix(prop->name, "barebox,mode-");
 	if (!prefix_len)
 		return NULL;
 
-- 
2.30.2




More information about the barebox mailing list