6 #include <console/console.h>
7 #include <device/device.h>
8 #include <device/pci.h>
9 #include <device/pci_ids.h>
10 #include <device/pci_ops.h>
12 #if CONFIG_CONSOLE_BTEXT==1
14 #define PLL_CRTC_DECODE 0
15 #define SUPPORT_8_BPP_ABOVE 0
20 #include <console/btext.h>
22 #endif /*CONFIG_CONSOLE_BTEXT*/
25 /* VGA init. We use the Bochs VESA VBE extensions */
26 #define VBE_DISPI_INDEX_ID 0x0
27 #define VBE_DISPI_INDEX_XRES 0x1
28 #define VBE_DISPI_INDEX_YRES 0x2
29 #define VBE_DISPI_INDEX_BPP 0x3
30 #define VBE_DISPI_INDEX_ENABLE 0x4
31 #define VBE_DISPI_INDEX_BANK 0x5
32 #define VBE_DISPI_INDEX_VIRT_WIDTH 0x6
33 #define VBE_DISPI_INDEX_VIRT_HEIGHT 0x7
34 #define VBE_DISPI_INDEX_X_OFFSET 0x8
35 #define VBE_DISPI_INDEX_Y_OFFSET 0x9
36 #define VBE_DISPI_INDEX_NB 0xa
38 #define VBE_DISPI_ID0 0xB0C0
39 #define VBE_DISPI_ID1 0xB0C1
40 #define VBE_DISPI_ID2 0xB0C2
42 #define VBE_DISPI_DISABLED 0x00
43 #define VBE_DISPI_ENABLED 0x01
44 #define VBE_DISPI_LFB_ENABLED 0x40
45 #define VBE_DISPI_NOCLEARMEM 0x80
47 #define VBE_DISPI_LFB_PHYSICAL_ADDRESS 0xE0000000
49 static void vbe_outw(int index, int val)
55 static void qemu_init(void)
57 int width=640, height=480, depth=8;
59 printk(BIOS_DEBUG, "Initializing VGA!\n");
61 vbe_outw(VBE_DISPI_INDEX_XRES, width);
62 vbe_outw(VBE_DISPI_INDEX_YRES, height);
63 vbe_outw(VBE_DISPI_INDEX_BPP, depth);
64 vbe_outw(VBE_DISPI_INDEX_ENABLE, VBE_DISPI_ENABLED);
65 outb(0x3c0, 0x20); /* disable blanking */
67 vga_fb_phys_addr = VBE_DISPI_LFB_PHYSICAL_ADDRESS;
69 vga_fb_height = height;
71 vga_fb_bpp = (depth + 7) >> 3;
72 vga_fb_linesize = width * vga_fb_bpp;
76 static struct device_operations qemu_graph_ops = {
77 .read_resources = pci_dev_read_resources,
78 .set_resources = pci_dev_set_resources,
79 .enable_resources = pci_dev_enable_resources,
84 static const struct pci_driver qemu_graph_driver __pci_driver = {
85 .ops = &qemu_graph_ops,