Hi,
The big problem here is that gettimeofday() apparently does not have any usable precision on your machine (maybe DOS/DJGPP related). Sometimes (always?) the time has not changed at all even after we delay for 10000 us and that causes the timer code to bail out.
Yes this function in DJGPP probably use standard timer at 18,2Hz (55ms) So I recomended uclock()...
To summarize:
- gettimeofday() has precision worse than 10 ms and that triggers timer
recalculation.
- Low uncached memory access is still broken on DOS or our SB600 SPI
code has a bug. It would be cool if you could run flashrom under Linux on that machine (no read/write needed) and post the output in verbose mode. OTOH, it is possible that the BIOS screwed up caching of the SB600 SPI MMIO region and in this case we can't do anything about it because checking MTRRs is infeasible.
Today I tried linux version (static linked by Rudolf) and it hanged at probing of the same chip, see log. So it's not DJGPP releated problem.
Martin
flashrom v0.9.1-r994 on Linux 2.6.24.07-alt16 (i686), built with libpci 3.0.0, GCC 4.4.1 No coreboot table found. DMI string system-manufacturer: "Dell Inc. " DMI string system-product-name: "OptiPlex 320 " DMI string system-version: "Not Specified" DMI string baseboard-manufacturer: "Dell Inc. " DMI string baseboard-product-name: "0CU395" DMI string baseboard-version: " " DMI string chassis-type: "Tower" Found chipset "AMD SB600", enabling flash write... SPI base address is at 0xd8000 AltSpiCSEnable=0, SpiRomEnable=0, AbortEnable=0 PrefetchEnSPIFromIMC=0, PrefetchEnSPIFromHost=0, SpiOpEnInLpcMode=0 SpiArbEnable=1, SpiAccessMacRomEn=1, SpiHostAccessRomEn=1, ArbWaitCount=4, SpiBridgeDisable=0, DropOneClkOnRd=0 GPIO11 used for SPI_DO GPIO12 used for SPI_DI GPIO31 used for SPI_HOLD GPIO32 used for SPI_CS GPIO47 used for SPI_CLK ROM strap override is not active OK. This chipset supports the following protocols: LPC,FWH,SPI. Calibrating delay loop... 1987M loops per second, 10 myus = 10 us, 100 myus = 99 us, 1000 myus = 1001 us, 10000 myus = 9996 us, OK. Probing for AMD Am29F010A/B, 128 KB: skipped. Probing for AMD Am29F002(N)BB, 256 KB: skipped. Probing for AMD Am29F002(N)BT, 256 KB: skipped. Probing for AMD Am29F016D, 2048 KB: skipped. Probing for AMD Am29F040B, 512 KB: skipped. Probing for AMD Am29F080B, 1024 KB: skipped. Probing for AMD Am29LV040B, 512 KB: skipped. Probing for AMD Am29LV081B, 1024 KB: skipped. Probing for ASD AE49F2008, 256 KB: skipped. Probing for Atmel AT25DF021, 256 KB: [it hangs here, breaked by ctrl-c]