Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 33731
b: refs/heads/master
c: 006b64d
h: refs/heads/master
i:
  33729: 84a75c5
  33727: 651b23d
v: v3
  • Loading branch information
Benjamin Herrenschmidt authored and Paul Mackerras committed Aug 30, 2006
1 parent da4bd25 commit 75b4931
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 8 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: 7233593b7844c2db930594ee9c0c872a6900bfcc
refs/heads/master: 006b64de607f895de2ba1e21d3179cddf059128f
11 changes: 9 additions & 2 deletions trunk/arch/powerpc/kernel/pci_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -1289,6 +1289,9 @@ int pci_read_irq_line(struct pci_dev *pci_dev)

DBG("Try to map irq for %s...\n", pci_name(pci_dev));

#ifdef DEBUG
memset(&oirq, 0xff, sizeof(oirq));
#endif
/* Try to get a mapping from the device-tree */
if (of_irq_map_pci(pci_dev, &oirq)) {
u8 line, pin;
Expand All @@ -1314,8 +1317,9 @@ int pci_read_irq_line(struct pci_dev *pci_dev)
if (virq != NO_IRQ)
set_irq_type(virq, IRQ_TYPE_LEVEL_LOW);
} else {
DBG(" -> got one, spec %d cells (0x%08x...) on %s\n",
oirq.size, oirq.specifier[0], oirq.controller->full_name);
DBG(" -> got one, spec %d cells (0x%08x 0x%08x...) on %s\n",
oirq.size, oirq.specifier[0], oirq.specifier[1],
oirq.controller->full_name);

virq = irq_create_of_mapping(oirq.controller, oirq.specifier,
oirq.size);
Expand All @@ -1324,6 +1328,9 @@ int pci_read_irq_line(struct pci_dev *pci_dev)
DBG(" -> failed to map !\n");
return -1;
}

DBG(" -> mapped to linux irq %d\n", virq);

pci_dev->irq = virq;
pci_write_config_byte(pci_dev, PCI_INTERRUPT_LINE, virq);

Expand Down
17 changes: 13 additions & 4 deletions trunk/arch/powerpc/kernel/prom_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -639,14 +639,17 @@ void of_irq_map_init(unsigned int flags)

}

int of_irq_map_raw(struct device_node *parent, u32 *intspec, u32 *addr,
struct of_irq *out_irq)
int of_irq_map_raw(struct device_node *parent, u32 *intspec, u32 ointsize,
u32 *addr, struct of_irq *out_irq)
{
struct device_node *ipar, *tnode, *old = NULL, *newpar = NULL;
u32 *tmp, *imap, *imask;
u32 intsize = 1, addrsize, newintsize = 0, newaddrsize = 0;
int imaplen, match, i;

DBG("of_irq_map_raw: par=%s,intspec=[0x%08x 0x%08x...],ointsize=%d\n",
parent->full_name, intspec[0], intspec[1], ointsize);

ipar = of_node_get(parent);

/* First get the #interrupt-cells property of the current cursor
Expand All @@ -670,6 +673,9 @@ int of_irq_map_raw(struct device_node *parent, u32 *intspec, u32 *addr,

DBG("of_irq_map_raw: ipar=%s, size=%d\n", ipar->full_name, intsize);

if (ointsize != intsize)
return -EINVAL;

/* Look for this #address-cells. We have to implement the old linux
* trick of looking for the parent here as some device-trees rely on it
*/
Expand Down Expand Up @@ -875,12 +881,15 @@ int of_irq_map_one(struct device_node *device, int index, struct of_irq *out_irq
}
intsize = *tmp;

DBG(" intsize=%d intlen=%d\n", intsize, intlen);

/* Check index */
if ((index + 1) * intsize > intlen)
return -EINVAL;

/* Get new specifier and map it */
res = of_irq_map_raw(p, intspec + index * intsize, addr, out_irq);
res = of_irq_map_raw(p, intspec + index * intsize, intsize,
addr, out_irq);
of_node_put(p);
return res;
}
Expand Down Expand Up @@ -965,7 +974,7 @@ int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq)
laddr[0] = (pdev->bus->number << 16)
| (pdev->devfn << 8);
laddr[1] = laddr[2] = 0;
return of_irq_map_raw(ppnode, &lspec, laddr, out_irq);
return of_irq_map_raw(ppnode, &lspec, 1, laddr, out_irq);
}
EXPORT_SYMBOL_GPL(of_irq_map_pci);
#endif /* CONFIG_PCI */
4 changes: 3 additions & 1 deletion trunk/include/asm-powerpc/prom.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ extern void of_irq_map_init(unsigned int flags);
* of_irq_map_raw - Low level interrupt tree parsing
* @parent: the device interrupt parent
* @intspec: interrupt specifier ("interrupts" property of the device)
* @ointsize: size of the passed in interrupt specifier
* @addr: address specifier (start of "reg" property of the device)
* @out_irq: structure of_irq filled by this function
*
Expand All @@ -288,7 +289,8 @@ extern void of_irq_map_init(unsigned int flags);
*
*/

extern int of_irq_map_raw(struct device_node *parent, u32 *intspec, u32 *addr,
extern int of_irq_map_raw(struct device_node *parent, u32 *intspec,
u32 ointsize, u32 *addr,
struct of_irq *out_irq);


Expand Down

0 comments on commit 75b4931

Please sign in to comment.