All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yao Zi <ziyao@disroot.org>
To: "牛 志宏" <Zone.Niuzh@hotmail.com>, "Tom Rini" <trini@konsulko.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Simon Glass <sjg@chromium.org>,
	"u-boot@lists.denx.de" <u-boot@lists.denx.de>,
	Leo Yu-Chi Liang <ycliang@andestech.com>,
	Rick Chen <rick@andestech.com>
Subject: Re: 回复: 回复: [PATCH] bootm: Pass SMP core ID and DTB address for ELF-formatted kernels
Date: Thu, 5 Jun 2025 14:29:52 +0000	[thread overview]
Message-ID: <aEGp4KEprzOSyOF8@pie.lan> (raw)
In-Reply-To: <ME0P300MB13099B02B4C316E4784D23529F6FA@ME0P300MB1309.AUSP300.PROD.OUTLOOK.COM>

On Thu, Jun 05, 2025 at 08:04:28AM +0000, 牛 志宏 wrote:
> Yes, this is a new OS currently being developed with plans to support Linux compatibility.
> Registers a0 and a1 pass the boot core ID and DTB address respectively, following a de facto standard shared by both the SBI (RISC-V Supervisor Binary Interface) specification and the Linux implementation.
> My rationale is: if U-Boot supports the combination of kernel + ELF loading, why shouldn't we implement this capability as well?

Do you mean passing arguments according to the convention of Linux even
when booting ELF stuff?

TBH, it should be easy to turn your ELF into an Linux-style Image...

> 
> ________________________________
> 发件人: Tom Rini
> 已发送: 2025 年 5 月 29 日 星期四 23:49
> 收件人: 牛 志宏
> 抄送: Heinrich Schuchardt; Simon Glass; u-boot@lists.denx.de; Leo Yu-Chi Liang; Rick Chen
> 主题: Re: 回复: [PATCH] bootm: Pass SMP core ID and DTB address for ELF-formatted kernels
> 
> On Thu, May 29, 2025 at 09:33:56AM +0000, 牛 志宏 wrote:
> > hi team,
> >
> > The ITS file looks something like the following, and the kernel is not a standard Linux kernel:
> > ```
> > /dts-v1/;
> >
> > / {
> >     ...
> >     images {
> >         kernel {
> >             type = "kernel";
> >             arch = "riscv";
> >             os = "elf";
> >             ...
> >         };
> >
> >         fdt {
> >             type = "flat_dt";
> >             arch = "riscv";
> >             ...
> >         };
> >     };
> >     ...
> > };
> > ```
> >
> > To handle this scenario, we need to:
> >
> >   1.
> > Access the values of the `type`, os, and arch fields stored in bootm_headers->image_info to determine the current context.
> >   2.
> > Access the boot_hart and ft_addr stored in the gd variable to update argc and argv.
> >
> > Not sure whether accessing the bootm_headers and gd variables in lib/elf.c is allowed or safe.
> So this is why I was asking if there's some more generalized
> specification we can reference. Is the OS you're using something
> pre-existing and so we need to do what it already expect from some other
> loader? Or is it something you're also creating and if so, why not
> follow the linux kernel convention for compatibility?
> 
> --
> Tom

Regards,
Yao Zi

  parent reply	other threads:[~2025-06-05 14:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-13  9:50 [PATCH] bootm: Pass SMP core ID and DTB address for ELF-formatted kernels 牛 志宏
2025-05-23 16:41 ` Simon Glass
2025-05-23 17:04   ` Heinrich Schuchardt
2025-05-23 22:29     ` Tom Rini
2025-05-24  4:29       ` Heinrich Schuchardt
2025-05-29  9:33         ` 回复: " 牛 志宏
2025-05-29 15:49           ` Tom Rini
     [not found]             ` <ME0P300MB13099B02B4C316E4784D23529F6FA@ME0P300MB1309.AUSP300.PROD.OUTLOOK.COM>
2025-06-05 14:29               ` Yao Zi [this message]
2025-06-05 14:47               ` 回复: " Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aEGp4KEprzOSyOF8@pie.lan \
    --to=ziyao@disroot.org \
    --cc=Zone.Niuzh@hotmail.com \
    --cc=rick@andestech.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    --cc=ycliang@andestech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.