Skip to contentSkip to conversation

x86: Move FRAMEBUFFER_SET_VESA_MODE etc to video Kconfig

PATCH New Bin Meng 2 participants 7 messages May 10, 2015 – May 27, 2015 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Bin Meng

author
#1 lore raw

PATCH v2 2/3 x86: Move FRAMEBUFFER_SET_VESA_MODE etc to video Kconfig

CONFIG_FRAMEBUFFER_SET_VESA_MODE and CONFIG_FRAMEBUFFER_VESA_MODE are not x86-specific, so move them to drivers/video/Kconfig and make them depend on VIDEO_VESA driver. Some cosmetic fixes are applied to the Kconfig help text as well.

---

Changes in v2: None

 arch/x86/Kconfig            | 141 --------------------------------------------
 configs/minnowmax_defconfig |   1 +
 drivers/video/Kconfig       | 138 +++++++++++++++++++++++++++++++++++++++++++
 include/configs/minnowmax.h |   3 -
 4 files changed, 139 insertions(+), 144 deletions(-)
arch/x86/Kconfig +0 -141
index 0b78f10..ac1dc65 100644
@@ -187,147 +187,6 @@ config MARK_GRAPHICS_MEM_WRCOMB
 	  memory is set as write-combining cache type. This option
 	  enables marking the graphics memory as write-combining.
 
-menu "Display"
-
-config FRAMEBUFFER_SET_VESA_MODE
-	prompt "Set framebuffer graphics resolution"
-	bool
-	help
-	  Set VESA/native framebuffer mode (needed for bootsplash and graphical framebuffer console)
-
-choice
-	prompt "framebuffer graphics resolution"
-	default FRAMEBUFFER_VESA_MODE_117
-	depends on FRAMEBUFFER_SET_VESA_MODE
-	help
-	  This option sets the resolution used for the coreboot framebuffer (and
-	  bootsplash screen).
-
-config FRAMEBUFFER_VESA_MODE_100
-	bool "640x400 256-color"
-
-config FRAMEBUFFER_VESA_MODE_101
-	bool "640x480 256-color"
-
-config FRAMEBUFFER_VESA_MODE_102
-	bool "800x600 16-color"
-
-config FRAMEBUFFER_VESA_MODE_103
-	bool "800x600 256-color"
-
-config FRAMEBUFFER_VESA_MODE_104
-	bool "1024x768 16-color"
-
-config FRAMEBUFFER_VESA_MODE_105
-	bool "1024x7686 256-color"
-
-config FRAMEBUFFER_VESA_MODE_106
-	bool "1280x1024 16-color"
-
-config FRAMEBUFFER_VESA_MODE_107
-	bool "1280x1024 256-color"
-
-config FRAMEBUFFER_VESA_MODE_108
-	bool "80x60 text"
-
-config FRAMEBUFFER_VESA_MODE_109
-	bool "132x25 text"
-
-config FRAMEBUFFER_VESA_MODE_10A
-	bool "132x43 text"
-
-config FRAMEBUFFER_VESA_MODE_10B
-	bool "132x50 text"
-
-config FRAMEBUFFER_VESA_MODE_10C
-	bool "132x60 text"
-
-config FRAMEBUFFER_VESA_MODE_10D
-	bool "320x200 32k-color (1:5:5:5)"
-
-config FRAMEBUFFER_VESA_MODE_10E
-	bool "320x200 64k-color (5:6:5)"
-
-config FRAMEBUFFER_VESA_MODE_10F
-	bool "320x200 16.8M-color (8:8:8)"
-
-config FRAMEBUFFER_VESA_MODE_110
-	bool "640x480 32k-color (1:5:5:5)"
-
-config FRAMEBUFFER_VESA_MODE_111
-	bool "640x480 64k-color (5:6:5)"
-
-config FRAMEBUFFER_VESA_MODE_112
-	bool "640x480 16.8M-color (8:8:8)"
-
-config FRAMEBUFFER_VESA_MODE_113
-	bool "800x600 32k-color (1:5:5:5)"
-
-config FRAMEBUFFER_VESA_MODE_114
-	bool "800x600 64k-color (5:6:5)"
-
-config FRAMEBUFFER_VESA_MODE_115
-	bool "800x600 16.8M-color (8:8:8)"
-
-config FRAMEBUFFER_VESA_MODE_116
-	bool "1024x768 32k-color (1:5:5:5)"
-
-config FRAMEBUFFER_VESA_MODE_117
-	bool "1024x768 64k-color (5:6:5)"
-
-config FRAMEBUFFER_VESA_MODE_118
-	bool "1024x768 16.8M-color (8:8:8)"
-
-config FRAMEBUFFER_VESA_MODE_119
-	bool "1280x1024 32k-color (1:5:5:5)"
-
-config FRAMEBUFFER_VESA_MODE_11A
-	bool "1280x1024 64k-color (5:6:5)"
-
-config FRAMEBUFFER_VESA_MODE_11B
-	bool "1280x1024 16.8M-color (8:8:8)"
-
-config FRAMEBUFFER_VESA_MODE_USER
-	bool "Manually select VESA mode"
-
-endchoice
-
-# Map the config names to an integer (KB).
-config FRAMEBUFFER_VESA_MODE
-	prompt "VESA mode" if FRAMEBUFFER_VESA_MODE_USER
-	hex
-	default 0x100 if FRAMEBUFFER_VESA_MODE_100
-	default 0x101 if FRAMEBUFFER_VESA_MODE_101
-	default 0x102 if FRAMEBUFFER_VESA_MODE_102
-	default 0x103 if FRAMEBUFFER_VESA_MODE_103
-	default 0x104 if FRAMEBUFFER_VESA_MODE_104
-	default 0x105 if FRAMEBUFFER_VESA_MODE_105
-	default 0x106 if FRAMEBUFFER_VESA_MODE_106
-	default 0x107 if FRAMEBUFFER_VESA_MODE_107
-	default 0x108 if FRAMEBUFFER_VESA_MODE_108
-	default 0x109 if FRAMEBUFFER_VESA_MODE_109
-	default 0x10A if FRAMEBUFFER_VESA_MODE_10A
-	default 0x10B if FRAMEBUFFER_VESA_MODE_10B
-	default 0x10C if FRAMEBUFFER_VESA_MODE_10C
-	default 0x10D if FRAMEBUFFER_VESA_MODE_10D
-	default 0x10E if FRAMEBUFFER_VESA_MODE_10E
-	default 0x10F if FRAMEBUFFER_VESA_MODE_10F
-	default 0x110 if FRAMEBUFFER_VESA_MODE_110
-	default 0x111 if FRAMEBUFFER_VESA_MODE_111
-	default 0x112 if FRAMEBUFFER_VESA_MODE_112
-	default 0x113 if FRAMEBUFFER_VESA_MODE_113
-	default 0x114 if FRAMEBUFFER_VESA_MODE_114
-	default 0x115 if FRAMEBUFFER_VESA_MODE_115
-	default 0x116 if FRAMEBUFFER_VESA_MODE_116
-	default 0x117 if FRAMEBUFFER_VESA_MODE_117
-	default 0x118 if FRAMEBUFFER_VESA_MODE_118
-	default 0x119 if FRAMEBUFFER_VESA_MODE_119
-	default 0x11A if FRAMEBUFFER_VESA_MODE_11A
-	default 0x11B if FRAMEBUFFER_VESA_MODE_11B
-	default 0x117 if FRAMEBUFFER_VESA_MODE_USER
-
-endmenu
-
 config HAVE_FSP
 	bool "Add an Firmware Support Package binary"
 	help
configs/minnowmax_defconfig +1 -0
index 426fb52..3d22229 100644
@@ -4,6 +4,7 @@ CONFIG_TARGET_MINNOWMAX=y
 CONFIG_OF_CONTROL=y
 CONFIG_OF_SEPARATE=y
 CONFIG_DEFAULT_DEVICE_TREE="minnowmax"
+CONFIG_VIDEO_VESA=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 CONFIG_FRAMEBUFFER_VESA_MODE_11A=y
 CONFIG_MMCONF_BASE_ADDRESS=0xe0000000
drivers/video/Kconfig +138 -0

144 lines not on this page · raw message

include/configs/minnowmax.h +0 -3
index 2a1915d..04d6b4c 100644
@@ -56,9 +56,6 @@
 #define CONFIG_X86_OPTION_ROM_FILE		vga.bin
 #define CONFIG_X86_OPTION_ROM_ADDR		0xfff90000
 
-#ifndef CONFIG_SYS_COREBOOT
-#define CONFIG_VIDEO_VESA
-#endif
 #define VIDEO_IO_OFFSET				0
 #define CONFIG_X86EMU_RAW_IO
 #define CONFIG_VGA_AS_SINGLE_DEVICE
Signature · 1 line
1.8.2.1
#2 lore raw

PATCH v2 2/3 x86: Move FRAMEBUFFER_SET_VESA_MODE etc to video Kconfig

Quoted 9 lines · Bin Meng

CONFIG_FRAMEBUFFER_SET_VESA_MODE and CONFIG_FRAMEBUFFER_VESA_MODE are not x86-specific, so move them to drivers/video/Kconfig and make them depend on VIDEO_VESA driver. Some cosmetic fixes are applied to the Kconfig help text as well.

---

Quoted 7 lines

Changes in v2: None

 arch/x86/Kconfig            | 141 --------------------------------------------
 configs/minnowmax_defconfig |   1 +
 drivers/video/Kconfig       | 138 +++++++++++++++++++++++++++++++++++++++++++
 include/configs/minnowmax.h |   3 -
 4 files changed, 139 insertions(+), 144 deletions(-)

Applied to u-boot-x86, thanks!

author
#3 lore raw

PATCH v2 3/3 x86: qemu: Add graphics support

In reply to a message not in the archive

It turns out that QEMU x86 emulated graphic card has a built-in option ROM which can be run perfectly with native mode by U-Boot.

---

Changes in v2:
- Drop the patch that tries to clean up the CONFIG_VGA_AS_SINGLE_DEVICE wraps
- Update README.x86 to mention QEMU version

 arch/x86/cpu/qemu/pci.c    | 24 +++++++++++++++++++++++-
 configs/qemu-x86_defconfig |  3 +++
 doc/README.x86             |  7 ++++++-
 include/configs/qemu-x86.h | 10 +++-------
 4 files changed, 35 insertions(+), 9 deletions(-)
arch/x86/cpu/qemu/pci.c +23 -1
index d50ab75..ac9c056 100644
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <pci.h>
+#include <pci_rom.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -45,5 +46,26 @@ void board_pci_setup_hose(struct pci_controller *hose)
 
 int board_pci_post_scan(struct pci_controller *hose)
 {
-	return 0;
+	int ret = 0;
+	ulong start;
+	pci_dev_t bdf;
+	struct pci_device_id graphic_card[] = { { 0x1234, 0x1111 } };
+
+	/*
+	 * QEMU emulated graphic card shows in the PCI configuration space with
+	 * PCI vendor id and device id as an artificial pair 0x1234:0x1111.
+	 * It is on PCI bus 0, function 0, but device number is not consistent
+	 * for the two x86 targets it supports. For i440FX and PIIX chipset
+	 * board, it shows as device 2, while for Q35 and ICH9 chipset board,
+	 * it shows as device 1. Here we locate its bdf at run-time based on
+	 * its vendor id and device id pair so we can support both boards.
+	 */
+	bdf = pci_find_devices(graphic_card, 0);
+	if (bdf != -1) {
+		start = get_timer(0);
+		ret = pci_run_vga_bios(bdf, NULL, PCI_ROM_USE_NATIVE);
+		debug("BIOS ran in %lums\n", get_timer(start));
+	}
+
+	return ret;
 }
configs/qemu-x86_defconfig +3 -0
index 9b02322..198ab97 100644
@@ -4,3 +4,6 @@ CONFIG_TARGET_QEMU_X86=y
 CONFIG_OF_CONTROL=y
 CONFIG_OF_SEPARATE=y
 CONFIG_DEFAULT_DEVICE_TREE="qemu-x86"
+CONFIG_VIDEO_VESA=y
+CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
+CONFIG_FRAMEBUFFER_VESA_MODE_111=y
doc/README.x86 +6 -1
index 4a30f68..0726205 100644
@@ -218,7 +218,8 @@ works correctly for link though.
 Test with QEMU
 --------------
 QEMU is a fancy emulator that can enable us to test U-Boot without access to
-a real x86 board. To launch QEMU with u-boot.rom, call QEMU as follows:
+a real x86 board. Please make sure your QEMU version is 2.3.0 or above test
+U-Boot. To launch QEMU with u-boot.rom, call QEMU as follows:
 
 $ qemu-system-i386 -nographic -bios path/to/u-boot.rom
 
@@ -239,6 +240,10 @@ supports 3 GiB maximum system memory and reserves the last 1 GiB address space
 for PCI device memory-mapped I/O and other stuff, so the maximum value of '-m'
 would be 3072.
 
+QEMU emulates a graphic card which U-Boot supports. Removing '-nographic' will
+show QEMU's VGA console window. Note this will disable QEMU's serial output.
+If you want to check both consoles, use '-serial stdio'.
+
 CPU Microcode
 -------------
 Modern CPUs usually require a special bit stream called microcode [6] to be
include/configs/qemu-x86.h +3 -7
index 281aaa5..6467c38 100644
@@ -36,9 +36,9 @@
 #define CONFIG_E1000
 #endif
 
-#define CONFIG_STD_DEVICES_SETTINGS	"stdin=serial\0" \
-					"stdout=serial\0" \
-					"stderr=serial\0"
+#define CONFIG_STD_DEVICES_SETTINGS	"stdin=serial,vga\0" \
+					"stdout=serial,vga\0" \
+					"stderr=serial,vga\0"
 
 #define CONFIG_SCSI_DEV_LIST		\
 	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371SB_1}
@@ -52,8 +52,4 @@
 #undef CONFIG_ENV_IS_IN_SPI_FLASH
 #define CONFIG_ENV_IS_NOWHERE
 
-/* Video is not supported */
-#undef CONFIG_VIDEO
-#undef CONFIG_CFB_CONSOLE
-
 #endif	/* __CONFIG_H */
Signature · 1 line
1.8.2.1
#4 lore raw

PATCH v2 3/3 x86: qemu: Add graphics support

Quoted 11 lines · Bin Meng

It turns out that QEMU x86 emulated graphic card has a built-in option ROM which can be run perfectly with native mode by U-Boot.

---

Changes in v2:
- Drop the patch that tries to clean up the CONFIG_VGA_AS_SINGLE_DEVICE wraps
- Update README.x86 to mention QEMU version

Quoted 5 lines
 arch/x86/cpu/qemu/pci.c    | 24 +++++++++++++++++++++++-
 configs/qemu-x86_defconfig |  3 +++
 doc/README.x86             |  7 ++++++-
 include/configs/qemu-x86.h | 10 +++-------
 4 files changed, 35 insertions(+), 9 deletions(-)
#5 lore raw

PATCH v2 3/3 x86: qemu: Add graphics support

Quoted 12 lines · Simon Glass
Quoted 11 lines · Bin Meng

It turns out that QEMU x86 emulated graphic card has a built-in option ROM which can be run perfectly with native mode by U-Boot.

---

Changes in v2:
- Drop the patch that tries to clean up the CONFIG_VGA_AS_SINGLE_DEVICE wraps
- Update README.x86 to mention QEMU version

Quoted 7 lines
Quoted 5 lines
 arch/x86/cpu/qemu/pci.c    | 24 +++++++++++++++++++++++-
 configs/qemu-x86_defconfig |  3 +++
 doc/README.x86             |  7 ++++++-
 include/configs/qemu-x86.h | 10 +++-------
 4 files changed, 35 insertions(+), 9 deletions(-)

Applied to u-boot-x86, thanks!

#6 lore raw

PATCH v2 3/3 x86: qemu: Add graphics support

Hi Bin,

Quoted 19 lines · Simon Glass
Quoted 18 lines · Simon Glass
Quoted 16 lines · Bin Meng

It turns out that QEMU x86 emulated graphic card has a built-in option ROM which can be run perfectly with native mode by U-Boot.

---

Changes in v2:
- Drop the patch that tries to clean up the CONFIG_VGA_AS_SINGLE_DEVICE wraps
- Update README.x86 to mention QEMU version

 arch/x86/cpu/qemu/pci.c    | 24 +++++++++++++++++++++++-
 configs/qemu-x86_defconfig |  3 +++
 doc/README.x86             |  7 ++++++-
 include/configs/qemu-x86.h | 10 +++-------
 4 files changed, 35 insertions(+), 9 deletions(-)
Quoted 3 lines
Quoted 1 line

Applied to u-boot-x86, thanks!

I'm see this failure with coreboot-x86. I can't really explain it since all seemed well when I applied these patches. Can you please take a look? The branch is at u-boot-x86/testing.

+drivers/built-in.o: In function `video_init':
+build/../drivers/video/cfb_console.c:2139: undefined reference to `video_hw_init'
+make[1]: *** [u-boot] Error 1

Regards,
Simon

author
#7 lore raw

PATCH v2 3/3 x86: qemu: Add graphics support

Hi Simon,

Quoted 32 lines · Simon Glass

Hi Bin,

Quoted 19 lines · Simon Glass
Quoted 18 lines · Simon Glass
Quoted 16 lines · Bin Meng

It turns out that QEMU x86 emulated graphic card has a built-in option ROM which can be run perfectly with native mode by U-Boot.

---

Changes in v2:
- Drop the patch that tries to clean up the CONFIG_VGA_AS_SINGLE_DEVICE wraps
- Update README.x86 to mention QEMU version

 arch/x86/cpu/qemu/pci.c    | 24 +++++++++++++++++++++++-
 configs/qemu-x86_defconfig |  3 +++
 doc/README.x86             |  7 ++++++-
 include/configs/qemu-x86.h | 10 +++-------
 4 files changed, 35 insertions(+), 9 deletions(-)
Quoted 3 lines
Quoted 1 line

Applied to u-boot-x86, thanks!

I'm see this failure with coreboot-x86. I can't really explain it since all seemed well when I applied these patches. Can you please take a look? The branch is at u-boot-x86/testing.

(quoted diff) +2 -0
+drivers/built-in.o: In function `video_init':
+build/../drivers/video/cfb_console.c:2139: undefined reference to
Quoted 3 lines

`video_hw_init'
+make[1]: *** [u-boot] Error 1

Yes, I will have a look.

Regards,
Bin