Commit 21c9bcebd0e388a7acc2b1a3dc38127e0fd6182c

Authored by Bin Meng
1 parent 2d3c573ee6

video: Remove legacy VESA and coreboot framebuffer drivers

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

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

Showing 2 changed files with 0 additions and 171 deletions Side-by-side Diff

drivers/video/coreboot_fb.c
1   -/*
2   - * coreboot Framebuffer driver.
3   - *
4   - * Copyright (C) 2011 The Chromium OS authors
5   - *
6   - * SPDX-License-Identifier: GPL-2.0+
7   - */
8   -
9   -#include <common.h>
10   -#include <asm/arch/sysinfo.h>
11   -#include <vbe.h>
12   -#include <video_fb.h>
13   -#include "videomodes.h"
14   -
15   -/*
16   - * The Graphic Device
17   - */
18   -GraphicDevice ctfb;
19   -
20   -static void save_vesa_mode(void)
21   -{
22   - struct vesa_mode_info *vesa = &mode_info.vesa;
23   - struct cb_framebuffer *fb = lib_sysinfo.framebuffer;
24   -
25   - vesa->x_resolution = fb->x_resolution;
26   - vesa->y_resolution = fb->y_resolution;
27   - vesa->bits_per_pixel = fb->bits_per_pixel;
28   - vesa->bytes_per_scanline = fb->bytes_per_line;
29   - vesa->phys_base_ptr = fb->physical_address;
30   - vesa->red_mask_size = fb->red_mask_size;
31   - vesa->red_mask_pos = fb->red_mask_pos;
32   - vesa->green_mask_size = fb->green_mask_size;
33   - vesa->green_mask_pos = fb->green_mask_pos;
34   - vesa->blue_mask_size = fb->blue_mask_size;
35   - vesa->blue_mask_pos = fb->blue_mask_pos;
36   - vesa->reserved_mask_size = fb->reserved_mask_size;
37   - vesa->reserved_mask_pos = fb->reserved_mask_pos;
38   -}
39   -
40   -static int parse_coreboot_table_fb(GraphicDevice *gdev)
41   -{
42   - struct cb_framebuffer *fb = lib_sysinfo.framebuffer;
43   -
44   - /* If there is no framebuffer structure, bail out and keep
45   - * running on the serial console.
46   - */
47   - if (!fb)
48   - return 0;
49   -
50   - gdev->winSizeX = fb->x_resolution;
51   - gdev->winSizeY = fb->y_resolution;
52   -
53   - gdev->plnSizeX = fb->x_resolution;
54   - gdev->plnSizeY = fb->y_resolution;
55   -
56   - gdev->gdfBytesPP = fb->bits_per_pixel / 8;
57   -
58   - switch (fb->bits_per_pixel) {
59   - case 24:
60   - gdev->gdfIndex = GDF_32BIT_X888RGB;
61   - break;
62   - case 16:
63   - gdev->gdfIndex = GDF_16BIT_565RGB;
64   - break;
65   - default:
66   - gdev->gdfIndex = GDF__8BIT_INDEX;
67   - break;
68   - }
69   -
70   - gdev->isaBase = CONFIG_SYS_ISA_IO_BASE_ADDRESS;
71   - gdev->pciBase = (unsigned int)fb->physical_address;
72   -
73   - gdev->frameAdrs = (unsigned int)fb->physical_address;
74   - gdev->memSize = fb->bytes_per_line * fb->y_resolution;
75   -
76   - gdev->vprBase = (unsigned int)fb->physical_address;
77   - gdev->cprBase = (unsigned int)fb->physical_address;
78   -
79   - return 1;
80   -}
81   -
82   -void *video_hw_init(void)
83   -{
84   - GraphicDevice *gdev = &ctfb;
85   - int bits_per_pixel;
86   -
87   - printf("Video: ");
88   -
89   - if (!parse_coreboot_table_fb(gdev)) {
90   - printf("No video mode configured in coreboot!\n");
91   - return NULL;
92   - }
93   -
94   - bits_per_pixel = gdev->gdfBytesPP * 8;
95   -
96   - /* fill in Graphic device struct */
97   - sprintf(gdev->modeIdent, "%dx%dx%d", gdev->winSizeX, gdev->winSizeY,
98   - bits_per_pixel);
99   - printf("%s\n", gdev->modeIdent);
100   -
101   - memset((void *)gdev->pciBase, 0,
102   - gdev->winSizeX * gdev->winSizeY * gdev->gdfBytesPP);
103   -
104   - /* Initialize vesa_mode_info structure */
105   - save_vesa_mode();
106   -
107   - return (void *)gdev;
108   -}
drivers/video/vesa_fb.c
1   -/*
2   - * VESA frame buffer driver
3   - *
4   - * Copyright (C) 2014 Google, Inc
5   - *
6   - * SPDX-License-Identifier: GPL-2.0+
7   - */
8   -
9   -#include <common.h>
10   -#include <pci_rom.h>
11   -#include <video_fb.h>
12   -#include <vbe.h>
13   -
14   -/*
15   - * The Graphic Device
16   - */
17   -GraphicDevice ctfb;
18   -
19   -void *video_hw_init(void)
20   -{
21   - GraphicDevice *gdev = &ctfb;
22   - struct udevice *dev;
23   - int bits_per_pixel;
24   - int ret;
25   -
26   - printf("Video: ");
27   - if (!ll_boot_init()) {
28   - /*
29   - * If we are running from EFI or coreboot, this driver can't
30   - * work.
31   - */
32   - printf("Not available (previous bootloader prevents it)\n");
33   - return NULL;
34   - }
35   - if (vbe_get_video_info(gdev)) {
36   - ret = dm_pci_find_class(PCI_CLASS_DISPLAY_VGA << 8, 0, &dev);
37   - if (ret) {
38   - printf("no card detected\n");
39   - return NULL;
40   - }
41   - bootstage_start(BOOTSTAGE_ID_ACCUM_LCD, "vesa display");
42   - ret = dm_pci_run_vga_bios(dev, NULL, PCI_ROM_USE_NATIVE |
43   - PCI_ROM_ALLOW_FALLBACK);
44   - bootstage_accum(BOOTSTAGE_ID_ACCUM_LCD);
45   - if (ret) {
46   - printf("failed to run video BIOS: %d\n", ret);
47   - return NULL;
48   - }
49   - }
50   -
51   - if (vbe_get_video_info(gdev)) {
52   - printf("No video mode configured\n");
53   - return NULL;
54   - }
55   -
56   - bits_per_pixel = gdev->gdfBytesPP * 8;
57   - sprintf(gdev->modeIdent, "%dx%dx%d", gdev->winSizeX, gdev->winSizeY,
58   - bits_per_pixel);
59   - printf("%s\n", gdev->modeIdent);
60   - debug("Frame buffer at %x\n", gdev->pciBase);
61   -
62   - return (void *)gdev;
63   -}