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:
Rudolf Cornelissen 2004-06-28 19:48:57 +00:00
parent 54302f75a1
commit cc04d75491
5 changed files with 42 additions and 22 deletions

View File

@ -808,7 +808,9 @@ static status_t nvxx_general_powerup()
/* initialize the shared_info PINS struct */
result = parse_pins();
if (result != B_OK) fake_pins();
// if (result != B_OK) fake_pins();
//temporary:
fake_pins();
/* log the PINS struct settings */
dump_pins();

View File

@ -33,10 +33,12 @@ status_t parse_pins ()
/* preset PINS read status to failed */
si->ps.pins_status = B_ERROR;
LOG(2,("INFO: cardROM size: %dKb\n", (si->rom.size / 1024)));
/* check the validity of PINS */
LOG(2,("INFO: Reading PINS info\n"));
rom = (uint8 *) si->rom_mirror;
/* check BIOS signature */
rom = (uint8 *) si->rom.mirror;
/* check BIOS signature - this is defined in the PCI standard */
if (rom[0]!=0x55 || rom[1]!=0xaa)
{
LOG(8,("INFO: BIOS signiture not found\n"));

View File

@ -4,12 +4,13 @@
</head>
<body>
<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>
<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.
<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>
<p><h1>nv_driver 0.10, (Rudolf)</h1></p>
<ul>

View File

@ -267,11 +267,18 @@ static settings current_settings = { // see comments in nv.settings
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;
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);
}
@ -446,24 +453,25 @@ static status_t map_device(device_info *di)
// physical_entry physical_memory[2];
// #define G400_DMA_BUFFER_SIZE 1024*1024
/*variables for making copy of ROM*/
/* variables for making copy of ROM */
char * rom_temp;
area_id rom_area;
uint32 rom_size;
/* Nvidia cards have registers in [0] and framebuffer in [1] */
int registers = 0;
int frame_buffer = 1;
// int pseudo_dma = 2;
/* enable memory mapped IO, disable VGA I/O - this is standard*/
tmpUlong = get_pci(PCI_command, 4);
/* enable memory mapped IO, disable VGA I/O - this is defined in the PCI standard */
tmpUlong = get_pci(PCI_command, 2);
/* enable PCI access */
tmpUlong |= PCI_command_memory;
/* enable busmastering */
tmpUlong |= PCI_command_master;
/* disable ISA I/O access */
tmpUlong &= ~PCI_command_io;
set_pci(PCI_command, 4, tmpUlong);
set_pci(PCI_command, 2, tmpUlong);
/*work out which version of BeOS is running*/
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.bus, di->pcii.device, di->pcii.function);
/*place ROM over the fbspace (this is definately safe)*/
tmpUlong = di->pcii.u.h0.base_registers[frame_buffer];
/* enable ROM decoding - this is defined in the PCI standard */
tmpUlong = get_pci(PCI_rom_base, 4);
tmpUlong |= 0x00000001;
set_pci(PCI_rom_base, 4, tmpUlong);
rom_area = map_physical_memory(
buffer,
(void *)di->pcii.u.h0.base_registers[frame_buffer],
32768,
(void *)di->pcii.u.h0.rom_base_pci,
di->pcii.u.h0.rom_size,
B_ANY_KERNEL_ADDRESS,
B_READ_AREA,
(void **)&(rom_temp)
@ -521,12 +529,19 @@ static status_t map_device(device_info *di)
return rom_area;
}
/* make a copy of ROM for future reference*/
memcpy (si->rom_mirror, rom_temp, 32768);
if (current_settings.dumprom) dumprom (rom_temp, 32768);
/* dump ROM to file if selected in nv.settings */
if (current_settings.dumprom) dumprom (rom_temp, di->pcii.u.h0.rom_size);
/* 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*/
set_pci(PCI_rom_base,4,0);
/* disable ROM decoding - this is defined in the PCI standard, and delete the area */
tmpUlong = get_pci(PCI_rom_base, 4);
tmpUlong &= 0xfffffffe;
set_pci(PCI_rom_base, 4, tmpUlong);
delete_area(rom_area);
/* work out a name for the framebuffer mapping*/

View File

@ -14,7 +14,7 @@ hardcursor true # if true use on-chip cursor capabilities
#logmask 0x00000000 # nothing logged, is default
#logmask 0x08000604 # log overlay use in full
#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)
force_pci false # block AGP mode use if true (AGP cards only)
#--------- that's all.