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

TOMOYO Linux Cross Reference
Linux/arch/arm/mach-ixp4xx/avila-pci.c

Version: ~ [ linux-5.13-rc7 ] ~ [ linux-5.12.12 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.45 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.127 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.195 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.237 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.273 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.273 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ 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.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * arch/arm/mach-ixp4xx/avila-pci.c
  3  *
  4  * Gateworks Avila board-level PCI initialization
  5  *
  6  * Author: Michael-Luke Jones <mlj28@cam.ac.uk>
  7  *
  8  * Based on ixdp-pci.c
  9  * Copyright (C) 2002 Intel Corporation.
 10  * Copyright (C) 2003-2004 MontaVista Software, Inc.
 11  *
 12  * Maintainer: Deepak Saxena <dsaxena@plexity.net>
 13  *
 14  * This program is free software; you can redistribute it and/or modify
 15  * it under the terms of the GNU General Public License version 2 as
 16  * published by the Free Software Foundation.
 17  *
 18  */
 19 
 20 #include <linux/kernel.h>
 21 #include <linux/pci.h>
 22 #include <linux/init.h>
 23 #include <linux/irq.h>
 24 #include <linux/delay.h>
 25 #include <asm/mach/pci.h>
 26 #include <asm/irq.h>
 27 #include <mach/hardware.h>
 28 #include <asm/mach-types.h>
 29 
 30 #define AVILA_MAX_DEV   4
 31 #define LOFT_MAX_DEV    6
 32 #define IRQ_LINES       4
 33 
 34 /* PCI controller GPIO to IRQ pin mappings */
 35 #define INTA            11
 36 #define INTB            10
 37 #define INTC            9
 38 #define INTD            8
 39 
 40 void __init avila_pci_preinit(void)
 41 {
 42         irq_set_irq_type(IXP4XX_GPIO_IRQ(INTA), IRQ_TYPE_LEVEL_LOW);
 43         irq_set_irq_type(IXP4XX_GPIO_IRQ(INTB), IRQ_TYPE_LEVEL_LOW);
 44         irq_set_irq_type(IXP4XX_GPIO_IRQ(INTC), IRQ_TYPE_LEVEL_LOW);
 45         irq_set_irq_type(IXP4XX_GPIO_IRQ(INTD), IRQ_TYPE_LEVEL_LOW);
 46         ixp4xx_pci_preinit();
 47 }
 48 
 49 static int __init avila_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 50 {
 51         static int pci_irq_table[IRQ_LINES] = {
 52                 IXP4XX_GPIO_IRQ(INTA),
 53                 IXP4XX_GPIO_IRQ(INTB),
 54                 IXP4XX_GPIO_IRQ(INTC),
 55                 IXP4XX_GPIO_IRQ(INTD)
 56         };
 57 
 58         if (slot >= 1 &&
 59             slot <= (machine_is_loft() ? LOFT_MAX_DEV : AVILA_MAX_DEV) &&
 60             pin >= 1 && pin <= IRQ_LINES)
 61                 return pci_irq_table[(slot + pin - 2) % 4];
 62 
 63         return -1;
 64 }
 65 
 66 struct hw_pci avila_pci __initdata = {
 67         .nr_controllers = 1,
 68         .ops            = &ixp4xx_ops,
 69         .preinit        = avila_pci_preinit,
 70         .setup          = ixp4xx_setup,
 71         .map_irq        = avila_map_irq,
 72 };
 73 
 74 int __init avila_pci_init(void)
 75 {
 76         if (machine_is_avila() || machine_is_loft())
 77                 pci_common_init(&avila_pci);
 78         return 0;
 79 }
 80 
 81 subsys_initcall(avila_pci_init);
 82 

~ [ 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