[coreboot-gerrit] Patch set updated for coreboot: lib/bootmem: allow architecture specific bootmem ranges

Aaron Durbin (adurbin@chromium.org) gerrit at coreboot.org
Wed Apr 20 15:33:39 CEST 2016


Aaron Durbin (adurbin at chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14434

-gerrit

commit 24930de3afc3812272d22a41639a55c7ccbde697
Author: Aaron Durbin <adurbin at chromium.org>
Date:   Tue Apr 19 17:25:59 2016 -0500

    lib/bootmem: allow architecture specific bootmem ranges
    
    A architecture-specific function, named bootmem_arch_add_ranges(),
    is added so that each architecture can add entries into the bootmem
    memory map. This allows for a common write_tables() implementation
    to avoid code duplication.
    
    Change-Id: I834c82eae212869cad8bb02c7abcd9254d120735
    Signed-off-by: Aaron Durbin <adurbin at chromium.org>
---
 src/arch/arm/tables.c    | 5 +++++
 src/arch/arm64/tables.c  | 5 +++++
 src/arch/mips/tables.c   | 5 +++++
 src/arch/power8/tables.c | 5 +++++
 src/arch/riscv/tables.c  | 5 +++++
 src/arch/x86/tables.c    | 5 +++++
 src/include/bootmem.h    | 3 +++
 src/lib/bootmem.c        | 2 ++
 8 files changed, 35 insertions(+)

diff --git a/src/arch/arm/tables.c b/src/arch/arm/tables.c
index eb08e6e..20891e8 100644
--- a/src/arch/arm/tables.c
+++ b/src/arch/arm/tables.c
@@ -17,12 +17,17 @@
 
 #include <console/console.h>
 #include <cpu/cpu.h>
+#include <bootmem.h>
 #include <boot/tables.h>
 #include <boot/coreboot_tables.h>
 #include <string.h>
 #include <cbmem.h>
 #include <lib.h>
 
+void bootmem_arch_add_ranges(void)
+{
+}
+
 #define MAX_COREBOOT_TABLE_SIZE CONFIG_COREBOOT_TABLE_SIZE
 
 void write_tables(void)
diff --git a/src/arch/arm64/tables.c b/src/arch/arm64/tables.c
index eb08e6e..20891e8 100644
--- a/src/arch/arm64/tables.c
+++ b/src/arch/arm64/tables.c
@@ -17,12 +17,17 @@
 
 #include <console/console.h>
 #include <cpu/cpu.h>
+#include <bootmem.h>
 #include <boot/tables.h>
 #include <boot/coreboot_tables.h>
 #include <string.h>
 #include <cbmem.h>
 #include <lib.h>
 
+void bootmem_arch_add_ranges(void)
+{
+}
+
 #define MAX_COREBOOT_TABLE_SIZE CONFIG_COREBOOT_TABLE_SIZE
 
 void write_tables(void)
diff --git a/src/arch/mips/tables.c b/src/arch/mips/tables.c
index a3d9939..d54b8d6 100644
--- a/src/arch/mips/tables.c
+++ b/src/arch/mips/tables.c
@@ -18,12 +18,17 @@
 
 #include <console/console.h>
 #include <cpu/cpu.h>
+#include <bootmem.h>
 #include <boot/tables.h>
 #include <boot/coreboot_tables.h>
 #include <string.h>
 #include <cbmem.h>
 #include <lib.h>
 
+void bootmem_arch_add_ranges(void)
+{
+}
+
 #define MAX_COREBOOT_TABLE_SIZE CONFIG_COREBOOT_TABLE_SIZE
 
 void write_tables(void)
diff --git a/src/arch/power8/tables.c b/src/arch/power8/tables.c
index 02d1c16..17e678a 100644
--- a/src/arch/power8/tables.c
+++ b/src/arch/power8/tables.c
@@ -17,12 +17,17 @@
 
 #include <console/console.h>
 #include <cpu/cpu.h>
+#include <bootmem.h>
 #include <boot/tables.h>
 #include <boot/coreboot_tables.h>
 #include <string.h>
 #include <cbmem.h>
 #include <lib.h>
 
+void bootmem_arch_add_ranges(void)
+{
+}
+
 #define MAX_COREBOOT_TABLE_SIZE CONFIG_COREBOOT_TABLE_SIZE
 
 void write_tables(void)
diff --git a/src/arch/riscv/tables.c b/src/arch/riscv/tables.c
index eb08e6e..20891e8 100644
--- a/src/arch/riscv/tables.c
+++ b/src/arch/riscv/tables.c
@@ -17,12 +17,17 @@
 
 #include <console/console.h>
 #include <cpu/cpu.h>
+#include <bootmem.h>
 #include <boot/tables.h>
 #include <boot/coreboot_tables.h>
 #include <string.h>
 #include <cbmem.h>
 #include <lib.h>
 
+void bootmem_arch_add_ranges(void)
+{
+}
+
 #define MAX_COREBOOT_TABLE_SIZE CONFIG_COREBOOT_TABLE_SIZE
 
 void write_tables(void)
diff --git a/src/arch/x86/tables.c b/src/arch/x86/tables.c
index b36078d..4fba509 100644
--- a/src/arch/x86/tables.c
+++ b/src/arch/x86/tables.c
@@ -17,6 +17,7 @@
 
 #include <console/console.h>
 #include <cpu/cpu.h>
+#include <bootmem.h>
 #include <boot/tables.h>
 #include <boot/coreboot_tables.h>
 #include <arch/pirq_routing.h>
@@ -180,6 +181,10 @@ static unsigned long write_smbios_table(unsigned long rom_table_end)
 	return rom_table_end;
 }
 
+void bootmem_arch_add_ranges(void)
+{
+}
+
 void write_tables(void)
 {
 	unsigned long low_table_start, low_table_end;
diff --git a/src/include/bootmem.h b/src/include/bootmem.h
index 0665058..10c8d51 100644
--- a/src/include/bootmem.h
+++ b/src/include/bootmem.h
@@ -26,6 +26,9 @@
  */
 void bootmem_init(void);
 
+/* Architecture hook to add bootmem areas the architecture controls. */
+void bootmem_arch_add_ranges(void);
+
 /* Add a range of a given type to the bootmem address space. */
 void bootmem_add_range(uint64_t start, uint64_t size, uint32_t type);
 
diff --git a/src/lib/bootmem.c b/src/lib/bootmem.c
index 29cbec6..ea02a16 100644
--- a/src/lib/bootmem.c
+++ b/src/lib/bootmem.c
@@ -39,6 +39,8 @@ void bootmem_init(void)
 
 	/* Add memory used by CBMEM. */
 	cbmem_add_bootmem();
+
+	bootmem_arch_add_ranges();
 }
 
 void bootmem_add_range(uint64_t start, uint64_t size, uint32_t type)



More information about the coreboot-gerrit mailing list