Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 94969
b: refs/heads/master
c: 92b913b
h: refs/heads/master
i:
  94967: bd54c14
v: v3
  • Loading branch information
Lennert Buytenhek authored and Nicolas Pitre committed Apr 28, 2008
1 parent a1cc54e commit af9c72b
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 28 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fd153abb01c3fbcc47cd4ac3c0bc8801cfcc0009
refs/heads/master: 92b913b08b18faa487b0c744282fafd944446ade
3 changes: 1 addition & 2 deletions trunk/arch/arm/mach-orion5x/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ struct pci_sys_data;
struct pci_bus;

void orion5x_pcie_id(u32 *dev, u32 *rev);
int orion5x_pcie_local_bus_nr(void);
int orion5x_pci_local_bus_nr(void);
int orion5x_pci_sys_setup(int nr, struct pci_sys_data *sys);
struct pci_bus *orion5x_pci_sys_scan_bus(int nr, struct pci_sys_data *sys);
int orion5x_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin);

/*
* Valid GPIO pins according to MPP setup, used by machine-setup.
Expand Down
11 changes: 7 additions & 4 deletions trunk/arch/arm/mach-orion5x/db88f5281-setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,14 +241,17 @@ void __init db88f5281_pci_preinit(void)

static int __init db88f5281_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
{
int irq;

/*
* PCIE IRQ is connected internally (not GPIO)
* Check for devices with hard-wired IRQs.
*/
if (dev->bus->number == orion5x_pcie_local_bus_nr())
return IRQ_ORION5X_PCIE0_INT;
irq = orion5x_pci_map_irq(dev, slot, pin);
if (irq != -1)
return irq;

/*
* PCI IRQs are connected via GPIOs
* PCI IRQs are connected via GPIOs.
*/
switch (slot - DB88F5281_PCI_SLOT0_OFFS) {
case 0:
Expand Down
13 changes: 9 additions & 4 deletions trunk/arch/arm/mach-orion5x/dns323-setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,16 @@

static int __init dns323_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
{
/* PCI-E */
if (dev->bus->number == orion5x_pcie_local_bus_nr())
return IRQ_ORION5X_PCIE0_INT;
int irq;

pr_err("%s: requested mapping for unknown bus\n", __func__);
/*
* Check for devices with hard-wired IRQs.
*/
irq = orion5x_pci_map_irq(dev, slot, pin);
if (irq != -1)
return irq;

pr_err("%s: requested mapping for unknown device\n", __func__);

return -1;
}
Expand Down
14 changes: 10 additions & 4 deletions trunk/arch/arm/mach-orion5x/kurobox_pro-setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,19 @@ static struct platform_device kurobox_pro_nor_flash = {

static int __init kurobox_pro_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
{
int irq;

/*
* Check for devices with hard-wired IRQs.
*/
irq = orion5x_pci_map_irq(dev, slot, pin);
if (irq != -1)
return irq;

/*
* PCI isn't used on the Kuro
*/
if (dev->bus->number == orion5x_pcie_local_bus_nr())
return IRQ_ORION5X_PCIE0_INT;
else
printk(KERN_ERR "kurobox_pro_pci_map_irq failed, unknown bus\n");
printk(KERN_ERR "kurobox_pro_pci_map_irq failed, unknown bus\n");

return -1;
}
Expand Down
20 changes: 14 additions & 6 deletions trunk/arch/arm/mach-orion5x/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ void __init orion5x_pcie_id(u32 *dev, u32 *rev)
*rev = orion_pcie_rev(PCIE_BASE);
}

int __init orion5x_pcie_local_bus_nr(void)
{
return orion_pcie_get_local_bus_nr(PCIE_BASE);
}

static int pcie_valid_config(int bus, int dev)
{
/*
Expand Down Expand Up @@ -269,7 +264,7 @@ static int __init pcie_setup(struct pci_sys_data *sys)
*/
static DEFINE_SPINLOCK(orion5x_pci_lock);

int orion5x_pci_local_bus_nr(void)
static int orion5x_pci_local_bus_nr(void)
{
u32 conf = orion5x_read(PCI_P2P_CONF);
return((conf & PCI_P2P_BUS_MASK) >> PCI_P2P_BUS_OFFS);
Expand Down Expand Up @@ -557,3 +552,16 @@ struct pci_bus __init *orion5x_pci_sys_scan_bus(int nr, struct pci_sys_data *sys

return bus;
}

int __init orion5x_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
{
int bus = dev->bus->number;

/*
* PCIe endpoint?
*/
if (bus < orion5x_pci_local_bus_nr())
return IRQ_ORION5X_PCIE0_INT;

return -1;
}
9 changes: 6 additions & 3 deletions trunk/arch/arm/mach-orion5x/rd88f5182-setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,14 @@ void __init rd88f5182_pci_preinit(void)

static int __init rd88f5182_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
{
int irq;

/*
* PCI-E isn't used on the RD2
* Check for devices with hard-wired IRQs.
*/
if (dev->bus->number == orion5x_pcie_local_bus_nr())
return IRQ_ORION5X_PCIE0_INT;
irq = orion5x_pci_map_irq(dev, slot, pin);
if (irq != -1)
return irq;

/*
* PCI IRQs are connected via GPIOs
Expand Down
11 changes: 7 additions & 4 deletions trunk/arch/arm/mach-orion5x/ts209-setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,17 @@ void __init qnap_ts209_pci_preinit(void)

static int __init qnap_ts209_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
{
int irq;

/*
* PCIE IRQ is connected internally (not GPIO)
* Check for devices with hard-wired IRQs.
*/
if (dev->bus->number == orion5x_pcie_local_bus_nr())
return IRQ_ORION5X_PCIE0_INT;
irq = orion5x_pci_map_irq(dev, slot, pin);
if (irq != -1)
return irq;

/*
* PCI IRQs are connected via GPIOs
* PCI IRQs are connected via GPIOs.
*/
switch (slot - QNAP_TS209_PCI_SLOT0_OFFS) {
case 0:
Expand Down

0 comments on commit af9c72b

Please sign in to comment.