flash: declare fixed arrays const
[openocd.git] / src / flash / nor / stellaris.c
index b167fb78c5f35f18e71b14308346c61dda6444d5..8886c195a8a9f1383180f425ecba8213576022ff 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.           *
  ***************************************************************************/
 
 /***************************************************************************
@@ -124,8 +124,8 @@ struct stellaris_flash_bank {
 };
 
 /* Autogenerated by contrib/gen-stellaris-part-header.pl */
-/* From Stellaris Firmware Development Package revision 8049 */
-static struct {
+/* From Stellaris Firmware Development Package revision 9453 */
+static const struct {
        uint8_t class;
        uint8_t partno;
        const char *partname;
@@ -189,7 +189,6 @@ static struct {
        {0x04, 0xC9, "LM3S1R26"},
        {0x04, 0x30, "LM3S1W16"},
        {0x04, 0x2F, "LM3S1Z16"},
-       {0x01, 0xD4, "LM3S2016"},
        {0x01, 0x51, "LM3S2110"},
        {0x01, 0x84, "LM3S2139"},
        {0x03, 0x39, "LM3S2276"},
@@ -301,9 +300,7 @@ static struct {
        {0x01, 0x8B, "LM3S6637"},
        {0x01, 0xA3, "LM3S6730"},
        {0x01, 0x77, "LM3S6753"},
-       {0x01, 0xD1, "LM3S6816"},
        {0x01, 0xE9, "LM3S6911"},
-       {0x01, 0xD3, "LM3S6916"},
        {0x01, 0xE8, "LM3S6918"},
        {0x01, 0x89, "LM3S6938"},
        {0x01, 0x72, "LM3S6950"},
@@ -350,11 +347,9 @@ static struct {
        {0x04, 0x1E, "LM3S9BN5"},
        {0x04, 0x1F, "LM3S9BN6"},
        {0x06, 0x70, "LM3S9C97"},
-       {0x06, 0x7A, "LM3S9CN5"},
        {0x06, 0xA9, "LM3S9D81"},
        {0x06, 0x7E, "LM3S9D90"},
        {0x06, 0x92, "LM3S9D92"},
-       {0x06, 0xC8, "LM3S9D95"},
        {0x06, 0x9D, "LM3S9D96"},
        {0x06, 0x7B, "LM3S9DN5"},
        {0x06, 0x7C, "LM3S9DN6"},
@@ -365,7 +360,6 @@ static struct {
        {0x06, 0xA8, "LM3S9U81"},
        {0x06, 0x7D, "LM3S9U90"},
        {0x06, 0x90, "LM3S9U92"},
-       {0x06, 0xB7, "LM3S9U95"},
        {0x06, 0x9B, "LM3S9U96"},
        {0x05, 0x18, "LM4F110B2QR"},
        {0x05, 0x19, "LM4F110C4QR"},
@@ -401,6 +395,13 @@ static struct {
        {0x05, 0x60, "LM4F132E5QC"},
        {0x05, 0x61, "LM4F132H5QC"},
        {0x05, 0x65, "LM4F132H5QD"},
+       {0x05, 0x70, "LM4F210E5QR"},
+       {0x05, 0x73, "LM4F210H5QR"},
+       {0x05, 0x80, "LM4F211E5QR"},
+       {0x05, 0x83, "LM4F211H5QR"},
+       {0x05, 0xE9, "LM4F212H5BB"},
+       {0x05, 0xC4, "LM4F212H5QC"},
+       {0x05, 0xC6, "LM4F212H5QD"},
        {0x05, 0xA0, "LM4F230E5QR"},
        {0x05, 0xA1, "LM4F230H5QR"},
        {0x05, 0xB0, "LM4F231E5QR"},
@@ -410,12 +411,13 @@ static struct {
        {0x05, 0xC1, "LM4F232H5QC"},
        {0x05, 0xC5, "LM4F232H5QD"},
        {0x05, 0xE5, "LM4FS1AH5BB"},
+       {0x05, 0xEA, "LM4FS1GH5BB"},
        {0x05, 0xE4, "LM4FS99H5BB"},
-       {0x05, 0xE0, "LM4FSXAH5BB"},
+       {0x05, 0xE1, "LM4FSXLH5BB"},
        {0xFF, 0x00, "Unknown Part"}
 };
 
-static char *StellarisClassname[7] = {
+static const char *StellarisClassname[7] = {
        "Sandstorm",
        "Fury",
        "Unknown",
@@ -1031,8 +1033,7 @@ static int stellaris_write_block(struct flash_bank *bank,
        while (target_alloc_working_area_try(target, buffer_size, &source) != ERROR_OK) {
                buffer_size /= 2;
                if (buffer_size <= buf_min) {
-                       if (write_algorithm)
-                               target_free_working_area(target, write_algorithm);
+                       target_free_working_area(target, write_algorithm);
                        return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
                }
                LOG_DEBUG("retry target_alloc_working_area(%s, size=%u)",
@@ -1041,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);
@@ -1398,7 +1399,7 @@ struct flash_driver stellaris_flash = {
        .read = default_flash_read,
        .probe = stellaris_probe,
        .auto_probe = stellaris_probe,
-       .erase_check = default_flash_mem_blank_check,
+       .erase_check = default_flash_blank_check,
        .protect_check = stellaris_protect_check,
        .info = get_stellaris_info,
 };

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)