public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Bin Meng <bmeng.cn@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 04/13] x86: Move install_e820_map() out of zimage.c
Date: Mon, 28 Sep 2015 02:12:01 -0700	[thread overview]
Message-ID: <1443431530-472-5-git-send-email-bmeng.cn@gmail.com> (raw)
In-Reply-To: <1443431530-472-1-git-send-email-bmeng.cn@gmail.com>

install_e820_map() has nothing to do with zimage related codes.
Move it to a dedicated place.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>

---

Changes in v2:
- New patch to move install_e820_map() out of zimage.c

 arch/x86/include/asm/e820.h   |  3 +++
 arch/x86/include/asm/zimage.h |  3 ---
 arch/x86/lib/Makefile         |  1 +
 arch/x86/lib/e820.c           | 37 +++++++++++++++++++++++++++++++++++++
 arch/x86/lib/zimage.c         | 26 --------------------------
 5 files changed, 41 insertions(+), 29 deletions(-)
 create mode 100644 arch/x86/lib/e820.c

diff --git a/arch/x86/include/asm/e820.h b/arch/x86/include/asm/e820.h
index 21bc633..351f021 100644
--- a/arch/x86/include/asm/e820.h
+++ b/arch/x86/include/asm/e820.h
@@ -23,4 +23,7 @@ struct e820entry {
 
 #endif /* __ASSEMBLY__ */
 
+/* Implementation defined function to install an e820 map */
+unsigned install_e820_map(unsigned max_entries, struct e820entry *);
+
 #endif /* _ASM_X86_E820_H */
diff --git a/arch/x86/include/asm/zimage.h b/arch/x86/include/asm/zimage.h
index bf351ed..94fa2a7 100644
--- a/arch/x86/include/asm/zimage.h
+++ b/arch/x86/include/asm/zimage.h
@@ -31,9 +31,6 @@
 #define BZIMAGE_LOAD_ADDR  0x100000
 #define ZIMAGE_LOAD_ADDR   0x10000
 
-/* Implementation defined function to install an e820 map. */
-unsigned install_e820_map(unsigned max_entries, struct e820entry *);
-
 struct boot_params *load_zimage(char *image, unsigned long kernel_size,
 				ulong *load_addressp);
 int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot,
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index 6ecd6db..169062e 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -12,6 +12,7 @@ obj-$(CONFIG_CMD_BOOTM) += bootm.o
 obj-y	+= cmd_boot.o
 obj-$(CONFIG_HAVE_FSP) += cmd_hob.o
 obj-$(CONFIG_EFI) += efi/
+obj-y	+= e820.o
 obj-y	+= gcc.o
 obj-y	+= init_helpers.o
 obj-y	+= interrupts.o
diff --git a/arch/x86/lib/e820.c b/arch/x86/lib/e820.c
new file mode 100644
index 0000000..5babfde
--- /dev/null
+++ b/arch/x86/lib/e820.c
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/e820.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/*
+ * Install a default e820 table with 4 entries as follows:
+ *
+ *	0x000000-0x0a0000	Useable RAM
+ *	0x0a0000-0x100000	Reserved for ISA
+ *	0x100000-gd->ram_size	Useable RAM
+ *	CONFIG_PCIE_ECAM_BASE	PCIe ECAM
+ */
+__weak unsigned install_e820_map(unsigned max_entries,
+				 struct e820entry *entries)
+{
+	entries[0].addr = 0;
+	entries[0].size = ISA_START_ADDRESS;
+	entries[0].type = E820_RAM;
+	entries[1].addr = ISA_START_ADDRESS;
+	entries[1].size = ISA_END_ADDRESS - ISA_START_ADDRESS;
+	entries[1].type = E820_RESERVED;
+	entries[2].addr = ISA_END_ADDRESS;
+	entries[2].size = gd->ram_size - ISA_END_ADDRESS;
+	entries[2].type = E820_RAM;
+	entries[3].addr = CONFIG_PCIE_ECAM_BASE;
+	entries[3].size = CONFIG_PCIE_ECAM_SIZE;
+	entries[3].type = E820_RESERVED;
+
+	return 4;
+}
diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c
index a1ec57e..1b33c77 100644
--- a/arch/x86/lib/zimage.c
+++ b/arch/x86/lib/zimage.c
@@ -42,32 +42,6 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define COMMAND_LINE_SIZE	2048
 
-/*
- * Install a default e820 table with 3 entries as follows:
- *
- *	0x000000-0x0a0000	Useable RAM
- *	0x0a0000-0x100000	Reserved for ISA
- *	0x100000-gd->ram_size	Useable RAM
- */
-__weak unsigned install_e820_map(unsigned max_entries,
-				 struct e820entry *entries)
-{
-	entries[0].addr = 0;
-	entries[0].size = ISA_START_ADDRESS;
-	entries[0].type = E820_RAM;
-	entries[1].addr = ISA_START_ADDRESS;
-	entries[1].size = ISA_END_ADDRESS - ISA_START_ADDRESS;
-	entries[1].type = E820_RESERVED;
-	entries[2].addr = ISA_END_ADDRESS;
-	entries[2].size = gd->ram_size - ISA_END_ADDRESS;
-	entries[2].type = E820_RAM;
-	entries[3].addr = CONFIG_PCIE_ECAM_BASE;
-	entries[3].size = CONFIG_PCIE_ECAM_SIZE;
-	entries[3].type = E820_RESERVED;
-
-	return 4;
-}
-
 static void build_command_line(char *command_line, int auto_boot)
 {
 	char *env_command_line;
-- 
1.8.2.1

  parent reply	other threads:[~2015-09-28  9:12 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-28  9:11 [U-Boot] [PATCH v2 00/13] Better support of booting VxWorks via 'bootvx' Bin Meng
2015-09-28  9:11 ` [U-Boot] [PATCH v2 01/13] Reorder defconfigs with 'savedefconfig' Bin Meng
2015-09-28  9:11 ` [U-Boot] [PATCH v2 02/13] x86: fsp: Report correct number of E820 table entries Bin Meng
2015-09-29  4:52   ` Simon Glass
2015-10-18 12:58     ` Simon Glass
2015-10-18 15:55       ` Tom Rini
2015-10-18 20:25         ` Simon Glass
2015-10-19  0:09       ` Tom Rini
2015-10-19  2:28         ` Simon Glass
2015-09-28  9:12 ` [U-Boot] [PATCH v2 03/13] x86: Initialize GDT entry 1 to be the 32-bit CS as well Bin Meng
2015-10-01 23:00   ` Simon Glass
2015-09-28  9:12 ` Bin Meng [this message]
2015-10-02  7:06   ` [U-Boot] [PATCH v2 04/13] x86: Move install_e820_map() out of zimage.c Simon Glass
2015-09-28  9:12 ` [U-Boot] [PATCH v2 05/13] x86: Remove quotation mark in CONFIG_HOSTNAME Bin Meng
2015-10-02  7:06   ` Simon Glass
2015-09-28  9:12 ` [U-Boot] [PATCH v2 06/13] cmd: Convert CONFIG_CMD_ELF to Kconfig Bin Meng
2015-09-29  6:47   ` Hannes Schmelzer
2015-09-28  9:12 ` [U-Boot] [PATCH v2 07/13] cmd: Clean up cmd_elf a little bit Bin Meng
2015-09-29  6:54   ` Hannes Schmelzer
2015-09-28  9:12 ` [U-Boot] [PATCH v2 08/13] cmd: elf: Reorder load_elf_image_phdr() and load_elf_image_shdr() Bin Meng
2015-09-28  9:12 ` [U-Boot] [PATCH v2 09/13] cmd: bootvx: Pass netmask and gatewayip to VxWorks bootline Bin Meng
2015-10-01 23:01   ` Simon Glass
2015-09-28  9:12 ` [U-Boot] [PATCH v2 10/13] cmd: bootvx: Always get VxWorks bootline from env Bin Meng
2015-09-29  6:54   ` Hannes Schmelzer
2015-09-28  9:12 ` [U-Boot] [PATCH v2 11/13] cmd: bootvx: Pass E820 information to an x86 VxWorks kernel Bin Meng
2015-10-02  7:06   ` Simon Glass
2015-09-28  9:12 ` [U-Boot] [PATCH v2 12/13] cmd: bootvx: Add asmlinkage to the VxWorks x86 entry Bin Meng
2015-10-02  7:06   ` Simon Glass
2015-09-28  9:12 ` [U-Boot] [PATCH v2 13/13] doc: Complement document about booting VxWorks Bin Meng

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=1443431530-472-5-git-send-email-bmeng.cn@gmail.com \
    --to=bmeng.cn@gmail.com \
    --cc=u-boot@lists.denx.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