Fix sector layout for 504-KiB LPC2000 devices
authorRolf Meeser <rolfm_9dq@yahoo.de>
Fri, 3 Dec 2010 13:06:11 +0000 (14:06 +0100)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Sat, 4 Dec 2010 08:35:33 +0000 (09:35 +0100)
src/flash/nor/lpc2000.c

index 14d0e44db507c1d70a88008401ae49b5f1d60fa5..fea663e9478913830cdf21186edff6dac4328d09 100644 (file)
@@ -196,10 +196,13 @@ static int lpc2000_build_sector_list(struct flash_bank *bank)
                        case 256 * 1024:
                                bank->num_sectors = 15;
                                break;
-                       case 512 * 1024:
                        case 500 * 1024:
                                bank->num_sectors = 27;
                                break;
+                       case 512 * 1024:
+                       case 504 * 1024:
+                               bank->num_sectors = 28;
+                               break;
                        default:
                                LOG_ERROR("BUG: unknown bank->size encountered");
                                exit(-1);
@@ -210,7 +213,7 @@ static int lpc2000_build_sector_list(struct flash_bank *bank)
 
                for (i = 0; i < bank->num_sectors; i++)
                {
-                       if ((i >= 0) && (i < 8))
+                       if (i < 8)
                        {
                                bank->sectors[i].offset = offset;
                                bank->sectors[i].size = 4 * 1024;
@@ -218,7 +221,7 @@ static int lpc2000_build_sector_list(struct flash_bank *bank)
                                bank->sectors[i].is_erased = -1;
                                bank->sectors[i].is_protected = 1;
                        }
-                       if ((i >= 8) && (i < 22))
+                       else if (i < 22)
                        {
                                bank->sectors[i].offset = offset;
                                bank->sectors[i].size = 32 * 1024;
@@ -226,7 +229,7 @@ static int lpc2000_build_sector_list(struct flash_bank *bank)
                                bank->sectors[i].is_erased = -1;
                                bank->sectors[i].is_protected = 1;
                        }
-                       if ((i >= 22) && (i < 27))
+                       else if (i < 28)
                        {
                                bank->sectors[i].offset = offset;
                                bank->sectors[i].size = 4 * 1024;

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)