[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 08/17] hw/loongarch: Init efi_fdt table
From: |
Song Gao |
Subject: |
[PATCH v1 08/17] hw/loongarch: Init efi_fdt table |
Date: |
Fri, 8 Dec 2023 17:00:33 +0800 |
Signed-off-by: Song Gao <gaosong@loongson.cn>
---
hw/loongarch/boot.c | 11 +++++++++++
include/hw/loongarch/boot.h | 4 ++++
2 files changed, 15 insertions(+)
diff --git a/hw/loongarch/boot.c b/hw/loongarch/boot.c
index 991df2cc14..f2e13ad7e3 100644
--- a/hw/loongarch/boot.c
+++ b/hw/loongarch/boot.c
@@ -142,6 +142,16 @@ static void init_efi_initrd_table(struct efi_system_table
*systab)
g_free(initrd_table);
}
+static void init_efi_fdt_table(struct efi_system_table *systab)
+{
+ efi_guid_t tbl_guid = DEVICE_TREE_GUID;
+
+ /* efi_configuration_table 3 */
+ guidcpy(&systab->tables[2].guid, &tbl_guid);
+ systab->tables[2].table = (void *)0x100000; /* fdt_base 1MiB */
+ systab->nr_tables = 3;
+}
+
static void init_systab(struct loongarch_boot_info *info)
{
struct efi_system_table *systab;
@@ -160,6 +170,7 @@ static void init_systab(struct loongarch_boot_info *info)
init_efi_boot_memmap(systab);
init_efi_initrd_table(systab);
+ init_efi_fdt_table(systab);
rom_add_blob_fixed("tables_rom", efi_tables,
loader_rommap[EFI_TABLES].size,
diff --git a/include/hw/loongarch/boot.h b/include/hw/loongarch/boot.h
index e482b829f7..ce1cd51c01 100644
--- a/include/hw/loongarch/boot.h
+++ b/include/hw/loongarch/boot.h
@@ -36,6 +36,10 @@ typedef struct {
EFI_GUID(0x5568e427, 0x68fc, 0x4f3d, 0xac, 0x74, \
0xca, 0x55, 0x52, 0x31, 0xcc, 0x68)
+#define DEVICE_TREE_GUID \
+ EFI_GUID(0xb1b621d5, 0xf19c, 0x41a5, 0x83, 0x0b, \
+ 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0)
+
struct efi_config_table {
efi_guid_t guid;
uint64_t *ptr;
--
2.25.1
- [PATCH v1 00/17] Add boot LoongArch elf kernel with FDT, Song Gao, 2023/12/08
- [PATCH v1 02/17] hw/loongarch: Add load initrd, Song Gao, 2023/12/08
- [PATCH v1 05/17] hw/loongarch: Init efi_system_table, Song Gao, 2023/12/08
- [PATCH v1 01/17] hw/loongarch: Move boot fucntions to boot.c, Song Gao, 2023/12/08
- [PATCH v1 08/17] hw/loongarch: Init efi_fdt table,
Song Gao <=
- [PATCH v1 04/17] hw/loongarch: Add slave cpu boot_code, Song Gao, 2023/12/08
- [PATCH v1 07/17] hw/loongarch: Init efi_initrd table, Song Gao, 2023/12/08
- [PATCH v1 03/17] hw/loongarch: Add init_cmdline, Song Gao, 2023/12/08
- [PATCH v1 06/17] hw/loongarch: Init efi_boot_memmap table, Song Gao, 2023/12/08
- [PATCH v1 10/17] hw/loongarch: fdt adds cpu interrupt controller node, Song Gao, 2023/12/08
- [PATCH v1 12/17] hw/loongarch: fdt adds pch_pic Controller, Song Gao, 2023/12/08
- [PATCH v1 13/17] hw/loongarch: fdt adds pch_msi Controller, Song Gao, 2023/12/08
- [PATCH v1 17/17] hw/loongarch: Add cells missing from rtc node, Song Gao, 2023/12/08
- [PATCH v1 14/17] hw/loongarch: fdt adds pcie irq_map node, Song Gao, 2023/12/08
- [PATCH v1 15/17] hw/loongarch: fdt remove unused irqchip node, Song Gao, 2023/12/08