fixed BIOS ROM readout
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8224 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
54302f75a1
commit
cc04d75491
@ -808,7 +808,9 @@ static status_t nvxx_general_powerup()
|
|||||||
|
|
||||||
/* initialize the shared_info PINS struct */
|
/* initialize the shared_info PINS struct */
|
||||||
result = parse_pins();
|
result = parse_pins();
|
||||||
if (result != B_OK) fake_pins();
|
// if (result != B_OK) fake_pins();
|
||||||
|
//temporary:
|
||||||
|
fake_pins();
|
||||||
|
|
||||||
/* log the PINS struct settings */
|
/* log the PINS struct settings */
|
||||||
dump_pins();
|
dump_pins();
|
||||||
|
@ -33,10 +33,12 @@ status_t parse_pins ()
|
|||||||
/* preset PINS read status to failed */
|
/* preset PINS read status to failed */
|
||||||
si->ps.pins_status = B_ERROR;
|
si->ps.pins_status = B_ERROR;
|
||||||
|
|
||||||
|
LOG(2,("INFO: cardROM size: %dKb\n", (si->rom.size / 1024)));
|
||||||
|
|
||||||
/* check the validity of PINS */
|
/* check the validity of PINS */
|
||||||
LOG(2,("INFO: Reading PINS info\n"));
|
LOG(2,("INFO: Reading PINS info\n"));
|
||||||
rom = (uint8 *) si->rom_mirror;
|
rom = (uint8 *) si->rom.mirror;
|
||||||
/* check BIOS signature */
|
/* check BIOS signature - this is defined in the PCI standard */
|
||||||
if (rom[0]!=0x55 || rom[1]!=0xaa)
|
if (rom[0]!=0x55 || rom[1]!=0xaa)
|
||||||
{
|
{
|
||||||
LOG(8,("INFO: BIOS signiture not found\n"));
|
LOG(8,("INFO: BIOS signiture not found\n"));
|
||||||
|
@ -4,12 +4,13 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<p><h2>Changes done for each driverversion:</h2></p>
|
<p><h2>Changes done for each driverversion:</h2></p>
|
||||||
<p><h1>head (0.15), (Rudolf)</h1></p>
|
<p><h1>head (0.16), (Rudolf)</h1></p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Added AGP mode capability on AGP cards along with the option to block it in nv.settings. No GART and AGP aperture support; but if your card and system AGP host bridge support the 'fastwrite' (FW) feature, you'll notice a nice speedup of mostly unaccelerated graphics. Tested Quake 2 in software rendering mode over here using timedemo1 with demo1.dm2: framerates jumped up to 140% of the 'original' in 'just' AGP2.0 4X mode!<br>
|
<li>Added AGP mode capability on AGP cards along with the option to block it in nv.settings. No GART and AGP aperture support; but if your card and system AGP host bridge support the 'fastwrite' (FW) feature, you'll notice a nice speedup of mostly unaccelerated graphics. Tested Quake 2 in software rendering mode over here using timedemo1 with demo1.dm2: framerates jumped up to 140% of the 'original' in 'just' AGP2.0 4X mode!<br>
|
||||||
<strong>Note please :</strong> You need the new AGP kernel driver I setup for this feature, without it you will remain using PCI mode as usual. This AGP driver will be released seperately asap: it's almost ready.
|
<strong>Note please :</strong> You need the new AGP kernel driver I setup for this feature, without it you will remain using PCI mode as usual. This AGP driver will be released seperately asap: it's almost ready.
|
||||||
<li>Updated CRTC memory granularity settings on TNT2 and later cards to reduce use of card internal bandwidth: this should minimize or prevent distortions on cards that have limited bandwidth available (especially on older cards). Note: doesn't actually fix the problem! (to be continued...)
|
<li>Updated CRTC memory granularity settings on TNT2 and later cards to reduce use of card internal bandwidth: this should minimize or prevent distortions on cards that have limited bandwidth available (especially on older cards). Note: doesn't actually fix the problem! (to be continued...)
|
||||||
<li>Updated CRTC modeline tuning for panels: this should fix the 'right-shifted' picture on some panels in their native modes.
|
<li>Updated CRTC modeline tuning for panels: this should fix the 'right-shifted' picture on some panels in their native modes;
|
||||||
|
<li>Fixed BIOS ROM dump (to file) option.
|
||||||
</ul>
|
</ul>
|
||||||
<p><h1>nv_driver 0.10, (Rudolf)</h1></p>
|
<p><h1>nv_driver 0.10, (Rudolf)</h1></p>
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -267,11 +267,18 @@ static settings current_settings = { // see comments in nv.settings
|
|||||||
false, // force_pci
|
false, // force_pci
|
||||||
};
|
};
|
||||||
|
|
||||||
static void dumprom (void *rom, size_t size)
|
static void dumprom (void *rom, uint32 size)
|
||||||
{
|
{
|
||||||
int fd = open ("/boot/home/" DRIVER_PREFIX ".rom", O_WRONLY | O_CREAT, 0666);
|
int fd;
|
||||||
|
uint32 cnt;
|
||||||
|
|
||||||
|
fd = open ("/boot/home/" DRIVER_PREFIX ".rom", O_WRONLY | O_CREAT, 0666);
|
||||||
if (fd < 0) return;
|
if (fd < 0) return;
|
||||||
write (fd, rom, size);
|
|
||||||
|
/* apparantly max. 32kb may be written at once;
|
||||||
|
* the ROM size is a multiple of that anyway. */
|
||||||
|
for (cnt = 0; (cnt < size); cnt += 32768)
|
||||||
|
write (fd, ((void *)(((uint8 *)rom) + cnt)), 32768);
|
||||||
close (fd);
|
close (fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -446,24 +453,25 @@ static status_t map_device(device_info *di)
|
|||||||
// physical_entry physical_memory[2];
|
// physical_entry physical_memory[2];
|
||||||
// #define G400_DMA_BUFFER_SIZE 1024*1024
|
// #define G400_DMA_BUFFER_SIZE 1024*1024
|
||||||
|
|
||||||
/*variables for making copy of ROM*/
|
/* variables for making copy of ROM */
|
||||||
char * rom_temp;
|
char * rom_temp;
|
||||||
area_id rom_area;
|
area_id rom_area;
|
||||||
|
uint32 rom_size;
|
||||||
|
|
||||||
/* Nvidia cards have registers in [0] and framebuffer in [1] */
|
/* Nvidia cards have registers in [0] and framebuffer in [1] */
|
||||||
int registers = 0;
|
int registers = 0;
|
||||||
int frame_buffer = 1;
|
int frame_buffer = 1;
|
||||||
// int pseudo_dma = 2;
|
// int pseudo_dma = 2;
|
||||||
|
|
||||||
/* enable memory mapped IO, disable VGA I/O - this is standard*/
|
/* enable memory mapped IO, disable VGA I/O - this is defined in the PCI standard */
|
||||||
tmpUlong = get_pci(PCI_command, 4);
|
tmpUlong = get_pci(PCI_command, 2);
|
||||||
/* enable PCI access */
|
/* enable PCI access */
|
||||||
tmpUlong |= PCI_command_memory;
|
tmpUlong |= PCI_command_memory;
|
||||||
/* enable busmastering */
|
/* enable busmastering */
|
||||||
tmpUlong |= PCI_command_master;
|
tmpUlong |= PCI_command_master;
|
||||||
/* disable ISA I/O access */
|
/* disable ISA I/O access */
|
||||||
tmpUlong &= ~PCI_command_io;
|
tmpUlong &= ~PCI_command_io;
|
||||||
set_pci(PCI_command, 4, tmpUlong);
|
set_pci(PCI_command, 2, tmpUlong);
|
||||||
|
|
||||||
/*work out which version of BeOS is running*/
|
/*work out which version of BeOS is running*/
|
||||||
get_system_info(&sysinfo);
|
get_system_info(&sysinfo);
|
||||||
@ -500,15 +508,15 @@ static status_t map_device(device_info *di)
|
|||||||
di->pcii.vendor_id, di->pcii.device_id,
|
di->pcii.vendor_id, di->pcii.device_id,
|
||||||
di->pcii.bus, di->pcii.device, di->pcii.function);
|
di->pcii.bus, di->pcii.device, di->pcii.function);
|
||||||
|
|
||||||
/*place ROM over the fbspace (this is definately safe)*/
|
/* enable ROM decoding - this is defined in the PCI standard */
|
||||||
tmpUlong = di->pcii.u.h0.base_registers[frame_buffer];
|
tmpUlong = get_pci(PCI_rom_base, 4);
|
||||||
tmpUlong |= 0x00000001;
|
tmpUlong |= 0x00000001;
|
||||||
set_pci(PCI_rom_base, 4, tmpUlong);
|
set_pci(PCI_rom_base, 4, tmpUlong);
|
||||||
|
|
||||||
rom_area = map_physical_memory(
|
rom_area = map_physical_memory(
|
||||||
buffer,
|
buffer,
|
||||||
(void *)di->pcii.u.h0.base_registers[frame_buffer],
|
(void *)di->pcii.u.h0.rom_base_pci,
|
||||||
32768,
|
di->pcii.u.h0.rom_size,
|
||||||
B_ANY_KERNEL_ADDRESS,
|
B_ANY_KERNEL_ADDRESS,
|
||||||
B_READ_AREA,
|
B_READ_AREA,
|
||||||
(void **)&(rom_temp)
|
(void **)&(rom_temp)
|
||||||
@ -521,12 +529,19 @@ static status_t map_device(device_info *di)
|
|||||||
return rom_area;
|
return rom_area;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* make a copy of ROM for future reference*/
|
/* dump ROM to file if selected in nv.settings */
|
||||||
memcpy (si->rom_mirror, rom_temp, 32768);
|
if (current_settings.dumprom) dumprom (rom_temp, di->pcii.u.h0.rom_size);
|
||||||
if (current_settings.dumprom) dumprom (rom_temp, 32768);
|
/* we reserved 128Kb for the ROM mirror, but note actual size for reference */
|
||||||
|
si->rom.size = di->pcii.u.h0.rom_size;
|
||||||
|
/* make a copy of ROM for future reference, but truncate our mirror if needed */
|
||||||
|
rom_size = si->rom.size;
|
||||||
|
if (rom_size > (128 * 1024)) rom_size = (128 * 1024);
|
||||||
|
memcpy (si->rom.mirror, rom_temp, rom_size);
|
||||||
|
|
||||||
/*disable ROM and delete the area*/
|
/* disable ROM decoding - this is defined in the PCI standard, and delete the area */
|
||||||
set_pci(PCI_rom_base,4,0);
|
tmpUlong = get_pci(PCI_rom_base, 4);
|
||||||
|
tmpUlong &= 0xfffffffe;
|
||||||
|
set_pci(PCI_rom_base, 4, tmpUlong);
|
||||||
delete_area(rom_area);
|
delete_area(rom_area);
|
||||||
|
|
||||||
/* work out a name for the framebuffer mapping*/
|
/* work out a name for the framebuffer mapping*/
|
||||||
|
@ -14,7 +14,7 @@ hardcursor true # if true use on-chip cursor capabilities
|
|||||||
#logmask 0x00000000 # nothing logged, is default
|
#logmask 0x00000000 # nothing logged, is default
|
||||||
#logmask 0x08000604 # log overlay use in full
|
#logmask 0x08000604 # log overlay use in full
|
||||||
#logmask 0xffffffff # log everything
|
#logmask 0xffffffff # log everything
|
||||||
dumprom false # dump bios rom in ~/nv.rom: probably not functional yet
|
dumprom false # dump bios rom in ~/nv.rom
|
||||||
switchhead false # switch head assignment (dualhead cards only)
|
switchhead false # switch head assignment (dualhead cards only)
|
||||||
force_pci false # block AGP mode use if true (AGP cards only)
|
force_pci false # block AGP mode use if true (AGP cards only)
|
||||||
#--------- that's all.
|
#--------- that's all.
|
||||||
|
Loading…
Reference in New Issue
Block a user