]> git.sur5r.net Git - openocd/commitdiff
- change str9 flash controller to read array after a level 1 protect
authorntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Sat, 26 Apr 2008 12:50:03 +0000 (12:50 +0000)
committerntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Sat, 26 Apr 2008 12:50:03 +0000 (12:50 +0000)
git-svn-id: svn://svn.berlios.de/openocd/trunk@619 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/flash/str9x.c

index 30c4e980833e742cb0bb90c31735bc434f3c5243..150f0f87353ce985da600ffb26196c88c77fcbbe 100644 (file)
@@ -216,6 +216,7 @@ int str9x_protect_check(struct flash_bank_s *bank)
                target_read_u16(target, adr, (u16*)&status);
        }
        
+       /* read array command */
        target_write_u16(target, adr, 0xFF);
        
        for (i = 0; i < bank->num_sectors; i++)
@@ -304,6 +305,12 @@ int str9x_protect(struct flash_bank_s *bank, int set, int first, int last)
                
                /* query status */
                target_read_u8(target, adr, &status);
+               
+               /* clear status, also clear read array */
+               target_write_u16(target, adr, 0x50);
+               
+               /* read array command */
+               target_write_u16(target, adr, 0xFF);
        }
        
        return ERROR_OK;