From 98ab435f736f24b503c8a9dbacc3ee1556a58106 Mon Sep 17 00:00:00 2001 From: Vadim Bendebury Date: Fri, 12 Oct 2012 18:48:47 +0000 Subject: x86: Add CBMEM console driver for coreboot This patch builds upon the recently introduced CBMEM console feature of coreboot. CBMEM console uses a memry area allocated by coreboot to store the console output. The memory area has a certain structure, which allows to determine where the buffer is, the buffer size and the location of the pointer in the buffer. This allows different phases of the firmware (rom based coreboot, ram based coreboot, u-boot after relocation with this change) to keep adding text to the same buffer. Note that this patch introduces a new console driver and adds the driver to the list of drivers to be used for console output, i.e. it engages only after u-boot relocates. Usiong CBMEM console for capturing the pre-relocation console output will be done under a separate change. >From Linux, run the cbmem.py utility (which is a part of the coreboot package) to see the output, e.g.: vvvvvvvvvvvvvvvvv SCSI: AHCI 0001.0300 32 slots 6 ports ? Gbps 0xf impl SATA mode flags: 64bit ilck stag led pmp pio ... Magic signature found Kernel command line: "cros_secure quiet loglevel=1 console=tty2... ^^^^^^^^^^^^^^^^^ Note that the entire u-boot output fits into the buffer only if the coreboot log level is reduced from the most verbose. Ether the buffer size will have to be increased, or the coreboot verbosity permanently reduced. Signed-off-by: Vadim Bendebury Signed-off-by: Simon Glass --- include/stdio_dev.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/stdio_dev.h b/include/stdio_dev.h index 23e0ee1..932d093 100644 --- a/include/stdio_dev.h +++ b/include/stdio_dev.h @@ -120,5 +120,8 @@ int drv_nc_init (void); #ifdef CONFIG_JTAG_CONSOLE int drv_jtag_console_init (void); #endif +#ifdef CONFIG_CBMEM_CONSOLE +int cbmemc_init(void); +#endif #endif -- cgit v1.1 From 420a2ca73f5805be5e69d01cfe60a06fba8c9754 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 29 Nov 2012 09:58:58 +0000 Subject: x86: Select stdio devices for coreboot We want to support VGA, serial, USB keyboard and the Coreboot memory console buffer. Signed-off-by: Simon Glass --- include/configs/coreboot.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include') diff --git a/include/configs/coreboot.h b/include/configs/coreboot.h index 5da006f..cfe5db3 100644 --- a/include/configs/coreboot.h +++ b/include/configs/coreboot.h @@ -92,6 +92,15 @@ #define CONFIG_SYS_NS16550_COM2 UART1_BASE #define CONFIG_SYS_NS16550_PORT_MAPPED +#define CONFIG_STD_DEVICES_SETTINGS "stdin=usbkbd,vga,eserial0\0" \ + "stdout=vga,eserial0,cbmem\0" \ + "stderr=vga,eserial0,cbmem\0" + +#define CONFIG_CONSOLE_MUX +#define CONFIG_SYS_CONSOLE_IS_IN_ENV +#define CONFIG_SYS_STDIO_DEREGISTER +#define CONFIG_CBMEM_CONSOLE + /* max. 1 IDE bus */ #define CONFIG_SYS_IDE_MAXBUS 1 /* max. 1 drive per IDE bus */ @@ -243,4 +252,7 @@ */ #define CONFIG_PCI +#define CONFIG_EXTRA_ENV_SETTINGS \ + CONFIG_STD_DEVICES_SETTINGS + #endif /* __CONFIG_H */ -- cgit v1.1 From a78d49473c81b8c95adfe684e62e5af6aa4f902d Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 20 Oct 2012 12:33:15 +0000 Subject: x86: Define CONFIG_SYS_VSNPRINTF for coreboot This option protects the printf() functions from overflow. Signed-off-by: Simon Glass --- include/configs/coreboot.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/configs/coreboot.h b/include/configs/coreboot.h index cfe5db3..a010adc 100644 --- a/include/configs/coreboot.h +++ b/include/configs/coreboot.h @@ -38,6 +38,7 @@ #undef CONFIG_SHOW_BOOT_PROGRESS #define CONFIG_LAST_STAGE_INIT #define CONFIG_X86_NO_RESET_VECTOR +#define CONFIG_SYS_VSNPRINTF /*----------------------------------------------------------------------- * Watchdog Configuration -- cgit v1.1