From 01c3de9bb45e09edfe715ec2934805b5ea2edd2f Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Wed, 29 Aug 2012 09:28:52 -0700 Subject: [PATCH] Make option rom init more verbose When bringing up VGA by running the option rom it's sometimes useful to get more information about the mode that gets set, or the reason why the mode could not be set or a picture could not be displayed. Also prefix the output from VBE mode setting with VBE: Copying VGA ROM Image from fff0fd78 to 0xc0000, 0x10000 bytes Real mode stub @00000600: 867 bytes Calling Option ROM... int15_handler: INT15 function 5fac! ... Option ROM returned. VBE: Getting information about VESA mode 4161 VBE: resolution: 1280x1024@16 VBE: framebuffer: d0000000 VBE: Setting VESA mode 4161 VGA Option ROM has been loaded Change-Id: I2be11f095dc62ed3c99e0d4272ad9d6521608a44 Signed-off-by: Stefan Reinauer Reviewed-on: http://review.coreboot.org/1714 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- src/devices/oprom/x86.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/devices/oprom/x86.c b/src/devices/oprom/x86.c index 564017d4e4..cc70d74cf5 100644 --- a/src/devices/oprom/x86.c +++ b/src/devices/oprom/x86.c @@ -169,7 +169,7 @@ static void setup_realmode_idt(void) #if CONFIG_FRAMEBUFFER_SET_VESA_MODE static u8 vbe_get_mode_info(vbe_mode_info_t * mode_info) { - printk(BIOS_DEBUG, "Getting information about VESA mode %04x\n", + printk(BIOS_DEBUG, "VBE: Getting information about VESA mode %04x\n", mode_info->video_mode); char *buffer = (char *)&__buffer; u16 buffer_seg = (((unsigned long)buffer) >> 4) & 0xff00; @@ -182,7 +182,7 @@ static u8 vbe_get_mode_info(vbe_mode_info_t * mode_info) static u8 vbe_set_mode(vbe_mode_info_t * mode_info) { - printk(BIOS_DEBUG, "Setting VESA mode %04x\n", mode_info->video_mode); + printk(BIOS_DEBUG, "VBE: Setting VESA mode %04x\n", mode_info->video_mode); // request linear framebuffer mode mode_info->video_mode |= (1 << 14); // request clearing of framebuffer @@ -203,7 +203,17 @@ void vbe_set_graphics(void) vbe_get_mode_info(&mode_info); unsigned char *framebuffer = (unsigned char *)mode_info.vesa.phys_base_ptr; - printk(BIOS_DEBUG, "framebuffer: %p\n", framebuffer); + printk(BIOS_DEBUG, "VBE: resolution: %dx%d@%d\n", + le16_to_cpu(mode_info.vesa.x_resolution), + le16_to_cpu(mode_info.vesa.y_resolution), + mode_info.vesa.bits_per_pixel); + printk(BIOS_DEBUG, "VBE: framebuffer: %p\n", framebuffer); + if (!framebuffer) { + printk(BIOS_DEBUG, "VBE: Mode does not support linear " + "framebuffer\n"); + return; + } + vbe_set_mode(&mode_info); #if CONFIG_BOOTSPLASH struct jpeg_decdata *decdata; @@ -211,6 +221,7 @@ void vbe_set_graphics(void) unsigned char *jpeg = cbfs_find_file("bootsplash.jpg", CBFS_TYPE_BOOTSPLASH); if (!jpeg) { + printk(BIOS_DEBUG, "VBE: No bootsplash found.\n"); return; } int ret = 0;