Skip to contentSkip to conversation

riscv: enable reset via SBI on PolarFire Icicle Kit

PATCH In review Heinrich Schuchardt 4 participants 6 messages Nov 7, 2022 – Nov 8, 2022

lore
Share & tools
lore
#0 lore raw

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

HSS 2022.10 provides support for resetting the board.

---
 configs/microchip_mpfs_icicle_defconfig | 2 ++
 1 file changed, 2 insertions(+)
configs/microchip_mpfs_icicle_defconfig +2 -0
index c295b9bad3..65bd50db80 100644
@@ -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
Signature · 1 line
2.37.2
Reviewed-by Tested-by on v1 1/1
#1 lore raw
Quoted 16 lines · Heinrich Schuchardt

HSS 2022.10 provides support for resetting the board.

Quoted 1 line
---
 configs/microchip_mpfs_icicle_defconfig | 2 ++
 1 file changed, 2 insertions(+)
configs/microchip_mpfs_icicle_defconfig +0 -0
index c295b9bad3..65bd50db80 100644

configs/microchip_mpfs_icicle_defconfig CONFIG_SYS_MEM_TOP_HIDE=0x400000 · line 25

Quoted 5 lines
configs/microchip_mpfs_icicle_defconfig +2 -0
@@ -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
Quoted 3 lines

--
2.37.2

Reviewed-by on v1 1/1
#2 lore raw
In reply to Heinrich Schuchardt
Quoted 1 line · Heinrich Schuchardt

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.

One minor & mostly unrelated question below.

Quoted 10 lines
---
 configs/microchip_mpfs_icicle_defconfig | 2 ++
 1 file changed, 2 insertions(+)
configs/microchip_mpfs_icicle_defconfig +0 -0
index c295b9bad3..65bd50db80 100644

configs/microchip_mpfs_icicle_defconfig CONFIG_SYS_MEM_TOP_HIDE=0x400000 · line 25

Quoted 5 lines
configs/microchip_mpfs_icicle_defconfig +2 -0
@@ -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.

Quoted 8 lines

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.

#3 lore raw
Quoted 30 lines · Conor Dooley
Quoted 1 line · Heinrich Schuchardt

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.

One minor & mostly unrelated question below.

Quoted 10 lines
---
  configs/microchip_mpfs_icicle_defconfig | 2 ++
  1 file changed, 2 insertions(+)
configs/microchip_mpfs_icicle_defconfig +0 -0
index c295b9bad3..65bd50db80 100644

configs/microchip_mpfs_icicle_defconfig CONFIG_SYS_MEM_TOP_HIDE=0x400000 · line 25

Quoted 5 lines
configs/microchip_mpfs_icicle_defconfig +2 -0
@@ -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.

Quoted 2 lines

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.

Quoted 8 lines
Quoted 8 lines

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.

#4 lore raw
Quoted 11 lines · Sean Anderson
Quoted 8 lines · Conor Dooley
Quoted 1 line

+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.

Quoted 9 lines
Quoted 8 lines
Quoted 8 lines

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.

#5 lore raw
In reply to Conor Dooley
Quoted 30 lines · Conor Dooley
Quoted 1 line · Heinrich Schuchardt

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.

One minor & mostly unrelated question below.

Quoted 10 lines
---
  configs/microchip_mpfs_icicle_defconfig | 2 ++
  1 file changed, 2 insertions(+)
configs/microchip_mpfs_icicle_defconfig +0 -0
index c295b9bad3..65bd50db80 100644

configs/microchip_mpfs_icicle_defconfig CONFIG_SYS_MEM_TOP_HIDE=0x400000 · line 25

Quoted 5 lines
configs/microchip_mpfs_icicle_defconfig +2 -0
@@ -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.

Quoted 2 lines

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

Quoted 9 lines
Quoted 9 lines

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.