U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Yao Zi <me@ziyao.cc>
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	u-boot@lists.denx.de
Subject: Re: [PATCH v2 10/16] LoongArch: Boot Image bits
Date: Wed, 1 Jul 2026 11:53:28 -0600	[thread overview]
Message-ID: <20260701175328.GQ749385@bill-the-cat> (raw)
In-Reply-To: <20260701111808.870705-11-me@ziyao.cc>

[-- Attachment #1: Type: text/plain, Size: 2415 bytes --]

On Wed, Jul 01, 2026 at 11:18:02AM +0000, Yao Zi wrote:

> From: Jiaxun Yang <jiaxun.yang@flygoat.com>
> 
> 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>
> ---
> 
> Changed from v1
> - Remove now unused arch_lmb_reserve()
> 
>  arch/loongarch/lib/Makefile |   2 +
>  arch/loongarch/lib/bootm.c  | 163 ++++++++++++++++++++++++++++++++++++
>  arch/loongarch/lib/image.c  |  66 +++++++++++++++
>  cmd/Kconfig                 |   2 +-
>  4 files changed, 232 insertions(+), 1 deletion(-)
>  create mode 100644 arch/loongarch/lib/bootm.c
>  create mode 100644 arch/loongarch/lib/image.c
> 
> diff --git a/arch/loongarch/lib/Makefile b/arch/loongarch/lib/Makefile
> index 3c17b9cd85af..e65e66357a9b 100644
> --- a/arch/loongarch/lib/Makefile
> +++ b/arch/loongarch/lib/Makefile
> @@ -3,6 +3,8 @@
>  # Copyright (C) 2024 Jiaxun yang <jiaxun.yang@flygoat.com>
>  #
>  
> +obj-$(CONFIG_CMD_BOOTM) += bootm.o
> +obj-$(CONFIG_CMD_BOOTI) += bootm.o image.o

We have LIB_BOOT[MI] symbols now, which should be used here instead.

[snip]
> +/**
> + * announce_and_cleanup() - Print message and prepare for kernel boot
> + *
> + * @fake: non-zero to do everything except actually boot
> + */
> +static void announce_and_cleanup(int fake)
> +{
> +	printf("\nStarting kernel ...%s\n\n", fake ?
> +		"(fake run for tracing)" : "");
> +	bootstage_mark_name(BOOTSTAGE_ID_BOOTM_HANDOFF, "start_kernel");
> +#if CONFIG_IS_ENABLED(BOOTSTAGE_FDT)
> +	bootstage_fdt_add_report();
> +#endif
> +#if CONFIG_IS_ENABLED(BOOTSTAGE_REPORT)
> +	bootstage_report();
> +#endif
> +
> +#if CONFIG_IS_ENABLED(USB_DEVICE)
> +	udc_disconnect();
> +#endif

We don't have USB_DEVICE anymore, so I think you should look at the git
changes to arm and riscv for example to these functions, since the
loongarch port was done, to catch up on current best practices here.
Thanks.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2026-07-01 17:53 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-01 11:17 [PATCH v2 00/16] LoongArch initial support Yao Zi
2026-07-01 11:17 ` [PATCH v2 01/16] lib: fdtdec: Handle multiple memory nodes Yao Zi
2026-07-02 10:22   ` Simon Glass
2026-07-02 20:39     ` Yao Zi
2026-07-01 11:17 ` [PATCH v2 02/16] linux/io.h: Use map_physmem to implement ioremap Yao Zi
2026-07-02 10:21   ` Simon Glass
2026-07-01 11:17 ` [PATCH v2 03/16] image: Take entry point as an output of setup_booti Yao Zi
2026-07-01 17:39   ` Tom Rini
2026-07-02 20:39     ` Yao Zi
2026-07-02 20:55       ` Tom Rini
2026-07-02 21:10         ` Yao Zi
2026-07-02  9:46   ` Simon Glass
2026-07-01 11:17 ` [PATCH v2 04/16] elf: Define LoongArch bits Yao Zi
2026-07-02 10:24   ` Simon Glass
2026-07-01 11:17 ` [PATCH v2 05/16] image: Define IH_ARCH_LOONGARCH Yao Zi
2026-07-02  9:44   ` Simon Glass
2026-07-01 11:17 ` [PATCH v2 06/16] LoongArch: skeleton and headers Yao Zi
2026-07-01 17:47   ` Tom Rini
2026-07-02 20:40     ` Yao Zi
2026-07-02 20:57       ` Tom Rini
2026-07-02 10:28   ` Simon Glass
2026-07-02 21:22     ` Yao Zi
2026-07-01 11:17 ` [PATCH v2 07/16] LoongArch: lib: General routines Yao Zi
2026-07-01 17:49   ` Tom Rini
2026-07-02  9:24     ` Jiaxun Yang
2026-07-02 10:54       ` Simon Glass
2026-07-02 14:07       ` Tom Rini
2026-07-02 20:56         ` Yao Zi
2026-07-02 20:58           ` Tom Rini
2026-07-02 10:28   ` Simon Glass
2026-07-02 21:46     ` Yao Zi
2026-07-01 11:18 ` [PATCH v2 08/16] LoongArch: CPU assembly routines Yao Zi
2026-07-02 10:25   ` Simon Glass
2026-07-03 20:12     ` Yao Zi
2026-07-04 11:22       ` Jiaxun Yang
2026-07-01 11:18 ` [PATCH v2 09/16] LoongArch: Exception handling Yao Zi
2026-07-02 10:25   ` Simon Glass
2026-07-01 11:18 ` [PATCH v2 10/16] LoongArch: Boot Image bits Yao Zi
2026-07-01 17:53   ` Tom Rini [this message]
2026-07-02 10:26   ` Simon Glass
2026-07-01 11:18 ` [PATCH v2 11/16] LoongArch: Generic CPU type Yao Zi
2026-07-01 17:55   ` Tom Rini
2026-07-02 10:26   ` Simon Glass
2026-07-01 11:18 ` [PATCH v2 12/16] cpu: Add loongarch_cpu driver Yao Zi
2026-07-02 10:26   ` Simon Glass
2026-07-01 11:18 ` [PATCH v2 13/16] timer: Add loongarch_timer driver Yao Zi
2026-07-02 10:27   ` Simon Glass
2026-07-01 11:18 ` [PATCH v2 14/16] board: emulation: Add qemu-loongarch Yao Zi
2026-07-02 10:27   ` Simon Glass
2026-07-01 11:18 ` [PATCH v2 15/16] efi: LoongArch: Define LoongArch bits everywhere Yao Zi
2026-07-02 10:27   ` Simon Glass
2026-07-01 11:18 ` [PATCH v2 16/16] efi: LoongArch: Implement everything Yao Zi
2026-07-02 10:29   ` Simon Glass
2026-07-01 15:53 ` [PATCH v2 00/16] LoongArch initial support Jiaxun Yang
2026-07-01 17:59 ` Tom Rini
2026-07-02 10:31 ` [v2,00/16] " Simon Glass

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=20260701175328.GQ749385@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jiaxun.yang@flygoat.com \
    --cc=me@ziyao.cc \
    --cc=u-boot@lists.denx.de \
    --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