From 5572367cc595d567361fc29298c099922ed65812 Mon Sep 17 00:00:00 2001 From: Stefan Roese Date: Mon, 26 Sep 2016 10:18:07 +0200 Subject: x86: baytrail: Add 2nd eMMC controller to the PCI probe list With this addition, the eMMC device available on the congatec and DFI BayTrail SoM is detected correctly. Signed-off-by: Stefan Roese Cc: Simon Glass Cc: Bin Meng Reviewed-by: Bin Meng --- include/pci_ids.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/pci_ids.h b/include/pci_ids.h index 17a01a0ff45..ab6aa58adb8 100644 --- a/include/pci_ids.h +++ b/include/pci_ids.h @@ -2599,13 +2599,14 @@ #define PCI_DEVICE_ID_INTEL_I960 0x0960 #define PCI_DEVICE_ID_INTEL_I960RM 0x0962 #define PCI_DEVICE_ID_INTEL_CENTERTON_ILB 0x0c60 -#define PCI_DEVICE_ID_INTEL_VALLEYVIEW_SDIO 0x0f15 -#define PCI_DEVICE_ID_INTEL_VALLEYVIEW_SDCARD 0x0f16 +#define PCI_DEVICE_ID_INTEL_BYT_SDIO 0x0f15 +#define PCI_DEVICE_ID_INTEL_BYT_SD 0x0f16 #define PCI_DEVICE_ID_INTEL_VALLEYVIEW_LPC 0x0f1c #define PCI_DEVICE_ID_INTEL_VALLEYVIEW_IDE 0x0f20 #define PCI_DEVICE_ID_INTEL_VALLEYVIEW_IDE_ALT 0x0f21 #define PCI_DEVICE_ID_INTEL_VALLEYVIEW_SATA 0x0f22 #define PCI_DEVICE_ID_INTEL_VALLEYVIEW_SATA_ALT 0x0f23 +#define PCI_DEVICE_ID_INTEL_BYT_EMMC2 0x0f50 #define PCI_DEVICE_ID_INTEL_82541ER 0x1078 #define PCI_DEVICE_ID_INTEL_82541GI_LF 0x107c #define PCI_DEVICE_ID_INTEL_82542 0x1000 -- cgit v1.3.1 From 5023bd7a804e09d0bf4937d8fecb5d85af6dba3c Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 5 Oct 2016 20:42:12 -0600 Subject: list: Add list_last_entry() to find the last entry We have list_first_entry() but in some cases it is useful to find the last item added to the list. Add a macro for this. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- include/linux/list.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include') diff --git a/include/linux/list.h b/include/linux/list.h index b78851c3d71..5b8d1df5dfe 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -337,6 +337,17 @@ static inline void list_splice_tail_init(struct list_head *list, #define list_first_entry(ptr, type, member) \ list_entry((ptr)->next, type, member) +/** + * list_last_entry - get the last element from a list + * @ptr: the list head to take the element from. + * @type: the type of the struct this is embedded in. + * @member: the name of the list_struct within the struct. + * + * Note, that list is expected to be not empty. + */ +#define list_last_entry(ptr, type, member) \ + list_entry((ptr)->prev, type, member) + /** * list_for_each - iterate over a list * @pos: the &struct list_head to use as a loop cursor. -- cgit v1.3.1 From 0a5f6f869f1c2c6e9f75d83203754937014cbe47 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 5 Oct 2016 20:42:13 -0600 Subject: dm: core: Add a function to get a uclass name It is useful in debug() statements to display the name of the uclass for a device. Add a simple function to provide this. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- drivers/core/uclass.c | 9 +++++++++ include/dm/uclass.h | 8 ++++++++ 2 files changed, 17 insertions(+) (limited to 'include') diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c index de602ae52dc..60610e5a1f5 100644 --- a/drivers/core/uclass.c +++ b/drivers/core/uclass.c @@ -148,6 +148,15 @@ int uclass_get(enum uclass_id id, struct uclass **ucp) return 0; } +const char *uclass_get_name(enum uclass_id id) +{ + struct uclass *uc; + + if (uclass_get(id, &uc)) + return NULL; + return uc->uc_drv->name; +} + int uclass_find_device(enum uclass_id id, int index, struct udevice **devp) { struct uclass *uc; diff --git a/include/dm/uclass.h b/include/dm/uclass.h index 84f05bcfcea..b583aa869b3 100644 --- a/include/dm/uclass.h +++ b/include/dm/uclass.h @@ -118,6 +118,14 @@ struct uclass_driver { */ int uclass_get(enum uclass_id key, struct uclass **ucp); +/** + * uclass_get_name() - Get the name of a uclass driver + * + * @id: ID to look up + * @returns the name of the uclass driver for that ID, or NULL if none + */ +const char *uclass_get_name(enum uclass_id id); + /** * uclass_get_device() - Get a uclass device based on an ID and index * -- cgit v1.3.1 From ee87ee82e1c9052d59e44c5c29448f4545ab59e7 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 5 Oct 2016 20:42:17 -0600 Subject: dm: video: Add driver-model support to vesa graphics Provide a function to run the Vesa BIOS for a given PCI device and obtain the resulting configuration (e.g. display size) for use by the video uclass. This makes it easier to write a video driver that uses vesa and supports driver model. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- drivers/pci/pci_rom.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++ include/vbe.h | 2 ++ 2 files changed, 57 insertions(+) (limited to 'include') diff --git a/drivers/pci/pci_rom.c b/drivers/pci/pci_rom.c index 399055b0781..21ed17c0a08 100644 --- a/drivers/pci/pci_rom.c +++ b/drivers/pci/pci_rom.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -348,3 +349,57 @@ err: free(ram); return ret; } + +#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) +{ + if (!vesa->x_resolution) + return -ENXIO; + uc_priv->xsize = vesa->x_resolution; + uc_priv->ysize = vesa->y_resolution; + switch (vesa->bits_per_pixel) { + case 32: + case 24: + uc_priv->bpix = VIDEO_BPP32; + break; + case 16: + uc_priv->bpix = VIDEO_BPP16; + break; + default: + return -EPROTONOSUPPORT; + } + plat->base = vesa->phys_base_ptr; + plat->size = vesa->bytes_per_scanline * vesa->y_resolution; + + return 0; +} + +int vbe_setup_video(struct udevice *dev, int (*int15_handler)(void)) +{ + struct video_uc_platdata *plat = dev_get_uclass_platdata(dev); + struct video_priv *uc_priv = dev_get_uclass_priv(dev); + int ret; + + /* If we are running from EFI or coreboot, this can't work */ + if (!ll_boot_init()) + 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); + bootstage_accum(BOOTSTAGE_ID_ACCUM_LCD); + if (ret) { + debug("failed to run video BIOS: %d\n", ret); + return ret; + } + + ret = vbe_setup_video_priv(&mode_info.vesa, uc_priv, plat); + if (ret) { + debug("No video mode configured\n"); + return ret; + } + + return 0; +} +#endif diff --git a/include/vbe.h b/include/vbe.h index 164ccae2800..a743892d27f 100644 --- a/include/vbe.h +++ b/include/vbe.h @@ -106,5 +106,7 @@ extern struct vbe_mode_info mode_info; struct graphic_device; int vbe_get_video_info(struct graphic_device *gdev); +struct video_priv; +int vbe_setup_video(struct udevice *dev, int (*int15_handler)(void)); #endif -- cgit v1.3.1 From 0d9483a25c5c936a87806108c29395f0c7d6b520 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 5 Oct 2016 20:42:18 -0600 Subject: x86: Adjust config to support DM_VIDEO Update the common configuration so that it works correctly when CONFIG_DM_VIDEO is enabled. This involves dropping the legacy CONFIG_VIDEO option and changing the stdio device from "vga" to "vidconsole". Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- include/configs/x86-chromebook.h | 10 ++++++++-- include/configs/x86-common.h | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/configs/x86-chromebook.h b/include/configs/x86-chromebook.h index 312987edc8a..7fba7169db2 100644 --- a/include/configs/x86-chromebook.h +++ b/include/configs/x86-chromebook.h @@ -53,8 +53,14 @@ #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=vga,serial\0" \ - "stderr=vga,serial\0" + "stdout=" VIDEO_DEV ",serial\0" \ + "stderr=" VIDEO_DEV ",serial\0" #endif diff --git a/include/configs/x86-common.h b/include/configs/x86-common.h index 74b25221920..96c53b841e9 100644 --- a/include/configs/x86-common.h +++ b/include/configs/x86-common.h @@ -131,11 +131,13 @@ /*----------------------------------------------------------------------- * 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 /*----------------------------------------------------------------------- -- cgit v1.3.1 From 22d9574337f47d6a47f40dc1874291108ad30b41 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 25 Sep 2016 21:33:05 -0600 Subject: Add _image_binary_end section declaration This is used in some link scripts, so add a declaration for it. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- include/asm-generic/sections.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h index 328bc629482..d69bc6035be 100644 --- a/include/asm-generic/sections.h +++ b/include/asm-generic/sections.h @@ -82,6 +82,7 @@ extern ulong __data_end; extern ulong __rel_dyn_start; extern ulong __rel_dyn_end; extern ulong __bss_end; +extern ulong _image_binary_end; extern ulong _TEXT_BASE; /* code start */ -- cgit v1.3.1 From 2547f3ed897b0ce252db0ffb8596ec9730ea1833 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 25 Sep 2016 21:33:09 -0600 Subject: elf: Add the Elf64_Rela type Add this so that we can support 64-bit relocation on x86. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- include/elf.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/elf.h b/include/elf.h index a35e085d82a..bcc5eb7b079 100644 --- a/include/elf.h +++ b/include/elf.h @@ -394,6 +394,12 @@ typedef struct { Elf64_Xword r_info; /* index and type of relocation */ } Elf64_Rel; +typedef struct { + Elf64_Addr r_offset; /* Location at which to apply the action */ + Elf64_Xword r_info; /* index and type of relocation */ + Elf64_Sxword r_addend; /* Constant addend used to compute value */ +} Elf64_Rela; + /* Extract relocation info - r_info */ #define ELF32_R_SYM(i) ((i) >> 8) #define ELF32_R_TYPE(i) ((unsigned char) (i)) -- cgit v1.3.1 From 5d7ec3d8d3f09293824d1486b33cbe578e896996 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 25 Sep 2016 21:33:31 -0600 Subject: x86: Don't export interrupt handlers with x86_64 We don't have a way of adjusting these at present so it is best to refuse to export these functions. This can be implemented later if the API is required. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- include/_exports.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/_exports.h b/include/_exports.h index 15847053290..6ff4364e443 100644 --- a/include/_exports.h +++ b/include/_exports.h @@ -13,7 +13,7 @@ EXPORT_FUNC(putc, void, putc, const char) EXPORT_FUNC(puts, void, puts, const char *) EXPORT_FUNC(printf, int, printf, const char*, ...) -#if defined(CONFIG_X86) || defined(CONFIG_PPC) +#if (defined(CONFIG_X86) && !defined(CONFIG_X86_64)) || defined(CONFIG_PPC) EXPORT_FUNC(irq_install_handler, void, install_hdlr, int, interrupt_handler_t, void*) -- cgit v1.3.1 From fcda8c388699d8602158aa16a1e9c607dac93df9 Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Sun, 9 Oct 2016 04:14:13 -0700 Subject: x86: Convert to use DM VESA video driver 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. Signed-off-by: Bin Meng Reviewed-by: Simon Glass --- 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(-) (limited to 'include') diff --git a/configs/bayleybay_defconfig b/configs/bayleybay_defconfig index 64e3d31190f..f8f5f5cc2b8 100644 --- a/configs/bayleybay_defconfig +++ b/configs/bayleybay_defconfig @@ -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 diff --git a/configs/chromebox_panther_defconfig b/configs/chromebox_panther_defconfig index 2557d35e0c0..6df4d4c8e5b 100644 --- a/configs/chromebox_panther_defconfig +++ b/configs/chromebox_panther_defconfig @@ -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 diff --git a/configs/conga-qeval20-qa3-e3845-internal-uart_defconfig b/configs/conga-qeval20-qa3-e3845-internal-uart_defconfig index f0da176718c..6bee9c6de18 100644 --- a/configs/conga-qeval20-qa3-e3845-internal-uart_defconfig +++ b/configs/conga-qeval20-qa3-e3845-internal-uart_defconfig @@ -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 diff --git a/configs/conga-qeval20-qa3-e3845_defconfig b/configs/conga-qeval20-qa3-e3845_defconfig index 63c2cbde201..76ff9042100 100644 --- a/configs/conga-qeval20-qa3-e3845_defconfig +++ b/configs/conga-qeval20-qa3-e3845_defconfig @@ -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 diff --git a/configs/crownbay_defconfig b/configs/crownbay_defconfig index d0cd9dbfb18..b37fce79851 100644 --- a/configs/crownbay_defconfig +++ b/configs/crownbay_defconfig @@ -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 diff --git a/configs/dfi-bt700-q7x-151_defconfig b/configs/dfi-bt700-q7x-151_defconfig index 245d0c74324..3931896098f 100644 --- a/configs/dfi-bt700-q7x-151_defconfig +++ b/configs/dfi-bt700-q7x-151_defconfig @@ -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 diff --git a/configs/minnowmax_defconfig b/configs/minnowmax_defconfig index 3d3a30dbb92..1446ab61368 100644 --- a/configs/minnowmax_defconfig +++ b/configs/minnowmax_defconfig @@ -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 diff --git a/configs/qemu-x86_defconfig b/configs/qemu-x86_defconfig index 769adf60f12..4cf0866d9c9 100644 --- a/configs/qemu-x86_defconfig +++ b/configs/qemu-x86_defconfig @@ -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 diff --git a/configs/qemu-x86_efi_payload32_defconfig b/configs/qemu-x86_efi_payload32_defconfig index 75e7203e5df..fd6afb87c20 100644 --- a/configs/qemu-x86_efi_payload32_defconfig +++ b/configs/qemu-x86_efi_payload32_defconfig @@ -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 diff --git a/configs/qemu-x86_efi_payload64_defconfig b/configs/qemu-x86_efi_payload64_defconfig index 4bcd0dcf68b..c6664b06719 100644 --- a/configs/qemu-x86_efi_payload64_defconfig +++ b/configs/qemu-x86_efi_payload64_defconfig @@ -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 diff --git a/configs/som-db5800-som-6867_defconfig b/configs/som-db5800-som-6867_defconfig index 4cfaeda1330..9fc169d48aa 100644 --- a/configs/som-db5800-som-6867_defconfig +++ b/configs/som-db5800-som-6867_defconfig @@ -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 diff --git a/configs/theadorable-x86-dfi-bt700_defconfig b/configs/theadorable-x86-dfi-bt700_defconfig index cea91b67b4e..43dc2fa66e5 100644 --- a/configs/theadorable-x86-dfi-bt700_defconfig +++ b/configs/theadorable-x86-dfi-bt700_defconfig @@ -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 diff --git a/drivers/video/Makefile b/drivers/video/Makefile index b888e995bfa..8a99d24c08f 100644 --- a/drivers/video/Makefile +++ b/drivers/video/Makefile @@ -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 diff --git a/include/configs/bayleybay.h b/include/configs/bayleybay.h index 8f31436374e..40b13d19edb 100644 --- a/include/configs/bayleybay.h +++ b/include/configs/bayleybay.h @@ -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}, \ diff --git a/include/configs/crownbay.h b/include/configs/crownbay.h index 49ed3efda9c..64ad736d8ad 100644 --- a/include/configs/crownbay.h +++ b/include/configs/crownbay.h @@ -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} diff --git a/include/configs/minnowmax.h b/include/configs/minnowmax.h index 95ad1287f60..935c88df65c 100644 --- a/include/configs/minnowmax.h +++ b/include/configs/minnowmax.h @@ -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}, \ diff --git a/include/configs/qemu-x86.h b/include/configs/qemu-x86.h index 476d37d4bce..a2dd79b21c9 100644 --- a/include/configs/qemu-x86.h +++ b/include/configs/qemu-x86.h @@ -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 diff --git a/include/configs/som-db5800-som-6867.h b/include/configs/som-db5800-som-6867.h index a4b343eae9b..a13be14bbb4 100644 --- a/include/configs/som-db5800-som-6867.h +++ b/include/configs/som-db5800-som-6867.h @@ -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}, \ -- cgit v1.3.1 From 5f6ad029f31e897fa8bd62d3f42092e051932bc2 Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Sun, 9 Oct 2016 04:14:15 -0700 Subject: vbe: Make vbe_setup_video_priv() public vbe_setup_video_priv() might be useful to other drivers. Signed-off-by: Bin Meng Reviewed-by: Simon Glass --- drivers/pci/pci_rom.c | 6 +++--- include/vbe.h | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/drivers/pci/pci_rom.c b/drivers/pci/pci_rom.c index 5746c3d551f..cd083f7dde8 100644 --- a/drivers/pci/pci_rom.c +++ b/drivers/pci/pci_rom.c @@ -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; diff --git a/include/vbe.h b/include/vbe.h index a743892d27f..16bb0962367 100644 --- a/include/vbe.h +++ b/include/vbe.h @@ -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 -- cgit v1.3.1 From 2d3c573ee6373f4521491f1a38e81245c3a6be57 Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Sun, 9 Oct 2016 04:14:18 -0700 Subject: x86: coreboot: Convert to use DM coreboot video driver This converts coreboot to use DM framebuffer driver. Signed-off-by: Bin Meng Reviewed-by: Simon Glass --- 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 (limited to 'include') diff --git a/arch/x86/cpu/coreboot/Kconfig b/arch/x86/cpu/coreboot/Kconfig index e0e3c64506d..4b3601f66d9 100644 --- a/arch/x86/cpu/coreboot/Kconfig +++ b/arch/x86/cpu/coreboot/Kconfig @@ -8,8 +8,4 @@ config CBMEM_CONSOLE bool default y -config VIDEO_COREBOOT - bool - default y - endif diff --git a/arch/x86/dts/bayleybay.dts b/arch/x86/dts/bayleybay.dts index c8907ce44bc..18b310d39e8 100644 --- a/arch/x86/dts/bayleybay.dts +++ b/arch/x86/dts/bayleybay.dts @@ -14,6 +14,7 @@ /include/ "serial.dtsi" /include/ "rtc.dtsi" /include/ "tsc_timer.dtsi" +/include/ "coreboot_fb.dtsi" / { model = "Intel Bayley Bay"; diff --git a/arch/x86/dts/broadwell_som-6896.dts b/arch/x86/dts/broadwell_som-6896.dts index 4bb0a34b5f2..39661990853 100644 --- a/arch/x86/dts/broadwell_som-6896.dts +++ b/arch/x86/dts/broadwell_som-6896.dts @@ -4,6 +4,7 @@ /include/ "serial.dtsi" /include/ "rtc.dtsi" /include/ "tsc_timer.dtsi" +/include/ "coreboot_fb.dtsi" / { model = "Advantech SOM-6896"; diff --git a/arch/x86/dts/chromebook_link.dts b/arch/x86/dts/chromebook_link.dts index fb1b31dc5e7..b93234046e0 100644 --- a/arch/x86/dts/chromebook_link.dts +++ b/arch/x86/dts/chromebook_link.dts @@ -7,6 +7,7 @@ /include/ "serial.dtsi" /include/ "rtc.dtsi" /include/ "tsc_timer.dtsi" +/include/ "coreboot_fb.dtsi" / { model = "Google Link"; diff --git a/arch/x86/dts/chromebook_samus.dts b/arch/x86/dts/chromebook_samus.dts index 5dd3e57cb9b..52a9ea66225 100644 --- a/arch/x86/dts/chromebook_samus.dts +++ b/arch/x86/dts/chromebook_samus.dts @@ -7,6 +7,7 @@ /include/ "serial.dtsi" /include/ "rtc.dtsi" /include/ "tsc_timer.dtsi" +/include/ "coreboot_fb.dtsi" / { model = "Google Samus"; diff --git a/arch/x86/dts/chromebox_panther.dts b/arch/x86/dts/chromebox_panther.dts index 480b36658ee..b25c9194f35 100644 --- a/arch/x86/dts/chromebox_panther.dts +++ b/arch/x86/dts/chromebox_panther.dts @@ -4,6 +4,7 @@ /include/ "serial.dtsi" /include/ "rtc.dtsi" /include/ "tsc_timer.dtsi" +/include/ "coreboot_fb.dtsi" / { model = "Google Panther"; diff --git a/arch/x86/dts/coreboot_fb.dtsi b/arch/x86/dts/coreboot_fb.dtsi new file mode 100644 index 00000000000..7d72f185373 --- /dev/null +++ b/arch/x86/dts/coreboot_fb.dtsi @@ -0,0 +1,5 @@ +/ { + coreboot-fb { + compatible = "coreboot-fb"; + }; +}; diff --git a/arch/x86/dts/minnowmax.dts b/arch/x86/dts/minnowmax.dts index 1a8a8cc7f1b..d51318bdf60 100644 --- a/arch/x86/dts/minnowmax.dts +++ b/arch/x86/dts/minnowmax.dts @@ -13,6 +13,7 @@ /include/ "serial.dtsi" /include/ "rtc.dtsi" /include/ "tsc_timer.dtsi" +/include/ "coreboot_fb.dtsi" / { model = "Intel Minnowboard Max"; diff --git a/configs/coreboot-x86_defconfig b/configs/coreboot-x86_defconfig index 378d75fb500..b33c5c4da80 100644 --- a/configs/coreboot-x86_defconfig +++ b/configs/coreboot-x86_defconfig @@ -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 diff --git a/doc/README.x86 b/doc/README.x86 index c34f45586be..679955983bb 100644 --- a/doc/README.x86 +++ b/doc/README.x86 @@ -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. diff --git a/drivers/video/Makefile b/drivers/video/Makefile index 8a99d24c08f..4a4241750de 100644 --- a/drivers/video/Makefile +++ b/drivers/video/Makefile @@ -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 diff --git a/include/configs/som-6896.h b/include/configs/som-6896.h index 43a9623f04a..d058603b142 100644 --- a/include/configs/som-6896.h +++ b/include/configs/som-6896.h @@ -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 -- cgit v1.3.1 From 00bcaedd5c4063c677d16af264bbcb991fb9675c Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Sun, 9 Oct 2016 04:14:20 -0700 Subject: x86: Clean up unused macros in the configuration headers Legacy video driver macros are not needed. Clean them up. Signed-off-by: Bin Meng Reviewed-by: Simon Glass --- 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(-) (limited to 'include') diff --git a/include/configs/cougarcanyon2.h b/include/configs/cougarcanyon2.h index 88845dc0681..d20ad96562d 100644 --- a/include/configs/cougarcanyon2.h +++ b/include/configs/cougarcanyon2.h @@ -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 */ diff --git a/include/configs/efi-x86.h b/include/configs/efi-x86.h index 95e46c558d2..5626061e2ee 100644 --- a/include/configs/efi-x86.h +++ b/include/configs/efi-x86.h @@ -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 diff --git a/include/configs/galileo.h b/include/configs/galileo.h index 40f7fba833b..034142cf7c4 100644 --- a/include/configs/galileo.h +++ b/include/configs/galileo.h @@ -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 diff --git a/include/configs/x86-chromebook.h b/include/configs/x86-chromebook.h index 7fba7169db2..4bcebfc3e07 100644 --- a/include/configs/x86-chromebook.h +++ b/include/configs/x86-chromebook.h @@ -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 diff --git a/include/configs/x86-common.h b/include/configs/x86-common.h index 96c53b841e9..392654198ac 100644 --- a/include/configs/x86-common.h +++ b/include/configs/x86-common.h @@ -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 /*----------------------------------------------------------------------- -- cgit v1.3.1