]> git.sur5r.net Git - openocd/commitdiff
efm32: basic Happy Gecko target support
authorKarl Palsson <karlp@tweak.net.au>
Tue, 11 Aug 2015 14:20:49 +0000 (14:20 +0000)
committerFreddie Chopin <freddie.chopin@gmail.com>
Mon, 23 Nov 2015 16:08:04 +0000 (16:08 +0000)
Basic basic support to get running, magic numbers taken from revision
0.90 of the reference manual.

Signed-off-by: Karl Palsson <karlp@tweak.net.au>
Change-Id: Iff6ab94d30698f056ef09f7a856b7285fed8f441
Reviewed-on: http://openocd.zylin.com/2931
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
src/flash/nor/efm32.c

index fa45ea131f9316793cf53d4c5b84e7831c7cac1b..bd77a96dec7f7934debdfb25c259dca18c057332 100644 (file)
@@ -47,6 +47,7 @@
 #define EFM_FAMILY_ID_LEOPARD_GECKO     74
 #define EFM_FAMILY_ID_WONDER_GECKO      75
 #define EFM_FAMILY_ID_ZERO_GECKO        76
+#define EFM_FAMILY_ID_HAPPY_GECKO      77
 #define EZR_FAMILY_ID_WONDER_GECKO             120
 #define EZR_FAMILY_ID_LEOPARD_GECKO            121
 
@@ -149,7 +150,7 @@ static int efm32x_read_info(struct flash_bank *bank,
        } else if (((cpuid >> 4) & 0xfff) == 0xc24) {
                /* Cortex M4 device(WONDER GECKO) */
        } else if (((cpuid >> 4) & 0xfff) == 0xc60) {
-               /* Cortex M0plus device(ZERO GECKO) */
+               /* Cortex M0plus device */
        } else {
                LOG_ERROR("Target is not Cortex-Mx Device");
                return ERROR_FAIL;
@@ -178,7 +179,8 @@ static int efm32x_read_info(struct flash_bank *bank,
        if (EFM_FAMILY_ID_GECKO == efm32_info->part_family ||
                        EFM_FAMILY_ID_TINY_GECKO == efm32_info->part_family)
                efm32_info->page_size = 512;
-       else if (EFM_FAMILY_ID_ZERO_GECKO == efm32_info->part_family)
+       else if (EFM_FAMILY_ID_ZERO_GECKO == efm32_info->part_family ||
+                       EFM_FAMILY_ID_HAPPY_GECKO == efm32_info->part_family)
                efm32_info->page_size = 1024;
        else if (EFM_FAMILY_ID_GIANT_GECKO == efm32_info->part_family ||
                        EFM_FAMILY_ID_LEOPARD_GECKO == efm32_info->part_family) {
@@ -860,6 +862,9 @@ static int efm32x_probe(struct flash_bank *bank)
                case EFM_FAMILY_ID_ZERO_GECKO:
                        LOG_INFO("Zero Gecko MCU detected");
                        break;
+               case EFM_FAMILY_ID_HAPPY_GECKO:
+                       LOG_INFO("Happy Gecko MCU detected");
+                       break;
                default:
                        LOG_ERROR("Unsupported MCU family %d",
                                efm32_mcu_info.part_family);
@@ -986,6 +991,9 @@ static int get_efm32x_info(struct flash_bank *bank, char *buf, int buf_size)
                case EFM_FAMILY_ID_ZERO_GECKO:
                        printed = snprintf(buf, buf_size, "Zero Gecko");
                        break;
+               case EFM_FAMILY_ID_HAPPY_GECKO:
+                       printed = snprintf(buf, buf_size, "Happy Gecko");
+                       break;
        }
 
        buf += printed;