[PATCH 1/1] riscv: enable reset via SBI on PolarFire Icicle Kit

HSS 2022.10 provides support for resetting the board.
Signed-off-by: Heinrich Schuchardt heinrich.schuchardt@canonical.com --- configs/microchip_mpfs_icicle_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/microchip_mpfs_icicle_defconfig b/configs/microchip_mpfs_icicle_defconfig index c295b9bad3..65bd50db80 100644 --- a/configs/microchip_mpfs_icicle_defconfig +++ b/configs/microchip_mpfs_icicle_defconfig @@ -21,3 +21,5 @@ CONFIG_SYS_MEM_TOP_HIDE=0x400000 CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_BOOTP_SEND_HOSTNAME=y CONFIG_DM_MTD=y +CONFIG_SYSRESET=y +CONFIG_SYSRESET_SBI=y

On Mon, 2022-11-07 at 10:55 +0100, Heinrich Schuchardt wrote:
HSS 2022.10 provides support for resetting the board.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com
configs/microchip_mpfs_icicle_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/microchip_mpfs_icicle_defconfig b/configs/microchip_mpfs_icicle_defconfig index c295b9bad3..65bd50db80 100644 --- a/configs/microchip_mpfs_icicle_defconfig +++ b/configs/microchip_mpfs_icicle_defconfig @@ -21,3 +21,5 @@ CONFIG_SYS_MEM_TOP_HIDE=0x400000 CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_BOOTP_SEND_HOSTNAME=y CONFIG_DM_MTD=y +CONFIG_SYSRESET=y +CONFIG_SYSRESET_SBI=y
Reviewed-by: Padmarao Begari padmarao.begari@microchip.com Tested-by: Padmarao Begari padmarao.begari@microchip.com
-- 2.37.2

On Mon, Nov 07, 2022 at 10:55:46AM +0100, Heinrich Schuchardt wrote:
HSS 2022.10 provides support for resetting the board.
It's actually v2022.09 that added support for reset. I don't think that that is important to correct though, since v2022.10 is the version we are updating the dt in U-Boot to match. Reviewed-by: Conor Dooley conor.dooley@microchip.com
One minor & mostly unrelated question below.
Signed-off-by: Heinrich Schuchardt heinrich.schuchardt@canonical.com
configs/microchip_mpfs_icicle_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/microchip_mpfs_icicle_defconfig b/configs/microchip_mpfs_icicle_defconfig index c295b9bad3..65bd50db80 100644 --- a/configs/microchip_mpfs_icicle_defconfig +++ b/configs/microchip_mpfs_icicle_defconfig @@ -21,3 +21,5 @@ CONFIG_SYS_MEM_TOP_HIDE=0x400000 CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_BOOTP_SEND_HOSTNAME=y CONFIG_DM_MTD=y +CONFIG_SYSRESET=y +CONFIG_SYSRESET_SBI=y
I took a look at the config option, but something seemed odd to me. It says "depends on SBI_V02" but the help text says "version 0.3". I see there's no define for SBI_V03 so I assume that's why there's a mismatch.
I didn't see a comment about it in the commit hence asking. AFAIR, v0.3 is the correct version.
config SYSRESET_SBI bool "Enable support for SBI System Reset" depends on RISCV_SMODE && SBI_V02 default y select SYSRESET_CMD_POWEROFF if CMD_POWEROFF help Enable system reset and poweroff via the SBI system reset extension. The extension was introduced in version 0.3 of the SBI specification.

On 11/8/22 09:16, Conor Dooley wrote:
On Mon, Nov 07, 2022 at 10:55:46AM +0100, Heinrich Schuchardt wrote:
HSS 2022.10 provides support for resetting the board.
It's actually v2022.09 that added support for reset. I don't think that that is important to correct though, since v2022.10 is the version we are updating the dt in U-Boot to match. Reviewed-by: Conor Dooley conor.dooley@microchip.com
One minor & mostly unrelated question below.
Signed-off-by: Heinrich Schuchardt heinrich.schuchardt@canonical.com
configs/microchip_mpfs_icicle_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/microchip_mpfs_icicle_defconfig b/configs/microchip_mpfs_icicle_defconfig index c295b9bad3..65bd50db80 100644 --- a/configs/microchip_mpfs_icicle_defconfig +++ b/configs/microchip_mpfs_icicle_defconfig @@ -21,3 +21,5 @@ CONFIG_SYS_MEM_TOP_HIDE=0x400000 CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_BOOTP_SEND_HOSTNAME=y CONFIG_DM_MTD=y +CONFIG_SYSRESET=y +CONFIG_SYSRESET_SBI=y
I took a look at the config option, but something seemed odd to me. It says "depends on SBI_V02" but the help text says "version 0.3". I see there's no define for SBI_V03 so I assume that's why there's a mismatch.
I didn't see a comment about it in the commit hence asking. AFAIR, v0.3 is the correct version.
IIRC 0.3 is the same as 0.2 except it was ratified.
config SYSRESET_SBI bool "Enable support for SBI System Reset" depends on RISCV_SMODE && SBI_V02 default y select SYSRESET_CMD_POWEROFF if CMD_POWEROFF help Enable system reset and poweroff via the SBI system reset extension. The extension was introduced in version 0.3 of the SBI specification.

On Tue, Nov 08, 2022 at 09:23:19AM -0500, Sean Anderson wrote:
On 11/8/22 09:16, Conor Dooley wrote:
+CONFIG_SYSRESET_SBI=y
I took a look at the config option, but something seemed odd to me. It says "depends on SBI_V02" but the help text says "version 0.3". I see there's no define for SBI_V03 so I assume that's why there's a mismatch.
I didn't see a comment about it in the commit hence asking. AFAIR, v0.3 is the correct version.
IIRC 0.3 is the same as 0.2 except it was ratified.
Ah I see. Apologies for the noise on that one so, had a quick look on the riscv-non-isa github but obviously not enough!
Thanks Sean.
config SYSRESET_SBI bool "Enable support for SBI System Reset" depends on RISCV_SMODE && SBI_V02 default y select SYSRESET_CMD_POWEROFF if CMD_POWEROFF help Enable system reset and poweroff via the SBI system reset extension. The extension was introduced in version 0.3 of the SBI specification.

On 11/8/22 15:16, Conor Dooley wrote:
On Mon, Nov 07, 2022 at 10:55:46AM +0100, Heinrich Schuchardt wrote:
HSS 2022.10 provides support for resetting the board.
It's actually v2022.09 that added support for reset. I don't think that that is important to correct though, since v2022.10 is the version we are updating the dt in U-Boot to match. Reviewed-by: Conor Dooley conor.dooley@microchip.com
One minor & mostly unrelated question below.
Signed-off-by: Heinrich Schuchardt heinrich.schuchardt@canonical.com
configs/microchip_mpfs_icicle_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/microchip_mpfs_icicle_defconfig b/configs/microchip_mpfs_icicle_defconfig index c295b9bad3..65bd50db80 100644 --- a/configs/microchip_mpfs_icicle_defconfig +++ b/configs/microchip_mpfs_icicle_defconfig @@ -21,3 +21,5 @@ CONFIG_SYS_MEM_TOP_HIDE=0x400000 CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_BOOTP_SEND_HOSTNAME=y CONFIG_DM_MTD=y +CONFIG_SYSRESET=y +CONFIG_SYSRESET_SBI=y
I took a look at the config option, but something seemed odd to me. It says "depends on SBI_V02" but the help text says "version 0.3". I see there's no define for SBI_V03 so I assume that's why there's a mismatch.
I didn't see a comment about it in the commit hence asking. AFAIR, v0.3 is the correct version.
The only ratified version of the SBI specification is 1.0.
v0.2 introduced the concept of extensions. v0.3 introduced the SRST extension.
CONFIG_SBI_V02=y means SBI specification v0.2 or later. We should update the description of CONFIG_SBI_V02 accordingly.
HSS 2022.10 provides an OpenSBI 1.0 which is good enough.
If you use a 0.1 or 0.2 SBI, the worst thing that can happen is that sbi_probe_extension(SBI_EXT_SRST) will return an error and the reset driver is not loaded.
Best regards
Heinrich
config SYSRESET_SBI bool "Enable support for SBI System Reset" depends on RISCV_SMODE && SBI_V02 default y select SYSRESET_CMD_POWEROFF if CMD_POWEROFF help Enable system reset and poweroff via the SBI system reset extension. The extension was introduced in version 0.3 of the SBI specification.
participants (4)
-
Conor Dooley
-
Heinrich Schuchardt
-
Padmarao.Begari@microchip.com
-
Sean Anderson