map display option ROMs
PATCH 1/1 map display option ROMs
By default, the sn2 PCI init code doesn't map option ROM address ranges since PIO address space is limited. However, we do need to map display option ROMs in the event that userland applications want to read and emulate them. Here's a patch to do that. It applies on top of the last cleanup patch I sent you.
Thanks,
Jesse
===== arch/ia64/sn/io/machvec/pci_bus_cvlink.c 1.38 vs edited =====
arch/ia64/sn/io/machvec/pci_bus_cvlink.c +28 -0
@@ -328,6 +328,34 @@ cmd |=PCI_COMMAND_MEMORY ; } +/* +* Assign addresses to the ROMs, but don't enable them yet +* Also note that we only map display card ROMs due to PIO mapping +* space scarcity. +*/ +if ((dev->class >>16 ) ==PCI_BASE_CLASS_DISPLAY ) { +unsigned long addr; + size = dev->resource[PCI_ROM_RESOURCE ].end - + dev->resource[PCI_ROM_RESOURCE ].start; + +if (size) { + addr = (unsigned long )pciio_pio_addr (vhdl,0 , +PCIIO_SPACE_ROM , +0 , size,0 ,PIOMAP_FIXED ); +if (!addr) { + dev->resource[PCI_ROM_RESOURCE ].start =0 ; + dev->resource[PCI_ROM_RESOURCE ].end =0 ; +printk ("sn_pci_fixup(): ROM pio map failure " +"for %s\n" , dev->slot_name); + } + addr |= __IA64_UNCACHED_OFFSET; + dev->resource[PCI_ROM_RESOURCE ].start = addr; + dev->resource[PCI_ROM_RESOURCE ].end = addr + size; +if (dev->resource[PCI_ROM_RESOURCE ].flags &IORESOURCE_MEM ) + cmd |=PCI_COMMAND_MEMORY ; + } + } +/* * Update the Command Word on the Card. */