This is an automated email from Gerrit.

"Fedi Bouzazi <fedi.bouz...@st.com>" just uploaded a new patch set to Gerrit, 
which you can find at https://review.openocd.org/c/openocd/+/7515

-- gerrit

commit 7f0376b8fe7c8fc35856291773fe34100de98810
Author: FBOSTM <fedi.bouz...@st.com>
Date:   Thu Mar 2 17:26:55 2023 +0100

    flash/stm32l4x: add support of STM32U535/U545
    
    
    Signed-off-by: FBOSTM <fedi.bouz...@st.com>
    Change-Id: I774ef0df4dddac5f06bbfc2e6c3fc2e628d2249e

diff --git a/src/flash/nor/stm32l4x.c b/src/flash/nor/stm32l4x.c
index 02e737b87c..5dbebb7fd6 100644
--- a/src/flash/nor/stm32l4x.c
+++ b/src/flash/nor/stm32l4x.c
@@ -346,6 +346,10 @@ static const struct stm32l4_rev stm32wle_wl5xx_revs[] = {
        { 0x1000, "1.0" },
 };
 
+static const struct stm32l4_rev stm32u535_u545_revs[] = {
+       { 0x1000, "A" },
+};
+
 static const struct stm32l4_part_info stm32l4_parts[] = {
        {
          .id                    = DEVID_STM32L47_L48XX,
@@ -359,6 +363,18 @@ static const struct stm32l4_part_info stm32l4_parts[] = {
          .otp_base              = 0x1FFF7000,
          .otp_size              = 1024,
        },
+       {
+                 .id                    = DEVID_STM32U535_U545,
+                 .revs                  = stm32u535_u545_revs,
+                 .num_revs              = ARRAY_SIZE(stm32u535_u545_revs),
+                 .device_str            = "STM32U535/U545",
+                 .max_flash_size_kb     = 512,
+                 .flags                 = F_HAS_DUAL_BANK | F_QUAD_WORD_PROG | 
F_HAS_TZ | F_HAS_L5_FLASH_REGS,
+                 .flash_regs_base       = 0x40022000,
+                 .fsize_addr            = 0x0BFA07A0,
+                 .otp_base              = 0x0BFA0000,
+                 .otp_size              = 512,
+       },
        {
          .id                    = DEVID_STM32L43_L44XX,
          .revs                  = stm32l43_l44xx_revs,
@@ -1940,13 +1956,14 @@ static int stm32l4_probe(struct flash_bank *bank)
                }
                break;
        case DEVID_STM32U57_U58XX:
+       case DEVID_STM32U535_U545:
                /* if flash size is max (2M) the device is always dual bank
                 * otherwise check DUALBANK
                 */
                page_size_kb = 8;
                num_pages = flash_size_kb / page_size_kb;
                stm32l4_info->bank1_sectors = num_pages;
-               if (is_max_flash_size || (stm32l4_info->optr & 
FLASH_U5_DUALBANK)) {
+               if (flash_size_kb > 1024 || (stm32l4_info->optr & 
FLASH_U5_DUALBANK)) {
                        stm32l4_info->dual_bank_mode = true;
                        stm32l4_info->bank1_sectors = num_pages / 2;
                }
diff --git a/src/flash/nor/stm32l4x.h b/src/flash/nor/stm32l4x.h
index 06cc66d4d8..d2aa9b3061 100644
--- a/src/flash/nor/stm32l4x.h
+++ b/src/flash/nor/stm32l4x.h
@@ -105,7 +105,7 @@
 #define DEVID_STM32WB5XX               0x495
 #define DEVID_STM32WB3XX               0x496
 #define DEVID_STM32WLE_WL5XX   0x497
-
+#define DEVID_STM32U535_U545   0x455
 /* known Flash base addresses */
 #define STM32_FLASH_BANK_BASE  0x08000000
 #define STM32_FLASH_S_BANK_BASE        0x0C000000

-- 

Reply via email to