diff options
author | Karl Palsson <karlp@tweak.net.au> | 2015-08-11 14:20:49 +0000 |
---|---|---|
committer | Freddie Chopin <freddie.chopin@gmail.com> | 2015-11-23 16:08:04 +0000 |
commit | 3f48732700e9ed6230ad6315bb3f50dfbe036816 (patch) | |
tree | 29df9ba643517a7c3f1bb8d84cab0e56ddc3686b /src/flash | |
parent | 2bb9256c34e75180450053787f98b13b8b07164d (diff) | |
download | riscv-openocd-3f48732700e9ed6230ad6315bb3f50dfbe036816.zip riscv-openocd-3f48732700e9ed6230ad6315bb3f50dfbe036816.tar.gz riscv-openocd-3f48732700e9ed6230ad6315bb3f50dfbe036816.tar.bz2 |
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>
Diffstat (limited to 'src/flash')
-rw-r--r-- | src/flash/nor/efm32.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/flash/nor/efm32.c b/src/flash/nor/efm32.c index fa45ea1..bd77a96 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; |