[LinuxBIOS] [PATCH] small fix for iei/juki-511p

Juergen Beisert juergen127 at kreuzholzen.de
Tue Nov 20 18:49:47 CET 2007


On Tuesday 20 November 2007 17:07, Uwe Hermann wrote:
> > @@ -99,5 +217,40 @@
> >   */
> >  unsigned long write_pirq_routing_table(unsigned long addr)
> >  {
> > -	return copy_pirq_routing_table(addr);
> > +	int i, j, k, num_entries;
> > +	unsigned char pirq[4];
> > +	uint16_t chipset_irq_map;
> > +	uint32_t pciAddr, pirtable_end;
> > +	struct irq_routing_table *pirq_tbl;
> > +	device_t pdev;
> > +
> > +	pirtable_end = copy_pirq_routing_table(addr);
> > +
> > +	/* Set up chipset IRQ steering. */
> > +	pdev = dev_find_slot(0, (0x12 << 3));
> > +	pci_write_config8(pdev, 0x5c, (PIRQB << 4 | PIRQA));
> > +	pci_write_config8(pdev, 0x5d, (PIRQD << 4 | PIRQC));
> > +
> > +	pirq_tbl = (struct irq_routing_table *)(addr);
> > +	num_entries = (pirq_tbl->size - 32) / 16;
> > +
> > +	/* Set PCI IRQs. */
> > +	for (i = 0; i < num_entries; i++) {
> > +		printk_debug("PIR Entry %d Dev/Fn: %X Slot: %d\n", i,
> > +			     pirq_tbl->slots[i].devfn, pirq_tbl->slots[i].slot);
> > +		for (j = 0; j < 4; j++) {
> > +			printk_debug("INT: %c bitmap: %x ", 'A' + j,
> > +				     pirq_tbl->slots[i].irq[j].bitmap);
> > +			for (k = 0; (!((pirq_tbl->slots[i].irq[j].bitmap >> k) & 1)) &&
> > (pirq_tbl->slots[i].irq[j].bitmap != 0); k++) ;	/* Finds lsb in bitmap to
> > IRQ#. */ +			pirq[j] = k;
> > +			printk_debug("PIRQ: %d\n", k);
> > +		}
> > +
> > +		/* Bus, device, slots IRQs for {A,B,C,D}. */
> > +		pci_assign_irqs(pirq_tbl->slots[i].bus,
> > +				pirq_tbl->slots[i].devfn >> 3, pirq);
> > +	}
> > +
> > +	/* Put the PIR table in memory and checksum. */
> > +	return pirtable_end;
>
> Hm, why is this required here? Is it necessary for all GX1/CS5530 boards?
> If so it should be done in the CS5530 code, I think. Why doesn't the usual
> copy_pirq_routing_table() suffice here?

It seems one thing he does is to set up the interrupt steering register. So he 
don't need my kernel patch to let Linux know the CS5530 interrupt router: 
Interrupt routing is already done when the kernel starts. But IMHO this 
should be done in the generic part.

Juergen




More information about the coreboot mailing list