U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yao Zi <me@ziyao.cc>
To: Simon Glass <sjg@chromium.org>, me@ziyao.cc
Cc: Tom Rini <trini@konsulko.com>,
	Jiaxun Yang <jiaxun.yang@flygoat.com>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	u-boot@lists.u-boot-project.org
Subject: Re: [PATCH v6 10/20] LoongArch: Boot Image bits
Date: Wed, 4 Nov 2026 04:45:38 +0000	[thread overview]
Message-ID: <auq4coFjtPBivwdl@pie> (raw)
In-Reply-To: <CAFLszTgZyC1yDgCtH_VzCS0ZvEG3kw81fx_xns8L=6w7m9OEaw@mail.gmail.com>

On Sat, Oct 31, 2026 at 01:43:27AM -0700, Simon Glass wrote:
> Hi Jiaxun,
> 
> On 2026-10-29T05:07:18+11:00, Yao Zi <me@ziyao.cc> wrote:
> > LoongArch: Boot Image bits
> >
> > Implement loading and booting functions for LoongArch
> > standard kernel image as per spec.
> >
> > LoongArch kernel do expect us to fake a efi systemtable
> > for passing fdt to kernel, we don't need to implement any
> > EFI functions for kernel because it won't look into anything
> > beside devicetree from that table if we tell kernel we are
> > not efi compatible by setting a0 boot argument to zero.
> >
> > Link: https://docs.kernel.org/arch/loongarch/booting.html
> > Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> > Signed-off-by: Yao Zi <me@ziyao.cc>
> >
> >  arch/loongarch/lib/Makefile |   2 +
> >  arch/loongarch/lib/bootm.c  | 129 ++++++++++++++++++++++++++++++++++++++++++++
> >  arch/loongarch/lib/image.c  |  77 ++++++++++++++++++++++++++
> >  boot/Kconfig                |   1 +
> >  cmd/Kconfig                 |   2 +-
> >  5 files changed, 210 insertions(+), 1 deletion(-)
> 
> > diff --git a/arch/loongarch/lib/bootm.c b/arch/loongarch/lib/bootm.c
> > @@ -0,0 +1,129 @@
> > +	systab->hdr.crc32 = crc32(0, (const unsigned char *)systab,
> > +				  systab->hdr.headersize);
> > +
> > +	cfgtab[0].guid = efi_guid_fdt;
> > +	cfgtab[0].table = images->ft_addr;
> > +
> > +	gd->bd->bi_boot_params = (ulong)systab;
> 
> The CRC is still calculated before cfgtab[0] is filled in, so please
> move it after that.

Oops, I'm totally confused by UEFI specification, where hdr.headersize
is the size of the full table, instead of only the header's size :(

I'll fix it up.

> Also please use map_to_sysmem(systab) for
> bi_boot_params rather than a plain cast.

The problem is that bi_boot_params is ulong, not a pointer, I don't
think it improves anything here?

> > diff --git a/arch/loongarch/lib/image.c b/arch/loongarch/lib/image.c
> > @@ -0,0 +1,77 @@
> > +	uint32_t	code0;			/* Executable code */
> > +	uint32_t	code1;			/* Executable code */
> > +	uint64_t	kernel_entry;		/* Kernel entry point */
> 
> Please can you use u32/u64 for these members?

Sure.

> In any case:
> Reviewed-by: Simon Glass <sjg@chromium.org>
> 
> Regards,
> Simon

Best regards,
Yao Zi

  reply	other threads:[~2026-11-04  4:45 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-29  5:07 [PATCH v6 00/20] LoongArch initial support Yao Zi
2026-10-29  5:07 ` [PATCH v6 01/20] lib: fdtdec: Handle multiple memory nodes Yao Zi
2026-10-31  8:43   ` Simon Glass
2026-10-29  5:07 ` [PATCH v6 02/20] linux/io.h: Use map_physmem to implement ioremap Yao Zi
2026-10-29  5:07 ` [PATCH v6 03/20] image: Take entry point as an output of booti_setup Yao Zi
2026-10-31  8:43   ` Simon Glass
2026-10-29  5:07 ` [PATCH v6 04/20] elf: Define LoongArch bits Yao Zi
2026-10-29  5:07 ` [PATCH v6 05/20] image: Define IH_ARCH_LOONGARCH Yao Zi
2026-10-29  5:07 ` [PATCH v6 06/20] LoongArch: skeleton and headers Yao Zi
2026-10-31  8:42   ` Simon Glass
2026-11-04  4:34     ` Yao Zi
2026-10-29  5:07 ` [PATCH v6 07/20] LoongArch: lib: General routines Yao Zi
2026-10-31  8:43   ` Simon Glass
2026-11-04  4:35     ` Yao Zi
2026-10-29  5:07 ` [PATCH v6 08/20] LoongArch: CPU assembly routines Yao Zi
2026-10-31  8:43   ` Simon Glass
2026-10-29  5:07 ` [PATCH v6 09/20] LoongArch: Exception handling Yao Zi
2026-10-31  8:43   ` Simon Glass
2026-11-04  4:38     ` Yao Zi
2026-10-29  5:07 ` [PATCH v6 10/20] LoongArch: Boot Image bits Yao Zi
2026-10-31  8:43   ` Simon Glass
2026-11-04  4:45     ` Yao Zi [this message]
2026-11-07 19:03       ` Yao Zi
2026-10-29  5:07 ` [PATCH v6 11/20] LoongArch: Generic platform type Yao Zi
2026-10-29  5:07 ` [PATCH v6 12/20] board_f: Add LoongArch path of mon_len calculation Yao Zi
2026-10-29  5:07 ` [PATCH v6 13/20] cpu: Add loongarch_cpu driver Yao Zi
2026-10-29  5:07 ` [PATCH v6 14/20] timer: Add loongarch_timer driver Yao Zi
2026-10-29  5:07 ` [PATCH v6 15/20] board: emulation: Add qemu-loongarch Yao Zi
2026-10-29  5:07 ` [PATCH v6 16/20] efi: LoongArch: Define LoongArch bits everywhere Yao Zi
2026-10-29  5:07 ` [PATCH v6 17/20] efi: LoongArch: Implement everything Yao Zi
2026-10-29  5:07 ` [PATCH v6 18/20] doc: arch: Add documentation for LoongArch Yao Zi
2026-10-29  5:07 ` [PATCH v6 19/20] MAINTAINERS: Add entry " Yao Zi
2026-10-29  5:07 ` [PATCH v6 20/20] CI: Wire up qemu-loongarch64 Yao Zi

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=auq4coFjtPBivwdl@pie \
    --to=me@ziyao.cc \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jiaxun.yang@flygoat.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.u-boot-project.org \
    --cc=xypron.glpk@gmx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox