* [PATCH] riscv: Support riscv64 image type
@ 2023-04-10 7:27 Rick Chen
2023-04-19 1:46 ` Simon Glass
0 siblings, 1 reply; 6+ messages in thread
From: Rick Chen @ 2023-04-10 7:27 UTC (permalink / raw)
To: sjg; +Cc: u-boot, bmeng.cn, ycliang, rick, rickchen36
Allow U-Boot to load 32 or 64 bits RISC-V Kernel Image
distinguishly. It helps to avoid someone maybe make a mistake
to run 32-bit U-Boot to load 64-bit kernel.
Signed-off-by: Rick Chen <rick@andestech.com>
---
The patchset is based on Simon's patch:
riscv: Add a 64-bit image type
---
---
arch/riscv/include/asm/u-boot.h | 4 ++++
cmd/booti.c | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/riscv/include/asm/u-boot.h b/arch/riscv/include/asm/u-boot.h
index d5e1d5f323..e3b4a0357c 100644
--- a/arch/riscv/include/asm/u-boot.h
+++ b/arch/riscv/include/asm/u-boot.h
@@ -23,6 +23,10 @@
#include <asm/u-boot-riscv.h>
/* For image.h:image_check_target_arch() */
+#ifdef CONFIG_ARCH_RV64I
+#define IH_ARCH_DEFAULT IH_ARCH_RISCV64
+#else
#define IH_ARCH_DEFAULT IH_ARCH_RISCV
+#endif
#endif /* _U_BOOT_H_ */
diff --git a/cmd/booti.c b/cmd/booti.c
index 6ac39193db..dc0b0ae41c 100644
--- a/cmd/booti.c
+++ b/cmd/booti.c
@@ -119,7 +119,7 @@ int do_booti(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
images.os.os = IH_OS_LINUX;
#ifdef CONFIG_RISCV_SMODE
- images.os.arch = IH_ARCH_RISCV;
+ images.os.arch = IH_ARCH_DEFAULT;
#elif CONFIG_ARM64
images.os.arch = IH_ARCH_ARM64;
#endif
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] riscv: Support riscv64 image type
2023-04-10 7:27 [PATCH] riscv: Support riscv64 image type Rick Chen
@ 2023-04-19 1:46 ` Simon Glass
2023-04-19 6:56 ` Rick Chen
0 siblings, 1 reply; 6+ messages in thread
From: Simon Glass @ 2023-04-19 1:46 UTC (permalink / raw)
To: Rick Chen; +Cc: u-boot, bmeng.cn, ycliang, rickchen36
Hi Rick,
On Mon, 10 Apr 2023 at 01:26, Rick Chen <rick@andestech.com> wrote:
>
> Allow U-Boot to load 32 or 64 bits RISC-V Kernel Image
> distinguishly. It helps to avoid someone maybe make a mistake
> to run 32-bit U-Boot to load 64-bit kernel.
>
> Signed-off-by: Rick Chen <rick@andestech.com>
>
> ---
> The patchset is based on Simon's patch:
> riscv: Add a 64-bit image type
> ---
> ---
> arch/riscv/include/asm/u-boot.h | 4 ++++
> cmd/booti.c | 2 +-
> 2 files changed, 5 insertions(+), 1 deletion(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
I don't know much about RISC-V, but I assume U-Boot is able to do this
successfully? Does it not need to switch modes first?
Regards,
Simon
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] riscv: Support riscv64 image type
2023-04-19 1:46 ` Simon Glass
@ 2023-04-19 6:56 ` Rick Chen
2023-07-26 21:33 ` Simon Glass
0 siblings, 1 reply; 6+ messages in thread
From: Rick Chen @ 2023-04-19 6:56 UTC (permalink / raw)
To: Simon Glass; +Cc: Rick Chen, u-boot, bmeng.cn, ycliang
Hi Simon,
> Hi Rick,
>
> On Mon, 10 Apr 2023 at 01:26, Rick Chen <rick@andestech.com> wrote:
> >
> > Allow U-Boot to load 32 or 64 bits RISC-V Kernel Image
> > distinguishly. It helps to avoid someone maybe make a mistake
> > to run 32-bit U-Boot to load 64-bit kernel.
> >
> > Signed-off-by: Rick Chen <rick@andestech.com>
> >
> > ---
> > The patchset is based on Simon's patch:
> > riscv: Add a 64-bit image type
> > ---
> > ---
> > arch/riscv/include/asm/u-boot.h | 4 ++++
> > cmd/booti.c | 2 +-
> > 2 files changed, 5 insertions(+), 1 deletion(-)
>
> Reviewed-by: Simon Glass <sjg@chromium.org>
>
> I don't know much about RISC-V, but I assume U-Boot is able to do this
> successfully? Does it not need to switch modes first?
No, it is not need to switch modes as far as I know.
Here only provide a check mechanism just like arm to see if loader and
OS are match
But This patch is for bootm flow.
Maybe I still need to check if it is necessary to prepare a patch for
binman flow ?
/arch/riscv/dts/binman.dtsi
arch = "riscv";
maybe provide another binman64.dtsi for arch="riscv64"
Thanks,
Rick
>
> Regards,
> Simon
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] riscv: Support riscv64 image type
2023-04-19 6:56 ` Rick Chen
@ 2023-07-26 21:33 ` Simon Glass
2023-07-27 1:27 ` Rick Chen
0 siblings, 1 reply; 6+ messages in thread
From: Simon Glass @ 2023-07-26 21:33 UTC (permalink / raw)
To: Rick Chen; +Cc: Rick Chen, u-boot, bmeng.cn, ycliang
Hi Rick,
On Wed, 19 Apr 2023 at 00:56, Rick Chen <rickchen36@gmail.com> wrote:
>
> Hi Simon,
>
> > Hi Rick,
> >
> > On Mon, 10 Apr 2023 at 01:26, Rick Chen <rick@andestech.com> wrote:
> > >
> > > Allow U-Boot to load 32 or 64 bits RISC-V Kernel Image
> > > distinguishly. It helps to avoid someone maybe make a mistake
> > > to run 32-bit U-Boot to load 64-bit kernel.
> > >
> > > Signed-off-by: Rick Chen <rick@andestech.com>
> > >
> > > ---
> > > The patchset is based on Simon's patch:
> > > riscv: Add a 64-bit image type
> > > ---
> > > ---
> > > arch/riscv/include/asm/u-boot.h | 4 ++++
> > > cmd/booti.c | 2 +-
> > > 2 files changed, 5 insertions(+), 1 deletion(-)
> >
> > Reviewed-by: Simon Glass <sjg@chromium.org>
> >
> > I don't know much about RISC-V, but I assume U-Boot is able to do this
> > successfully? Does it not need to switch modes first?
>
> No, it is not need to switch modes as far as I know.
> Here only provide a check mechanism just like arm to see if loader and
> OS are match
>
> But This patch is for bootm flow.
> Maybe I still need to check if it is necessary to prepare a patch for
> binman flow ?
> /arch/riscv/dts/binman.dtsi
> arch = "riscv";
>
> maybe provide another binman64.dtsi for arch="riscv64"
Yes I think that is needed too. Are you going to update this patch, or
send a second one?
Regards,
Simon
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] riscv: Support riscv64 image type
2023-07-26 21:33 ` Simon Glass
@ 2023-07-27 1:27 ` Rick Chen
2023-07-27 1:39 ` Leo Liang
0 siblings, 1 reply; 6+ messages in thread
From: Rick Chen @ 2023-07-27 1:27 UTC (permalink / raw)
To: Simon Glass; +Cc: Rick Chen, u-boot, bmeng.cn, ycliang
> Hi Rick,
>
> On Wed, 19 Apr 2023 at 00:56, Rick Chen <rickchen36@gmail.com> wrote:
> >
> > Hi Simon,
> >
> > > Hi Rick,
> > >
> > > On Mon, 10 Apr 2023 at 01:26, Rick Chen <rick@andestech.com> wrote:
> > > >
> > > > Allow U-Boot to load 32 or 64 bits RISC-V Kernel Image
> > > > distinguishly. It helps to avoid someone maybe make a mistake
> > > > to run 32-bit U-Boot to load 64-bit kernel.
> > > >
> > > > Signed-off-by: Rick Chen <rick@andestech.com>
> > > >
> > > > ---
> > > > The patchset is based on Simon's patch:
> > > > riscv: Add a 64-bit image type
> > > > ---
> > > > ---
> > > > arch/riscv/include/asm/u-boot.h | 4 ++++
> > > > cmd/booti.c | 2 +-
> > > > 2 files changed, 5 insertions(+), 1 deletion(-)
> > >
> > > Reviewed-by: Simon Glass <sjg@chromium.org>
> > >
> > > I don't know much about RISC-V, but I assume U-Boot is able to do this
> > > successfully? Does it not need to switch modes first?
> >
> > No, it is not need to switch modes as far as I know.
> > Here only provide a check mechanism just like arm to see if loader and
> > OS are match
> >
> > But This patch is for bootm flow.
> > Maybe I still need to check if it is necessary to prepare a patch for
> > binman flow ?
> > /arch/riscv/dts/binman.dtsi
> > arch = "riscv";
> >
> > maybe provide another binman64.dtsi for arch="riscv64"
>
> Yes I think that is needed too. Are you going to update this patch, or
> send a second one?
Hi Simon,
OK.
HI Leo,
I am a little busy on other things.Can you help to update this patch ?
Thanks.
Rick
>
> Regards,
> Simon
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] riscv: Support riscv64 image type
2023-07-27 1:27 ` Rick Chen
@ 2023-07-27 1:39 ` Leo Liang
0 siblings, 0 replies; 6+ messages in thread
From: Leo Liang @ 2023-07-27 1:39 UTC (permalink / raw)
To: Rick Chen; +Cc: Simon Glass, Rick Chen, u-boot, bmeng.cn
Hi Rick,
On Thu, Jul 27, 2023 at 09:27:31AM +0800, Rick Chen wrote:
> > Hi Rick,
> >
> > On Wed, 19 Apr 2023 at 00:56, Rick Chen <rickchen36@gmail.com> wrote:
> > >
> > > Hi Simon,
> > >
> > > > Hi Rick,
> > > >
> > > > On Mon, 10 Apr 2023 at 01:26, Rick Chen <rick@andestech.com> wrote:
> > > > >
> > > > > Allow U-Boot to load 32 or 64 bits RISC-V Kernel Image
> > > > > distinguishly. It helps to avoid someone maybe make a mistake
> > > > > to run 32-bit U-Boot to load 64-bit kernel.
> > > > >
> > > > > Signed-off-by: Rick Chen <rick@andestech.com>
> > > > >
> > > > > ---
> > > > > The patchset is based on Simon's patch:
> > > > > riscv: Add a 64-bit image type
> > > > > ---
> > > > > ---
> > > > > arch/riscv/include/asm/u-boot.h | 4 ++++
> > > > > cmd/booti.c | 2 +-
> > > > > 2 files changed, 5 insertions(+), 1 deletion(-)
> > > >
> > > > Reviewed-by: Simon Glass <sjg@chromium.org>
> > > >
> > > > I don't know much about RISC-V, but I assume U-Boot is able to do this
> > > > successfully? Does it not need to switch modes first?
> > >
> > > No, it is not need to switch modes as far as I know.
> > > Here only provide a check mechanism just like arm to see if loader and
> > > OS are match
> > >
> > > But This patch is for bootm flow.
> > > Maybe I still need to check if it is necessary to prepare a patch for
> > > binman flow ?
> > > /arch/riscv/dts/binman.dtsi
> > > arch = "riscv";
> > >
> > > maybe provide another binman64.dtsi for arch="riscv64"
> >
> > Yes I think that is needed too. Are you going to update this patch, or
> > send a second one?
>
> Hi Simon,
>
> OK.
>
> HI Leo,
>
> I am a little busy on other things.Can you help to update this patch ?
>
No problem!
I will send a v2 patch ASAP.
Best regards,
Leo
> Thanks.
> Rick
>
> >
> > Regards,
> > Simon
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-07-27 1:39 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-10 7:27 [PATCH] riscv: Support riscv64 image type Rick Chen
2023-04-19 1:46 ` Simon Glass
2023-04-19 6:56 ` Rick Chen
2023-07-26 21:33 ` Simon Glass
2023-07-27 1:27 ` Rick Chen
2023-07-27 1:39 ` Leo Liang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).