Skip to contentSkip to conversation

x86: dm: video: Convert to use DM video drivers on all x86 boards

PATCH New Bin Meng 2 participants 34 messages Oct 9, 2016 – Oct 12, 2016

Subsystems (3)
lore
Share & tools
lore

Bin Meng

author
#0 lore raw

cover x86: dm: video: Convert to use DM video drivers on all x86 boards

This adds two new DM video drivers, one for VESA compatible device, the other one for coreboot framebuffer device. All x86 boards have been converted to use the new drivers.

Tested on Intel Crown Bay using an external graphics card, on QEMU using the on-board VGA with DM VESA driver.
Tested on QEMU using the on-board VGA with DM coreboot framebuffer driver, U-Boot as coreboot payload.

This series is available at u-boot-x86/video-working.

Bin Meng (11):
x86: doc: Document coreboot framebuffer driver issue on QEMU
dm: video: Add driver for VESA compatible device
dm: video: Output verbose information in vbe_setup_video()
x86: Convert to use DM VESA video driver
x86: doc: Correct qfw command example
vbe: Make vbe_setup_video_priv() public
dm: video: Add driver for coreboot framebuffer device
dm: video: Don't do anything in alloc_fb() when plat->size is zero
x86: coreboot: Convert to use DM coreboot video driver
video: Remove legacy VESA and coreboot framebuffer drivers
x86: Clean up unused macros in the configuration headers

 arch/x86/cpu/coreboot/Kconfig                      |   4 -
 arch/x86/dts/bayleybay.dts                         |   1 +
 arch/x86/dts/broadwell_som-6896.dts                |   1 +
 arch/x86/dts/chromebook_link.dts                   |   1 +
 arch/x86/dts/chromebook_samus.dts                  |   1 +
 arch/x86/dts/chromebox_panther.dts                 |   1 +
 arch/x86/dts/coreboot_fb.dtsi                      |   5 +
 arch/x86/dts/minnowmax.dts                         |   1 +
 configs/bayleybay_defconfig                        |   1 +
 configs/chromebox_panther_defconfig                |   1 +
 ...conga-qeval20-qa3-e3845-internal-uart_defconfig |   1 +
 configs/conga-qeval20-qa3-e3845_defconfig          |   1 +
 configs/coreboot-x86_defconfig                     |   2 +
 configs/crownbay_defconfig                         |   1 +
 configs/dfi-bt700-q7x-151_defconfig                |   1 +
 configs/minnowmax_defconfig                        |   1 +
 configs/qemu-x86_defconfig                         |   1 +
 configs/qemu-x86_efi_payload32_defconfig           |   1 +
 configs/qemu-x86_efi_payload64_defconfig           |   1 +
 configs/som-db5800-som-6867_defconfig              |   1 +
 configs/theadorable-x86-dfi-bt700_defconfig        |   1 +
 doc/README.x86                                     |   9 +-
 drivers/pci/pci_rom.c                              |  15 ++-
 drivers/video/Kconfig                              |   9 ++
 drivers/video/Makefile                             |   4 +-
 drivers/video/coreboot.c                           |  79 +++++++++++++++
 drivers/video/coreboot_fb.c                        | 108 ---------------------
 drivers/video/vesa.c                               |  34 +++++++
 drivers/video/vesa_fb.c                            |  63 ------------
 drivers/video/video-uclass.c                       |   3 +
 include/configs/bayleybay.h                        |   6 +-
 include/configs/cougarcanyon2.h                    |   4 -
 include/configs/crownbay.h                         |   4 +-
 include/configs/efi-x86.h                          |   2 -
 include/configs/galileo.h                          |   4 -
 include/configs/minnowmax.h                        |   6 +-
 include/configs/qemu-x86.h                         |   4 +-
 include/configs/som-6896.h                         |   6 +-
 include/configs/som-db5800-som-6867.h              |   6 +-
 include/configs/x86-chromebook.h                   |  12 +--
 include/configs/x86-common.h                       |   7 --
 include/vbe.h                                      |   4 +
 42 files changed, 194 insertions(+), 224 deletions(-)
 create mode 100644 arch/x86/dts/coreboot_fb.dtsi
 create mode 100644 drivers/video/coreboot.c
 delete mode 100644 drivers/video/coreboot_fb.c
 create mode 100644 drivers/video/vesa.c
 delete mode 100644 drivers/video/vesa_fb.c
Signature · 1 line
2.9.2
author
#1 lore raw

PATCH 1/11 x86: doc: Document coreboot framebuffer driver issue on QEMU

For some unknown reason, coreboot framebuffer driver never works on QEMU since day 1. It seems the driver only works on real hardware. Document this issue.

---

 doc/README.x86 | 3 +++
 1 file changed, 3 insertions(+)
doc/README.x86 +3 -0
index ba5bb99..437dc29 100644
@@ -385,6 +385,9 @@ At present it seems that for Minnowboard Max, coreboot does not pass through
 the video information correctly (it always says the resolution is 0x0). This
 works correctly for link though.
 
+Note: coreboot framebuffer driver does not work on QEMU. The reason is unknown
+at this point. Patches are welcome if you figure out anything wrong.
+
 Test with QEMU for bare mode
 ----------------------------
 QEMU is a fancy emulator that can enable us to test U-Boot without access to
Signature · 1 line
2.9.2
author
#4 lore raw

PATCH 2/11 dm: video: Add driver for VESA compatible device

In reply to Bin Meng

This adds a DM driver for VESA compatible device.

---

 drivers/video/vesa.c | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 drivers/video/vesa.c
drivers/video/vesa.c new file +34 -0
new file mode 100644
index 0000000..ddf8df8
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2016, Bin Meng <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <pci.h>
+#include <vbe.h>
+
+static int vesa_video_probe(struct udevice *dev)
+{
+	return vbe_setup_video(dev, NULL);
+}
+
+static const struct udevice_id vesa_video_ids[] = {
+	{ .compatible = "vesa-fb" },
+	{ }
+};
+
+U_BOOT_DRIVER(vesa_video) = {
+	.name	= "vesa_video",
+	.id	= UCLASS_VIDEO,
+	.of_match = vesa_video_ids,
+	.probe	= vesa_video_probe,
+};
+
+static struct pci_device_id vesa_video_supported[] = {
+	{ PCI_DEVICE_CLASS(PCI_CLASS_DISPLAY_VGA << 8, ~0) },
+	{ },
+};
+
+U_BOOT_PCI_DEVICE(vesa_video, vesa_video_supported);
Signature · 1 line
2.9.2
author
#7 lore raw

PATCH 3/11 dm: video: Output verbose information in vbe_setup_video()

In reply to Bin Meng

With DM conversion, information like "Video: 1024x768x16" is not shown anymore. Now add these verbose output back.

---

 drivers/pci/pci_rom.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/pci/pci_rom.c +8 -1
index 21ed17c..5746c3d 100644
@@ -382,9 +382,13 @@ int vbe_setup_video(struct udevice *dev, int (*int15_handler)(void))
 	struct video_priv *uc_priv = dev_get_uclass_priv(dev);
 	int ret;
 
+	printf("Video: ");
+
 	/* If we are running from EFI or coreboot, this can't work */
-	if (!ll_boot_init())
+	if (!ll_boot_init()) {
+		printf("Not available (previous bootloader prevents it)\n");
 		return -EPERM;
+	}
 	bootstage_start(BOOTSTAGE_ID_ACCUM_LCD, "vesa display");
 	ret = dm_pci_run_vga_bios(dev, int15_handler, PCI_ROM_USE_NATIVE |
 					PCI_ROM_ALLOW_FALLBACK);
@@ -400,6 +404,9 @@ int vbe_setup_video(struct udevice *dev, int (*int15_handler)(void))
 		return ret;
 	}
 
+	printf("%dx%dx%d\n", uc_priv->xsize, uc_priv->ysize,
+	       mode_info.vesa.bits_per_pixel);
+
 	return 0;
 }
 #endif
Signature · 1 line
2.9.2
author
#10 lore raw

PATCH 4/11 x86: Convert to use DM VESA video driver

In reply to Bin Meng

At present only chromebook boards are converted to DM video. Other x86 boards are still using the legacy cfb_console driver. This switches to use DM version drivers.

---

 configs/bayleybay_defconfig                             | 1 +
 configs/chromebox_panther_defconfig                     | 1 +
 configs/conga-qeval20-qa3-e3845-internal-uart_defconfig | 1 +
 configs/conga-qeval20-qa3-e3845_defconfig               | 1 +
 configs/crownbay_defconfig                              | 1 +
 configs/dfi-bt700-q7x-151_defconfig                     | 1 +
 configs/minnowmax_defconfig                             | 1 +
 configs/qemu-x86_defconfig                              | 1 +
 configs/qemu-x86_efi_payload32_defconfig                | 1 +
 configs/qemu-x86_efi_payload64_defconfig                | 1 +
 configs/som-db5800-som-6867_defconfig                   | 1 +
 configs/theadorable-x86-dfi-bt700_defconfig             | 1 +
 drivers/video/Makefile                                  | 2 +-
 include/configs/bayleybay.h                             | 6 +++---
 include/configs/crownbay.h                              | 4 ++--
 include/configs/minnowmax.h                             | 6 +++---
 include/configs/qemu-x86.h                              | 4 ++--
 include/configs/som-db5800-som-6867.h                   | 6 +++---
 18 files changed, 26 insertions(+), 14 deletions(-)
configs/bayleybay_defconfig +1 -0
index 64e3d31..f8f5f5c 100644
@@ -53,6 +53,7 @@ CONFIG_TIMER=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_DM_VIDEO=y
 CONFIG_VIDEO_VESA=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 CONFIG_FRAMEBUFFER_VESA_MODE_11A=y
configs/chromebox_panther_defconfig +1 -0
index 2557d35..6df4d4c 100644
@@ -49,6 +49,7 @@ CONFIG_TPM_TIS_LPC=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_DM_VIDEO=y
 CONFIG_VIDEO_VESA=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 CONFIG_FRAMEBUFFER_VESA_MODE_11A=y
configs/conga-qeval20-qa3-e3845-internal-uart_defconfig +1 -0
index f0da176..6bee9c6 100644
@@ -61,6 +61,7 @@ CONFIG_TIMER=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_DM_VIDEO=y
 CONFIG_VIDEO_VESA=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 CONFIG_FRAMEBUFFER_VESA_MODE_114=y
configs/conga-qeval20-qa3-e3845_defconfig +1 -0
index 63c2cbd..76ff904 100644
@@ -60,6 +60,7 @@ CONFIG_TIMER=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_DM_VIDEO=y
 CONFIG_VIDEO_VESA=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 CONFIG_FRAMEBUFFER_VESA_MODE_114=y
configs/crownbay_defconfig +1 -0
index d0cd9db..b37fce7 100644
@@ -47,6 +47,7 @@ CONFIG_TIMER=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_DM_VIDEO=y
 CONFIG_VIDEO_VESA=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 CONFIG_USE_PRIVATE_LIBGCC=y
configs/dfi-bt700-q7x-151_defconfig +1 -0
index 245d0c7..3931896 100644
@@ -58,6 +58,7 @@ CONFIG_TIMER=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_DM_VIDEO=y
 CONFIG_VIDEO_VESA=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 CONFIG_FRAMEBUFFER_VESA_MODE_114=y
configs/minnowmax_defconfig +1 -0
index 3d3a30d..1446ab6 100644
@@ -57,6 +57,7 @@ CONFIG_TIMER=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_DM_VIDEO=y
 CONFIG_VIDEO_VESA=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 CONFIG_FRAMEBUFFER_VESA_MODE_11A=y
configs/qemu-x86_defconfig +1 -0
index 769adf6..4cf0866 100644
@@ -44,6 +44,7 @@ CONFIG_TIMER=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_DM_VIDEO=y
 CONFIG_VIDEO_VESA=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 CONFIG_FRAMEBUFFER_VESA_MODE_111=y
configs/qemu-x86_efi_payload32_defconfig +1 -0
index 75e7203..fd6afb8 100644
@@ -41,6 +41,7 @@ CONFIG_TIMER=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_DM_VIDEO=y
 CONFIG_VIDEO_VESA=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 CONFIG_FRAMEBUFFER_VESA_MODE_111=y
configs/qemu-x86_efi_payload64_defconfig +1 -0
index 4bcd0dc..c6664b0 100644
@@ -41,6 +41,7 @@ CONFIG_TIMER=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_DM_VIDEO=y
 CONFIG_VIDEO_VESA=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 CONFIG_FRAMEBUFFER_VESA_MODE_111=y
configs/som-db5800-som-6867_defconfig +1 -0
index 4cfaeda..9fc169d 100644
@@ -55,6 +55,7 @@ CONFIG_TIMER=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_DM_VIDEO=y
 CONFIG_VIDEO_VESA=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 CONFIG_FRAMEBUFFER_VESA_MODE_11A=y
configs/theadorable-x86-dfi-bt700_defconfig +1 -0
index cea91b6..43dc2fa 100644
@@ -55,6 +55,7 @@ CONFIG_TIMER=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_DM_VIDEO=y
 CONFIG_VIDEO_VESA=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 CONFIG_FRAMEBUFFER_VESA_MODE_114=y
drivers/video/Makefile +1 -1
index b888e99..8a99d24 100644
@@ -58,7 +58,7 @@ obj-$(CONFIG_VIDEO_SMI_LYNXEM) += smiLynxEM.o videomodes.o
 obj-$(CONFIG_VIDEO_SUNXI) += sunxi_display.o videomodes.o
 obj-$(CONFIG_VIDEO_TEGRA20) += tegra.o
 obj-$(CONFIG_VIDEO_VCXK) += bus_vcxk.o
-obj-$(CONFIG_VIDEO_VESA) += vesa_fb.o
+obj-$(CONFIG_VIDEO_VESA) += vesa.o
 obj-$(CONFIG_FORMIKE) += formike.o
 obj-$(CONFIG_LG4573) += lg4573.o
 obj-$(CONFIG_AM335X_LCD) += am335x-fb.o
include/configs/bayleybay.h +3 -3
index 8f31436..40b13d1 100644
@@ -18,9 +18,9 @@
 
 #define CONFIG_PCI_PNP
 
-#define CONFIG_STD_DEVICES_SETTINGS	"stdin=serial,vga,usbkbd\0" \
-					"stdout=serial,vga\0" \
-					"stderr=serial,vga\0"
+#define CONFIG_STD_DEVICES_SETTINGS	"stdin=serial,usbkbd\0" \
+					"stdout=serial,vidconsole\0" \
+					"stderr=serial,vidconsole\0"
 
 #define CONFIG_SCSI_DEV_LIST		\
 	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_VALLEYVIEW_SATA}, \
include/configs/crownbay.h +2 -2
index 49ed3ef..64ad736 100644
@@ -22,8 +22,8 @@
 #define CONFIG_PCI_PNP
 
 #define CONFIG_STD_DEVICES_SETTINGS	"stdin=serial,i8042-kbd,usbkbd\0" \
-					"stdout=serial,vga\0" \
-					"stderr=serial,vga\0"
+					"stdout=serial,vidconsole\0" \
+					"stderr=serial,vidconsole\0"
 
 #define CONFIG_SCSI_DEV_LIST		\
 	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TCF_SATA}
include/configs/minnowmax.h +3 -3
index 95ad128..935c88d 100644
@@ -20,9 +20,9 @@
 #define CONFIG_SMSC_LPC47M
 
 #define CONFIG_PCI_PNP
-#define CONFIG_STD_DEVICES_SETTINGS     "stdin=usbkbd,vga,serial\0" \
-					"stdout=vga,serial\0" \
-					"stderr=vga,serial\0"
+#define CONFIG_STD_DEVICES_SETTINGS	"stdin=usbkbd,serial\0" \
+					"stdout=vidconsole,serial\0" \
+					"stderr=vidconsole,serial\0"
 
 #define CONFIG_SCSI_DEV_LIST		\
 	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_VALLEYVIEW_SATA}, \
include/configs/qemu-x86.h +2 -2
index 476d37d..a2dd79b 100644
@@ -19,8 +19,8 @@
 #define CONFIG_PCI_PNP
 
 #define CONFIG_STD_DEVICES_SETTINGS	"stdin=serial,i8042-kbd\0" \
-					"stdout=serial,vga\0" \
-					"stderr=serial,vga\0"
+					"stdout=serial,vidconsole\0" \
+					"stderr=serial,vidconsole\0"
 
 /*
  * ATA/SATA support for QEMU x86 targets
include/configs/som-db5800-som-6867.h +3 -3
index a4b343e..a13be14 100644
@@ -19,9 +19,9 @@
 #define CONFIG_ARCH_MISC_INIT
 
 #define CONFIG_PCI_PNP
-#define CONFIG_STD_DEVICES_SETTINGS     "stdin=serial,usbkbd,vga\0" \
-					"stdout=serial,vga\0" \
-					"stderr=serial,vga\0"
+#define CONFIG_STD_DEVICES_SETTINGS	"stdin=serial,usbkbd\0" \
+					"stdout=serial,vidconsole\0" \
+					"stderr=serial,vidconsole\0"
 
 #define CONFIG_SCSI_DEV_LIST		\
 	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_VALLEYVIEW_SATA}, \
Signature · 1 line
2.9.2
author
#13 lore raw

PATCH 5/11 x86: doc: Correct qfw command example

In reply to Bin Meng

The kernel load address for zboot should be 0x1000000.

---

 doc/README.x86 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
doc/README.x86 +1 -1
index 437dc29..c34f455 100644
@@ -449,7 +449,7 @@ loading kernel to address 01000000 size 5d9d30 initrd 04000000 size 1b1ab50
 Here the kernel (bzImage) is loaded to 01000000 and initrd is to 04000000. Then,
 'zboot' can be used to boot the kernel:
 
-=> zboot 02000000 - 04000000 1b1ab50
+=> zboot 01000000 - 04000000 1b1ab50
 
 CPU Microcode
 -------------
Signature · 1 line
2.9.2
author
#16 lore raw

PATCH 6/11 vbe: Make vbe_setup_video_priv() public

In reply to Bin Meng

vbe_setup_video_priv() might be useful to other drivers.

---

 drivers/pci/pci_rom.c | 6 +++---
 include/vbe.h         | 4 ++++
 2 files changed, 7 insertions(+), 3 deletions(-)
drivers/pci/pci_rom.c +3 -3
index 5746c3d..cd083f7 100644
@@ -351,9 +351,9 @@ err:
 }
 
 #ifdef CONFIG_DM_VIDEO
-static int vbe_setup_video_priv(struct vesa_mode_info *vesa,
-				struct video_priv *uc_priv,
-				struct video_uc_platdata *plat)
+int vbe_setup_video_priv(struct vesa_mode_info *vesa,
+			 struct video_priv *uc_priv,
+			 struct video_uc_platdata *plat)
 {
 	if (!vesa->x_resolution)
 		return -ENXIO;
include/vbe.h +4 -0
index a743892..16bb096 100644
@@ -107,6 +107,10 @@ extern struct vbe_mode_info mode_info;
 struct graphic_device;
 int vbe_get_video_info(struct graphic_device *gdev);
 struct video_priv;
+struct video_uc_platdata;
+int vbe_setup_video_priv(struct vesa_mode_info *vesa,
+			 struct video_priv *uc_priv,
+			 struct video_uc_platdata *plat);
 int vbe_setup_video(struct udevice *dev, int (*int15_handler)(void));
 
 #endif
Signature · 1 line
2.9.2
author
#19 lore raw

PATCH 7/11 dm: video: Add driver for coreboot framebuffer device

In reply to Bin Meng

This adds a DM driver for coreboot framebuffer device.

---

 drivers/video/Kconfig    |  9 ++++++
 drivers/video/coreboot.c | 79 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 88 insertions(+)
 create mode 100644 drivers/video/coreboot.c
drivers/video/Kconfig +9 -0
index fd26690..554a03f 100644
@@ -101,6 +101,15 @@ config VIDCONSOLE_AS_LCD
 	  to update the environment, the breakage may be confusing for users.
 	  This option will be removed around the end of 2016.
 
+config VIDEO_COREBOOT
+	bool "Enable coreboot framebuffer driver support"
+	depends on X86 && SYS_COREBOOT
+	help
+	  Turn on this option to enable a framebuffer driver when U-Boot is
+	  loaded by coreboot where graphics device is configured by coreboot
+	  already. This can in principle be used with any platform that
+	  coreboot supports.
+
 config VIDEO_VESA
 	bool "Enable VESA video driver support"
 	default n
drivers/video/coreboot.c new file +79 -0

79 lines not on this page · raw message

Signature · 1 line
2.9.2
author
#22 lore raw

PATCH 8/11 dm: video: Don't do anything in alloc_fb() when plat->size is zero

In reply to Bin Meng

With DM VESA driver on x86 boards, plat->base/size/align are all zeroes and starting address passed to alloc_fb() happens to be 1MB aligned, so this routine does not trigger any issue. On QEMU with U-Boot as coreboot payload, the starting address is within 1MB range (eg: 0x7fb0000), thus causes failure in video_post_bind().

Actually if plat->size is zero, it makes no sense to do anything in this routine. Add such check there.

---

 drivers/video/video-uclass.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/video/video-uclass.c +3 -0
index b6dd0f5..11ca793 100644
@@ -54,6 +54,9 @@ static ulong alloc_fb(struct udevice *dev, ulong *addrp)
 	struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
 	ulong base, align, size;
 
+	if (!plat->size)
+		return 0;
+
 	align = plat->align ? plat->align : 1 << 20;
 	base = *addrp - plat->size;
 	base &= ~(align - 1);
Signature · 1 line
2.9.2
author
#25 lore raw

PATCH 9/11 x86: coreboot: Convert to use DM coreboot video driver

In reply to Bin Meng

This converts coreboot to use DM framebuffer driver.

---

 arch/x86/cpu/coreboot/Kconfig       | 4 ----
 arch/x86/dts/bayleybay.dts          | 1 +
 arch/x86/dts/broadwell_som-6896.dts | 1 +
 arch/x86/dts/chromebook_link.dts    | 1 +
 arch/x86/dts/chromebook_samus.dts   | 1 +
 arch/x86/dts/chromebox_panther.dts  | 1 +
 arch/x86/dts/coreboot_fb.dtsi       | 5 +++++
 arch/x86/dts/minnowmax.dts          | 1 +
 configs/coreboot-x86_defconfig      | 2 ++
 doc/README.x86                      | 4 ++++
 drivers/video/Makefile              | 2 +-
 include/configs/som-6896.h          | 6 +++---
 12 files changed, 21 insertions(+), 8 deletions(-)
 create mode 100644 arch/x86/dts/coreboot_fb.dtsi
arch/x86/cpu/coreboot/Kconfig +0 -4
index e0e3c64..4b3601f 100644
@@ -8,8 +8,4 @@ config CBMEM_CONSOLE
 	bool
 	default y
 
-config VIDEO_COREBOOT
-	bool
-	default y
-
 endif
arch/x86/dts/bayleybay.dts +1 -0
index c8907ce..18b310d 100644
@@ -14,6 +14,7 @@
 /include/ "serial.dtsi"
 /include/ "rtc.dtsi"
 /include/ "tsc_timer.dtsi"
+/include/ "coreboot_fb.dtsi"
 
 / {
 	model = "Intel Bayley Bay";
arch/x86/dts/broadwell_som-6896.dts +1 -0
index 4bb0a34..3966199 100644
@@ -4,6 +4,7 @@
 /include/ "serial.dtsi"
 /include/ "rtc.dtsi"
 /include/ "tsc_timer.dtsi"
+/include/ "coreboot_fb.dtsi"
 
 / {
 	model = "Advantech SOM-6896";
arch/x86/dts/chromebook_link.dts +1 -0
index fb1b31d..b932340 100644
@@ -7,6 +7,7 @@
 /include/ "serial.dtsi"
 /include/ "rtc.dtsi"
 /include/ "tsc_timer.dtsi"
+/include/ "coreboot_fb.dtsi"
 
 / {
 	model = "Google Link";
arch/x86/dts/chromebook_samus.dts +1 -0
index 5dd3e57..52a9ea6 100644
@@ -7,6 +7,7 @@
 /include/ "serial.dtsi"
 /include/ "rtc.dtsi"
 /include/ "tsc_timer.dtsi"
+/include/ "coreboot_fb.dtsi"
 
 / {
 	model = "Google Samus";
arch/x86/dts/chromebox_panther.dts +1 -0
index 480b366..b25c919 100644
@@ -4,6 +4,7 @@
 /include/ "serial.dtsi"
 /include/ "rtc.dtsi"
 /include/ "tsc_timer.dtsi"
+/include/ "coreboot_fb.dtsi"
 
 / {
 	model = "Google Panther";
arch/x86/dts/coreboot_fb.dtsi new file +5 -0
new file mode 100644
index 0000000..7d72f18
@@ -0,0 +1,5 @@
+/ {
+	coreboot-fb {
+		compatible = "coreboot-fb";
+	};
+};
arch/x86/dts/minnowmax.dts +1 -0
index 1a8a8cc..d51318b 100644
@@ -13,6 +13,7 @@
 /include/ "serial.dtsi"
 /include/ "rtc.dtsi"
 /include/ "tsc_timer.dtsi"
+/include/ "coreboot_fb.dtsi"
 
 / {
 	model = "Intel Minnowboard Max";
configs/coreboot-x86_defconfig +2 -0
index 378d75f..b33c5c4 100644
@@ -40,5 +40,7 @@ CONFIG_TPM_TIS_LPC=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_COREBOOT=y
 CONFIG_USE_PRIVATE_LIBGCC=y
 CONFIG_TPM=y
doc/README.x86 +4 -0
index c34f455..6799559 100644
@@ -381,6 +381,10 @@ To enable video you must enable these options in coreboot:
    - Set framebuffer graphics resolution (1280x1024 32k-color (1:5:5))
    - Keep VESA framebuffer
 
+And include coreboot_fb.dtsi in your board's device tree source file, like:
+
+   /include/ "coreboot_fb.dtsi"
+
 At present it seems that for Minnowboard Max, coreboot does not pass through
 the video information correctly (it always says the resolution is 0x0). This
 works correctly for link though.
drivers/video/Makefile +1 -1
index 8a99d24..4a42417 100644
@@ -37,7 +37,7 @@ obj-$(CONFIG_S6E63D6) += s6e63d6.o
 obj-$(CONFIG_LD9040) += ld9040.o
 obj-$(CONFIG_SED156X) += sed156x.o
 obj-$(CONFIG_VIDEO_BCM2835) += bcm2835.o
-obj-$(CONFIG_VIDEO_COREBOOT) += coreboot_fb.o
+obj-$(CONFIG_VIDEO_COREBOOT) += coreboot.o
 obj-$(CONFIG_VIDEO_CT69000) += ct69000.o videomodes.o
 obj-$(CONFIG_VIDEO_DA8XX) += da8xx-fb.o videomodes.o
 obj-$(CONFIG_VIDEO_IMX25LCDC) += imx25lcdc.o videomodes.o
include/configs/som-6896.h +3 -3
index 43a9623..d058603 100644
@@ -27,9 +27,9 @@
 
 #define CONFIG_ARCH_EARLY_INIT_R
 
-#define CONFIG_STD_DEVICES_SETTINGS     "stdin=serial,vga,usbkbd\0" \
-					"stdout=serial,vga\0" \
-					"stderr=serial,vga\0"
+#define CONFIG_STD_DEVICES_SETTINGS	"stdin=serial,usbkbd\0" \
+					"stdout=serial,vidconsole\0" \
+					"stderr=serial,vidconsole\0"
 
 #define CONFIG_ENV_SECT_SIZE		0x1000
 #define CONFIG_ENV_OFFSET		0x00ff0000
Signature · 1 line
2.9.2
author
#28 lore raw

PATCH 10/11 video: Remove legacy VESA and coreboot framebuffer drivers

In reply to Bin Meng

Now that all x86 boards have been converted to DM video, drop the legacy drivers.

---

 drivers/video/coreboot_fb.c | 108 --------------------------------------------
 drivers/video/vesa_fb.c     |  63 --------------------------
 2 files changed, 171 deletions(-)
 delete mode 100644 drivers/video/coreboot_fb.c
 delete mode 100644 drivers/video/vesa_fb.c
drivers/video/coreboot_fb.c deleted +0 -108
deleted file mode 100644
index feb5463..0000000
@@ -1,108 +0,0 @@
-/*
- * coreboot Framebuffer driver.
- *
- * Copyright (C) 2011 The Chromium OS authors
- *
- * SPDX-License-Identifier:	GPL-2.0+
- */
-
-#include <common.h>
-#include <asm/arch/sysinfo.h>
-#include <vbe.h>
-#include <video_fb.h>
-#include "videomodes.h"
-
-/*
- * The Graphic Device
- */
-GraphicDevice ctfb;
-
-static void save_vesa_mode(void)
-{
-	struct vesa_mode_info *vesa = &mode_info.vesa;
-	struct cb_framebuffer *fb = lib_sysinfo.framebuffer;
-
-	vesa->x_resolution = fb->x_resolution;
-	vesa->y_resolution = fb->y_resolution;
-	vesa->bits_per_pixel = fb->bits_per_pixel;
-	vesa->bytes_per_scanline = fb->bytes_per_line;
-	vesa->phys_base_ptr = fb->physical_address;
-	vesa->red_mask_size = fb->red_mask_size;
-	vesa->red_mask_pos = fb->red_mask_pos;
-	vesa->green_mask_size = fb->green_mask_size;
-	vesa->green_mask_pos = fb->green_mask_pos;
-	vesa->blue_mask_size = fb->blue_mask_size;
-	vesa->blue_mask_pos = fb->blue_mask_pos;
-	vesa->reserved_mask_size = fb->reserved_mask_size;
-	vesa->reserved_mask_pos = fb->reserved_mask_pos;
-}
-
-static int parse_coreboot_table_fb(GraphicDevice *gdev)
-{
-	struct cb_framebuffer *fb = lib_sysinfo.framebuffer;
-
-	/* If there is no framebuffer structure, bail out and keep
-	 * running on the serial console.
-	 */
-	if (!fb)
-		return 0;
-
-	gdev->winSizeX = fb->x_resolution;
-	gdev->winSizeY = fb->y_resolution;
-
-	gdev->plnSizeX = fb->x_resolution;
-	gdev->plnSizeY = fb->y_resolution;
-
-	gdev->gdfBytesPP = fb->bits_per_pixel / 8;
-
-	switch (fb->bits_per_pixel) {
-	case 24:
-		gdev->gdfIndex = GDF_32BIT_X888RGB;
-		break;
-	case 16:
-		gdev->gdfIndex = GDF_16BIT_565RGB;
-		break;
-	default:
-		gdev->gdfIndex = GDF__8BIT_INDEX;
-		break;
-	}
-
-	gdev->isaBase = CONFIG_SYS_ISA_IO_BASE_ADDRESS;
-	gdev->pciBase = (unsigned int)fb->physical_address;
-
-	gdev->frameAdrs = (unsigned int)fb->physical_address;
-	gdev->memSize = fb->bytes_per_line * fb->y_resolution;
-
-	gdev->vprBase = (unsigned int)fb->physical_address;
-	gdev->cprBase = (unsigned int)fb->physical_address;
-
-	return 1;
-}
-
-void *video_hw_init(void)
-{
-	GraphicDevice *gdev = &ctfb;
-	int bits_per_pixel;
-
-	printf("Video: ");
-
-	if (!parse_coreboot_table_fb(gdev)) {
-		printf("No video mode configured in coreboot!\n");
-		return NULL;
-	}
-
-	bits_per_pixel = gdev->gdfBytesPP * 8;
-
-	/* fill in Graphic device struct */
-	sprintf(gdev->modeIdent, "%dx%dx%d", gdev->winSizeX, gdev->winSizeY,
-		 bits_per_pixel);
-	printf("%s\n", gdev->modeIdent);
-
-	memset((void *)gdev->pciBase, 0,
-		gdev->winSizeX * gdev->winSizeY * gdev->gdfBytesPP);
-
-	/* Initialize vesa_mode_info structure */
-	save_vesa_mode();
-
-	return (void *)gdev;
-}
drivers/video/vesa_fb.c deleted +0 -63

63 lines not on this page · raw message

Signature · 1 line
2.9.2
author
#31 lore raw

PATCH 11/11 x86: Clean up unused macros in the configuration headers

In reply to Bin Meng

Legacy video driver macros are not needed. Clean them up.

---

 include/configs/cougarcanyon2.h  |  4 ----
 include/configs/efi-x86.h        |  2 --
 include/configs/galileo.h        |  4 ----
 include/configs/x86-chromebook.h | 12 +++---------
 include/configs/x86-common.h     |  7 -------
 5 files changed, 3 insertions(+), 26 deletions(-)
include/configs/cougarcanyon2.h +0 -4
index 88845dc..d20ad96 100644
@@ -27,8 +27,4 @@
 #define CONFIG_ENV_SECT_SIZE		0x1000
 #define CONFIG_ENV_OFFSET		0x5ff000
 
-/* Video is not supported for now */
-#undef CONFIG_VIDEO
-#undef CONFIG_CFB_CONSOLE
-
 #endif	/* __CONFIG_H */
include/configs/efi-x86.h +0 -2
index 95e46c5..5626061 100644
@@ -15,8 +15,6 @@
 
 #undef CONFIG_ENV_IS_IN_SPI_FLASH
 #define CONFIG_ENV_IS_NOWHERE
-#undef CONFIG_VIDEO
-#undef CONFIG_CFB_CONSOLE
 #undef CONFIG_SCSI_AHCI
 #undef CONFIG_SCSI
 #undef CONFIG_INTEL_ICH6_GPIO
include/configs/galileo.h +0 -4
index 40f7fba..034142c 100644
@@ -31,10 +31,6 @@
 #undef CONFIG_SCSI_AHCI
 #undef CONFIG_SCSI
 
-/* Video is not supported in Quark SoC */
-#undef CONFIG_VIDEO
-#undef CONFIG_CFB_CONSOLE
-
 /* SD/MMC support */
 #define CONFIG_MMC
 #define CONFIG_SDHCI
include/configs/x86-chromebook.h +3 -9
index 7fba716..4bcebfc 100644
@@ -53,14 +53,8 @@
 
 #define CONFIG_SYS_WHITE_ON_BLACK
 
-#ifdef CONFIG_DM_VIDEO
-#define VIDEO_DEV "vidconsole"
-#else
-#define VIDEO_DEV "vga"
-#endif
-
-#define CONFIG_STD_DEVICES_SETTINGS     "stdin=usbkbd,i8042-kbd,serial\0" \
-					"stdout=" VIDEO_DEV ",serial\0" \
-					"stderr=" VIDEO_DEV ",serial\0"
+#define CONFIG_STD_DEVICES_SETTINGS	"stdin=usbkbd,i8042-kbd,serial\0" \
+					"stdout=vidconsole,serial\0" \
+					"stderr=vidconsole,serial\0"
 
 #endif
include/configs/x86-common.h +0 -7
index 96c53b8..3926541 100644
@@ -131,13 +131,6 @@
 /*-----------------------------------------------------------------------
  * Video Configuration
  */
-#ifndef CONFIG_DM_VIDEO
-#define CONFIG_VIDEO
-#define CONFIG_VIDEO_SW_CURSOR
-#define VIDEO_FB_16BPP_WORD_SWAP
-#define CONFIG_VGA_AS_SINGLE_DEVICE
-#define CONFIG_CFB_CONSOLE
-#endif
 #define CONFIG_CONSOLE_SCROLL_LINES 5
 
 /*-----------------------------------------------------------------------
Signature · 1 line
2.9.2
#8 lore raw

PATCH 3/11 dm: video: Output verbose information in vbe_setup_video()

In reply to Bin Meng
Quoted 8 lines · Bin Meng

With DM conversion, information like "Video: 1024x768x16" is not shown anymore. Now add these verbose output back.

---

 drivers/pci/pci_rom.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Although at some point I'd prefer that this is printed by board_init_r() somehow.

#11 lore raw

PATCH 4/11 x86: Convert to use DM VESA video driver

In reply to Bin Meng
Quoted 18 lines · Bin Meng

At present only chromebook boards are converted to DM video. Other x86 boards are still using the legacy cfb_console driver. This switches to use DM version drivers.

---

 configs/bayleybay_defconfig                             | 1 +
 configs/chromebox_panther_defconfig                     | 1 +
 configs/conga-qeval20-qa3-e3845-internal-uart_defconfig | 1 +
 configs/conga-qeval20-qa3-e3845_defconfig               | 1 +
 configs/crownbay_defconfig                              | 1 +
 configs/dfi-bt700-q7x-151_defconfig                     | 1 +
 configs/minnowmax_defconfig                             | 1 +
 configs/qemu-x86_defconfig                              | 1 +
 configs/qemu-x86_efi_payload32_defconfig                | 1 +
 configs/qemu-x86_efi_payload64_defconfig                | 1 +
 configs/som-db5800-som-6867_defconfig                   | 1 +
Quoted 8 lines
 configs/theadorable-x86-dfi-bt700_defconfig             | 1 +
 drivers/video/Makefile                                  | 2 +-
 include/configs/bayleybay.h                             | 6 +++---
 include/configs/crownbay.h                              | 4 ++--
 include/configs/minnowmax.h                             | 6 +++---
 include/configs/qemu-x86.h                              | 4 ++--
 include/configs/som-db5800-som-6867.h                   | 6 +++---
 18 files changed, 26 insertions(+), 14 deletions(-)
#20 lore raw

PATCH 7/11 dm: video: Add driver for coreboot framebuffer device

In reply to Bin Meng
Quoted 9 lines · Bin Meng

This adds a DM driver for coreboot framebuffer device.

---

 drivers/video/Kconfig    |  9 ++++++
 drivers/video/coreboot.c | 79 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 88 insertions(+)
 create mode 100644 drivers/video/coreboot.c

Nice!

Nits below

Quoted 6 lines
drivers/video/Kconfig +0 -0
index fd26690..554a03f 100644

drivers/video/Kconfig config VIDCONSOLE_AS_LCD · line 109

Quoted 9 lines
drivers/video/Kconfig +6 -0
@@ -101,6 +101,15 @@ config VIDCONSOLE_AS_LCD
          to update the environment, the breakage may be confusing for users.
          This option will be removed around the end of 2016.
 
+config VIDEO_COREBOOT
+       bool "Enable coreboot framebuffer driver support"
+       depends on X86 && SYS_COREBOOT
+       help
+         Turn on this option to enable a framebuffer driver when U-Boot is
+         loaded by coreboot where graphics device is configured by coreboot

where the graphics device

Quoted 62 lines
drivers/video/Kconfig +3 -0
+         already. This can in principle be used with any platform that
+         coreboot supports.
+
 config VIDEO_VESA
        bool "Enable VESA video driver support"
        default n
drivers/video/coreboot.c new file +50 -0
new file mode 100644
index 0000000..3a94aa1
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2016, Bin Meng <[email protected]>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <vbe.h>
+#include <video.h>
+#include <asm/arch/sysinfo.h>
+
+static int save_vesa_mode(struct cb_framebuffer *fb,
+                         struct vesa_mode_info *vesa)
+{
+       /*
+        * If there is no framebuffer structure, bail out and keep
+        * running on the serial console.
+        */
+       if (!fb)
+               return -ENXIO;
+
+       vesa->x_resolution = fb->x_resolution;
+       vesa->y_resolution = fb->y_resolution;
+       vesa->bits_per_pixel = fb->bits_per_pixel;
+       vesa->bytes_per_scanline = fb->bytes_per_line;
+       vesa->phys_base_ptr = fb->physical_address;
+       vesa->red_mask_size = fb->red_mask_size;
+       vesa->red_mask_pos = fb->red_mask_pos;
+       vesa->green_mask_size = fb->green_mask_size;
+       vesa->green_mask_pos = fb->green_mask_pos;
+       vesa->blue_mask_size = fb->blue_mask_size;
+       vesa->blue_mask_pos = fb->blue_mask_pos;
+       vesa->reserved_mask_size = fb->reserved_mask_size;
+       vesa->reserved_mask_pos = fb->reserved_mask_pos;
+
+       return 0;
+}
+
+static int coreboot_video_probe(struct udevice *dev)
+{
+       struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+       struct video_priv *uc_priv = dev_get_uclass_priv(dev);
+       struct cb_framebuffer *fb = lib_sysinfo.framebuffer;
+       struct vesa_mode_info *vesa = &mode_info.vesa;
+       int ret;
+
+       printf("Video: ");
+
+       /* Initialize vesa_mode_info structure */

drivers/video/coreboot.c line 60

Quoted 10 lines
drivers/video/coreboot.c new file +10 -0
+       ret = save_vesa_mode(fb, vesa);
+       if (ret)
+               goto err;
+
+       ret = vbe_setup_video_priv(vesa, uc_priv, plat);
+       if (ret)
+               goto err;
+
+       printf("%dx%dx%d\n", uc_priv->xsize, uc_priv->ysize,
+              vesa->bits_per_pixel);

Again at some point (later) it would be good to avoid printing info in drivers.

Quoted 20 lines
drivers/video/coreboot.c new file +19 -1
+
+       return 0;
+
+err:
+       printf("No video mode configured in coreboot!\n");
+       return ret;
+}
+
+static const struct udevice_id coreboot_video_ids[] = {
+       { .compatible = "coreboot-fb" },
+       { }
+};
+
+U_BOOT_DRIVER(coreboot_video) = {
+       .name   = "coreboot_video",
+       .id     = UCLASS_VIDEO,
+       .of_match = coreboot_video_ids,
+       .probe  = coreboot_video_probe,
+};
--
Quoted 2 lines

2.9.2

Regards,
Simon

#23 lore raw

PATCH 8/11 dm: video: Don't do anything in alloc_fb() when plat->size is zero

In reply to Bin Meng
Quoted 6 lines · Bin Meng

With DM VESA driver on x86 boards, plat->base/size/align are all zeroes and starting address passed to alloc_fb() happens to be 1MB aligned, so this routine does not trigger any issue. On QEMU with U-Boot as coreboot payload, the starting address is within 1MB range (eg: 0x7fb0000), thus causes failure in video_post_bind().

Quoted 8 lines

Actually if plat->size is zero, it makes no sense to do anything in this routine. Add such check there.

---

 drivers/video/video-uclass.c | 3 +++
 1 file changed, 3 insertions(+)
#26 lore raw

PATCH 9/11 x86: coreboot: Convert to use DM coreboot video driver

In reply to Bin Meng
Quoted 5 lines · Bin Meng

This converts coreboot to use DM framebuffer driver.

---

Quoted 14 lines
 arch/x86/cpu/coreboot/Kconfig       | 4 ----
 arch/x86/dts/bayleybay.dts          | 1 +
 arch/x86/dts/broadwell_som-6896.dts | 1 +
 arch/x86/dts/chromebook_link.dts    | 1 +
 arch/x86/dts/chromebook_samus.dts   | 1 +
 arch/x86/dts/chromebox_panther.dts  | 1 +
 arch/x86/dts/coreboot_fb.dtsi       | 5 +++++
 arch/x86/dts/minnowmax.dts          | 1 +
 configs/coreboot-x86_defconfig      | 2 ++
 doc/README.x86                      | 4 ++++
 drivers/video/Makefile              | 2 +-
 include/configs/som-6896.h          | 6 +++---
 12 files changed, 21 insertions(+), 8 deletions(-)
 create mode 100644 arch/x86/dts/coreboot_fb.dtsi
#29 lore raw

PATCH 10/11 video: Remove legacy VESA and coreboot framebuffer drivers

In reply to Bin Meng
Quoted 11 lines · Bin Meng

Now that all x86 boards have been converted to DM video, drop the legacy drivers.

---

 drivers/video/coreboot_fb.c | 108 --------------------------------------------
 drivers/video/vesa_fb.c     |  63 --------------------------
 2 files changed, 171 deletions(-)
 delete mode 100644 drivers/video/coreboot_fb.c
 delete mode 100644 drivers/video/vesa_fb.c

This is great!

#32 lore raw

PATCH 11/11 x86: Clean up unused macros in the configuration headers

In reply to Bin Meng
Quoted 4 lines · Bin Meng

Legacy video driver macros are not needed. Clean them up.

Quoted 8 lines

---

 include/configs/cougarcanyon2.h  |  4 ----
 include/configs/efi-x86.h        |  2 --
 include/configs/galileo.h        |  4 ----
 include/configs/x86-chromebook.h | 12 +++---------
 include/configs/x86-common.h     |  7 -------
 5 files changed, 3 insertions(+), 26 deletions(-)
author
#3 lore raw

PATCH 1/11 x86: doc: Document coreboot framebuffer driver issue on QEMU

In reply to Simon Glass
Quoted 5 lines · Simon Glass
Quoted 4 lines · Bin Meng

For some unknown reason, coreboot framebuffer driver never works on QEMU since day 1. It seems the driver only works on real hardware. Document this issue.

Quoted 7 lines
Quoted 5 lines

---

 doc/README.x86 | 3 +++
 1 file changed, 3 insertions(+)

applied to u-boot-x86, thanks!

author
#6 lore raw

PATCH 2/11 dm: video: Add driver for VESA compatible device

In reply to Simon Glass
Quoted 4 lines · Simon Glass
Quoted 1 line · Bin Meng

This adds a DM driver for VESA compatible device.

nit: VESA-compatible

Fixed nits, and

Quoted 10 lines
Quoted 8 lines

---

 drivers/video/vesa.c | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 drivers/video/vesa.c

applied to u-boot-x86, thanks!

author
#9 lore raw

PATCH 3/11 dm: video: Output verbose information in vbe_setup_video()

In reply to Simon Glass
Quoted 7 lines · Simon Glass
Quoted 6 lines · Bin Meng

With DM conversion, information like "Video: 1024x768x16" is not shown anymore. Now add these verbose output back.

---

Quoted 7 lines
Quoted 2 lines
 drivers/pci/pci_rom.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Although at some point I'd prefer that this is printed by board_init_r() somehow.

applied to u-boot-x86, thanks!

author
#12 lore raw

PATCH 4/11 x86: Convert to use DM VESA video driver

In reply to Simon Glass
Quoted 28 lines · Simon Glass
Quoted 18 lines · Bin Meng

At present only chromebook boards are converted to DM video. Other x86 boards are still using the legacy cfb_console driver. This switches to use DM version drivers.

---

 configs/bayleybay_defconfig                             | 1 +
 configs/chromebox_panther_defconfig                     | 1 +
 configs/conga-qeval20-qa3-e3845-internal-uart_defconfig | 1 +
 configs/conga-qeval20-qa3-e3845_defconfig               | 1 +
 configs/crownbay_defconfig                              | 1 +
 configs/dfi-bt700-q7x-151_defconfig                     | 1 +
 configs/minnowmax_defconfig                             | 1 +
 configs/qemu-x86_defconfig                              | 1 +
 configs/qemu-x86_efi_payload32_defconfig                | 1 +
 configs/qemu-x86_efi_payload64_defconfig                | 1 +
 configs/som-db5800-som-6867_defconfig                   | 1 +
Quoted 8 lines
 configs/theadorable-x86-dfi-bt700_defconfig             | 1 +
 drivers/video/Makefile                                  | 2 +-
 include/configs/bayleybay.h                             | 6 +++---
 include/configs/crownbay.h                              | 4 ++--
 include/configs/minnowmax.h                             | 6 +++---
 include/configs/qemu-x86.h                              | 4 ++--
 include/configs/som-db5800-som-6867.h                   | 6 +++---
 18 files changed, 26 insertions(+), 14 deletions(-)
Quoted 1 line

applied to u-boot-x86, thanks!

author
#21 lore raw

PATCH 7/11 dm: video: Add driver for coreboot framebuffer device

In reply to Simon Glass
Quoted 11 lines · Simon Glass
Quoted 9 lines · Bin Meng

This adds a DM driver for coreboot framebuffer device.

---

 drivers/video/Kconfig    |  9 ++++++
 drivers/video/coreboot.c | 79 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 88 insertions(+)
 create mode 100644 drivers/video/coreboot.c
Quoted 6 lines

Nice!

Nits below

Fixed nits and applied to u-boot-x86, thanks!

author
#24 lore raw

PATCH 8/11 dm: video: Don't do anything in alloc_fb() when plat->size is zero

In reply to Simon Glass
Quoted 10 lines · Simon Glass
Quoted 9 lines · Bin Meng

With DM VESA driver on x86 boards, plat->base/size/align are all zeroes and starting address passed to alloc_fb() happens to be 1MB aligned, so this routine does not trigger any issue. On QEMU with U-Boot as coreboot payload, the starting address is within 1MB range (eg: 0x7fb0000), thus causes failure in video_post_bind().

Actually if plat->size is zero, it makes no sense to do anything in this routine. Add such check there.

Quoted 7 lines
Quoted 5 lines

---

 drivers/video/video-uclass.c | 3 +++
 1 file changed, 3 insertions(+)

applied to u-boot-x86, thanks!

author
#27 lore raw

PATCH 9/11 x86: coreboot: Convert to use DM coreboot video driver

In reply to Simon Glass
Quoted 21 lines · Simon Glass
Quoted 5 lines · Bin Meng

This converts coreboot to use DM framebuffer driver.

---

Quoted 14 lines
 arch/x86/cpu/coreboot/Kconfig       | 4 ----
 arch/x86/dts/bayleybay.dts          | 1 +
 arch/x86/dts/broadwell_som-6896.dts | 1 +
 arch/x86/dts/chromebook_link.dts    | 1 +
 arch/x86/dts/chromebook_samus.dts   | 1 +
 arch/x86/dts/chromebox_panther.dts  | 1 +
 arch/x86/dts/coreboot_fb.dtsi       | 5 +++++
 arch/x86/dts/minnowmax.dts          | 1 +
 configs/coreboot-x86_defconfig      | 2 ++
 doc/README.x86                      | 4 ++++
 drivers/video/Makefile              | 2 +-
 include/configs/som-6896.h          | 6 +++---
 12 files changed, 21 insertions(+), 8 deletions(-)
 create mode 100644 arch/x86/dts/coreboot_fb.dtsi
Quoted 1 line

applied to u-boot-x86, thanks!

author
#30 lore raw

PATCH 10/11 video: Remove legacy VESA and coreboot framebuffer drivers

In reply to Simon Glass
Quoted 13 lines · Simon Glass
Quoted 11 lines · Bin Meng

Now that all x86 boards have been converted to DM video, drop the legacy drivers.

---

 drivers/video/coreboot_fb.c | 108 --------------------------------------------
 drivers/video/vesa_fb.c     |  63 --------------------------
 2 files changed, 171 deletions(-)
 delete mode 100644 drivers/video/coreboot_fb.c
 delete mode 100644 drivers/video/vesa_fb.c
Quoted 3 lines

This is great!

applied to u-boot-x86, thanks!

author
#33 lore raw

PATCH 11/11 x86: Clean up unused macros in the configuration headers

In reply to Simon Glass
Quoted 7 lines · Simon Glass
Quoted 6 lines · Bin Meng

Legacy video driver macros are not needed. Clean them up.

---

Quoted 8 lines
Quoted 6 lines
 include/configs/cougarcanyon2.h  |  4 ----
 include/configs/efi-x86.h        |  2 --
 include/configs/galileo.h        |  4 ----
 include/configs/x86-chromebook.h | 12 +++---------
 include/configs/x86-common.h     |  7 -------
 5 files changed, 3 insertions(+), 26 deletions(-)

applied to u-boot-x86, thanks!