All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shawn Anastasio <sanastasio@raptorengineering.com>
To: xen-devel@lists.xenproject.org
Cc: Timothy Pearson <tpearson@raptorengineering.com>,
	Jan Beulich <jbeulich@suse.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>,
	Julien Grall <julien@xen.org>
Subject: [PATCH v2 3/7] xen/common: Move Arm's bootfdt to common
Date: Thu, 14 Dec 2023 20:43:58 -0600	[thread overview]
Message-ID: <b26a07209b54cd036e42a8b00f036201821eb775.1702607884.git.sanastasio@raptorengineering.com> (raw)
In-Reply-To: <cover.1702607884.git.sanastasio@raptorengineering.com>

Move Arm's bootfdt.c to xen/common so that it can be used by other
device tree architectures like PPC and RISCV. Only a minor change to
conditionalize a call to a function only available on EFI-supporting
targets was made to the code itself.

Suggested-by: Julien Grall <julien@xen.org>
Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/arch/arm/Makefile                          |  1 -
 xen/common/Makefile                            |  1 +
 xen/common/device-tree/Makefile                |  1 +
 xen/{arch/arm => common/device-tree}/bootfdt.c | 15 +++++++++------
 4 files changed, 11 insertions(+), 7 deletions(-)
 create mode 100644 xen/common/device-tree/Makefile
 rename xen/{arch/arm => common/device-tree}/bootfdt.c (98%)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 33c677672f..64fdf84170 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -10,7 +10,6 @@ obj-$(CONFIG_TEE) += tee/
 obj-$(CONFIG_HAS_VPCI) += vpci.o
 
 obj-$(CONFIG_HAS_ALTERNATIVE) += alternative.o
-obj-y += bootfdt.init.o
 obj-y += cpuerrata.o
 obj-y += cpufeature.o
 obj-y += decode.o
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 69d6aa626c..6e175626d5 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -77,6 +77,7 @@ obj-$(CONFIG_UBSAN) += ubsan/
 
 obj-$(CONFIG_NEEDS_LIBELF) += libelf/
 obj-$(CONFIG_HAS_DEVICE_TREE) += libfdt/
+obj-$(CONFIG_HAS_DEVICE_TREE) += device-tree/
 
 CONF_FILE := $(if $(patsubst /%,,$(KCONFIG_CONFIG)),$(objtree)/)$(KCONFIG_CONFIG)
 $(obj)/config.gz: $(CONF_FILE)
diff --git a/xen/common/device-tree/Makefile b/xen/common/device-tree/Makefile
new file mode 100644
index 0000000000..66c2500df9
--- /dev/null
+++ b/xen/common/device-tree/Makefile
@@ -0,0 +1 @@
+obj-y += bootfdt.init.o
diff --git a/xen/arch/arm/bootfdt.c b/xen/common/device-tree/bootfdt.c
similarity index 98%
rename from xen/arch/arm/bootfdt.c
rename to xen/common/device-tree/bootfdt.c
index f496a8cf94..ae9fa1e3d6 100644
--- a/xen/arch/arm/bootfdt.c
+++ b/xen/common/device-tree/bootfdt.c
@@ -431,12 +431,15 @@ static int __init early_scan_node(const void *fdt,
 {
     int rc = 0;
 
-    /*
-     * If Xen has been booted via UEFI, the memory banks are
-     * populated. So we should skip the parsing.
-     */
-    if ( !efi_enabled(EFI_BOOT) &&
-         device_tree_node_matches(fdt, node, "memory") )
+    if ( device_tree_node_matches(fdt, node, "memory") )
+#if defined(CONFIG_ARM_EFI)
+        /*
+         * If Xen has been booted via UEFI, the memory banks are
+         * populated. So we should skip the parsing.
+         */
+        if ( efi_enabled(EFI_BOOT) )
+            return rc;
+#endif
         rc = process_memory_node(fdt, node, name, depth,
                                  address_cells, size_cells, &bootinfo.mem);
     else if ( depth == 1 && !dt_node_cmp(name, "reserved-memory") )
-- 
2.30.2



  parent reply	other threads:[~2023-12-15  2:52 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-15  2:43 [PATCH v2 0/7] Early Boot Allocation on Power Shawn Anastasio
2023-12-15  2:43 ` [PATCH v2 1/7] xen/asm-generic: Introduce generic static-shmem.h Shawn Anastasio
2023-12-19 17:07   ` Jan Beulich
2023-12-15  2:43 ` [PATCH v2 2/7] xen/asm-generic: Introduce generic setup.h Shawn Anastasio
2023-12-20  7:23   ` Jan Beulich
2023-12-20 11:09   ` Jan Beulich
2023-12-20 18:51     ` Shawn Anastasio
2023-12-15  2:43 ` Shawn Anastasio [this message]
2023-12-19 17:03   ` [PATCH v2 3/7] xen/common: Move Arm's bootfdt to common Jan Beulich
2023-12-19 18:29     ` Julien Grall
2023-12-20  8:09       ` Jan Beulich
2023-12-20 20:58         ` Shawn Anastasio
2023-12-20 22:08           ` Julien Grall
2023-12-20 22:10             ` Timothy Pearson
2023-12-21  7:11             ` Jan Beulich
2023-12-20 13:53   ` Julien Grall
2023-12-15  2:43 ` [PATCH v2 4/7] xen/device-tree: Fix bootfdt.c to tolerate 0 reserved regions Shawn Anastasio
2024-01-09 18:14   ` Julien Grall
2024-01-10  8:15     ` Michal Orzel
2024-01-11 22:56     ` Shawn Anastasio
2023-12-15  2:44 ` [PATCH v2 5/7] xen/ppc: Enable bootfdt and boot allocator Shawn Anastasio
2023-12-20 11:44   ` Jan Beulich
2023-12-20 13:23   ` Julien Grall
2023-12-20 16:07     ` Julien Grall
2023-12-20 13:49   ` Julien Grall
2024-01-18  1:36     ` Shawn Anastasio
2024-01-18  9:21       ` Julien Grall
2023-12-15  2:44 ` [PATCH v2 6/7] xen/ppc: mm-radix: Replace debug printing code with printk Shawn Anastasio
2023-12-20 11:48   ` Jan Beulich
2024-01-18  1:37     ` Shawn Anastasio
2023-12-15  2:44 ` [PATCH v2 7/7] xen/ppc: mm-radix: Allocate Partition and Process Tables at runtime Shawn Anastasio
2023-12-21  7:06   ` Jan Beulich
2024-03-14 18:29     ` Shawn Anastasio

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=b26a07209b54cd036e42a8b00f036201821eb775.1702607884.git.sanastasio@raptorengineering.com \
    --to=sanastasio@raptorengineering.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=tpearson@raptorengineering.com \
    --cc=xen-devel@lists.xenproject.org \
    /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.