[coreboot-gerrit] Patch set updated for coreboot: 7a7b2d7 ARM: Always select DYNAMIC_CBMEM

Kyösti Mälkki (kyosti.malkki@gmail.com) gerrit at coreboot.org
Thu Dec 18 20:54:37 CET 2014


Kyösti Mälkki (kyosti.malkki at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7469

-gerrit

commit 7a7b2d7863b05207b4be1aef4f828fe91d942fa0
Author: Kyösti Mälkki <kyosti.malkki at gmail.com>
Date:   Mon Nov 10 15:08:47 2014 +0200

    ARM: Always select DYNAMIC_CBMEM
    
    TODO before merge: proper cbmem_top(), there is now just empty stub.
    
    Change-Id: I6939559c720383978a3afec8b6da789f895c81d2
    Signed-off-by: Kyösti Mälkki <kyosti.malkki at gmail.com>
---
 src/arch/arm/tables.c                           |  9 ---------
 src/arch/arm64/cbmem.c                          | 12 ------------
 src/arch/arm64/tables.c                         | 17 -----------------
 src/cpu/allwinner/a10/Kconfig                   |  1 +
 src/cpu/allwinner/a10/cbmem.c                   |  4 ----
 src/cpu/ti/am335x/Kconfig                       |  1 +
 src/cpu/ti/am335x/Makefile.inc                  |  2 ++
 src/cpu/ti/am335x/cbmem.c                       | 24 ++++++++++++++++++++++++
 src/mainboard/emulation/qemu-armv7/Kconfig      |  1 +
 src/mainboard/emulation/qemu-armv7/Makefile.inc |  3 +++
 src/mainboard/emulation/qemu-armv7/cbmem.c      | 24 ++++++++++++++++++++++++
 src/soc/qualcomm/ipq806x/Kconfig                |  1 +
 src/soc/qualcomm/ipq806x/Makefile.inc           |  2 ++
 src/soc/qualcomm/ipq806x/cbmem.c                | 24 ++++++++++++++++++++++++
 14 files changed, 83 insertions(+), 42 deletions(-)

diff --git a/src/arch/arm/tables.c b/src/arch/arm/tables.c
index cdeeb36..09385b6 100644
--- a/src/arch/arm/tables.c
+++ b/src/arch/arm/tables.c
@@ -29,15 +29,6 @@
 
 #define MAX_COREBOOT_TABLE_SIZE (8 * 1024)
 
-#if !CONFIG_DYNAMIC_CBMEM
-void __attribute__((weak)) get_cbmem_table(uint64_t *base, uint64_t *size)
-{
-	printk(BIOS_WARNING, "WARNING: you need to define get_cbmem_table for your board\n");
-	*base = 0;
-	*size = 0;
-}
-#endif
-
 void write_tables(void)
 {
 	unsigned long table_pointer, new_table_pointer;
diff --git a/src/arch/arm64/cbmem.c b/src/arch/arm64/cbmem.c
index 69b60a2..307d633 100644
--- a/src/arch/arm64/cbmem.c
+++ b/src/arch/arm64/cbmem.c
@@ -18,18 +18,6 @@
 #include <cbmem.h>
 #include <console/cbmem_console.h>
 
-unsigned long get_top_of_ram(void);
-
-unsigned long get_top_of_ram(void)
-{
-        return CONFIG_RAMTOP;
-}
-
-void *cbmem_top(void)
-{
-        return (void *)get_top_of_ram();
-}
-
 void cbmem_arch_init(void)
 {
 	__cbmemc_relocate();
diff --git a/src/arch/arm64/tables.c b/src/arch/arm64/tables.c
index 825d7a2..f71c215 100644
--- a/src/arch/arm64/tables.c
+++ b/src/arch/arm64/tables.c
@@ -29,27 +29,10 @@
 
 #define MAX_COREBOOT_TABLE_SIZE (8 * 1024)
 
-#if ! CONFIG_DYNAMIC_CBMEM
-/*
- * TODO: "High" tables are a convention used on x86. Maybe we can
- * clean up that naming at some point.
- */
-uint64_t high_tables_base = 0;
-uint64_t high_tables_size;
-#endif
-
 struct lb_memory *write_tables(void)
 {
 	unsigned long table_pointer, new_table_pointer;
 
-#if ! CONFIG_DYNAMIC_CBMEM
-	if (!high_tables_base) {
-		printk(BIOS_ERR, "ERROR: high_tables_base is not set.\n");
-	}
-
-	printk(BIOS_DEBUG, "high_tables_base: %llx.\n", high_tables_base);
-#endif
-
 	post_code(0x9d);
 
 	table_pointer = (unsigned long)cbmem_add(CBMEM_ID_CBTABLE,
diff --git a/src/cpu/allwinner/a10/Kconfig b/src/cpu/allwinner/a10/Kconfig
index 2bf32ec..b7b435f 100644
--- a/src/cpu/allwinner/a10/Kconfig
+++ b/src/cpu/allwinner/a10/Kconfig
@@ -13,6 +13,7 @@ config CPU_SPECIFIC_OPTIONS
 	select HAVE_UART_SPECIAL
 	select BOOTBLOCK_CONSOLE
 	select CPU_HAS_BOOTBLOCK_INIT
+	select DYNAMIC_CBMEM
 
 # The "eGON.BT0" header takes 32 bytes
 config BOOTBLOCK_BASE
diff --git a/src/cpu/allwinner/a10/cbmem.c b/src/cpu/allwinner/a10/cbmem.c
index 84dc2bf..e051f06 100644
--- a/src/cpu/allwinner/a10/cbmem.c
+++ b/src/cpu/allwinner/a10/cbmem.c
@@ -8,11 +8,7 @@
 #include "ram_segs.h"
 #include <cbmem.h>
 
-#if IS_ENABLED(CONFIG_DYNAMIC_CBMEM)
-
 void *cbmem_top(void)
 {
 	return a1x_get_cbmem_top();
 }
-
-#endif
diff --git a/src/cpu/ti/am335x/Kconfig b/src/cpu/ti/am335x/Kconfig
index 1de871f..42c091c 100644
--- a/src/cpu/ti/am335x/Kconfig
+++ b/src/cpu/ti/am335x/Kconfig
@@ -5,6 +5,7 @@ config CPU_TI_AM335X
 	select HAVE_MONOTONIC_TIMER
 	select HAVE_UART_SPECIAL
 	select BOOTBLOCK_CONSOLE
+	select DYNAMIC_CBMEM
 	bool
 	default n
 
diff --git a/src/cpu/ti/am335x/Makefile.inc b/src/cpu/ti/am335x/Makefile.inc
index 032b1f4..3a1492a 100644
--- a/src/cpu/ti/am335x/Makefile.inc
+++ b/src/cpu/ti/am335x/Makefile.inc
@@ -3,11 +3,13 @@ bootblock-y	+= bootblock_media.c
 bootblock-y	+= pinmux.c
 
 romstage-y	+= nand.c
+romstage-y	+= cbmem.c
 
 ramstage-y	+= dmtimer.c
 ramstage-y	+= monotonic_timer.c
 ramstage-y	+= nand.c
 ramstage-y	+= timer.c
+ramstage-y	+= cbmem.c
 
 ifeq ($(CONFIG_DRIVERS_UART),y)
 bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += uart.c
diff --git a/src/cpu/ti/am335x/cbmem.c b/src/cpu/ti/am335x/cbmem.c
new file mode 100644
index 0000000..c104e9c
--- /dev/null
+++ b/src/cpu/ti/am335x/cbmem.c
@@ -0,0 +1,24 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <stddef.h>
+#include <cbmem.h>
+
+void *cbmem_top(void)
+{
+        return NULL;
+}
diff --git a/src/mainboard/emulation/qemu-armv7/Kconfig b/src/mainboard/emulation/qemu-armv7/Kconfig
index b275e88..7e24a20 100644
--- a/src/mainboard/emulation/qemu-armv7/Kconfig
+++ b/src/mainboard/emulation/qemu-armv7/Kconfig
@@ -32,6 +32,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
 	select ARM_ROMSTAGE_ARMV7
 	select ARM_RAMSTAGE_ARMV7
 	select BOARD_ROMSIZE_KB_4096
+	select DYNAMIC_CBMEM
 
 config MAINBOARD_DIR
 	string
diff --git a/src/mainboard/emulation/qemu-armv7/Makefile.inc b/src/mainboard/emulation/qemu-armv7/Makefile.inc
index e088da6..4119f93 100644
--- a/src/mainboard/emulation/qemu-armv7/Makefile.inc
+++ b/src/mainboard/emulation/qemu-armv7/Makefile.inc
@@ -14,6 +14,9 @@
 
 romstage-y += romstage.c
 
+romstage-y += cbmem.c
+ramstage-y += cbmem.c
+
 bootblock-y += media.c
 romstage-y += media.c
 ramstage-y += media.c
diff --git a/src/mainboard/emulation/qemu-armv7/cbmem.c b/src/mainboard/emulation/qemu-armv7/cbmem.c
new file mode 100644
index 0000000..c104e9c
--- /dev/null
+++ b/src/mainboard/emulation/qemu-armv7/cbmem.c
@@ -0,0 +1,24 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <stddef.h>
+#include <cbmem.h>
+
+void *cbmem_top(void)
+{
+        return NULL;
+}
diff --git a/src/soc/qualcomm/ipq806x/Kconfig b/src/soc/qualcomm/ipq806x/Kconfig
index 0fb780c..a6ddf81 100644
--- a/src/soc/qualcomm/ipq806x/Kconfig
+++ b/src/soc/qualcomm/ipq806x/Kconfig
@@ -2,6 +2,7 @@ config SOC_QC_IPQ806X
 	select ARCH_BOOTBLOCK_ARMV4
 	select ARCH_ROMSTAGE_ARMV7
 	select ARCH_RAMSTAGE_ARMV7
+	select DYNAMIC_CBMEM
 	bool
 	default n
 
diff --git a/src/soc/qualcomm/ipq806x/Makefile.inc b/src/soc/qualcomm/ipq806x/Makefile.inc
index cffcc12..cda2787 100644
--- a/src/soc/qualcomm/ipq806x/Makefile.inc
+++ b/src/soc/qualcomm/ipq806x/Makefile.inc
@@ -3,10 +3,12 @@ bootblock-y += clock.c
 bootblock-y += gpio.c
 
 romstage-y += cbfs.c
+romstage-y += cbmem.c
 romstage-y += clock.c
 romstage-y += gpio.c
 
 ramstage-y += cbfs.c
+ramstage-y += cbmem.c
 ramstage-y += clock.c
 ramstage-y += gpio.c
 ramstage-y += timer.c
diff --git a/src/soc/qualcomm/ipq806x/cbmem.c b/src/soc/qualcomm/ipq806x/cbmem.c
new file mode 100644
index 0000000..c104e9c
--- /dev/null
+++ b/src/soc/qualcomm/ipq806x/cbmem.c
@@ -0,0 +1,24 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <stddef.h>
+#include <cbmem.h>
+
+void *cbmem_top(void)
+{
+        return NULL;
+}



More information about the coreboot-gerrit mailing list