This is an automated email from Gerrit.

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

-- gerrit

commit bde4550828e4a34d975a0bfd096add2a6c7944e7
Author: Helen Fornazier <[email protected]>
Date:   Wed Apr 11 11:01:57 2012 +0200

    smartfusion_a2f200: startup - writing in flash memory
    
    Basic support for SmartFusion A2f200 from Actel.
    Writting in its flash memory is now possible
    
    Change-Id: Iab1b00242bb9eeb6011ebfc3fa5979a716f76489
    Signed-off-by: Helen Fornazier <[email protected]>

diff --git a/src/flash/nor/Makefile.am b/src/flash/nor/Makefile.am
index 0b219a9..cdef858 100644
--- a/src/flash/nor/Makefile.am
+++ b/src/flash/nor/Makefile.am
@@ -33,7 +33,8 @@ NOR_DRIVERS = \
        virtual.c \
        fm3.c \
        dsp5680xx_flash.c \
-       kinetis.c
+       kinetis.c \
+       smartfusion_a2f200.c
 
 noinst_HEADERS = \
        core.h \
diff --git a/src/flash/nor/drivers.c b/src/flash/nor/drivers.c
index 746b55b..035a53f 100644
--- a/src/flash/nor/drivers.c
+++ b/src/flash/nor/drivers.c
@@ -47,6 +47,7 @@ extern struct flash_driver em357_flash;
 extern struct flash_driver dsp5680xx_flash;
 extern struct flash_driver fm3_flash;
 extern struct flash_driver kinetis_flash;
+extern struct flash_driver smartfusion_a2f200_flash;
 
 /**
  * The list of built-in flash drivers.
@@ -78,6 +79,7 @@ static struct flash_driver *flash_drivers[] = {
        &fm3_flash,
        &dsp5680xx_flash,
        &kinetis_flash,
+       &smartfusion_a2f200_flash,
        NULL,
 };
 
diff --git a/src/flash/nor/smartfusion_a2f200.c 
b/src/flash/nor/smartfusion_a2f200.c
new file mode 100644
index 0000000..75aca86
--- /dev/null
+++ b/src/flash/nor/smartfusion_a2f200.c
@@ -0,0 +1,276 @@
+/***************************************************************************
+ *   Copyright (C) 2012 by Thalita Drumond                                 *
+ *   [email protected]                                             *
+ *                                                                         *
+ *   Copyright (C) 2012 by Helen Fornazier                                 *
+ *   [email protected]                                             *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "imp.h"
+#include "helper/binarybuffer.h"
+#include <target/algorithm.h>
+#include <target/armv7m.h>
+
+static /* unsigned const char smartfusion_a2f200_flash_write_code[] = ... */
+#include "smartfusion_a2f200_write_code.h"
+
+struct smartfusion_a2f200_flash_bank {
+       uint32_t nvm_start;
+       struct working_area *write_algorithm;
+};
+
+FLASH_BANK_COMMAND_HANDLER(smartfusion_a2f200_flash_bank_command)
+{
+       if (CMD_ARGC < 6)
+               return ERROR_COMMAND_SYNTAX_ERROR;
+
+       LOG_INFO("add flash_bank smartfusion_a2f200 %s", bank->name);
+
+       bank->driver_priv =
+         calloc(sizeof(struct smartfusion_a2f200_flash_bank), 1);
+
+       return ERROR_OK;
+}
+
+static int smartfusion_a2f200_protect(struct flash_bank *bank, int set,
+       int first, int last)
+{
+       LOG_WARNING("smartfusion_a2f200_protect not supported yet");
+
+       return ERROR_OK;
+}
+
+static int smartfusion_a2f200_protect_check(struct flash_bank *bank)
+{
+       if (bank->target->state != TARGET_HALTED) {
+               LOG_ERROR("Target not halted");
+               return ERROR_TARGET_NOT_HALTED;
+       }
+
+       LOG_WARNING("smartfusion_a2f200_protect_check not supported yet");
+
+       return ERROR_OK;
+}
+
+static int smartfusion_a2f200_erase(struct flash_bank *bank, int first, int 
last)
+{
+       if (bank->target->state != TARGET_HALTED) {
+               LOG_ERROR("Target not halted");
+               return ERROR_TARGET_NOT_HALTED;
+       }
+
+       LOG_WARNING("smartfusion_a2f200_erase not supported yet");
+
+       return ERROR_OK;
+}
+
+static int smartfusion_a2f200_write(struct flash_bank *bank, uint8_t *buffer,
+       uint32_t offset, uint32_t count)
+{
+       struct smartfusion_a2f200_flash_bank *smartfusion_a2f200_info =
+                                                       bank->driver_priv;
+       struct target *target = bank->target;
+       uint32_t buffer_size = 16384; //FIXME Why this value? change?
+       struct working_area *source;
+       uint32_t address = bank->base + offset;
+       struct reg_param reg_params[5];
+       struct armv7m_algorithm armv7m_info;
+       int retval = ERROR_OK;
+
+       if (bank->target->state != TARGET_HALTED) {
+               LOG_ERROR("Target not halted");
+               return ERROR_TARGET_NOT_HALTED;
+       }
+
+       if (target_alloc_working_area(target,
+                       sizeof(smartfusion_a2f200_flash_write_code),
+                       &smartfusion_a2f200_info->write_algorithm) != ERROR_OK) 
{
+               LOG_WARNING("no working area available, can't do block memory 
writes");
+               return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
+       };
+
+       retval = target_write_buffer(target,
+                       smartfusion_a2f200_info->write_algorithm->address,
+                       sizeof(smartfusion_a2f200_flash_write_code),
+                       (uint8_t *)smartfusion_a2f200_flash_write_code);
+       if (retval != ERROR_OK)
+               return retval;
+
+       /* memory buffer */
+       while (target_alloc_working_area_try(target, buffer_size, &source)
+                                                               != ERROR_OK) {
+               buffer_size /= 2;
+
+               if (buffer_size <= 256) {
+
+                       /* if we already allocated the writing code,
+                        * but failed to get a buffer, free the algorithm */
+                       if (smartfusion_a2f200_info->write_algorithm)
+                               target_free_working_area(target,
+                               smartfusion_a2f200_info->write_algorithm);
+
+                       LOG_WARNING("no large enough working area available, 
can't do memory writes");
+
+                       return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
+               }
+       };
+
+       init_reg_param(&reg_params[0], "r0", 32, PARAM_IN_OUT); /* flash adress 
(in), status (out) */
+       init_reg_param(&reg_params[1], "r1", 32, PARAM_OUT);    /* buffer start 
*/
+       init_reg_param(&reg_params[2], "r2", 32, PARAM_OUT);    /* buffer size 
*/
+
+       armv7m_info.common_magic = ARMV7M_COMMON_MAGIC;
+       armv7m_info.core_mode = ARMV7M_MODE_ANY;
+
+       while (count > 0) {
+
+               /* write a part of the image in RAM
+                * (count has total size of the image) */
+               const uint32_t thisrun_count = (count > buffer_size) ? 
buffer_size : count;
+
+               /* writes thisrun_count bytes from buffer
+                * at source->address(in RAM) */
+               retval = target_write_buffer(target, source->address,
+                                                       thisrun_count, buffer);
+               if (retval != ERROR_OK)
+                       goto cleanup;
+
+               /* set reg params */
+               buf_set_u32(reg_params[0].value, 0, 32, address);
+               buf_set_u32(reg_params[1].value, 0, 32, source->address);
+               buf_set_u32(reg_params[2].value, 0, 32, source->size);
+
+               LOG_DEBUG("Write 0x%04" PRIx32 " bytes to flash at 0x%08" 
PRIx32,
+                       thisrun_count, address);
+
+               /* Execute algorithm, assume breakpoint for last instruction */
+               retval = target_run_algorithm(target, 0, NULL,
+                               3, reg_params,
+                               
smartfusion_a2f200_info->write_algorithm->address,
+                               0,
+                               10000,  /* FIXME 10s should be enough ? */
+                               &armv7m_info);
+
+               /* Failed to run algorithm */
+               if (retval != ERROR_OK) {
+                       LOG_ERROR("Execution of flash algorythm failed. Can't 
fall back. Please report.");
+                       retval = ERROR_FLASH_OPERATION_FAILED;
+                       goto cleanup;
+               }
+
+               /* Check return value from algo code */
+               const uint32_t retval_target = buf_get_u32(reg_params[0].value, 
0, 32);
+               switch (retval_target) {
+               case 0:
+                       retval = ERROR_OK;
+                       break;
+               case 1:
+                       LOG_ERROR("eNVM Protection error.");
+                       retval = ERROR_FLASH_OPERATION_FAILED;
+                       goto cleanup;
+               case 2:
+                       LOG_ERROR("eNVM write error.");
+                       retval = ERROR_FLASH_OPERATION_FAILED;
+                       goto cleanup;
+               case 3:
+                       LOG_ERROR("eNVM invalid address error.");
+                       retval = ERROR_FLASH_OPERATION_FAILED;
+                       goto cleanup;
+               default:
+                       LOG_ERROR("eNVM unknown error.");
+                       retval = ERROR_FLASH_OPERATION_FAILED;
+                       goto cleanup;
+               }
+
+               buffer += thisrun_count;
+               address += thisrun_count;
+               count -= thisrun_count;
+
+               keep_alive();
+       }
+
+       /* free up resources */
+cleanup:
+       if (source)
+               target_free_working_area(target, source);
+
+       if (smartfusion_a2f200_info->write_algorithm) {
+               target_free_working_area(target,
+                               smartfusion_a2f200_info->write_algorithm);
+               smartfusion_a2f200_info->write_algorithm = NULL;
+       }
+
+       destroy_reg_param(&reg_params[0]);
+       destroy_reg_param(&reg_params[1]);
+       destroy_reg_param(&reg_params[2]);
+
+       return retval;
+}
+
+static int smartfusion_a2f200_probe(struct flash_bank *bank)
+{
+       if (bank->target->state != TARGET_HALTED) {
+               LOG_ERROR("Target not halted");
+               return ERROR_TARGET_NOT_HALTED;
+       }
+
+       /* FIXME Complete this function */
+       LOG_WARNING("smartfusion_a2f200_probe not supported yet");
+
+       bank->base = 0x60000000;
+       bank->size = 256000;
+       bank->num_sectors = 1;
+       bank->sectors = malloc(sizeof(struct flash_sector) * 1);
+
+       bank->sectors[0].offset = 0;
+       bank->sectors[0].size = bank->size;
+       bank->sectors[0].is_erased = -1;
+       bank->sectors[0].is_protected = 1;
+
+       return ERROR_OK;
+}
+
+static int smartfusion_a2f200_auto_probe(struct flash_bank *bank)
+{
+       return smartfusion_a2f200_probe(bank);
+}
+
+static int smartfusion_a2f200_info(struct flash_bank *bank, char *buf, int 
buf_size)
+{
+       LOG_WARNING("smartfusion_a2f200_info not supported yet");
+
+       return ERROR_OK;
+}
+
+const struct flash_driver smartfusion_a2f200_flash = {
+       .name = "smartfusion_a2f200",
+       .flash_bank_command = smartfusion_a2f200_flash_bank_command,
+       .erase = smartfusion_a2f200_erase,
+       .protect = smartfusion_a2f200_protect,
+       .write = smartfusion_a2f200_write,
+       .read = default_flash_read,
+       .probe = smartfusion_a2f200_probe,
+       .auto_probe = smartfusion_a2f200_auto_probe,
+       .erase_check = default_flash_mem_blank_check,
+       .protect_check = smartfusion_a2f200_protect_check,
+       .info = smartfusion_a2f200_info,
+};
diff --git a/src/flash/nor/smartfusion_a2f200_write_code.h 
b/src/flash/nor/smartfusion_a2f200_write_code.h
new file mode 100644
index 0000000..0f28160
--- /dev/null
+++ b/src/flash/nor/smartfusion_a2f200_write_code.h
@@ -0,0 +1,103 @@
+/* autogenerated from ./bin2char */
+/* See contrib/loaders/flash/smartfusion_a2f200 */
+unsigned const char smartfusion_a2f200_flash_write_code[] = {
+0xdf,0xf8,0x20,0xd0,0x07,0xb4,0x08,0x4b,0x08,0x4c,0x09,0x4d,0xac,0x42,0x18,0xbf,
+0x44,0xf8,0x04,0x3b,0x7f,0xf4,0xfa,0xaf,0x07,0xbc,0x00,0xf0,0x0b,0xf8,0x00,0xbe,
+0xff,0xf7,0xfe,0xbf,0x00,0x00,0x01,0x20,0x00,0x00,0x00,0x00,0x38,0x06,0x00,0x20,
+0x40,0x06,0x00,0x20,0x80,0xb5,0x84,0xb0,0x00,0xaf,0xf8,0x60,0xb9,0x60,0x7a,0x60,
+0x4f,0xf0,0x01,0x00,0x00,0xf0,0x92,0xf9,0xf8,0x68,0xb9,0x68,0x7a,0x68,0x00,0xf0,
+0x9d,0xf9,0x03,0x46,0x18,0x46,0x07,0xf1,0x10,0x07,0xbd,0x46,0x80,0xbd,0x00,0xbf,
+0x80,0xb4,0x85,0xb0,0x00,0xaf,0x78,0x60,0x39,0x60,0x4f,0xf0,0xff,0x33,0xfb,0x60,
+0x7a,0x68,0x48,0xf2,0xff,0x13,0xc6,0xf2,0x08,0x03,0x9a,0x42,0x00,0xf2,0x6f,0x81,
+0x7a,0x68,0x6f,0xf0,0x20,0x43,0x9a,0x42,0x40,0xf2,0x69,0x81,0x7a,0x68,0x4f,0xf6,
+0xff,0x73,0xc6,0xf2,0x07,0x03,0x9a,0x42,0x40,0xf2,0x0d,0x81,0x7a,0x68,0x43,0xf6,
+0xff,0x73,0xc6,0xf2,0x08,0x03,0x9a,0x42,0x54,0xd8,0x7a,0x68,0x41,0xf6,0xff,0x73,
+0xc6,0xf2,0x08,0x03,0x9a,0x42,0x2e,0xd8,0x4f,0xf0,0x00,0x03,0xfb,0x60,0x40,0xf2,
+0x30,0x63,0xc2,0xf2,0x00,0x03,0x1b,0x78,0x00,0x2b,0x06,0xd1,0x3a,0x68,0x40,0xf6,
+0xff,0x73,0xc6,0xf2,0x08,0x03,0x13,0x60,0x2d,0xe0,0x40,0xf2,0x30,0x63,0xc2,0xf2,
+0x00,0x03,0x1b,0x78,0x02,0x2b,0x0f,0xd1,0x40,0xf2,0x38,0x63,0xc2,0xf2,0x00,0x03,
+0x4f,0xf4,0x00,0x52,0xc6,0xf2,0x08,0x02,0x1a,0x60,0x3a,0x68,0x43,0xf6,0xff,0x73,
+0xc6,0xf2,0x08,0x03,0x13,0x60,0x16,0xe0,0x3a,0x68,0x41,0xf6,0xff,0x73,0xc6,0xf2,
+0x08,0x03,0x13,0x60,0x0f,0xe0,0x40,0xf2,0x30,0x63,0xc2,0xf2,0x00,0x03,0x1b,0x78,
+0x02,0x2b,0x02,0xd1,0x4f,0xf0,0x01,0x03,0xfb,0x60,0x3a,0x68,0x43,0xf6,0xff,0x73,
+0xc6,0xf2,0x08,0x03,0x13,0x60,0x40,0xf2,0x31,0x63,0xc2,0xf2,0x00,0x03,0x4f,0xf0,
+0x80,0x02,0x1a,0x70,0x40,0xf2,0x34,0x63,0xc2,0xf2,0x00,0x03,0x6f,0xf0,0x7f,0x02,
+0x1a,0x60,0x04,0xe1,0x7a,0x68,0x47,0xf6,0xff,0x73,0xc6,0xf2,0x08,0x03,0x9a,0x42,
+0x54,0xd8,0x7a,0x68,0x45,0xf6,0xff,0x73,0xc6,0xf2,0x08,0x03,0x9a,0x42,0x2e,0xd8,
+0x4f,0xf0,0x00,0x03,0xfb,0x60,0x40,0xf2,0x30,0x63,0xc2,0xf2,0x00,0x03,0x1b,0x78,
+0x00,0x2b,0x06,0xd1,0x3a,0x68,0x44,0xf6,0xff,0x73,0xc6,0xf2,0x08,0x03,0x13,0x60,
+0x2d,0xe0,0x40,0xf2,0x30,0x63,0xc2,0xf2,0x00,0x03,0x1b,0x78,0x02,0x2b,0x0f,0xd1,
+0x40,0xf2,0x38,0x63,0xc2,0xf2,0x00,0x03,0x4f,0xf4,0xc0,0x42,0xc6,0xf2,0x08,0x02,
+0x1a,0x60,0x3a,0x68,0x47,0xf6,0xff,0x73,0xc6,0xf2,0x08,0x03,0x13,0x60,0x16,0xe0,
+0x3a,0x68,0x45,0xf6,0xff,0x73,0xc6,0xf2,0x08,0x03,0x13,0x60,0x0f,0xe0,0x40,0xf2,
+0x30,0x63,0xc2,0xf2,0x00,0x03,0x1b,0x78,0x02,0x2b,0x02,0xd1,0x4f,0xf0,0x01,0x03,
+0xfb,0x60,0x3a,0x68,0x47,0xf6,0xff,0x73,0xc6,0xf2,0x08,0x03,0x13,0x60,0x40,0xf2,
+0x31,0x63,0xc2,0xf2,0x00,0x03,0x4f,0xf0,0x04,0x02,0x1a,0x70,0x40,0xf2,0x34,0x63,
+0xc2,0xf2,0x00,0x03,0x6f,0xf0,0x03,0x02,0x1a,0x60,0xa8,0xe0,0x7a,0x68,0x48,0xf2,
+0xff,0x03,0xc6,0xf2,0x08,0x03,0x9a,0x42,0x2e,0xd8,0x4f,0xf0,0x00,0x03,0xfb,0x60,
+0x40,0xf2,0x30,0x63,0xc2,0xf2,0x00,0x03,0x1b,0x78,0x00,0x2b,0x06,0xd1,0x3a,0x68,
+0x48,0xf2,0x7f,0x03,0xc6,0xf2,0x08,0x03,0x13,0x60,0x2d,0xe0,0x40,0xf2,0x30,0x63,
+0xc2,0xf2,0x00,0x03,0x1b,0x78,0x02,0x2b,0x0f,0xd1,0x40,0xf2,0x38,0x63,0xc2,0xf2,
+0x00,0x03,0x4f,0xf4,0x01,0x42,0xc6,0xf2,0x08,0x02,0x1a,0x60,0x3a,0x68,0x48,0xf2,
+0xff,0x13,0xc6,0xf2,0x08,0x03,0x13,0x60,0x16,0xe0,0x3a,0x68,0x48,0xf2,0xff,0x03,
+0xc6,0xf2,0x08,0x03,0x13,0x60,0x0f,0xe0,0x40,0xf2,0x30,0x63,0xc2,0xf2,0x00,0x03,
+0x1b,0x78,0x02,0x2b,0x02,0xd1,0x4f,0xf0,0x01,0x03,0xfb,0x60,0x3a,0x68,0x48,0xf2,
+0xff,0x13,0xc6,0xf2,0x08,0x03,0x13,0x60,0x40,0xf2,0x31,0x63,0xc2,0xf2,0x00,0x03,
+0x4f,0xf0,0x04,0x02,0x1a,0x70,0x40,0xf2,0x34,0x63,0xc2,0xf2,0x00,0x03,0x6f,0xf0,
+0x03,0x02,0x1a,0x60,0x53,0xe0,0x7a,0x68,0x4f,0xf6,0xff,0x73,0xc6,0xf2,0x03,0x03,
+0x9a,0x42,0x2e,0xd8,0x4f,0xf0,0x00,0x03,0xfb,0x60,0x40,0xf2,0x30,0x63,0xc2,0xf2,
+0x00,0x03,0x1b,0x78,0x00,0x2b,0x06,0xd1,0x3a,0x68,0x4f,0xf6,0xff,0x73,0xc6,0xf2,
+0x01,0x03,0x13,0x60,0x2d,0xe0,0x40,0xf2,0x30,0x63,0xc2,0xf2,0x00,0x03,0x1b,0x78,
+0x02,0x2b,0x0f,0xd1,0x40,0xf2,0x38,0x63,0xc2,0xf2,0x00,0x03,0x4f,0xf0,0x00,0x02,
+0xc6,0xf2,0x04,0x02,0x1a,0x60,0x3a,0x68,0x4f,0xf6,0xff,0x73,0xc6,0xf2,0x07,0x03,
+0x13,0x60,0x16,0xe0,0x3a,0x68,0x4f,0xf6,0xff,0x73,0xc6,0xf2,0x03,0x03,0x13,0x60,
+0x0f,0xe0,0x40,0xf2,0x30,0x63,0xc2,0xf2,0x00,0x03,0x1b,0x78,0x02,0x2b,0x02,0xd1,
+0x4f,0xf0,0x01,0x03,0xfb,0x60,0x3a,0x68,0x4f,0xf6,0xff,0x73,0xc6,0xf2,0x07,0x03,
+0x13,0x60,0x40,0xf2,0x31,0x63,0xc2,0xf2,0x00,0x03,0x4f,0xf0,0x80,0x02,0x1a,0x70,
+0x40,0xf2,0x34,0x63,0xc2,0xf2,0x00,0x03,0x6f,0xf0,0x7f,0x02,0x1a,0x60,0xfb,0x68,
+0x18,0x46,0x07,0xf1,0x14,0x07,0xbd,0x46,0x80,0xbc,0x70,0x47,0x80,0xb4,0x83,0xb0,
+0x00,0xaf,0x03,0x46,0xfb,0x71,0x40,0xf2,0x30,0x63,0xc2,0xf2,0x00,0x03,0xfa,0x79,
+0x1a,0x70,0x07,0xf1,0x0c,0x07,0xbd,0x46,0x80,0xbc,0x70,0x47,0x80,0xb5,0x96,0xb0,
+0x00,0xaf,0xf8,0x60,0xb9,0x60,0x7a,0x60,0x40,0xf2,0x18,0x63,0xc2,0xf2,0x00,0x03,
+0x07,0xf1,0x24,0x02,0x93,0xe8,0x03,0x00,0x82,0xe8,0x03,0x00,0x40,0xf2,0x20,0x63,
+0xc2,0xf2,0x00,0x03,0x07,0xf1,0x1c,0x02,0x93,0xe8,0x03,0x00,0x82,0xe8,0x03,0x00,
+0x40,0xf2,0x28,0x63,0xc2,0xf2,0x00,0x03,0x07,0xf1,0x14,0x02,0x93,0xe8,0x03,0x00,
+0x82,0xe8,0x03,0x00,0x4f,0xf0,0x00,0x03,0x87,0xf8,0x4f,0x30,0xfb,0x68,0xbb,0x64,
+0x07,0xf1,0x10,0x03,0xf8,0x68,0x19,0x46,0xff,0xf7,0x3a,0xfe,0x03,0x46,0x3b,0x65,
+0x3b,0x6d,0x00,0x2b,0x00,0xda,0x00,0xbe,0x7a,0x68,0x48,0xf2,0xff,0x13,0xc0,0xf2,
+0x08,0x03,0x9a,0x42,0x00,0xd9,0x00,0xbe,0x3a,0x69,0xfb,0x68,0xd3,0x1a,0x03,0xf1,
+0x01,0x02,0x7b,0x68,0x9a,0x42,0x00,0xd2,0x00,0xbe,0x3b,0x6d,0x00,0x2b,0x0e,0xdb,
+0x7a,0x68,0x48,0xf2,0xff,0x13,0xc0,0xf2,0x08,0x03,0x9a,0x42,0x07,0xd8,0x3a,0x69,
+0xfb,0x68,0xd3,0x1a,0x03,0xf1,0x01,0x02,0x7b,0x68,0x9a,0x42,0x04,0xd2,0x4f,0xf0,
+0x03,0x03,0x87,0xf8,0x4f,0x30,0xe0,0xe0,0x4f,0xf4,0x00,0x53,0xce,0xf2,0x04,0x03,
+0x5b,0x68,0xfb,0x63,0x4f,0xf4,0x00,0x53,0xce,0xf2,0x04,0x03,0xfa,0x6b,0x42,0xf0,
+0xc0,0x02,0x5a,0x60,0x7b,0x68,0x7b,0x64,0xba,0xe0,0xba,0x6c,0x40,0xf2,0x34,0x63,
+0xc2,0xf2,0x00,0x03,0x1b,0x68,0x13,0x40,0xbb,0x63,0x40,0xf2,0x38,0x63,0xc2,0xf2,
+0x00,0x03,0x1b,0x68,0xba,0x6b,0x9a,0x42,0x05,0xd1,0x3b,0x6d,0x00,0x2b,0x02,0xd1,
+0x4f,0xf0,0x01,0x03,0x3b,0x65,0x4f,0xf0,0x00,0x03,0xc6,0xf2,0x10,0x03,0x4f,0xf0,
+0xff,0x32,0x1a,0x60,0xbb,0x6b,0x23,0xf0,0x7f,0x43,0x23,0xf4,0x70,0x03,0x43,0xf0,
+0x00,0x73,0x7b,0x63,0x4f,0xf0,0x00,0x03,0xc6,0xf2,0x10,0x03,0x7a,0x6b,0x5a,0x60,
+0x4f,0xf0,0x00,0x03,0xc6,0xf2,0x10,0x03,0x1b,0x68,0x1a,0x46,0x3b,0x6d,0x4f,0xea,
+0x83,0x03,0x07,0xf1,0x58,0x01,0xcb,0x18,0x53,0xf8,0x34,0x3c,0x13,0x40,0x3b,0x63,
+0x3b,0x6b,0x00,0x2b,0xec,0xd1,0x4f,0xf0,0x00,0x03,0xc6,0xf2,0x10,0x03,0x1b,0x68,
+0x1a,0x46,0x3b,0x6d,0x4f,0xea,0x83,0x03,0x07,0xf1,0x58,0x01,0xcb,0x18,0x53,0xf8,
+0x3c,0x3c,0x13,0x40,0xfb,0x62,0xfb,0x6a,0x00,0x2b,0x04,0xd0,0x4f,0xf0,0x01,0x03,
+0x87,0xf8,0x4f,0x30,0x64,0xe0,0x40,0xf2,0x31,0x63,0xc2,0xf2,0x00,0x03,0x1b,0x78,
+0x1a,0x46,0xbb,0x6b,0xd2,0x18,0xbb,0x6c,0xd3,0x1a,0x3b,0x64,0x7a,0x6c,0x3b,0x6c,
+0x9a,0x42,0x01,0xd2,0x7b,0x6c,0x3b,0x64,0x4f,0xf0,0x00,0x03,0x7b,0x65,0x0f,0xe0,
+0xbb,0x68,0x1a,0x78,0xbb,0x6c,0x1a,0x70,0xbb,0x6c,0x03,0xf1,0x01,0x03,0xbb,0x64,
+0xbb,0x68,0x03,0xf1,0x01,0x03,0xbb,0x60,0x7b,0x6d,0x03,0xf1,0x01,0x03,0x7b,0x65,
+0x7a,0x6d,0x3b,0x6c,0x9a,0x42,0xeb,0xd3,0x7a,0x6c,0x3b,0x6c,0xd3,0x1a,0x7b,0x64,
+0xbb,0x6b,0x23,0xf0,0x7f,0x43,0x23,0xf4,0x70,0x03,0x43,0xf0,0x80,0x53,0x7b,0x63,
+0x4f,0xf0,0x00,0x03,0xc6,0xf2,0x10,0x03,0x7a,0x6b,0x5a,0x60,0x4f,0xf0,0x00,0x03,
+0xc6,0xf2,0x10,0x03,0x1b,0x68,0x1a,0x46,0x3b,0x6d,0x4f,0xea,0x83,0x03,0x07,0xf1,
+0x58,0x01,0xcb,0x18,0x53,0xf8,0x34,0x3c,0x13,0x40,0x3b,0x63,0x3b,0x6b,0x00,0x2b,
+0xec,0xd1,0x4f,0xf0,0x00,0x03,0xc6,0xf2,0x10,0x03,0x1b,0x68,0x1a,0x46,0x3b,0x6d,
+0x4f,0xea,0x83,0x03,0x07,0xf1,0x58,0x01,0xcb,0x18,0x53,0xf8,0x44,0x3c,0x13,0x40,
+0xfb,0x62,0xfb,0x6a,0x00,0x2b,0x03,0xd0,0x4f,0xf0,0x02,0x03,0x87,0xf8,0x4f,0x30,
+0x7b,0x6c,0x00,0x2b,0x04,0xd0,0x97,0xf8,0x4f,0x30,0x00,0x2b,0x3f,0xf4,0x3d,0xaf,
+0x4f,0xf0,0x00,0x03,0xc6,0xf2,0x10,0x03,0x4f,0xf0,0x80,0x62,0x5a,0x60,0x4f,0xf4,
+0x00,0x53,0xce,0xf2,0x04,0x03,0xfa,0x6b,0x5a,0x60,0x97,0xf8,0x4f,0x30,0x18,0x46,
+0x07,0xf1,0x58,0x07,0xbd,0x46,0x80,0xbd,0x01,0x00,0x00,0x00,0x00,0x00,0x01,0x00,
+0x02,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x74,0x80,0x00,0x00,0x00,0x00,0x74,0x80,
+0x01,0x80,0x00,0x00,0x80,0xff,0xff,0xff,0 /* terminate with a null */};
diff --git a/tcl/target/smartfusion_a2f200.cfg 
b/tcl/target/smartfusion_a2f200.cfg
new file mode 100644
index 0000000..457ce77
--- /dev/null
+++ b/tcl/target/smartfusion_a2f200.cfg
@@ -0,0 +1,41 @@
+# SmartFusion AF200 target configuration file
+
+if {[info exists CHIPNAME]} {
+   set  _CHIPNAME $CHIPNAME
+} else {
+   set  _CHIPNAME smartfusion_a2f200
+}
+
+if { [info exists ENDIAN] } {
+   set  _ENDIAN $ENDIAN
+} else {
+   set  _ENDIAN little
+}
+
+# Work-area is a space in RAM used for flash programming
+# By default use 24kB
+if { [info exists WORKAREASIZE] } {
+    set  _WORKAREASIZE $WORKAREASIZE
+} else {
+    set  _WORKAREASIZE 0x6000
+}
+
+# JTAG speed
+# FIXME: Why this value?
+adapter_khz 4000
+
+# Setup the JTAG scan chain.
+if { [info exists CPUTAPID ] } {
+   set _CPUTAPID $CPUTAPID
+} else {
+   set _CPUTAPID 0X3BA00477
+}
+jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id 
$_CPUTAPID
+
+set _TARGETNAME $_CHIPNAME.cpu
+target create $_TARGETNAME cortex_m3 -endian $_ENDIAN -chain-position 
$_TARGETNAME
+$_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size 
$_WORKAREASIZE -work-area-backup 0
+
+# flash size will be probed
+set _FLASHNAME $_CHIPNAME.flash
+flash bank $_FLASHNAME smartfusion_a2f200 0x60000000 0 0 0 $_TARGETNAME

-- 

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to