| 
    
 [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] RE: [Xen-devel] allocating AGP aperture memory
 > > You're right, I don't really want to do that, but I got
> > inadvertantly sidetracked into thinking I needed AGP support 
> > working.  Fortunately, I don't.
> > 
> > However, if I don't have AGP support working, I need to
> > program the Northbridge registers with the physical address 
> > of the GATT (see init_k8_gatt() in 
> arch/xen/x86_64/kernel/pci-gart.c).
> > Just doing a __pa() obviously doesn't return meaningful data, 
> > which is to be expected.  How should dom0 go about getting it?
> 
> You need to allocate the gatt mapping table using alloc_gatt_pages
> (dma_alloc_coherent) rather than get_free_pages.
> 
> You then want to use virt_to_gart on the address returned.
Are you sure?  I've been trying this for days, and it
isn't working.
Here's the original code in question, from pci-gart.c
        gatt = (void *) __get_free_pages(GFP_KERNEL,
get_order(gatt_size));
        for_all_nb(dev) {
                u32 gatt_reg;
                gatt_reg = __pa(gatt) >> 12;
                gatt_reg <= 4;
                pci_write_config_dword(dev, 0x98, gatt_reg);
        }
I've changed it to:
        gatt = (void *) alloc_gatt_pages(get_order(gatt_size));
        for_all_nb(dev) {
                u32 gatt_reg;
                gatt_reg = phys_to_gart(virt_to_phys(gatt)) >> 12;
                gatt_reg <= 4;
                pci_write_config_dword(dev, 0x98, gatt_reg);
        }
I don't think the northbridge is looking for the gart
value of the gatt, even in a virtualized environment.
-Mark Langsdorf
AMD, Inc.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
  | 
  
![]()  | 
            
         Lists.xenproject.org is hosted with RackSpace, monitoring our  |