RISC-V FIT image type

Hi,
I notice that in image.h we have IH_ARCH_RISCV but no mention of IH_ARCH_RISCV64. Should we not have two separate image types, as we do with ARM and x86? Otherwise, how would a loader know the word size of the target machine?
Regards, Simon

On Fri, Mar 31, 2023 at 5:36 AM Simon Glass sjg@chromium.org wrote:
Hi,
I notice that in image.h we have IH_ARCH_RISCV but no mention of IH_ARCH_RISCV64. Should we not have two separate image types, as we do with ARM and x86? Otherwise, how would a loader know the word size of the target machine?
I think that's because in RISC-V it is always the same bit-width U-Boot to load the same bit-width kernel. There is no support of 32-bit U-Boot to load 64-bit kernel and vice versa.
Regards, Bin

Hi Bin,
On Fri, 31 Mar 2023 at 19:22, Bin Meng bmeng.cn@gmail.com wrote:
On Fri, Mar 31, 2023 at 5:36 AM Simon Glass sjg@chromium.org wrote:
Hi,
I notice that in image.h we have IH_ARCH_RISCV but no mention of IH_ARCH_RISCV64. Should we not have two separate image types, as we do with ARM and x86? Otherwise, how would a loader know the word size of the target machine?
I think that's because in RISC-V it is always the same bit-width U-Boot to load the same bit-width kernel. There is no support of 32-bit U-Boot to load 64-bit kernel and vice versa.
Yes, understood, but in this case we can't be sure that it is possible load a FIT, e.g. if someone makes a mistake.
Would it be OK to create a new "riscv64" type? This has come up in the universal payload discussions.
Regards, Simon

Hi Simon,
On Sat, Apr 1, 2023 at 2:31 PM Simon Glass sjg@chromium.org wrote:
Hi Bin,
On Fri, 31 Mar 2023 at 19:22, Bin Meng bmeng.cn@gmail.com wrote:
On Fri, Mar 31, 2023 at 5:36 AM Simon Glass sjg@chromium.org wrote:
Hi,
I notice that in image.h we have IH_ARCH_RISCV but no mention of IH_ARCH_RISCV64. Should we not have two separate image types, as we do with ARM and x86? Otherwise, how would a loader know the word size of the target machine?
I think that's because in RISC-V it is always the same bit-width U-Boot to load the same bit-width kernel. There is no support of 32-bit U-Boot to load 64-bit kernel and vice versa.
Yes, understood, but in this case we can't be sure that it is possible load a FIT, e.g. if someone makes a mistake.
Would it be OK to create a new "riscv64" type? This has come up in the universal payload discussions.
I think so. But I will leave this to the RISC-V maintainers to make a call.
Regards, Bin

Hi Bin,
On Sun, 2 Apr 2023 at 15:33, Bin Meng bmeng.cn@gmail.com wrote:
Hi Simon,
On Sat, Apr 1, 2023 at 2:31 PM Simon Glass sjg@chromium.org wrote:
Hi Bin,
On Fri, 31 Mar 2023 at 19:22, Bin Meng bmeng.cn@gmail.com wrote:
On Fri, Mar 31, 2023 at 5:36 AM Simon Glass sjg@chromium.org wrote:
Hi,
I notice that in image.h we have IH_ARCH_RISCV but no mention of IH_ARCH_RISCV64. Should we not have two separate image types, as we do with ARM and x86? Otherwise, how would a loader know the word size of the target machine?
I think that's because in RISC-V it is always the same bit-width U-Boot to load the same bit-width kernel. There is no support of 32-bit U-Boot to load 64-bit kernel and vice versa.
Yes, understood, but in this case we can't be sure that it is possible load a FIT, e.g. if someone makes a mistake.
Would it be OK to create a new "riscv64" type? This has come up in the universal payload discussions.
I think so. But I will leave this to the RISC-V maintainers to make a call.
OK thanks. I'll send a patch.
Regards, Simon
participants (2)
-
Bin Meng
-
Simon Glass