jtag: linuxgpiod: drop extra parenthesis
[openocd.git] / src / flash / nor / stm32l4x.c
index 77a89f53c04971f2d4571dbd541c69b8e06ecbcb..039938512bfa9378cfe87be62b0fec90a7a29761 100644 (file)
@@ -57,6 +57,9 @@
  */
 
 /* STM32WBxxx series for reference.
+ *
+ * RM0493 (STM32WBA52x)
+ * http://www.st.com/resource/en/reference_manual/dm00821869.pdf
  *
  * RM0434 (STM32WB55/WB35x)
  * http://www.st.com/resource/en/reference_manual/dm00318631.pdf
@@ -346,6 +349,10 @@ static const struct stm32l4_rev stm32u57_u58xx_revs[] = {
        { 0x2001, "X" }, { 0x3000, "C" },
 };
 
+static const struct stm32l4_rev stm32wba5x_revs[] = {
+       { 0x1000, "A" },
+};
+
 static const struct stm32l4_rev stm32wb1xx_revs[] = {
        { 0x1000, "A" }, { 0x2000, "B" },
 };
@@ -579,6 +586,18 @@ static const struct stm32l4_part_info stm32l4_parts[] = {
          .otp_base              = 0x0BFA0000,
          .otp_size              = 512,
        },
+       {
+         .id                    = DEVID_STM32WBA5X,
+         .revs                  = stm32wba5x_revs,
+         .num_revs              = ARRAY_SIZE(stm32wba5x_revs),
+         .device_str            = "STM32WBA5x",
+         .max_flash_size_kb     = 1024,
+         .flags                 = F_QUAD_WORD_PROG | F_HAS_TZ | F_HAS_L5_FLASH_REGS,
+         .flash_regs_base       = 0x40022000,
+         .fsize_addr            = 0x0FF907A0,
+         .otp_base              = 0x0FF90000,
+         .otp_size              = 512,
+       },
        {
          .id                    = DEVID_STM32WB1XX,
          .revs                  = stm32wb1xx_revs,
@@ -1682,7 +1701,7 @@ static int stm32l4_read_idcode(struct flash_bank *bank, uint32_t *id)
 
        /* CPU2 (Cortex-M0+) is supported only with non-hla adapters because it is on AP1.
         * Using HLA adapters armv7m.debug_ap is null, and checking ap_num triggers a segfault */
-       if (cortex_m_get_partno_safe(target) == CORTEX_M0P_PARTNO &&
+       if (cortex_m_get_impl_part(target) == CORTEX_M0P_PARTNO &&
                        armv7m->debug_ap && armv7m->debug_ap->ap_num == 1) {
                uint32_t uid64_ids;
 
@@ -1993,6 +2012,12 @@ static int stm32l4_probe(struct flash_bank *bank)
                        stm32l4_info->bank1_sectors = num_pages / 2;
                }
                break;
+       case DEVID_STM32WBA5X:
+               /* single bank flash */
+               page_size_kb = 8;
+               num_pages = flash_size_kb / page_size_kb;
+               stm32l4_info->bank1_sectors = num_pages;
+               break;
        case DEVID_STM32WB5XX:
        case DEVID_STM32WB3XX:
                /* single bank flash */
@@ -2193,10 +2218,8 @@ err_lock:
 
 COMMAND_HANDLER(stm32l4_handle_mass_erase_command)
 {
-       if (CMD_ARGC < 1) {
-               command_print(CMD, "stm32l4x mass_erase <STM32L4 bank>");
+       if (CMD_ARGC != 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
-       }
 
        struct flash_bank *bank;
        int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
@@ -2214,10 +2237,8 @@ COMMAND_HANDLER(stm32l4_handle_mass_erase_command)
 
 COMMAND_HANDLER(stm32l4_handle_option_read_command)
 {
-       if (CMD_ARGC < 2) {
-               command_print(CMD, "stm32l4x option_read <STM32L4 bank> <option_reg offset>");
+       if (CMD_ARGC != 2)
                return ERROR_COMMAND_SYNTAX_ERROR;
-       }
 
        struct flash_bank *bank;
        int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
@@ -2241,10 +2262,8 @@ COMMAND_HANDLER(stm32l4_handle_option_read_command)
 
 COMMAND_HANDLER(stm32l4_handle_option_write_command)
 {
-       if (CMD_ARGC < 3) {
-               command_print(CMD, "stm32l4x option_write <STM32L4 bank> <option_reg offset> <value> [mask]");
+       if (CMD_ARGC != 3 && CMD_ARGC != 4)
                return ERROR_COMMAND_SYNTAX_ERROR;
-       }
 
        struct flash_bank *bank;
        int retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
@@ -2356,7 +2375,7 @@ COMMAND_HANDLER(stm32l4_handle_lock_command)
 {
        struct target *target = NULL;
 
-       if (CMD_ARGC < 1)
+       if (CMD_ARGC != 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        struct flash_bank *bank;
@@ -2391,7 +2410,7 @@ COMMAND_HANDLER(stm32l4_handle_unlock_command)
 {
        struct target *target = NULL;
 
-       if (CMD_ARGC < 1)
+       if (CMD_ARGC != 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        struct flash_bank *bank;
@@ -2495,7 +2514,7 @@ COMMAND_HANDLER(stm32l4_handle_wrp_info_command)
 
 COMMAND_HANDLER(stm32l4_handle_otp_command)
 {
-       if (CMD_ARGC < 2)
+       if (CMD_ARGC != 2)
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        struct flash_bank *bank;

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)