]> git.sur5r.net Git - openocd/blobdiff - src/flash/nor/stellaris.c
flash: Constify write buffer
[openocd] / src / flash / nor / stellaris.c
index 83ca58539c171eccecf6dfa31c0c740d2600ad10..7665ab38a9611479d720091d9b18fa2276dd9544 100644 (file)
@@ -18,7 +18,7 @@
  *   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.             *
+ *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.           *
  ***************************************************************************/
 
 /***************************************************************************
@@ -125,7 +125,7 @@ struct stellaris_flash_bank {
 
 /* Autogenerated by contrib/gen-stellaris-part-header.pl */
 /* From Stellaris Firmware Development Package revision 9453 */
-static struct {
+static const struct {
        uint8_t class;
        uint8_t partno;
        const char *partname;
@@ -417,7 +417,7 @@ static struct {
        {0xFF, 0x00, "Unknown Part"}
 };
 
-static char *StellarisClassname[7] = {
+static const char *StellarisClassname[7] = {
        "Sandstorm",
        "Fury",
        "Unknown",
@@ -997,7 +997,7 @@ static const uint8_t stellaris_write_code[] = {
        0x01, 0x00, 0x42, 0xA4  /* .word        0xA4420001 */
 };
 static int stellaris_write_block(struct flash_bank *bank,
-               uint8_t *buffer, uint32_t offset, uint32_t wcount)
+               const uint8_t *buffer, uint32_t offset, uint32_t wcount)
 {
        struct target *target = bank->target;
        uint32_t buffer_size = 16384;
@@ -1042,10 +1042,10 @@ static int stellaris_write_block(struct flash_bank *bank,
 
        target_write_buffer(target, write_algorithm->address,
                        sizeof(stellaris_write_code),
-                       (uint8_t *) stellaris_write_code);
+                       stellaris_write_code);
 
        armv7m_info.common_magic = ARMV7M_COMMON_MAGIC;
-       armv7m_info.core_mode = ARMV7M_MODE_ANY;
+       armv7m_info.core_mode = ARM_MODE_THREAD;
 
        init_reg_param(&reg_params[0], "r0", 32, PARAM_OUT);
        init_reg_param(&reg_params[1], "r1", 32, PARAM_OUT);
@@ -1078,7 +1078,7 @@ static int stellaris_write_block(struct flash_bank *bank,
        return retval;
 }
 
-static int stellaris_write(struct flash_bank *bank, uint8_t *buffer,
+static int stellaris_write(struct flash_bank *bank, const uint8_t *buffer,
                uint32_t offset, uint32_t count)
 {
        struct stellaris_flash_bank *stellaris_info = bank->driver_priv;