1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2016, Bin Meng <bmeng.cn@gmail.com>
14 static int vesa_video_probe(struct udevice *dev)
16 struct video_uc_plat *plat = dev_get_uclass_plat(dev);
20 ret = vbe_setup_video(dev, NULL);
24 /* Use write-combining for the graphics memory, 256MB */
25 fbbase = IS_ENABLED(CONFIG_VIDEO_COPY) ? plat->copy_base : plat->base;
26 mtrr_add_request(MTRR_TYPE_WRCOMB, fbbase, 256 << 20);
32 static int vesa_video_bind(struct udevice *dev)
34 struct video_uc_plat *uc_plat = dev_get_uclass_plat(dev);
36 /* Set the maximum supported resolution */
37 uc_plat->size = 2560 * 1600 * 4;
38 log_debug("%s: Frame buffer size %x\n", __func__, uc_plat->size);
43 static const struct udevice_id vesa_video_ids[] = {
44 { .compatible = "vesa-fb" },
48 U_BOOT_DRIVER(vesa_video) = {
51 .of_match = vesa_video_ids,
52 .bind = vesa_video_bind,
53 .probe = vesa_video_probe,
56 static struct pci_device_id vesa_video_supported[] = {
57 { PCI_DEVICE_CLASS(PCI_CLASS_DISPLAY_VGA << 8, ~0) },
61 U_BOOT_PCI_DEVICE(vesa_video, vesa_video_supported);