From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heinrich Schuchardt Date: Sat, 6 Mar 2021 08:31:20 +0100 Subject: [PATCH 5/5] maix: enable SBI system reset for MAIX In-Reply-To: <783cbbe4-07e9-fbb0-ef5b-64e8ff01814d@gmail.com> References: <20210304170051.58993-1-xypron.glpk@gmx.de> <20210304170051.58993-6-xypron.glpk@gmx.de> <783cbbe4-07e9-fbb0-ef5b-64e8ff01814d@gmail.com> Message-ID: <4ce2bf14-a9bd-838e-0365-5993e6a85c7c@gmx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 3/5/21 12:24 AM, Sean Anderson wrote: > On 3/4/21 12:00 PM, Heinrich Schuchardt wrote: >> When running in S-mode we can use the SBI system reset extension to >> provide >> the system reset. >> >> Signed-off-by: Heinrich Schuchardt >> --- >> ? board/sipeed/maix/maix.c??????????? | 5 +++++ >> ? configs/sipeed_maix_smode_defconfig | 2 ++ >> ? 2 files changed, 7 insertions(+) >> >> diff --git a/board/sipeed/maix/maix.c b/board/sipeed/maix/maix.c >> index cbcb23cf5c..388eddee6e 100644 >> --- a/board/sipeed/maix/maix.c >> +++ b/board/sipeed/maix/maix.c >> @@ -6,6 +6,7 @@ >> ? #include >> ? #include >> ? #include >> +#include >> ? #include >> ? #include >> >> @@ -37,5 +38,9 @@ int board_init(void) >> ????????????? return ret; >> ????? } >> >> +??? if (IS_ENABLED(CONFIG_SYSRESET_SBI)) >> +??????? ret = device_bind_driver(gd->dm_root, "sbi-sysreset", >> +???????????????????? "sbi-sysreset", NULL); >> + > > Besides that this isn't a device-tree driver, shouldn't this live in > arch_early_init_r or similar? This isn't really board-specific. Using arch_early_init_r() seems to be a viable alternative to putting some dummy node into each device-tree. Best regards Heinrich > > --Sean > >> ????? return 0; >> ? } >> diff --git a/configs/sipeed_maix_smode_defconfig >> b/configs/sipeed_maix_smode_defconfig >> index 2516bb7258..aa95893feb 100644 >> --- a/configs/sipeed_maix_smode_defconfig >> +++ b/configs/sipeed_maix_smode_defconfig >> @@ -7,4 +7,6 @@ CONFIG_STACK_SIZE=0x100000 >> ? # CONFIG_NET is not set >> ? # CONFIG_INPUT is not set >> ? # CONFIG_DM_ETH is not set >> +CONFIG_SYSRESET_SBI=y >> +# CONFIG_SYSRESET_SYSCON is not set >> ? # CONFIG_EFI_UNICODE_CAPITALIZATION is not set >> -- >> 2.30.1 >> >