]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/bios_emulator/atibios.c
ati_radeon: Support PCI virtual not eq bus mapping.
[karo-tx-uboot.git] / drivers / bios_emulator / atibios.c
index 2881449d980c8862372445e995395f5b0bc73478..dbb5e8cce52d055313f6831176fca17a37e84049 100644 (file)
@@ -173,7 +173,7 @@ Maps a pointer to the BIOS image on the graphics card on the PCI bus.
 ****************************************************************************/
 void *PCI_mapBIOSImage(pci_dev_t pcidev)
 {
-       u32 BIOSImagePhys;
+       u32 BIOSImageBus;
        int BIOSImageBAR;
        u8 *BIOSImage;
 
@@ -195,16 +195,18 @@ void *PCI_mapBIOSImage(pci_dev_t pcidev)
         specific programming for different cards to solve this problem.
        */
 
-       if ((BIOSImagePhys = PCI_findBIOSAddr(pcidev, &BIOSImageBAR)) == 0) {
+       BIOSImageBus = PCI_findBIOSAddr(pcidev, &BIOSImageBAR);
+       if (BIOSImageBus == 0) {
                printf("Find bios addr error\n");
                return NULL;
        }
 
-       BIOSImage = (u8 *) BIOSImagePhys;
+       BIOSImage = pci_bus_to_virt(pcidev, BIOSImageBus,
+                                   PCI_REGION_MEM, 0, MAP_NOCACHE);
 
        /*Change the PCI BAR registers to map it onto the bus.*/
        pci_write_config_dword(pcidev, BIOSImageBAR, 0);
-       pci_write_config_dword(pcidev, PCI_ROM_ADDRESS, BIOSImagePhys | 0x1);
+       pci_write_config_dword(pcidev, PCI_ROM_ADDRESS, BIOSImageBus | 0x1);
 
        udelay(1);