From: Karl Palsson Date: Tue, 11 Aug 2015 14:20:49 +0000 (+0000) Subject: efm32: basic Happy Gecko target support X-Git-Tag: v0.10.0-rc1~356 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3f48732700e9ed6230ad6315bb3f50dfbe036816;p=openocd efm32: basic Happy Gecko target support Basic basic support to get running, magic numbers taken from revision 0.90 of the reference manual. Signed-off-by: Karl Palsson Change-Id: Iff6ab94d30698f056ef09f7a856b7285fed8f441 Reviewed-on: http://openocd.zylin.com/2931 Tested-by: jenkins Reviewed-by: Freddie Chopin --- diff --git a/src/flash/nor/efm32.c b/src/flash/nor/efm32.c index fa45ea13..bd77a96d 100644 --- a/src/flash/nor/efm32.c +++ b/src/flash/nor/efm32.c @@ -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;