From 07587c7b9fc1cf0e4e6e751a33a58a2feecb6d17 Mon Sep 17 00:00:00 2001 From: Rudolf Cornelissen Date: Sat, 3 Jul 2004 16:47:59 +0000 Subject: [PATCH] added workaround for non-mapped ROMS: getting it from legacy ISA mapping if the PCI config resource manager did not assign an adress for PCI style ROM mapping. Our PCI config manager needs to do this mapping! Be's devices doesn't even mention it. (maybe currently BeOS is relying on the system BIOS to map the ROM PCI style?, but I think BeOS should tell the user about the mapping in 'devices' anyway..) Ah, well: it works now :) git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8286 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../kernel/drivers/graphics/nvidia/driver.c | 38 +++++++++++++------ 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/src/add-ons/kernel/drivers/graphics/nvidia/driver.c b/src/add-ons/kernel/drivers/graphics/nvidia/driver.c index 3c1fda19b5..a03812a579 100644 --- a/src/add-ons/kernel/drivers/graphics/nvidia/driver.c +++ b/src/add-ons/kernel/drivers/graphics/nvidia/driver.c @@ -515,19 +515,35 @@ static status_t map_device(device_info *di) * however the actual ROM content (so the used part) is intact (confirmed). */ //set_pci(NVCFG_ROMSHADOW, 4, 0); - /* enable ROM decoding - this is defined in the PCI standard */ + /* get ROM memory mapped base adress - this is defined in the PCI standard */ tmpUlong = get_pci(PCI_rom_base, 4); - tmpUlong |= 0x00000001; - set_pci(PCI_rom_base, 4, tmpUlong); + if (tmpUlong) + { + /* ROM was assigned an adress, so enable ROM decoding - see PCI standard */ + tmpUlong |= 0x00000001; + set_pci(PCI_rom_base, 4, tmpUlong); - rom_area = map_physical_memory( - buffer, - (void *)di->pcii.u.h0.rom_base_pci, - di->pcii.u.h0.rom_size, - B_ANY_KERNEL_ADDRESS, - B_READ_AREA, - (void **)&(rom_temp) - ); + rom_area = map_physical_memory( + buffer, + (void *)di->pcii.u.h0.rom_base_pci, + di->pcii.u.h0.rom_size, + B_ANY_KERNEL_ADDRESS, + B_READ_AREA, + (void **)&(rom_temp) + ); + } + else + { + /* ROM was not assigned an adress, fetch it from ISA legacy memory map! */ + rom_area = map_physical_memory( + buffer, + (void *)0x000c0000, + 65536, + B_ANY_KERNEL_ADDRESS, + B_READ_AREA, + (void **)&(rom_temp) + ); + } /* if mapping ROM to vmem failed then clean up and pass on error */ if (rom_area < 0) {