Skip to content
Snippets Groups Projects
Commit de4a2189 authored by Joerg Fischer's avatar Joerg Fischer Committed by Spencer Oliver
Browse files

EFM32 Wonder Gecko Family support


Add support for EFM32 Wonder Gecko family to flash driver.
This family has Cortex M4F core.

Change-Id: If71511015403069e3e30cb9f19df12cd97ac49e8
Signed-off-by: default avatarJoerg Fischer <turboj@gmx.de>
Reviewed-on: http://openocd.zylin.com/1968


Tested-by: jenkins
Reviewed-by: default avatarSpencer Oliver <spen@spen-soft.co.uk>
parent bb0ef230
Branches
No related tags found
No related merge requests found
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#define EFM_FAMILY_ID_GIANT_GECKO 72 #define EFM_FAMILY_ID_GIANT_GECKO 72
#define EFM_FAMILY_ID_TINY_GECKO 73 #define EFM_FAMILY_ID_TINY_GECKO 73
#define EFM_FAMILY_ID_LEOPARD_GECKO 74 #define EFM_FAMILY_ID_LEOPARD_GECKO 74
#define EFM_FAMILY_ID_WONDER_GECKO 75
#define EFM32_FLASH_ERASE_TMO 100 #define EFM32_FLASH_ERASE_TMO 100
#define EFM32_FLASH_WDATAREADY_TMO 100 #define EFM32_FLASH_WDATAREADY_TMO 100
...@@ -139,8 +140,10 @@ static int efm32x_read_info(struct flash_bank *bank, ...@@ -139,8 +140,10 @@ static int efm32x_read_info(struct flash_bank *bank,
if (((cpuid >> 4) & 0xfff) == 0xc23) { if (((cpuid >> 4) & 0xfff) == 0xc23) {
/* Cortex M3 device */ /* Cortex M3 device */
} else if (((cpuid >> 4) & 0xfff) == 0xc24) {
/* Cortex M4 device */
} else { } else {
LOG_ERROR("Target is not CortexM3"); LOG_ERROR("Target is not CortexM3 or M4");
return ERROR_FAIL; return ERROR_FAIL;
} }
...@@ -191,6 +194,18 @@ static int efm32x_read_info(struct flash_bank *bank, ...@@ -191,6 +194,18 @@ static int efm32x_read_info(struct flash_bank *bank,
LOG_ERROR("Invalid page size %u", efm32_info->page_size); LOG_ERROR("Invalid page size %u", efm32_info->page_size);
return ERROR_FAIL; return ERROR_FAIL;
} }
} else if (EFM_FAMILY_ID_WONDER_GECKO == efm32_info->part_family) {
uint8_t pg_size = 0;
ret = target_read_u8(bank->target, EFM32_MSC_DI_PAGE_SIZE,
&pg_size);
if (ERROR_OK != ret)
return ret;
efm32_info->page_size = (1 << ((pg_size+10) & 0xff));
if (2048 != efm32_info->page_size) {
LOG_ERROR("Invalid page size %u", efm32_info->page_size);
return ERROR_FAIL;
}
} else { } else {
LOG_ERROR("Unknown MCU family %d", efm32_info->part_family); LOG_ERROR("Unknown MCU family %d", efm32_info->part_family);
return ERROR_FAIL; return ERROR_FAIL;
...@@ -825,6 +840,9 @@ static int efm32x_probe(struct flash_bank *bank) ...@@ -825,6 +840,9 @@ static int efm32x_probe(struct flash_bank *bank)
case EFM_FAMILY_ID_LEOPARD_GECKO: case EFM_FAMILY_ID_LEOPARD_GECKO:
LOG_INFO("Leopard Gecko MCU detected"); LOG_INFO("Leopard Gecko MCU detected");
break; break;
case EFM_FAMILY_ID_WONDER_GECKO:
LOG_INFO("Wonder 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);
...@@ -935,6 +953,9 @@ static int get_efm32x_info(struct flash_bank *bank, char *buf, int buf_size) ...@@ -935,6 +953,9 @@ static int get_efm32x_info(struct flash_bank *bank, char *buf, int buf_size)
case EFM_FAMILY_ID_LEOPARD_GECKO: case EFM_FAMILY_ID_LEOPARD_GECKO:
printed = snprintf(buf, buf_size, "Leopard Gecko"); printed = snprintf(buf, buf_size, "Leopard Gecko");
break; break;
case EFM_FAMILY_ID_WONDER_GECKO:
printed = snprintf(buf, buf_size, "Wonder Gecko");
break;
} }
buf += printed; buf += printed;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment