This is an automated email from Gerrit.

"Philip Gruebele <phil...@audiophilleo.com>" just uploaded a new patch set to 
Gerrit, which you can find at https://review.openocd.org/c/openocd/+/8509

-- gerrit

commit d19227c8e391b1f9763d4f0437e4f27fb1a2dfbd
Author: Philip Gruebele <phil...@audiophilleo.com>
Date:   Tue Sep 24 13:06:00 2024 +0300

    flash/nor/efm32: add support for bootloader flash page writing
    
    Change-Id: If011dba389887619ad273a0ff54393c4028f21da
    Signed-off-by: Philip Gruebele <phil...@audiophilleo.com>

diff --git a/src/flash/nor/efm32.c b/src/flash/nor/efm32.c
index f8e0886570..5d75fc56d4 100644
--- a/src/flash/nor/efm32.c
+++ b/src/flash/nor/efm32.c
@@ -48,6 +48,7 @@
 #define EFM32_MSC_LOCK_BITS             (EFM32_MSC_INFO_BASE+0x4000)
 #define EFM32_MSC_LOCK_BITS_EXTRA       (EFM32_MSC_LOCK_BITS+LOCKWORDS_SZ)
 #define EFM32_MSC_DEV_INFO              (EFM32_MSC_INFO_BASE+0x8000)
+#define EFM32_MSC_BOOTLOADER            (EFM32_MSC_INFO_BASE + 0x10000)
 
 /* PAGE_SIZE is not present in Zero, Happy and the original Gecko MCU */
 #define EFM32_MSC_DI_PAGE_SIZE          (EFM32_MSC_DEV_INFO+0x1e7)
@@ -82,6 +83,7 @@ enum efm32_bank_index {
        EFM32_BANK_INDEX_MAIN,
        EFM32_BANK_INDEX_USER_DATA,
        EFM32_BANK_INDEX_LOCK_BITS,
+       EFM32_BANK_INDEX_BOOTLOADER,
        EFM32_N_BANKS
 };
 
@@ -94,6 +96,8 @@ static int efm32x_get_bank_index(target_addr_t base)
                        return EFM32_BANK_INDEX_USER_DATA;
                case EFM32_MSC_LOCK_BITS:
                        return EFM32_BANK_INDEX_LOCK_BITS;
+               case EFM32_MSC_BOOTLOADER:
+                       return EFM32_BANK_INDEX_BOOTLOADER;
                default:
                        return ERROR_FAIL;
        }
@@ -674,6 +678,11 @@ static int efm32x_get_page_lock(struct flash_bank *bank, 
size_t page)
                        dw = efm32x_info->lb_page[126];
                        mask = 0x2;
                        break;
+               case EFM32_MSC_BOOTLOADER:
+                       // There is no lockbit for bootloader page?  So just 
return same as user data page.
+                       dw = efm32x_info->lb_page[126];
+                       mask = 0x1;
+                       break;
        }
 
        return (dw & mask) ? 0 : 1;

-- 

Reply via email to