This is an automated email from Gerrit. Sergey A. Borshch ([email protected]) just uploaded a new patch set to Gerrit, which you can find at http://openocd.zylin.com/2610
-- gerrit commit 53a0e2102a26d97aa2064e8912a4485667920908 Author: Sergey A. Borshch <[email protected]> Date: Wed Mar 18 14:03:21 2015 +0200 at91sam7: do not touch flash banks which are belongs to another targets at91sam7_read_part_info() walks throw all flash banks following current one. I don't know why it has to do it at all (possibly for multi-bank devices like SAM7S512), but if there is more than one target in JTAG chain, this lookup can touch flash bank of another (possibly not halted) target, which cause probe error and current command execution abort. Change-Id: Ide50e93578786e1250f7a0fd0e3d296247924814 Signed-off-by: Sergey A. Borshch <[email protected]> diff --git a/src/flash/nor/at91sam7.c b/src/flash/nor/at91sam7.c index c7334ca..a5722f4 100644 --- a/src/flash/nor/at91sam7.c +++ b/src/flash/nor/at91sam7.c @@ -373,21 +373,20 @@ static int at91sam7_read_part_info(struct flash_bank *bank) if (at91sam7_info->cidr != 0) { /* flash already configured, update clock and check for protected sectors */ - struct flash_bank *fb = bank; struct flash_bank *t_bank = bank; while (t_bank) { - /* re-calculate master clock frequency */ - at91sam7_read_clock_info(t_bank); + if (t_bank->target == target) { + /* re-calculate master clock frequency */ + at91sam7_read_clock_info(t_bank); - /* no timming */ - at91sam7_set_flash_mode(t_bank, FMR_TIMING_NONE); + /* no timming */ + at91sam7_set_flash_mode(t_bank, FMR_TIMING_NONE); - /* check protect state */ - at91sam7_protect_check(t_bank); - - t_bank = fb->next; - fb = t_bank; + /* check protect state */ + at91sam7_protect_check(t_bank); + } + t_bank = t_bank->next; } return ERROR_OK; @@ -402,32 +401,32 @@ static int at91sam7_read_part_info(struct flash_bank *bank) if (at91sam7_info->flash_autodetection == 0) { /* banks and sectors are already created, based on data from input file */ - struct flash_bank *fb = bank; struct flash_bank *t_bank = bank; while (t_bank) { - at91sam7_info = t_bank->driver_priv; - - at91sam7_info->cidr = cidr; - at91sam7_info->cidr_ext = (cidr >> 31)&0x0001; - at91sam7_info->cidr_nvptyp = (cidr >> 28)&0x0007; - at91sam7_info->cidr_arch = (cidr >> 20)&0x00FF; - at91sam7_info->cidr_sramsiz = (cidr >> 16)&0x000F; - at91sam7_info->cidr_nvpsiz2 = (cidr >> 12)&0x000F; - at91sam7_info->cidr_nvpsiz = (cidr >> 8)&0x000F; - at91sam7_info->cidr_eproc = (cidr >> 5)&0x0007; - at91sam7_info->cidr_version = cidr&0x001F; - - /* calculate master clock frequency */ - at91sam7_read_clock_info(t_bank); - - /* no timming */ - at91sam7_set_flash_mode(t_bank, FMR_TIMING_NONE); - - /* check protect state */ - at91sam7_protect_check(t_bank); + if (t_bank->target == target) { + at91sam7_info = t_bank->driver_priv; + + at91sam7_info->cidr = cidr; + at91sam7_info->cidr_ext = (cidr >> 31)&0x0001; + at91sam7_info->cidr_nvptyp = (cidr >> 28)&0x0007; + at91sam7_info->cidr_arch = (cidr >> 20)&0x00FF; + at91sam7_info->cidr_sramsiz = (cidr >> 16)&0x000F; + at91sam7_info->cidr_nvpsiz2 = (cidr >> 12)&0x000F; + at91sam7_info->cidr_nvpsiz = (cidr >> 8)&0x000F; + at91sam7_info->cidr_eproc = (cidr >> 5)&0x0007; + at91sam7_info->cidr_version = cidr&0x001F; + + /* calculate master clock frequency */ + at91sam7_read_clock_info(t_bank); + + /* no timming */ + at91sam7_set_flash_mode(t_bank, FMR_TIMING_NONE); + + /* check protect state */ + at91sam7_protect_check(t_bank); + } - t_bank = fb->next; - fb = t_bank; + t_bank = t_bank->next; } return ERROR_OK; -- ------------------------------------------------------------------------------ Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ OpenOCD-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openocd-devel
