Index: jedec.c =================================================================== --- jedec.c (revision 875) +++ jedec.c (working copy) @@ -28,6 +28,9 @@ #define MASK_FULL 0xffff #define MASK_2AA 0x7ff +int unlock_winbond_fwhub(struct flashchip *flash); +static int unlocked = 0; + /* Check one byte for odd parity */ uint8_t oddparity(uint8_t val) { @@ -203,6 +206,11 @@ { chipaddr bios = flash->virtual_memory; + if (!unlocked) { + unlock_winbond_fwhub(flash); + unlocked=1; + } + /* Issue the Sector Erase command */ chip_writeb(0xAA, bios + (0x5555 & mask)); programmer_delay(10);