All of lore.kernel.org
 help / color / mirror / Atom feed
From: Song Gao <gaosong@loongson.cn>
To: qemu-devel@nongnu.org, maobibo@loongson.cn
Cc: richard.henderson@linaro.org, peter.maydell@linaro.org,
	philmd@linaro.org, zltjiangshi@gmail.com
Subject: [PATCH v7 00/17] Add boot LoongArch elf kernel with FDT
Date: Fri, 26 Apr 2024 17:15:34 +0800	[thread overview]
Message-ID: <20240426091551.2397867-1-gaosong@loongson.cn> (raw)

Hi, All

We already support boot efi kernel with bios, but not support boot elf kernel.
This series adds boot elf kernel with FDT.

'LoongArch supports ACPI and FDT. The information that needs to be passed
 to the kernel includes the memmap, the initrd, the command line, optionally
 the ACPI/FDT tables, and so on'  see [1].

Patch 2-8 : Create efi system table, and three efi configuration table
            boot_memmap, initd, FDT.
Patch 9-17 : Fixes FDT problems.

Test:
  - Start kernel
    See [2] start_kernel.sh
  - Start qcow2
    See [2] start_qcow2.sh

Patch 3 and Patch 6 need to be reviewed.

Thanks.
Song Gao

V7:
  - Rebase and R-b;
  - Patch3, replace reg_num with reg_name.
    move slave boot code buf to pflash0;
  - Patch5: replace __aligned(8) with QEMU_ALIGNED(8);
  - Patch8: Use the macro FDT_BASE to indicate the fdt base size.

V6:
  - Fixes test/compilation failures; 

V5:
  - Rebase;

V4:
  - patch 3 change slave_boot_code[] to const, and 'static void *p ' to
    'void *p';
  - patch 4 fixes build error;
  - patch 10-13, add project and commit link.

V3:
  - Load initrd at  kernel_high + 4 * kernel_size;
  - Load 'boot_rom' at [0 - 1M], the 'boot_rom' includes
    slave_boot_code, cmdline_buf and systab_tables;
  - R-b and rebase.

V2:
  - FDT pcie node adds cells 'msi-map';


[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/arch/loongarch/booting.rst?h=v6.7-rc4

[2]: https://github.com/gaosong-loongson/loongarch-binary/releases

Song Gao (17):
  hw/loongarch: Move boot functions to boot.c
  hw/loongarch: Add load initrd
  hw/loongarch: Add slave cpu boot_code
  hw/loongarch: Add init_cmdline
  hw/loongarch: Init efi_system_table
  hw/loongarch: Init efi_boot_memmap table
  hw/loongarch: Init efi_initrd table
  hw/loongarch: Init efi_fdt table
  hw/loongarch: Fix fdt memory node wrong 'reg'
  hw/loongarch: fdt adds cpu interrupt controller node
  hw/loongarch: fdt adds Extend I/O Interrupt Controller
  hw/loongarch: fdt adds pch_pic Controller
  hw/loongarch: fdt adds pch_msi Controller
  hw/loongarch: fdt adds pcie irq_map node
  hw/loongarch: fdt remove unused irqchip node
  hw/loongarch: Add cells missing from uart node
  hw/loongarch: Add cells missing from rtc node

 include/hw/intc/loongarch_extioi.h |   1 +
 include/hw/loongarch/boot.h        | 109 +++++++++
 include/hw/loongarch/virt.h        |  14 ++
 include/hw/pci-host/ls7a.h         |   2 +
 target/loongarch/cpu.h             |   2 +
 hw/loongarch/boot.c                | 337 ++++++++++++++++++++++++++
 hw/loongarch/virt.c                | 363 ++++++++++++++++-------------
 hw/loongarch/meson.build           |   1 +
 8 files changed, 669 insertions(+), 160 deletions(-)
 create mode 100644 include/hw/loongarch/boot.h
 create mode 100644 hw/loongarch/boot.c

-- 
2.25.1



             reply	other threads:[~2024-04-26  9:34 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26  9:15 Song Gao [this message]
2024-04-26  9:15 ` [PATCH v7 01/17] hw/loongarch: Move boot functions to boot.c Song Gao
2024-04-26  9:15 ` [PATCH v7 02/17] hw/loongarch: Add load initrd Song Gao
2024-04-26  9:15 ` [PATCH v7 03/17] hw/loongarch: Add slave cpu boot_code Song Gao
2024-04-28  1:15   ` maobibo
2024-04-28  7:15     ` gaosong
2024-04-26  9:15 ` [PATCH v7 04/17] hw/loongarch: Add init_cmdline Song Gao
2024-04-26  9:15 ` [PATCH v7 05/17] hw/loongarch: Init efi_system_table Song Gao
2024-04-26  9:15 ` [PATCH v7 06/17] hw/loongarch: Init efi_boot_memmap table Song Gao
2024-04-28  1:34   ` maobibo
2024-04-28  7:19     ` gaosong
2024-04-26  9:15 ` [PATCH v7 07/17] hw/loongarch: Init efi_initrd table Song Gao
2024-04-26  9:15 ` [PATCH v7 08/17] hw/loongarch: Init efi_fdt table Song Gao
2024-04-26  9:15 ` [PATCH v7 09/17] hw/loongarch: Fix fdt memory node wrong 'reg' Song Gao
2024-04-26  9:15 ` [PATCH v7 10/17] hw/loongarch: fdt adds cpu interrupt controller node Song Gao
2024-04-26  9:15 ` [PATCH v7 11/17] hw/loongarch: fdt adds Extend I/O Interrupt Controller Song Gao
2024-04-26  9:15 ` [PATCH v7 12/17] hw/loongarch: fdt adds pch_pic Controller Song Gao
2024-04-26  9:15 ` [PATCH v7 13/17] hw/loongarch: fdt adds pch_msi Controller Song Gao
2024-04-26  9:15 ` [PATCH v7 14/17] hw/loongarch: fdt adds pcie irq_map node Song Gao
2024-04-26  9:15 ` [PATCH v7 15/17] hw/loongarch: fdt remove unused irqchip node Song Gao
2024-04-26  9:15 ` [PATCH v7 16/17] hw/loongarch: Add cells missing from uart node Song Gao
2024-04-26  9:15 ` [PATCH v7 17/17] hw/loongarch: Add cells missing from rtc node Song Gao

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=20240426091551.2397867-1-gaosong@loongson.cn \
    --to=gaosong@loongson.cn \
    --cc=maobibo@loongson.cn \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=zltjiangshi@gmail.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.