2018-08-02 18:04:20 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Peter Jones <pjones@redhat.com>
|
2019-08-15 06:01:31 +00:00
|
|
|
Date: Thu, 11 Jul 2019 13:01:41 +0200
|
2018-08-02 18:04:20 +00:00
|
|
|
Subject: [PATCH] Rework how the fdt command builds.
|
|
|
|
|
|
|
|
Trying to avoid all variants of:
|
|
|
|
cat syminfo.lst | sort | gawk -f ../../grub-core/genmoddep.awk > moddep.lst || (rm -f moddep.lst; exit 1)
|
|
|
|
grub_fdt_install in linux is not defined
|
|
|
|
grub_fdt_load in linux is not defined
|
|
|
|
grub_fdt_unload in linux is not defined
|
|
|
|
grub_fdt_install in xen_boot is not defined
|
|
|
|
grub_fdt_load in xen_boot is not defined
|
|
|
|
grub_fdt_unload in xen_boot is not defined
|
|
|
|
|
|
|
|
Signed-off-by: Peter Jones <pjones@redhat.com>
|
2022-01-17 23:06:55 +00:00
|
|
|
[javierm: Fix build with platform emu, aarch64, and risc-v]
|
|
|
|
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
|
|
|
|
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
|
2018-08-02 18:04:20 +00:00
|
|
|
---
|
2024-07-10 18:20:32 +00:00
|
|
|
grub-core/Makefile.core.def | 4 ++--
|
2018-08-02 18:04:20 +00:00
|
|
|
grub-core/lib/fdt.c | 2 --
|
|
|
|
grub-core/loader/efi/fdt.c | 2 ++
|
2022-01-17 23:06:55 +00:00
|
|
|
include/grub/fdt.h | 6 ++++++
|
2018-08-02 18:04:20 +00:00
|
|
|
grub-core/Makefile.am | 1 +
|
2024-07-10 18:20:32 +00:00
|
|
|
5 files changed, 11 insertions(+), 4 deletions(-)
|
2018-08-02 18:04:20 +00:00
|
|
|
|
|
|
|
diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def
|
2024-07-10 18:20:32 +00:00
|
|
|
index 56eb6a828e8..4629c179e40 100644
|
2018-08-02 18:04:20 +00:00
|
|
|
--- a/grub-core/Makefile.core.def
|
|
|
|
+++ b/grub-core/Makefile.core.def
|
2024-07-10 18:20:32 +00:00
|
|
|
@@ -188,7 +188,6 @@ kernel = {
|
2018-08-02 18:04:20 +00:00
|
|
|
arm_coreboot = kern/arm/coreboot/init.c;
|
|
|
|
arm_coreboot = kern/arm/coreboot/timer.c;
|
|
|
|
arm_coreboot = kern/arm/coreboot/coreboot.S;
|
|
|
|
- arm_coreboot = lib/fdt.c;
|
|
|
|
arm_coreboot = bus/fdt.c;
|
|
|
|
arm_coreboot = term/ps2.c;
|
|
|
|
arm_coreboot = term/arm/pl050.c;
|
2024-07-10 18:20:32 +00:00
|
|
|
@@ -370,6 +369,8 @@ kernel = {
|
2019-08-15 06:01:31 +00:00
|
|
|
riscv64 = kern/riscv/cache_flush.S;
|
|
|
|
riscv64 = kern/riscv/dl.c;
|
2018-08-02 18:04:20 +00:00
|
|
|
|
|
|
|
+ fdt = lib/fdt.c;
|
|
|
|
+
|
|
|
|
emu = disk/host.c;
|
|
|
|
emu = kern/emu/cache_s.S;
|
|
|
|
emu = kern/emu/hostdisk.c;
|
2024-07-10 18:20:32 +00:00
|
|
|
@@ -1882,7 +1883,6 @@ module = {
|
2018-08-02 18:04:20 +00:00
|
|
|
module = {
|
|
|
|
name = fdt;
|
|
|
|
efi = loader/efi/fdt.c;
|
|
|
|
- common = lib/fdt.c;
|
|
|
|
enable = fdt;
|
|
|
|
};
|
|
|
|
|
|
|
|
diff --git a/grub-core/lib/fdt.c b/grub-core/lib/fdt.c
|
2024-07-10 18:20:32 +00:00
|
|
|
index 73cfa94a2df..fbf749e1d61 100644
|
2018-08-02 18:04:20 +00:00
|
|
|
--- a/grub-core/lib/fdt.c
|
|
|
|
+++ b/grub-core/lib/fdt.c
|
|
|
|
@@ -21,8 +21,6 @@
|
|
|
|
#include <grub/mm.h>
|
|
|
|
#include <grub/dl.h>
|
|
|
|
|
|
|
|
-GRUB_MOD_LICENSE ("GPLv3+");
|
|
|
|
-
|
|
|
|
#define FDT_SUPPORTED_VERSION 17
|
|
|
|
|
|
|
|
#define FDT_BEGIN_NODE 0x00000001
|
|
|
|
diff --git a/grub-core/loader/efi/fdt.c b/grub-core/loader/efi/fdt.c
|
2024-07-10 18:20:32 +00:00
|
|
|
index 439964b9ca6..e08d8738afc 100644
|
2018-08-02 18:04:20 +00:00
|
|
|
--- a/grub-core/loader/efi/fdt.c
|
|
|
|
+++ b/grub-core/loader/efi/fdt.c
|
2021-03-12 21:54:28 +00:00
|
|
|
@@ -27,6 +27,8 @@
|
2018-08-02 18:04:20 +00:00
|
|
|
#include <grub/efi/memory.h>
|
2021-03-12 21:54:28 +00:00
|
|
|
#include <grub/cpu/efi/memory.h>
|
2018-08-02 18:04:20 +00:00
|
|
|
|
|
|
|
+GRUB_MOD_LICENSE ("GPLv3+");
|
|
|
|
+
|
|
|
|
static void *loaded_fdt;
|
|
|
|
static void *fdt;
|
|
|
|
|
2018-08-02 18:54:16 +00:00
|
|
|
diff --git a/include/grub/fdt.h b/include/grub/fdt.h
|
2024-07-10 18:20:32 +00:00
|
|
|
index e609c7e4111..3514aa4a5b6 100644
|
2018-08-02 18:54:16 +00:00
|
|
|
--- a/include/grub/fdt.h
|
|
|
|
+++ b/include/grub/fdt.h
|
2022-01-17 23:06:55 +00:00
|
|
|
@@ -19,6 +19,9 @@
|
2018-08-02 18:54:16 +00:00
|
|
|
#ifndef GRUB_FDT_HEADER
|
|
|
|
#define GRUB_FDT_HEADER 1
|
|
|
|
|
2022-01-17 23:06:55 +00:00
|
|
|
+#if !defined(GRUB_MACHINE_EMU) && \
|
|
|
|
+ (defined(__arm__) || defined(__aarch64__) || defined(__riscv))
|
2018-08-02 18:54:16 +00:00
|
|
|
+
|
|
|
|
#include <grub/types.h>
|
|
|
|
#include <grub/symbol.h>
|
|
|
|
|
2022-01-17 23:06:55 +00:00
|
|
|
@@ -144,4 +147,7 @@ int EXPORT_FUNC(grub_fdt_set_prop) (void *fdt, unsigned int nodeoffset, const ch
|
2018-08-02 18:54:16 +00:00
|
|
|
grub_fdt_set_prop ((fdt), (nodeoffset), "reg", reg_64, 16); \
|
|
|
|
})
|
|
|
|
|
2022-01-17 23:06:55 +00:00
|
|
|
+#endif /* !defined(GRUB_MACHINE_EMU) && \
|
|
|
|
+ (defined(__arm__) || defined(__aarch64__) || defined(__riscv)) */
|
2018-08-02 18:54:16 +00:00
|
|
|
+
|
|
|
|
#endif /* ! GRUB_FDT_HEADER */
|
2018-08-02 18:04:20 +00:00
|
|
|
diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am
|
2024-07-10 18:20:32 +00:00
|
|
|
index b7192a3da82..7953ba95399 100644
|
2018-08-02 18:04:20 +00:00
|
|
|
--- a/grub-core/Makefile.am
|
|
|
|
+++ b/grub-core/Makefile.am
|
|
|
|
@@ -76,6 +76,7 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/sb.h
|
|
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/env.h
|
|
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/env_private.h
|
|
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/err.h
|
|
|
|
+KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/fdt.h
|
|
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/file.h
|
|
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/fs.h
|
|
|
|
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i18n.h
|