This is an automated email from Gerrit.

Nemui Trinomius ([email protected]) just uploaded a new patch set 
to Gerrit, which you can find at http://openocd.zylin.com/2607

-- gerrit

commit 9cd57fd2b3a5829e47491d8ac657da2f913c571e
Author: Nemui Trinomius <[email protected]>
Date:   Tue Mar 17 00:00:40 2015 +0900

    lpc2000: Removed cmd51_can_xxxxb variables.
    
    Current flash driver can fail to write across the sector boundary.
    This patch fixes "thisrun_bytes" set to "cmd51_dst_boundary" value instead 
of "cmd51_can_xxxxb"
    
    Referred to SevenW's post and fix,thanks.
    
http://sourceforge.net/p/openocd/mailman/openocd-devel/thread/fa32e7d6654df22470dc5f4a3dbc984a%40familiebenschop.nl/#msg33594152
    
    Tested on below listed chips.
    LPC810,LPC811,LPC812,LPC824,LPC1115,LPC1343,LPC1347,LPC1227,
    LPC1769,LPC1788,LPC54102,LPC4088 and LPC2388.
    
    Change-Id: If1c6a1daa58ca27c405bd959a784e599a7a8f4d4
    Signed-off-by: Nemui Trinomius <[email protected]>

diff --git a/src/flash/nor/lpc2000.c b/src/flash/nor/lpc2000.c
index c2a1fc2..1808543 100644
--- a/src/flash/nor/lpc2000.c
+++ b/src/flash/nor/lpc2000.c
@@ -276,9 +276,6 @@ struct lpc2000_flash_bank {
        lpc2000_variant variant;
        uint32_t cclk;
        int cmd51_dst_boundary;
-       int cmd51_can_64b;
-       int cmd51_can_256b;
-       int cmd51_can_8192b;
        int calc_checksum;
        uint32_t cmd51_max_buffer;
        int checksum_vector;
@@ -323,9 +320,6 @@ static int lpc2000_build_sector_list(struct flash_bank 
*bank)
 
        if (lpc2000_info->variant == lpc2000_v1) {
                lpc2000_info->cmd51_dst_boundary = 512;
-               lpc2000_info->cmd51_can_64b = 0;
-               lpc2000_info->cmd51_can_256b = 0;
-               lpc2000_info->cmd51_can_8192b = 1;
                lpc2000_info->checksum_vector = 5;
                lpc2000_info->iap_max_stack = 128;
 
@@ -371,9 +365,6 @@ static int lpc2000_build_sector_list(struct flash_bank 
*bank)
                }
        } else if (lpc2000_info->variant == lpc2000_v2) {
                lpc2000_info->cmd51_dst_boundary = 256;
-               lpc2000_info->cmd51_can_64b = 0;
-               lpc2000_info->cmd51_can_256b = 1;
-               lpc2000_info->cmd51_can_8192b = 0;
                lpc2000_info->checksum_vector = 5;
                lpc2000_info->iap_max_stack = 128;
 
@@ -440,9 +431,6 @@ static int lpc2000_build_sector_list(struct flash_bank 
*bank)
                }
        } else if (lpc2000_info->variant == lpc1700) {
                lpc2000_info->cmd51_dst_boundary = 256;
-               lpc2000_info->cmd51_can_64b = 0;
-               lpc2000_info->cmd51_can_256b = 1;
-               lpc2000_info->cmd51_can_8192b = 0;
                lpc2000_info->checksum_vector = 7;
                lpc2000_info->iap_max_stack = 128;
 
@@ -492,9 +480,6 @@ static int lpc2000_build_sector_list(struct flash_bank 
*bank)
                }
        } else if (lpc2000_info->variant == lpc4300) {
                lpc2000_info->cmd51_dst_boundary = 512;
-               lpc2000_info->cmd51_can_64b = 0;
-               lpc2000_info->cmd51_can_256b = 0;
-               lpc2000_info->cmd51_can_8192b = 0;
                lpc2000_info->checksum_vector = 7;
                lpc2000_info->iap_max_stack = 208;
 
@@ -526,9 +511,6 @@ static int lpc2000_build_sector_list(struct flash_bank 
*bank)
 
        } else if (lpc2000_info->variant == lpc800) {
                lpc2000_info->cmd51_dst_boundary = 64;
-               lpc2000_info->cmd51_can_64b = 1;
-               lpc2000_info->cmd51_can_256b = 0;
-               lpc2000_info->cmd51_can_8192b = 0;
                lpc2000_info->checksum_vector = 7;
                lpc2000_info->iap_max_stack = 208;              /* 148byte for 
LPC81x,208byte for LPC82x. */
                lpc2000_info->cmd51_max_buffer = 256;   /* smallest MCU in the 
series, LPC810, has 1 kB of SRAM */
@@ -565,9 +547,6 @@ static int lpc2000_build_sector_list(struct flash_bank 
*bank)
 
        } else if (lpc2000_info->variant == lpc1100) {
                lpc2000_info->cmd51_dst_boundary = 256;
-               lpc2000_info->cmd51_can_64b = 0;
-               lpc2000_info->cmd51_can_256b = 1;
-               lpc2000_info->cmd51_can_8192b = 0;
                lpc2000_info->checksum_vector = 7;
                lpc2000_info->iap_max_stack = 128;
 
@@ -591,9 +570,6 @@ static int lpc2000_build_sector_list(struct flash_bank 
*bank)
 
        } else if (lpc2000_info->variant == lpc1500) {
                lpc2000_info->cmd51_dst_boundary = 256;
-               lpc2000_info->cmd51_can_64b = 0;
-               lpc2000_info->cmd51_can_256b = 1;
-               lpc2000_info->cmd51_can_8192b = 0;
                lpc2000_info->checksum_vector = 7;
                lpc2000_info->iap_max_stack = 128;
 
@@ -625,9 +601,6 @@ static int lpc2000_build_sector_list(struct flash_bank 
*bank)
 
        } else if (lpc2000_info->variant == lpc54100) {
                lpc2000_info->cmd51_dst_boundary = 256;
-               lpc2000_info->cmd51_can_64b = 0;
-               lpc2000_info->cmd51_can_256b = 1;
-               lpc2000_info->cmd51_can_8192b = 0;
                lpc2000_info->checksum_vector = 7;
                lpc2000_info->iap_max_stack = 128;
 
@@ -1127,14 +1100,8 @@ static int lpc2000_write(struct flash_bank *bank, const 
uint8_t *buffer, uint32_
                uint32_t thisrun_bytes;
                if (bytes_remaining >= lpc2000_info->cmd51_max_buffer)
                        thisrun_bytes = lpc2000_info->cmd51_max_buffer;
-               else if (bytes_remaining >= 1024)
-                       thisrun_bytes = 1024;
-               else if ((bytes_remaining >= 512) || 
(!lpc2000_info->cmd51_can_256b))
-                       thisrun_bytes = 512;
-               else if ((bytes_remaining >= 256) || 
(!lpc2000_info->cmd51_can_64b))
-                       thisrun_bytes = 256;
                else
-                       thisrun_bytes = 64;
+                       thisrun_bytes = lpc2000_info->cmd51_dst_boundary;
 
                /* Prepare sectors */
                param_table[0] = first_sector;

-- 

------------------------------------------------------------------------------
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

Reply via email to