Thread: BAR 1 64 bit
View Single Post
Old 01-07-10, 08:32 AM   #3
genux
Registered User
 
Join Date: Dec 2009
Posts: 4
Default Re: BAR 1 64 bit

I had sorted out a fix for this problem..

I have included more details on this site, BAR 15 - nvidia graphics card does not work, regarding the fix because I had to stop any resources trying to claim the 0xc0-0xcf range. But basically the fix was to add another test to block out any other resources trying to claim that space as well in the linux-source-code arch/x86/pci/i386.c pcibios_allocate_bus_resources function

Code:
/*
www.codingfriends.com added, to test for the nvidia problem
 
[0xb0000000-0xbfffffff] is where the BIOS is telling nvidia to get the memory,
but with 4GB this is where the system memory is.                              
 
a better way of doing this, would be to run the BIOS find memory process twice
and then if no resources can gain memory, e.g. nvidia in this case, flag it for the
second run to then give that the starting area and re-do the rest of them, because 
mainly it is the graphics card that needs the most memory..e.g. 256-512 etc.       
*/                               
                                                  
                                if ((r->start >= 0xc0000000) && (r->end <= 0xcfffffff)) {
                                        dev_info(&dev->dev,                              
                                                 " not allocating resource 0xc - 0xcf %pR\n",
                                                 r);                                         
                                        /*                                                   
                                                stop any resources gaining the 0xc0000000 - 0xcfffffff
                                                region, the linux kernel will re-place them.          
                                        */                                                            
                                        r->flags = 0;                                                 
                                }                                                                     
 
                                /* where the nvidia is going and replace in the above region */
                                if ((r->start == 0xb0000000) && (r->end == 0xbfffffff)) {      
                                        r->start = 0xc0000000;                                 
                                        r->end = 0xcfffffff;                                   
                                }
Hope that this helps any other people regarding this error, I am going to see if I am able to make it so that the linux kernel will do this sort of thing automatically without custom writing the memory locations.
genux is offline   Reply With Quote