2 * linux/arch/alpha/kernel/console.c
4 * Architecture-specific specific support for VGA device on
9 #include <linux/init.h>
10 #include <linux/tty.h>
11 #include <linux/console.h>
14 #include <asm/machvec.h>
18 #ifdef CONFIG_VGA_HOSE
20 struct pci_controller *pci_vga_hose;
21 static struct resource alpha_vga = {
23 .flags = IORESOURCE_IO,
28 static struct pci_controller * __init
29 default_vga_hose_select(struct pci_controller *h1, struct pci_controller *h2)
31 if (h2->index < h1->index)
38 locate_and_init_vga(void *(*sel_func)(void *, void *))
40 struct pci_controller *hose = NULL;
41 struct pci_dev *dev = NULL;
43 /* Default the select function */
44 if (!sel_func) sel_func = (void *)default_vga_hose_select;
46 /* Find the console VGA device */
47 for(dev=NULL; (dev=pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, dev));) {
51 hose = sel_func(hose, dev->sysdata);
54 /* Did we already initialize the correct one? Is there one? */
55 if (!hose || (conswitchp == &vga_con && pci_vga_hose == hose))
58 /* Create a new VGA ioport resource WRT the hose it is on. */
59 alpha_vga.start += hose->io_space->start;
60 alpha_vga.end += hose->io_space->start;
61 request_resource(hose->io_space, &alpha_vga);
63 /* Set the VGA hose and init the new console. */
66 do_take_over_console(&vga_con, 0, MAX_NR_CONSOLES-1, 1);
71 find_console_vga_hose(void)
73 u64 *pu64 = (u64 *)((u64)hwrpb + hwrpb->ctbt_offset);
75 if (pu64[7] == 3) { /* TERM_TYPE == graphics */
76 struct pci_controller *hose;
77 int h = (pu64[30] >> 24) & 0xff; /* console hose # */
80 * Our hose numbering DOES match the console's, so find
83 for (hose = hose_head; hose; hose = hose->next) {
84 if (hose->index == h) break;
88 printk("Console graphics on hose %d\n", h);