]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - arch/frv/mb93090-mb00/pci-irq.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[mirror_ubuntu-bionic-kernel.git] / arch / frv / mb93090-mb00 / pci-irq.c
CommitLineData
b2441318 1// SPDX-License-Identifier: GPL-2.0
1da177e4
LT
2/* pci-irq.c: PCI IRQ routing on the FRV motherboard
3 *
4 * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved.
5 * Written by David Howells (dhowells@redhat.com)
6 * derived from: arch/i386/kernel/pci-irq.c: (c) 1999--2000 Martin Mares <mj@suse.cz>
7 */
8
1da177e4
LT
9#include <linux/types.h>
10#include <linux/kernel.h>
11#include <linux/pci.h>
12#include <linux/init.h>
1da177e4
LT
13#include <linux/interrupt.h>
14#include <linux/irq.h>
15
16#include <asm/io.h>
17#include <asm/smp.h>
1da177e4
LT
18
19#include "pci-frv.h"
20
21/*
22 * DEVICE DEVNO INT#A INT#B INT#C INT#D
23 * ======= ======= ======= ======= ======= =======
24 * MB86943 0 fpga.10 - - -
25 * RTL8029 16 fpga.12 - - -
26 * SLOT 1 19 fpga.6 fpga.5 fpga.4 fpga.3
27 * SLOT 2 18 fpga.5 fpga.4 fpga.3 fpga.6
28 * SLOT 3 17 fpga.4 fpga.3 fpga.6 fpga.5
29 *
30 */
31
3f3247d0 32static const uint8_t __initconst pci_bus0_irq_routing[32][4] = {
576132b4
AV
33 [0 ] = { IRQ_FPGA_MB86943_PCI_INTA },
34 [16] = { IRQ_FPGA_RTL8029_INTA },
35 [17] = { IRQ_FPGA_PCI_INTC, IRQ_FPGA_PCI_INTD, IRQ_FPGA_PCI_INTA, IRQ_FPGA_PCI_INTB },
36 [18] = { IRQ_FPGA_PCI_INTB, IRQ_FPGA_PCI_INTC, IRQ_FPGA_PCI_INTD, IRQ_FPGA_PCI_INTA },
37 [19] = { IRQ_FPGA_PCI_INTA, IRQ_FPGA_PCI_INTB, IRQ_FPGA_PCI_INTC, IRQ_FPGA_PCI_INTD },
1da177e4
LT
38};
39
40void __init pcibios_irq_init(void)
41{
42}
43
44void __init pcibios_fixup_irqs(void)
45{
46 struct pci_dev *dev = NULL;
47 uint8_t line, pin;
48
3c94792f 49 for_each_pci_dev(dev) {
1da177e4
LT
50 pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
51 if (pin) {
52 dev->irq = pci_bus0_irq_routing[PCI_SLOT(dev->devfn)][pin - 1];
53 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
54 }
55 pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &line);
56 }
57}
58
1da177e4
LT
59void pcibios_enable_irq(struct pci_dev *dev)
60{
61 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
62}