bo-yang / plan9front

Automatically exported from code.google.com/p/plan9front
0 stars 0 forks source link

i82579 bad eeprom checksum #129

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
8086/1503 device reported to return wrong eeprom checksum.
device works under linux.

Original issue reported on code.google.com by cinap_le...@felloff.net on 19 Jun 2012 at 11:26

GoogleCodeExporter commented 9 years ago
device is a t520

Original comment by cinap_le...@felloff.net on 19 Jun 2012 at 11:27

GoogleCodeExporter commented 9 years ago
    f.sz = f.reg32[Bfpr];
    if(csr32r(c, Eec) & 1<<22){
-       if(c->type == i82579)
+       if(0)
            f.sz  += 16;        /* sector size: 64k */
        else
            f.sz  += 1;     /* sector size: 4k */
    }
    r = (f.sz & 0x1fff) << 12;

seems to make it work

Original comment by cinap_le...@felloff.net on 19 Jun 2012 at 11:33

GoogleCodeExporter commented 9 years ago
after reading:

http://lxr.free-electrons.com/source/drivers/net/ethernet/intel/e1000e/ich8lan.c
#L499

this might be another approach:

    r = f.reg32[Bfpr];
    if(csr32r(c, Eec) & 1<<22)
        r += ((1+((r >> 16) & 0x1fff)) - (r & 0x1fff)) >> 1;
    r = (r & 0x1fff) << 12;

waiting for eriks opinion for now...

Original comment by cinap_le...@felloff.net on 20 Jun 2012 at 1:36

GoogleCodeExporter commented 9 years ago
check re02a657704bd

Original comment by cinap_le...@felloff.net on 20 Jun 2012 at 11:11

GoogleCodeExporter commented 9 years ago

Original comment by cinap_le...@felloff.net on 24 Jun 2012 at 4:31