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

TOMOYO Linux Cross Reference
Linux/arch/mips/pci/pci-lasat.c

Version: ~ [ linux-5.1-rc5 ] ~ [ linux-5.0.7 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.34 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.111 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.168 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.178 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.138 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.65 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * This file is subject to the terms and conditions of the GNU General Public
  3  * License.  See the file "COPYING" in the main directory of this archive
  4  * for more details.
  5  *
  6  * Copyright (C) 2000, 2001, 04 Keith M Wesolowski
  7  */
  8 #include <linux/init.h>
  9 #include <linux/kernel.h>
 10 #include <linux/pci.h>
 11 #include <linux/types.h>
 12 
 13 #include <asm/lasat/lasat.h>
 14 
 15 #include <irq.h>
 16 
 17 extern struct pci_ops nile4_pci_ops;
 18 extern struct pci_ops gt64xxx_pci0_ops;
 19 static struct resource lasat_pci_mem_resource = {
 20         .name   = "LASAT PCI MEM",
 21         .start  = 0x18000000,
 22         .end    = 0x19ffffff,
 23         .flags  = IORESOURCE_MEM,
 24 };
 25 
 26 static struct resource lasat_pci_io_resource = {
 27         .name   = "LASAT PCI IO",
 28         .start  = 0x1a000000,
 29         .end    = 0x1bffffff,
 30         .flags  = IORESOURCE_IO,
 31 };
 32 
 33 static struct pci_controller lasat_pci_controller = {
 34         .mem_resource   = &lasat_pci_mem_resource,
 35         .io_resource    = &lasat_pci_io_resource,
 36 };
 37 
 38 static int __init lasat_pci_setup(void)
 39 {
 40         printk(KERN_DEBUG "PCI: starting\n");
 41 
 42         if (IS_LASAT_200())
 43                 lasat_pci_controller.pci_ops = &nile4_pci_ops;
 44         else
 45                 lasat_pci_controller.pci_ops = &gt64xxx_pci0_ops;
 46 
 47         register_pci_controller(&lasat_pci_controller);
 48 
 49         return 0;
 50 }
 51 
 52 arch_initcall(lasat_pci_setup);
 53 
 54 #define LASAT_IRQ_ETH1   (LASAT_IRQ_BASE + 0)
 55 #define LASAT_IRQ_ETH0   (LASAT_IRQ_BASE + 1)
 56 #define LASAT_IRQ_HDC    (LASAT_IRQ_BASE + 2)
 57 #define LASAT_IRQ_COMP   (LASAT_IRQ_BASE + 3)
 58 #define LASAT_IRQ_HDLC   (LASAT_IRQ_BASE + 4)
 59 #define LASAT_IRQ_PCIA   (LASAT_IRQ_BASE + 5)
 60 #define LASAT_IRQ_PCIB   (LASAT_IRQ_BASE + 6)
 61 #define LASAT_IRQ_PCIC   (LASAT_IRQ_BASE + 7)
 62 #define LASAT_IRQ_PCID   (LASAT_IRQ_BASE + 8)
 63 
 64 int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 65 {
 66         switch (slot) {
 67         case 1:
 68         case 2:
 69         case 3:
 70                 return LASAT_IRQ_PCIA + (((slot-1) + (pin-1)) % 4);
 71         case 4:
 72                 return LASAT_IRQ_ETH1;   /* Ethernet 1 (LAN 2) */
 73         case 5:
 74                 return LASAT_IRQ_ETH0;   /* Ethernet 0 (LAN 1) */
 75         case 6:
 76                 return LASAT_IRQ_HDC;    /* IDE controller */
 77         default:
 78                 return 0xff;            /* Illegal */
 79         }
 80 
 81         return -1;
 82 }
 83 
 84 /* Do platform specific device initialization at pci_enable_device() time */
 85 int pcibios_plat_dev_init(struct pci_dev *dev)
 86 {
 87         return 0;
 88 }
 89 

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

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | 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.

osdn.jp