summaryrefslogtreecommitdiff
path: root/drivers/bios_emulator
diff options
context:
space:
mode:
authorEd Swarthout <Ed.Swarthout@freescale.com>2010-03-31 15:52:40 -0500
committerAnatolij Gustschin <agust@denx.de>2010-04-08 15:30:47 +0200
commitf6a7a2e88854666e6a9ede50891fe415e803ace2 (patch)
treeb22e61e55853364f7b2f818d2120e51708ab6fa8 /drivers/bios_emulator
parent9624f6d9eb4b7223e97a27844ec4489ab953a2e2 (diff)
ati_radeon: Support PCI virtual not eq bus mapping.
Use pci_bus_to_virt() to convert the bus address from the BARs to virtual address' to eliminate the direct mapping requirement. Rename variables to better match usage (_phys -> _bus or no-suffix) This fixes the mpc8572ds CONFIG_PHYS_64BIT mode failure: "videoboot: Video ROM failed to map!" Tested on mpc8572ds with and without CONFIG_PHYS_64BIT. Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com>
Diffstat (limited to 'drivers/bios_emulator')
-rw-r--r--drivers/bios_emulator/atibios.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/bios_emulator/atibios.c b/drivers/bios_emulator/atibios.c
index 2881449d98..dbb5e8cce5 100644
--- a/drivers/bios_emulator/atibios.c
+++ b/drivers/bios_emulator/atibios.c
@@ -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);