Commit da37fb36 authored by Tom Rini's avatar Tom Rini

ppc32: Use residual data to determine the addr to pass i8259_init()

Signed-off-by: default avatarLeigh Brown <leigh@solinno.co.uk>
Signed-off-by: default avatarTom Rini <trini@kernel.crashing.org>
parent 024050ec
......@@ -972,6 +972,12 @@ prep_init_IRQ(void)
}
for ( i = 0 ; i < NUM_8259_INTERRUPTS ; i++ )
irq_desc[i].handler = &i8259_pic;
if (have_residual_data) {
i8259_init(residual_isapic_addr());
return;
}
/* If we have a Raven PCI bridge or a Hawk PCI bridge / Memory
* controller, we poll (as they have a different int-ack address). */
early_read_config_dword(NULL, 0, 0, PCI_VENDOR_ID, &pci_viddid);
......
......@@ -917,6 +917,39 @@ void __init residual_irq_mask(char *irq_edge_mask_lo, char *irq_edge_mask_hi)
*irq_edge_mask_hi = irq_mask >> 8;
}
unsigned int __init residual_isapic_addr(void)
{
PPC_DEVICE *isapic;
PnP_TAG_PACKET *pkt;
unsigned int addr;
isapic = residual_find_device(~0, NULL, SystemPeripheral,
ProgrammableInterruptController,
ISA_PIC, 0);
if (!isapic)
goto unknown;
pkt = PnP_find_large_vendor_packet(res->DevicePnPHeap +
isapic->AllocatedOffset, 9, 0);
if (!pkt)
goto unknown;
#define p pkt->L4_Pack.L4_Data.L4_PPCPack
/* Must be 32-bit memory address */
if (!((p.PPCData[0] == 2) && (p.PPCData[1] == 32)))
goto unknown;
/* It doesn't seem to work where length != 1 (what can I say? :-/ ) */
if (ld_le32((unsigned int *)(p.PPCData + 12)) != 1)
goto unknown;
addr = ld_le32((unsigned int *) (p.PPCData + 4));
#undef p
return addr;
unknown:
return 0;
}
PnP_TAG_PACKET *PnP_find_packet(unsigned char *p,
unsigned packet_tag,
int n)
......
......@@ -328,6 +328,7 @@ extern PPC_DEVICE *residual_find_device(unsigned long BusMask,
int SubType, int Interface, int n);
extern int residual_pcidev_irq(struct pci_dev *dev);
extern void residual_irq_mask(char *irq_edge_mask_lo, char *irq_edge_mask_hi);
extern unsigned int residual_isapic_addr(void);
extern PnP_TAG_PACKET *PnP_find_packet(unsigned char *p, unsigned packet_tag,
int n);
extern PnP_TAG_PACKET *PnP_find_small_vendor_packet(unsigned char *p,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment