[PATCH 5/5] maix: enable SBI system reset for MAIX

Heinrich Schuchardt xypron.glpk at gmx.de
Sat Mar 6 08:31:20 CET 2021


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 <xypron.glpk at gmx.de>
>> ---
>>   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 <common.h>
>>   #include <clk.h>
>>   #include <dm.h>
>> +#include <dm/lists.h>
>>   #include <fdt_support.h>
>>   #include <asm/io.h>
>>
>> @@ -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
>>
>



More information about the U-Boot mailing list