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 <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>
__archive__
Karl Palsson 2015-08-11 14:20:49 +00:00 committed by Freddie Chopin
parent 2bb9256c34
commit 3f48732700
1 changed files with 10 additions and 2 deletions

View File

@ -47,6 +47,7 @@
#define EFM_FAMILY_ID_LEOPARD_GECKO 74 #define EFM_FAMILY_ID_LEOPARD_GECKO 74
#define EFM_FAMILY_ID_WONDER_GECKO 75 #define EFM_FAMILY_ID_WONDER_GECKO 75
#define EFM_FAMILY_ID_ZERO_GECKO 76 #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_WONDER_GECKO 120
#define EZR_FAMILY_ID_LEOPARD_GECKO 121 #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) { } else if (((cpuid >> 4) & 0xfff) == 0xc24) {
/* Cortex M4 device(WONDER GECKO) */ /* Cortex M4 device(WONDER GECKO) */
} else if (((cpuid >> 4) & 0xfff) == 0xc60) { } else if (((cpuid >> 4) & 0xfff) == 0xc60) {
/* Cortex M0plus device(ZERO GECKO) */ /* Cortex M0plus device */
} else { } else {
LOG_ERROR("Target is not Cortex-Mx Device"); LOG_ERROR("Target is not Cortex-Mx Device");
return ERROR_FAIL; 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 || if (EFM_FAMILY_ID_GECKO == efm32_info->part_family ||
EFM_FAMILY_ID_TINY_GECKO == efm32_info->part_family) EFM_FAMILY_ID_TINY_GECKO == efm32_info->part_family)
efm32_info->page_size = 512; 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; efm32_info->page_size = 1024;
else if (EFM_FAMILY_ID_GIANT_GECKO == efm32_info->part_family || else if (EFM_FAMILY_ID_GIANT_GECKO == efm32_info->part_family ||
EFM_FAMILY_ID_LEOPARD_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: case EFM_FAMILY_ID_ZERO_GECKO:
LOG_INFO("Zero Gecko MCU detected"); LOG_INFO("Zero Gecko MCU detected");
break; break;
case EFM_FAMILY_ID_HAPPY_GECKO:
LOG_INFO("Happy Gecko MCU detected");
break;
default: default:
LOG_ERROR("Unsupported MCU family %d", LOG_ERROR("Unsupported MCU family %d",
efm32_mcu_info.part_family); 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: case EFM_FAMILY_ID_ZERO_GECKO:
printed = snprintf(buf, buf_size, "Zero Gecko"); printed = snprintf(buf, buf_size, "Zero Gecko");
break; break;
case EFM_FAMILY_ID_HAPPY_GECKO:
printed = snprintf(buf, buf_size, "Happy Gecko");
break;
} }
buf += printed; buf += printed;