[coreboot-gerrit] Patch set updated for coreboot: a24d30d ARM ARM64: Fix preram CBMEM console
Kyösti Mälkki (kyosti.malkki@gmail.com)
gerrit at coreboot.org
Thu Dec 18 20:54:30 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/7862
-gerrit
commit a24d30d7a6d7804ac369ee530ce9b6435184f077
Author: Kyösti Mälkki <kyosti.malkki at gmail.com>
Date: Thu Dec 18 19:27:13 2014 +0200
ARM ARM64: Fix preram CBMEM console
TODO: Missing actual PRERAM_BUFFER_BASE values.
Drop old romstage console from ARM64, generic console driver
handles all arch and stages of boot.
Change-Id: I70d82da629529dbfd7bc9491223abd703cbc0115
Signed-off-by: Kyösti Mälkki <kyosti.malkki at gmail.com>
---
src/arch/arm/Kconfig | 4 --
src/arch/arm64/Makefile.inc | 2 -
src/arch/arm64/bootblock.ld | 2 +
src/arch/arm64/early_console.c | 75 -------------------------------------
src/console/Kconfig | 4 ++
src/include/console/cbmem_console.h | 3 +-
src/lib/Makefile.inc | 4 ++
7 files changed, 12 insertions(+), 82 deletions(-)
diff --git a/src/arch/arm/Kconfig b/src/arch/arm/Kconfig
index e946f59..edc4b12 100644
--- a/src/arch/arm/Kconfig
+++ b/src/arch/arm/Kconfig
@@ -20,10 +20,6 @@ config ARM_BOOTBLOCK_CUSTOM
bool
default n
-config CBMEM_CONSOLE_PRERAM_BASE
- hex
- depends on CONSOLE_CBMEM
-
config CPU_HAS_BOOTBLOCK_INIT
bool
default n
diff --git a/src/arch/arm64/Makefile.inc b/src/arch/arm64/Makefile.inc
index b4df4aa..aa5507e 100644
--- a/src/arch/arm64/Makefile.inc
+++ b/src/arch/arm64/Makefile.inc
@@ -44,7 +44,6 @@ endif
ifeq ($(CONFIG_ARCH_BOOTBLOCK_ARM64),y)
bootblock-y += div0.c
-bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += early_console.c
bootblock-y += id.S
$(obj)/arch/arm64/id.bootblock.o: $(obj)/build.h
@@ -72,7 +71,6 @@ ifeq ($(CONFIG_ARCH_ROMSTAGE_ARM64),y)
romstage-y += stages.c
romstage-y += div0.c
-romstage-y += early_console.c
romstage-y += eabi_compat.c
romstage-y += cbmem.c
romstage-y += memset.S
diff --git a/src/arch/arm64/bootblock.ld b/src/arch/arm64/bootblock.ld
index acce1f1..3040500 100644
--- a/src/arch/arm64/bootblock.ld
+++ b/src/arch/arm64/bootblock.ld
@@ -49,6 +49,8 @@ SECTIONS
*(.sbss.*);
} : to_load = 0xff
+ preram_cbmem_console = CONFIG_CBMEM_CONSOLE_PRERAM_BASE;
+
/DISCARD/ : {
*(.comment)
*(.note)
diff --git a/src/arch/arm64/early_console.c b/src/arch/arm64/early_console.c
deleted file mode 100644
index aa287a3..0000000
--- a/src/arch/arm64/early_console.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * 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 <console/console.h>
-#include <console/vtxprintf.h>
-
-/* FIXME: need to make console driver more generic */
-void console_tx_byte(unsigned char byte)
-{
- if (byte == '\n')
- console_tx_byte('\r');
-
-#if CONFIG_CONSOLE_SERIAL8250MEM
- if (oxford_oxpcie_present) {
- uart8250_mem_tx_byte(
- CONFIG_OXFORD_OXPCIE_BASE_ADDRESS + 0x1000, byte);
- }
-#endif
-#if CONFIG_CONSOLE_SERIAL_UART
- uart_tx_byte(byte);
-#endif
-#if CONFIG_USBDEBUG
- usbdebug_tx_byte(0, byte);
-#endif
-#if CONFIG_CONSOLE_CBMEM && !defined(__BOOT_BLOCK__)
- cbmemc_tx_byte(byte);
-#endif
-}
-
-void console_tx_flush(void)
-{
-#if CONFIG_CONSOLE_SERIAL8250MEM
- uart8250_mem_tx_flush(CONFIG_OXFORD_OXPCIE_BASE_ADDRESS + 0x1000);
-#endif
-#if CONFIG_CONSOLE_SERIAL_UART
- uart_tx_flush();
-#endif
-#if CONFIG_USBDEBUG
- usbdebug_tx_flush(0);
-#endif
-}
-
-int do_printk(int msg_level, const char *fmt, ...)
-{
- va_list args;
- int i;
-
- if (msg_level > console_loglevel) {
- return 0;
- }
-
- va_start(args, fmt);
- i = vtxprintf(console_tx_byte, fmt, args);
- va_end(args);
-
- console_tx_flush();
-
- return i;
-}
diff --git a/src/console/Kconfig b/src/console/Kconfig
index 0d32011..80f0b21 100644
--- a/src/console/Kconfig
+++ b/src/console/Kconfig
@@ -184,6 +184,10 @@ config CONSOLE_CBMEM_BUFFER_SIZE
value (128K or 0x20000 bytes) is large enough to accommodate
even the BIOS_SPEW level.
+config CBMEM_CONSOLE_PRERAM_BASE
+ hex
+ depends on CONSOLE_CBMEM
+
config CONSOLE_PRERAM_BUFFER_SIZE
depends on CONSOLE_CBMEM
hex "Room allocated for console output before RAM is initialized"
diff --git a/src/include/console/cbmem_console.h b/src/include/console/cbmem_console.h
index 0cadf8e..48c6831 100644
--- a/src/include/console/cbmem_console.h
+++ b/src/include/console/cbmem_console.h
@@ -30,7 +30,8 @@ void cbmemc_tx_byte(unsigned char data);
static inline void cbmemc_reinit(void) {}
#define __CBMEM_CONSOLE_ENABLE__ CONFIG_CONSOLE_CBMEM && \
- ((ENV_ROMSTAGE && !CONFIG_BROKEN_CAR_MIGRATE) || ENV_RAMSTAGE)
+ ((ENV_BOOTBLOCK && CONFIG_BOOTBLOCK_CONSOLE) || \
+ (ENV_ROMSTAGE && !CONFIG_BROKEN_CAR_MIGRATE) || ENV_RAMSTAGE)
#if __CBMEM_CONSOLE_ENABLE__
static inline void __cbmemc_init(void) { cbmemc_init(); }
diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc
index 2b5c203..d25fa9c 100644
--- a/src/lib/Makefile.inc
+++ b/src/lib/Makefile.inc
@@ -22,6 +22,10 @@ bootblock-y += cbfs.c cbfs_core.c
bootblock-y += memchr.c
bootblock-y += memcmp.c
+ifeq ($(CONFIG_BOOTBLOCK_CONSOLE),y)
+bootblock-$(CONFIG_CONSOLE_CBMEM) += cbmem_console.c
+endif
+
romstage-y += memchr.c
romstage-y += memcmp.c
$(foreach arch,$(ARCH_SUPPORTED),\
More information about the coreboot-gerrit
mailing list