Re: Flash programming with rtl8139
Donald Becker <[email protected]> Thu, 14 Aug 2003 16:56:13 -0400 (EDT)
| Newsgroups | gmane.linux.drivers.realtek.devel |
|---|---|
| Message-ID | <Pine.LNX.4.44.0308141636020.2729-100000@beohost> |
On Thu, 14 Aug 2003, Markus Schlotterer wrote:
> I tried to flash an AMD Am29F010B flash rom using a noname NIC with
> RTL8139C chip. The tool provided bei Realtek (rtflash.exe) didn't work
> because the AMD flash is not know.
> Then I tried the rtl8139-diag tool. At first it didn't even recognize
> the chips ids correctly. Then I found a patch by Mikkel Lauritsen
> (http://www.scyld.com/pipermail/realtek/2001-August/001070.html) and
> after applying this patch, everything worked correctly.
What part of the patch did you apply?
The first part, using register 0xD4 instead of 0x54, was added in
rtl8139-diag.c for v2.5 of January 2002. The 0x54 value is only correct
for the original chips, but it seems that few boards with old chips have flash
sockets so I didn't bother selecting the register offset based on chip
version.
Did you also need the other part of that patch, which does some extra
toggling of the chip select bits? If so, let me know. This might be
Flash-chip-specific, but the only way to know for certain is to see who
else complains.
----------------------------
revision 2.5
date: 2002/01/28 18:17:32; author: becker; state: Exp; lines: +140 -124
rtl8139-diag.c:v2.05
Moved all config EEPROM code to its own function.
Corrected swapped BMCR-BMSR in MII output.
(Basic Mode Configuration/Status Register.)
Changed the FlashAccess register offset from the old 0x74 to the current 0xD4.
This may cause problems with old chips, but should be correct for future chip
versions.
----------------------------
> This flash rom needs a chip erase before programming. After programming
> first few bytes were not programmed correctly and remained 0xFF. So I
> patched libflash.c and applied the "Data Polling Algorithm" to check
> whether the flash internal chip erase algorithm has been finished and
> did succed. The "Data Polling Algorithm" has been taken form the AMD
> Am29F010B data sheet.
OK, I'll have to read that and digest your patch.
After applying the algorithm, everything worked
> perfectly. Maybe this algorithm is used by other chips too, so i will
> provide the patch here:
[[ Polling patch omitted.]]
> 114c114
> < { 0x01, 0x20, 0, 0, 0, "AMD Am29F010B", },
> ---
> > { 0x01, 0x20, ERASE_FIRST, 1024*128, 1, "AMD Am29F010B", },
...and check why I though that this chip was bulk-erased+byte-programmed
instead of block-overwritten.
--
Donald Becker [email protected]
Scyld Computing Corporation http://www.scyld.com
914 Bay Ridge Road, Suite 220 Scyld Beowulf cluster system
Annapolis MD 21403 410-990-9993