[realtek] Flash programming fix for rtl8139-diag

Donald Becker becker@scyld.com
Tue, 21 Aug 2001 19:22:07 -0400 (EDT)


On Tue, 21 Aug 2001, Mikkel Lauritsen wrote:

> After having poked around a bit I've managed to make my
> generic 8139C based NIC actually program an AT29C256-120
> flash prom.
>
> The patch below contains the not very documented changes
> that I've made. Is this the right way to go about reporting
> fixes like this? I haven't been able to test it with other
> versions of the 8139, but at least it works for me.

I suspect a difference in the chip versions.  But I can't find my flash
chips to test with.

I'll put this change in the next rtl8139-diag version.

> - NWayExpansion=0x6A, FlashAccess=0x74,
> + NWayExpansion=0x6A, FlashAccess=0xD4,

>   static int rtl_flash_in(long ioaddr, int offset) {
> - outl(0x1C0000 | (offset & 0x1ffff), ioaddr + FlashAccess);
> + outl(0x1e0000, ioaddr + FlashAccess);

>   static void rtl_flash_out(long ioaddr, int offset, int val) {
> - outl((val<<24) | 0x1a0000 | (offset & 0x1ffff), ioaddr + FlashAccess);
> + outl(0x1e0000, ioaddr + FlashAccess);
> + outl(0xe0000 | (offset & 0x1ffff), ioaddr + FlashAccess);
> + outl((val<<24) | 0xa0000 | (offset & 0x1ffff), ioaddr + FlashAccess);
> + outl(0x1c0000, ioaddr + FlashAccess);
>   }

Hmmm, the extra flash_out() steps look a little bogus to me.
Are they really needed?

Donald Becker				becker@scyld.com
Scyld Computing Corporation		http://www.scyld.com
410 Severn Ave. Suite 210		Second Generation Beowulf Clusters
Annapolis MD 21403			410-990-9993