Skip to contentSkip to conversation

RiscV SBI incompatibilities?

DISCUSSION Martin Husemann 2 participants 5 messages Nov 11 – Nov 12

lore
Share & tools
lore
#0 lore raw

Hi folks,

maybe I tried something stupid, but it felt like a good idea at first.

I am updating my VisionFive 2 board from an oldish installation with U-Boot 2024.10.

To have as few moving parts as possible, I build 2026.10 with the same SBI that I had lying around from the original 2024.10 build, which happend to be OpenSBI 1.4.

This failed spectacularily: most sbc_* calls for HSM fail with -3 (SBI_ERR_INVALID_PARAM).

A few calls worked, like sbi_hart_start() and sbi_hart_get_status(), which told me the hartids I was using were valid, but then doing e.g. sbi_send_ipi() or sbi_remote_sfence_vma() failed.

Does this ring a bell? Is it expected? Did I overlook a "minimal SBI version 1.X" somewhere?

Martin

#1 lore raw
Quoted 14 lines · Martin Husemann

Hi folks,

maybe I tried something stupid, but it felt like a good idea at first.

I am updating my VisionFive 2 board from an oldish installation with U-Boot 2024.10.

To have as few moving parts as possible, I build 2026.10 with the same SBI that I had lying around from the original 2024.10 build, which happend to be OpenSBI 1.4.

This failed spectacularily: most sbc_* calls for HSM fail with -3 (SBI_ERR_INVALID_PARAM).

Quoted 6 lines

A few calls worked, like sbi_hart_start() and sbi_hart_get_status(), which told me the hartids I was using were valid, but then doing e.g. sbi_send_ipi() or sbi_remote_sfence_vma() failed.

Does this ring a bell? Is it expected? Did I overlook a "minimal SBI version 1.X" somewhere?

doc/board/starfive/jh7110_common.rst says,

Quoted 3 lines

3. U-Boot for JH-7110 requires OpenSBI v1.5+ generic platform object fw_dynamic.bin to be included in the Flattened Image Tree blob. OpenSBI may first be built as below:

I had a brief look through the changes from v1.4 to v1.5, and suspect it has something to do with OpenSBI commit c5be0e1ed1fa ("lib: utils/ipi:
Skip initialize ipi when dt is not enabled")[1], but don't confirm it :)

Quoted 1 line

Martin

Signature · 6 lines
Thanks,
Yao Zi

Meow-mrrp-mrow, I'm a cat.

[1]: https://github.com/riscv-software-src/opensbi/commit/c5be0e1ed1fa17b9f9abb49e80db014e067523e4
#2 lore raw
Quoted 3 lines · Yao Zi

I had a brief look through the changes from v1.4 to v1.5, and suspect it has something to do with OpenSBI commit c5be0e1ed1fa ("lib: utils/ipi:
Skip initialize ipi when dt is not enabled")[1], but don't confirm it :)

Thanks, indeed with OpenSBI 1.9 it works a lot better.

Martin

#3 lore raw
In reply to Yao Zi
Quoted 24 lines · Yao Zi
Quoted 14 lines · Martin Husemann

Hi folks,

maybe I tried something stupid, but it felt like a good idea at first.

I am updating my VisionFive 2 board from an oldish installation with U-Boot 2024.10.

To have as few moving parts as possible, I build 2026.10 with the same SBI that I had lying around from the original 2024.10 build, which happend to be OpenSBI 1.4.

This failed spectacularily: most sbc_* calls for HSM fail with -3 (SBI_ERR_INVALID_PARAM).

Quoted 6 lines

A few calls worked, like sbi_hart_start() and sbi_hart_get_status(), which told me the hartids I was using were valid, but then doing e.g. sbi_send_ipi() or sbi_remote_sfence_vma() failed.

Does this ring a bell? Is it expected? Did I overlook a "minimal SBI version 1.X" somewhere?

doc/board/starfive/jh7110_common.rst says,

Quoted 7 lines
Quoted 3 lines

3. U-Boot for JH-7110 requires OpenSBI v1.5+ generic platform object fw_dynamic.bin to be included in the Flattened Image Tree blob. OpenSBI may first be built as below:

I had a brief look through the changes from v1.4 to v1.5, and suspect it has something to do with OpenSBI commit c5be0e1ed1fa ("lib: utils/ipi:
Skip initialize ipi when dt is not enabled")[1], but don't confirm it :)

Totally unnecessary, just out of curiosity, could you please send a list of failed sbi calls and their corresponding error codes? From this I could probably find out whether it's related to the OpenSBI commit :)

Feel free to ignore this message if you don't want to :)

Quoted 9 lines
Quoted 1 line

Martin

Signature · 6 lines
Thanks,
Yao Zi

Meow-mrrp-mrow, I'm a cat.

[1]: https://github.com/riscv-software-src/opensbi/commit/c5be0e1ed1fa17b9f9abb49e80db014e067523e4
Signature · 4 lines
Thanks,
Yao Zi

Meow-mrrp-mrow, I'm a cat.
#4 lore raw
Quoted 3 lines · Yao Zi

Totally unnecessary, just out of curiosity, could you please send a list of failed sbi calls and their corresponding error codes? From this I could probably find out whether it's related to the OpenSBI commit :)

I didn't create a full list, but verified two that did fail:

sbi_send_ipi()
sbi_remote_sfence_vma()

Unrelated:
I still have a strange problem (identical in 2024.10 and 2026.10) that sometimes the NVMe is not readable after reboot; I initially thought it would be related to a USB storage device being present, but it seems to be mostly random. Maybe the USB device enhances the chance for failure, wich might point at a power supply problem - I should replace the cable.

Martin