~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/alpha/kernel/console.c

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0
  2 /*
  3  *      linux/arch/alpha/kernel/console.c
  4  *
  5  * Architecture-specific specific support for VGA device on 
  6  * non-0 I/O hose
  7  */
  8 
  9 #include <linux/pci.h>
 10 #include <linux/init.h>
 11 #include <linux/tty.h>
 12 #include <linux/console.h>
 13 #include <linux/vt.h>
 14 #include <asm/vga.h>
 15 #include <asm/machvec.h>
 16 
 17 #include "pci_impl.h"
 18 #include "proto.h"
 19 
 20 #ifdef CONFIG_VGA_HOSE
 21 
 22 struct pci_controller *pci_vga_hose;
 23 static struct resource alpha_vga = {
 24         .name   = "alpha-vga+",
 25         .flags  = IORESOURCE_IO,
 26         .start  = 0x3C0,
 27         .end    = 0x3DF
 28 };
 29 
 30 static struct pci_controller * __init 
 31 default_vga_hose_select(struct pci_controller *h1, struct pci_controller *h2)
 32 {
 33         if (h2->index < h1->index)
 34                 return h2;
 35 
 36         return h1;
 37 }
 38 
 39 void __init 
 40 locate_and_init_vga(void *(*sel_func)(void *, void *))
 41 {
 42         struct pci_controller *hose = NULL;
 43         struct pci_dev *dev = NULL;
 44 
 45         /* Default the select function */
 46         if (!sel_func) sel_func = (void *)default_vga_hose_select;
 47 
 48         /* Find the console VGA device */
 49         for(dev=NULL; (dev=pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, dev));) {
 50                 if (!hose)
 51                         hose = dev->sysdata;
 52                 else
 53                         hose = sel_func(hose, dev->sysdata);
 54         }
 55 
 56         /* Did we already initialize the correct one? Is there one? */
 57         if (!hose || (conswitchp == &vga_con && pci_vga_hose == hose))
 58                 return;
 59 
 60         /* Create a new VGA ioport resource WRT the hose it is on. */
 61         alpha_vga.start += hose->io_space->start;
 62         alpha_vga.end += hose->io_space->start;
 63         request_resource(hose->io_space, &alpha_vga);
 64 
 65         /* Set the VGA hose and init the new console. */
 66         pci_vga_hose = hose;
 67         console_lock();
 68         do_take_over_console(&vga_con, 0, MAX_NR_CONSOLES-1, 1);
 69         console_unlock();
 70 }
 71 
 72 void __init
 73 find_console_vga_hose(void)
 74 {
 75         u64 *pu64 = (u64 *)((u64)hwrpb + hwrpb->ctbt_offset);
 76 
 77         if (pu64[7] == 3) {     /* TERM_TYPE == graphics */
 78                 struct pci_controller *hose;
 79                 int h = (pu64[30] >> 24) & 0xff;        /* console hose # */
 80 
 81                 /*
 82                  * Our hose numbering DOES match the console's, so find
 83                  * the right one...
 84                  */
 85                 for (hose = hose_head; hose; hose = hose->next) {
 86                         if (hose->index == h) break;
 87                 }
 88 
 89                 if (hose) {
 90                         printk("Console graphics on hose %d\n", h);
 91                         pci_vga_hose = hose;
 92                 }
 93         }
 94 }
 95 
 96 #endif
 97 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php