sandbox: Initialize sysreset before relocation
PATCH v2 1/2 sandbox: Initialize sysreset before relocation
Without this the early sysreset code cannot be tested.
---
v2: use u-boot,dm-pre-proper rather than u-boot,dm-pre-reloc - sandbox
SPL cannot build otherwise
--- arch/sandbox/dts/sandbox.dtsi | 1 + arch/sandbox/dts/test.dts | 2 ++ 2 files changed, 3 insertions(+)
arch/sandbox/dts/sandbox.dtsi +1 -0
@@ -239,6 +239,7 @@ reset@1 { compatible = "sandbox,reset"; + u-boot,dm-pre-proper; }; rng {
arch/sandbox/dts/test.dts +2 -0
@@ -1121,10 +1121,12 @@ reset@0 { compatible = "sandbox,warm-reset"; + u-boot,dm-pre-proper; }; reset@1 { compatible = "sandbox,reset"; + u-boot,dm-pre-proper; }; resetc: reset-ctl {
Signature · 1 line
2.37.3
PATCH v2 2/2 common: board_f: Print information for all sysresets
Boards can have multiple sysresets, iterate all when printing sysreset info.
---
v2:
- do not use errno_str
- rename flag variable
--- common/board_f.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-)
common/board_f.c +18 -11
@@ -146,20 +146,27 @@ static int print_resetinfo(void) {struct udevice *dev;char status[256 ]; +bool status_printed = false;int ret; - ret =uclass_first_device_err (UCLASS_SYSRESET , &dev); -if (ret) { -debug ("%s: No sysreset device found (error: %d)\n" , - __func__, ret); -/* Not all boards have sysreset drivers available during early -* boot, so don't fail if one can't be found. -*/ -return 0 ; - } +/* Not all boards have sysreset drivers available during early +* boot, so don't fail if one can't be found. +*/ +for (ret =uclass_first_device_check (UCLASS_SYSRESET , &dev); dev; + ret =uclass_next_device_check (&dev)) { +if (ret) { +debug ("%s: %s sysreset device (error: %d)\n" , + __func__, dev->name, ret); +continue ; + } -if (!sysreset_get_status (dev, status,sizeof (status))) -printf ("%s" , status); +if (!sysreset_get_status (dev, status,sizeof (status))) { +printf ("%s%s" , status_printed ?" " :"" , status); + status_printed = true; + } + } +if (status_printed) +printf ("\n" );return 0 ; }
Signature · 1 line
2.37.3
Re: [PATCH v2 2/2] common: board_f: Print information for all sysresets
Quoted 6 lines · Michal Suchanek
Boards can have multiple sysresets, iterate all when printing sysreset info.
Fixes 23471aed5c ("board_f: Add reset status printing")Signed-off-by Michal Suchanek <[email protected]>
Quoted 9 lines
---
v2:
- do not useerrno_str
- rename flag variable--- common/board_f.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-)
Re: [PATCH v2 2/2] common: board_f: Print information for all sysresets
In reply to Michal SuchanekQuoted 6 lines · Michal Suchanek
Boards can have multiple sysresets, iterate all when printing sysreset info.
Fixes 23471aed5c ("board_f: Add reset status printing")Signed-off-by Michal Suchanek <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 1 line
Tom
Quoted 11 lines · Michal Suchanek
Without this the early sysreset code cannot be tested.
Signed-off-by Michal Suchanek <[email protected]>---
v2: use u-boot,dm-pre-proper rather than u-boot,dm-pre-reloc - sandbox
SPL cannot build otherwise--- arch/sandbox/dts/sandbox.dtsi | 1 + arch/sandbox/dts/test.dts | 2 ++ 2 files changed, 3 insertions(+)
Quoted 4 lines · Michal Suchanek
Without this the early sysreset code cannot be tested.
Signed-off-by Michal Suchanek <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 1 line
Tom