Comment 8 for bug 1091380

Revision history for this message
In , Xorgbugs (xorgbugs) wrote :

I found out another problem, I move the card to the final machine and got the
following error from handlePciBIOS(...);

"Cannot find empty range to map base to"

This was because it tried to find a 64MB range in from 0xe800_0000 -
0xe080f_ffff. This range was the range for everything but the framebuffer.

The cause was that it tried to find a place to put the BIOS but used the lenght
of BAR0 (the framebuffer of 64MB).

The reason seemed to be that in HandlePciBios() there is the following code;

  Acc1 = pciReadLong(Tag, PCI_CMD_STAT_REG);
  pciWriteLong(Tag, PCI_CMD_STAT_REG, (Acc1 & ~PCI_ENA));

  for (i = 0; i < num; i++) {
    Acc2 = pciReadLong(pTag[i], PCI_CMD_STAT_REG);
    pciWriteLong(pTag[i], PCI_CMD_STAT_REG, (Acc2 | PCI_ENA));

    n = handlePciBIOS( pTag[i], 0, buf, len );

    pciWriteLong(pTag[i], PCI_CMD_STAT_REG, Acc2);
    if (n)
      break;
  }
  pciWriteLong(Tag, PCI_CMD_STAT_REG, Acc1);
  return n;

There you can see the handlePciBIOS is always called with 0 as the region
number, when i change this to basereg (which is passed as an argument) it works.

Also i tried to replace handlePciBIOS with pciOSHandleBIOS but that did not
work. So it seems the second chip can only be initialized by the handlePciBIOS
function.