The code is taken from "LE25FW406A" chip and changed to fit the "LE25FW106".
This is the error: Found Sanyo flash chip "LE25FW106" (128 kB, SPI). Erasing and writing flash chip... Trying erase function 0... 0x000000-0x007fff:E, 0x008000-0x00ffff:EError: invalid response 0xAF from device
That's a bug in the serprog implementation (again... I think we saw that already in one of your logs a few weeks ago?). Is it perfectly reproducible?
Your chip definition looks good. I'd use another .printlock: spi_prettyprint_status_register_bp1_srwd with a fixme noting that the ERSER error flag is not implemented (yet) though. I am looking forward to a complete patch with sign-off this time? :)
Few minutes after sending my mail i thought it could be the "bug" in serprog. I tested again and all is working, only erase function1 not. The response is not always the same (now it's 0xA5). I attached the patch for LE25FW106, you can commit it if you think it's ok. And you can find logs from all read, write and erase (function0, 1 and 2). For me all looks good, only "LE25FW106-Erase1.txt" not. But on "normal" operation it uses function0 and this works with serprog.
Greetings