flash/nor/stm32f1x: Group and cleanup device list 23/5423/4
authorMarc Schink <dev@zapb.de>
Tue, 28 Jan 2020 09:53:35 +0000 (10:53 +0100)
committerTomas Vanek <vanekt@fbl.cz>
Sat, 7 Mar 2020 15:28:01 +0000 (15:28 +0000)
Group device list based on the device family and add clear
device family names.

Change-Id: I7a2dab1d1c0c8d141df02656c1964cb2c3fcbcd1
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: http://openocd.zylin.com/5423
Tested-by: jenkins
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
src/flash/nor/stm32f1x.c

index ba0d54e798496cca0debacfe0317399020c15dd1..7d5a8f0a29ea12527922f12a98d2aebc4602041e 100644 (file)
@@ -713,31 +713,63 @@ static int stm32x_probe(struct flash_bank *bank)
 
        /* set page size, protection granularity and max flash size depending on family */
        switch (device_id & 0xfff) {
-       case 0x410: /* medium density */
+       case 0x440: /* stm32f05x */
+       case 0x444: /* stm32f03x */
+       case 0x445: /* stm32f04x */
+               page_size = 1024;
+               stm32x_info->ppage_size = 4;
+               max_flash_size_in_kb = 64;
+               stm32x_info->user_data_offset = 16;
+               stm32x_info->option_offset = 6;
+               stm32x_info->default_rdp = 0xAA;
+               stm32x_info->can_load_options = true;
+               break;
+       case 0x448: /* stm32f07x */
+       case 0x442: /* stm32f09x */
+               page_size = 2048;
+               stm32x_info->ppage_size = 4;
+               max_flash_size_in_kb = 256;
+               stm32x_info->user_data_offset = 16;
+               stm32x_info->option_offset = 6;
+               stm32x_info->default_rdp = 0xAA;
+               stm32x_info->can_load_options = true;
+               break;
+       case 0x410: /* stm32f1x medium-density */
                page_size = 1024;
                stm32x_info->ppage_size = 4;
                max_flash_size_in_kb = 128;
                break;
-       case 0x412: /* low density */
+       case 0x412: /* stm32f1x low-density */
                page_size = 1024;
                stm32x_info->ppage_size = 4;
                max_flash_size_in_kb = 32;
                break;
-       case 0x414: /* high density */
+       case 0x414: /* stm32f1x high-density */
                page_size = 2048;
                stm32x_info->ppage_size = 2;
                max_flash_size_in_kb = 512;
                break;
-       case 0x418: /* connectivity line density */
+       case 0x418: /* stm32f1x connectivity */
                page_size = 2048;
                stm32x_info->ppage_size = 2;
                max_flash_size_in_kb = 256;
                break;
-       case 0x420: /* value line density */
+       case 0x430: /* stm32f1 XL-density (dual flash banks) */
+               page_size = 2048;
+               stm32x_info->ppage_size = 2;
+               max_flash_size_in_kb = 1024;
+               stm32x_info->has_dual_banks = true;
+               break;
+       case 0x420: /* stm32f100xx low- and medium-density value line */
                page_size = 1024;
                stm32x_info->ppage_size = 4;
                max_flash_size_in_kb = 128;
                break;
+       case 0x428: /* stm32f100xx high-density value line */
+               page_size = 2048;
+               stm32x_info->ppage_size = 4;
+               max_flash_size_in_kb = 128;
+               break;
        case 0x422: /* stm32f302/3xb/c */
                page_size = 2048;
                stm32x_info->ppage_size = 2;
@@ -756,17 +788,6 @@ static int stm32x_probe(struct flash_bank *bank)
                stm32x_info->default_rdp = 0xAA;
                stm32x_info->can_load_options = true;
                break;
-       case 0x428: /* value line High density */
-               page_size = 2048;
-               stm32x_info->ppage_size = 4;
-               max_flash_size_in_kb = 128;
-               break;
-       case 0x430: /* xl line density (dual flash banks) */
-               page_size = 2048;
-               stm32x_info->ppage_size = 2;
-               max_flash_size_in_kb = 1024;
-               stm32x_info->has_dual_banks = true;
-               break;
        case 0x432: /* stm32f37x */
                page_size = 2048;
                stm32x_info->ppage_size = 2;
@@ -786,27 +807,6 @@ static int stm32x_probe(struct flash_bank *bank)
                stm32x_info->default_rdp = 0xAA;
                stm32x_info->can_load_options = true;
                break;
-       case 0x440: /* stm32f05x */
-       case 0x444: /* stm32f03x */
-       case 0x445: /* stm32f04x */
-               page_size = 1024;
-               stm32x_info->ppage_size = 4;
-               max_flash_size_in_kb = 64;
-               stm32x_info->user_data_offset = 16;
-               stm32x_info->option_offset = 6;
-               stm32x_info->default_rdp = 0xAA;
-               stm32x_info->can_load_options = true;
-               break;
-       case 0x448: /* stm32f07x */
-       case 0x442: /* stm32f09x */
-               page_size = 2048;
-               stm32x_info->ppage_size = 4;
-               max_flash_size_in_kb = 256;
-               stm32x_info->user_data_offset = 16;
-               stm32x_info->option_offset = 6;
-               stm32x_info->default_rdp = 0xAA;
-               stm32x_info->can_load_options = true;
-               break;
        default:
                LOG_WARNING("Cannot identify target as a STM32 family.");
                return ERROR_FAIL;

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)