flash/stm32h7x: include IO_HSLV in user3_options 45/4745/3
authorChristopher Head <chead@zaber.com>
Tue, 30 Oct 2018 21:45:11 +0000 (14:45 -0700)
committerTomas Vanek <vanekt@fbl.cz>
Wed, 10 Apr 2019 15:36:54 +0000 (16:36 +0100)
Bit 29 of OPTSR is IO_HSLV. It ought to be read in stm32x_read_options
and written in stm32x_write_options. Adjust the bitmasks to do this.

Change-Id: I785a5291c991c98b774177f960dc58f2b5e045e2
Signed-off-by: Christopher Head <chead@zaber.com>
Reviewed-on: http://openocd.zylin.com/4745
Tested-by: jenkins
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
src/flash/nor/stm32h7x.c

index ce89bb446b8d41fde23b1dc5235b8f5e8a93ae8f..8bcc29cb1140eaa666859143b2d0df6fdc10a025 100644 (file)
@@ -321,7 +321,7 @@ static int stm32x_read_options(struct flash_bank *bank)
        stm32x_info->option_bytes.user_options = optiondata & 0xfc;
        stm32x_info->option_bytes.RDP = (optiondata >> 8) & 0xff;
        stm32x_info->option_bytes.user2_options = (optiondata >> 16) & 0xff;
-       stm32x_info->option_bytes.user3_options = (optiondata >> 24) & 0x83;
+       stm32x_info->option_bytes.user3_options = (optiondata >> 24) & 0xa3;
 
        if (stm32x_info->option_bytes.RDP != 0xAA)
                LOG_INFO("Device Security Bit Set");
@@ -357,7 +357,7 @@ static int stm32x_write_options(struct flash_bank *bank)
        optiondata = stm32x_info->option_bytes.user_options;
        optiondata |= (stm32x_info->option_bytes.RDP << 8);
        optiondata |= (stm32x_info->option_bytes.user2_options & 0xff) << 16;
-       optiondata |= (stm32x_info->option_bytes.user3_options & 0x83) << 24;
+       optiondata |= (stm32x_info->option_bytes.user3_options & 0xa3) << 24;
 
        /* program options */
        retval = target_write_u32(target, FLASH_REG_BASE_B0 + FLASH_OPTPRG, optiondata);

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)