[flashrom] New programmer AMD Am79C971 (PCNet32 / Lance), need help

Alexander Lundén alexander.lunden at telia.com
Sun Jul 29 22:15:05 CEST 2018


Hi everyone,

I have spent the past few days implementing support for the AMD 
Am79C971, in the family of AMD Lance network controllers. Please see 
attached source code.

So far, testing with SST39SF020A memory has shown positive results for 
reading flash memory. However, erasure and writing fails now and then, 
often with just one or two bytes being erroneous. Sometimes it fails 
with “magic data” being written, sometimes with random data at random 
locations. Please see the attached log for a full example failure.

"Verifying flash... FAILED at 0x00005555! Expected=0xef, Found=0xaa, 
failed byte count from 0x00000000-0x0003ffff: 0x1"
"Verifying flash... FAILED at 0x000008b9! Expected=0x00, Found=0xb9, 
failed byte count from 0x00000000-0x0003ffff: 0x1"
"Verifying flash... FAILED at 0x0001fd86! Expected=0x86, Found=0x85, 
failed byte count from 0x00000000-0x0003ffff: 0x1"

I have never worked with PCI devices nor flash memory before, and I 
would really appreciate some ideas of where to start poking around to 
fix the erasure and writing issues. Also, comments on the code is highly 
appreciated!

The datasheet for the network controller can be found here: 
https://datasheet.octopart.com/AM79C971AKC-W-AMD-datasheet-5389196.pdf

Kind regards,
Alexander Lundén


-------------- next part --------------
flashrom v1.0 on Linux 4.17.3-1-ARCH (x86_64)
flashrom was built with libpci 3.2.1, GCC 4.9.2, little endian
Command line (9 args): ./flashrom -VVV -p nicamd -c SST39SF020A -w ../rom/pattern.bin -o ../log/20180729/nicamd-rc2-write5.log
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
Initializing nicamd programmer
Found "AMD PCNET32: Am79C971 PCI 10/100 Mbps" (1022:2000, BDF 07:04.0).
===
This PCI device is UNTESTED. Please report the 'flashrom -p xxxx' output 
to flashrom at flashrom.org if it works for you. Please add the name of your
PCI device to the subject. Thank you for your help!
===
PCI header type 0x00
Requested BAR is of type I/O
PCI header type 0x00
Requested BAR is of type I/O
[nicamd] Enabling/verifying 32-bit I/O.
[nicamd] Entering STOP mode.
The following protocols are supported: Parallel.
Probing for SST SST39SF020A, 256 kB: programmer_map_flash_region: mapping SST39SF020A from 0x00000000fffc0000 to 0x0000000000000000
probe_jedec_common: id1 0xbf, id2 0xb6
Found SST flash chip "SST39SF020A" (256 kB, Parallel) on nicamd.
programmer_unmap_flash_region: unmapped 0x0000000000000000
programmer_map_flash_region: mapping SST39SF020A from 0x00000000fffc0000 to 0x0000000000000000
Reading old flash chip contents... done.
Erasing and writing flash chip... Trying erase function 0... 0x000000-0x000fff:EW, 0x001000-0x001fff:EW, 0x002000-0x002fff:EW, 0x003000-0x003fff:EW, 0x004000-0x004fff:EW, 0x005000-0x005fff:EW, 0x006000-0x006fff:EW, 0x007000-0x007fff:EW, 0x008000-0x008fff:EW, 0x009000-0x009fff:EW, 0x00a000-0x00afff:EW, 0x00b000-0x00bfff:EW, 0x00c000-0x00cfff:EW, 0x00d000-0x00dfff:EW, 0x00e000-0x00efff:EW, 0x00f000-0x00ffff:EW, 0x010000-0x010fff:EW, 0x011000-0x011fff:EW, 0x012000-0x012fff:EW, 0x013000-0x013fff:EW, 0x014000-0x014fff:EW, 0x015000-0x015fff:EW, 0x016000-0x016fff:EW, 0x017000-0x017fff:EW, 0x018000-0x018fff:EW, 0x019000-0x019fff:EW, 0x01a000-0x01afff:EW, 0x01b000-0x01bfff:EW, 0x01c000-0x01cfff:EW, 0x01d000-0x01dfff:EW, 0x01e000-0x01efff:EW, 0x01f000-0x01ffff:EW, 0x020000-0x020fff:EW, 0x021000-0x021fff:EW, 0x022000-0x022fff:EW, 0x023000-0x023fff:EW, 0x024000-0x024fff:EW, 0x025000-0x025fff:EW, 0x026000-0x026fff:EW, 0x027000-0x027fff:EW, 0x028000-0x028fff:EW, 0x029000-0x029fff:EW, 0x02a000-0x02afff:EW, 0x02b000-0x02bfff:EW, 0x02c000-0x02cfff:EW, 0x02d000-0x02dfff:EW, 0x02e000-0x02efff:EW, 0x02f000-0x02ffff:EW, 0x030000-0x030fff:EW, 0x031000-0x031fff:EW, 0x032000-0x032fff:EW, 0x033000-0x033fff:EW, 0x034000-0x034fff:EW, 0x035000-0x035fff:EW, 0x036000-0x036fff:EW, 0x037000-0x037fff:EW, 0x038000-0x038fff:EW, 0x039000-0x039fff:EW, 0x03a000-0x03afff:EW, 0x03b000-0x03bfff:EW, 0x03c000-0x03cfff:EW, 0x03d000-0x03dfff:EW, 0x03e000-0x03efff:EW, 0x03f000-0x03ffff:EW
Erase/write done.
Verifying flash... FAILED at 0x0001fd86! Expected=0x86, Found=0x85, failed byte count from 0x00000000-0x0003ffff: 0x1
Your flash chip is in an unknown state.
Please report this on IRC at chat.freenode.net (channel #flashrom) or
mail flashrom at flashrom.org, thanks!
programmer_unmap_flash_region: unmapped 0x0000000000000000
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: nicamd.c
URL: <http://mail.coreboot.org/pipermail/flashrom/attachments/20180729/c1dff206/attachment.c>


More information about the flashrom mailing list