From 4e9cebb2fbf22519659a9dc0a8ff4d5d1293ede2 Mon Sep 17 00:00:00 2001 From: Carl-Daniel Hailfinger Date: Sat, 5 Sep 2009 01:16:30 +0000 Subject: Unify some probe functions that basically correspond to probe_jedec() Use the correct reset sequence for 82802AB. Detailed explanation: The reset sequence before ID reading was correct, so ID always worked. But the reset sequence after ID reading was a copy-paste leftover from probe_jedec and didn't have any effect. I dug up flash_and_burn from the freebios-v1 tree and found out that 82802ab.c was indeed a copy of jedec.c with lots of experimental unannotated #if 0 and #if 1. About the wait_82802ab change: Before the patch, wait_82802ab entered read status mode, switched to ID mode, then tried an incorrect and unsupported JEDEC command to exit ID mode. Nobody ever saw that this failed because all subsequent function calls had the correct reset sequence at the beginning. With the patch, wait_82802ab enters read status mode, then switches back to read mode with the official reset command. Corresponding to flashrom svn r717. Signed-off-by: Carl-Daniel Hailfinger Acked-by: Stefan Reinauer --- w39v080fa.c | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) (limited to 'w39v080fa.c') diff --git a/w39v080fa.c b/w39v080fa.c index 96e83a8e1..580657f96 100644 --- a/w39v080fa.c +++ b/w39v080fa.c @@ -22,29 +22,10 @@ int probe_winbond_fwhub(struct flashchip *flash) { - chipaddr bios = flash->virtual_memory; - uint8_t id1, id2; - - /* Product Identification Entry */ - chip_writeb(0xAA, bios + 0x5555); - chip_writeb(0x55, bios + 0x2AAA); - chip_writeb(0x90, bios + 0x5555); - programmer_delay(10); - - /* Read product ID */ - id1 = chip_readb(bios); - id2 = chip_readb(bios + 0x01); + int result = probe_jedec(flash); - /* Product Identifixation Exit */ - chip_writeb(0xAA, bios + 0x5555); - chip_writeb(0x55, bios + 0x2AAA); - chip_writeb(0xF0, bios + 0x5555); - programmer_delay(10); - - printf_debug("%s: id1 0x%x, id2 0x%x\n", __func__, id1, id2); - - if (id1 != flash->manufacture_id || id2 != flash->model_id) - return 0; + if (!result) + return result; map_flash_registers(flash); -- cgit v1.2.3