From e91da4ae45758bfd970f7005ded40801c190dbd9 Mon Sep 17 00:00:00 2001 From: Oane Kingma Date: Fri, 29 Nov 2019 21:30:33 +0100 Subject: [PATCH] soc/arm/silabs_exx32: Add support for EFM32GG11B SoC This commit adds support for the Silicon Labs EFM32GG11B series of SoCs. Signed-off-by: Oane Kingma --- .../efm32gg11b/Kconfig.defconfig.efm32gg11b | 35 +++++++++++++++++ .../efm32gg11b/Kconfig.defconfig.series | 21 ++++++++++ .../silabs_exx32/efm32gg11b/Kconfig.series | 21 ++++++++++ soc/arm/silabs_exx32/efm32gg11b/Kconfig.soc | 11 ++++++ soc/arm/silabs_exx32/efm32gg11b/dts_fixup.h | 34 +++++++++++++++++ soc/arm/silabs_exx32/efm32gg11b/linker.ld | 17 +++++++++ soc/arm/silabs_exx32/efm32gg11b/soc.h | 38 +++++++++++++++++++ soc/arm/silabs_exx32/efm32gg11b/soc_pinmap.h | 36 ++++++++++++++++++ west.yml | 2 +- 9 files changed, 214 insertions(+), 1 deletion(-) create mode 100644 soc/arm/silabs_exx32/efm32gg11b/Kconfig.defconfig.efm32gg11b create mode 100644 soc/arm/silabs_exx32/efm32gg11b/Kconfig.defconfig.series create mode 100644 soc/arm/silabs_exx32/efm32gg11b/Kconfig.series create mode 100644 soc/arm/silabs_exx32/efm32gg11b/Kconfig.soc create mode 100644 soc/arm/silabs_exx32/efm32gg11b/dts_fixup.h create mode 100644 soc/arm/silabs_exx32/efm32gg11b/linker.ld create mode 100644 soc/arm/silabs_exx32/efm32gg11b/soc.h create mode 100644 soc/arm/silabs_exx32/efm32gg11b/soc_pinmap.h diff --git a/soc/arm/silabs_exx32/efm32gg11b/Kconfig.defconfig.efm32gg11b b/soc/arm/silabs_exx32/efm32gg11b/Kconfig.defconfig.efm32gg11b new file mode 100644 index 00000000000..8ef4ca52ffd --- /dev/null +++ b/soc/arm/silabs_exx32/efm32gg11b/Kconfig.defconfig.efm32gg11b @@ -0,0 +1,35 @@ +# Silicon Labs EFM32GG-STK3701A platform configuration options +# Copyright (c) 2019 Interay Solutions B.V. +# Copyright (c) 2019 Oane Kingma +# SPDX-License-Identifier: Apache-2.0 + +if GPIO || LOG_BACKEND_SWO + +config GPIO_GECKO + default y + +endif # GPIO || LOG_BACKEND_SWO + +if SERIAL + +config UART_GECKO + default y + +config LEUART_GECKO + default y + +endif # SERIAL + +if I2C + +config I2C_GECKO + default y + +endif # I2C + +if FLASH + +config SOC_FLASH_GECKO + default y + +endif # FLASH diff --git a/soc/arm/silabs_exx32/efm32gg11b/Kconfig.defconfig.series b/soc/arm/silabs_exx32/efm32gg11b/Kconfig.defconfig.series new file mode 100644 index 00000000000..4e32ef9bd50 --- /dev/null +++ b/soc/arm/silabs_exx32/efm32gg11b/Kconfig.defconfig.series @@ -0,0 +1,21 @@ +# EFM32GG11B series configuration options +# Copyright (c) 2019 Interay Solutions B.V. +# Copyright (c) 2019 Oane Kingma +# SPDX-License-Identifier: Apache-2.0 + +if SOC_SERIES_EFM32GG11B + +config SOC_SERIES + default "efm32gg11b" + +config SOC_PART_NUMBER + default "EFM32GG11B820F2048GL192" if SOC_PART_NUMBER_EFM32GG11B820F2048GL192 + +config NUM_IRQS + int + # must be >= the highest interrupt number used + default 68 + +source "soc/arm/silabs_exx32/efm32gg11b/Kconfig.defconfig.efm32gg11b" + +endif # SOC_SERIES_EFM32GG11B diff --git a/soc/arm/silabs_exx32/efm32gg11b/Kconfig.series b/soc/arm/silabs_exx32/efm32gg11b/Kconfig.series new file mode 100644 index 00000000000..9efcc18f7db --- /dev/null +++ b/soc/arm/silabs_exx32/efm32gg11b/Kconfig.series @@ -0,0 +1,21 @@ +# EFM32GG11B MCU line +# Copyright (c) 2019 Interay Solutions B.V. +# Copyright (c) 2019 Oane Kingma +# SPDX-License-Identifier: Apache-2.0 + +config SOC_SERIES_EFM32GG11B + bool "EFM32PG11B Series MCU" + select HAS_SILABS_GECKO + select HAS_SWO + select CPU_CORTEX_M4 + select CPU_HAS_FPU + select SOC_FAMILY_EXX32 + select HAS_SYS_POWER_STATE_SLEEP_1 + select HAS_SYS_POWER_STATE_SLEEP_2 + select HAS_SYS_POWER_STATE_SLEEP_3 + select SOC_GECKO_HAS_INDIVIDUAL_PIN_LOCATION + select SOC_GECKO_CMU + select SOC_GECKO_EMU + select SOC_GECKO_GPIO + help + Enable support for EFM32 GiantGecko MCU series diff --git a/soc/arm/silabs_exx32/efm32gg11b/Kconfig.soc b/soc/arm/silabs_exx32/efm32gg11b/Kconfig.soc new file mode 100644 index 00000000000..2f08c4787fd --- /dev/null +++ b/soc/arm/silabs_exx32/efm32gg11b/Kconfig.soc @@ -0,0 +1,11 @@ +# EFM32GG11B (Giant Gecko) MCU line +# Copyright (c) 2019 Interay Solutions B.V. +# Copyright (c) 2019 Oane Kingma +# SPDX-License-Identifier: Apache-2.0 + +if SOC_SERIES_EFM32GG11B + +config SOC_PART_NUMBER_EFM32GG11B820F2048GL192 + bool + +endif # SOC_SERIES_EFM32GG11B diff --git a/soc/arm/silabs_exx32/efm32gg11b/dts_fixup.h b/soc/arm/silabs_exx32/efm32gg11b/dts_fixup.h new file mode 100644 index 00000000000..18922dc824b --- /dev/null +++ b/soc/arm/silabs_exx32/efm32gg11b/dts_fixup.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2019 Interay Solutions B.V. + * Copyright (c) 2019 Oane Kingma + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* SoC level DTS fixup file */ + +#define DT_NUM_IRQ_PRIO_BITS DT_ARM_V7M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS + +#define DT_FLASH_DEV_BASE_ADDRESS DT_SILABS_GECKO_FLASH_CONTROLLER_40000000_BASE_ADDRESS +#define DT_FLASH_DEV_NAME DT_SILABS_GECKO_FLASH_CONTROLLER_40000000_LABEL + +#define DT_GPIO_GECKO_COMMON_NAME DT_SILABS_EFM32_GPIO_40088400_LABEL +#define DT_GPIO_GECKO_COMMON_EVEN_IRQ DT_SILABS_EFM32_GPIO_40088400_IRQ_GPIO_EVEN +#define DT_GPIO_GECKO_COMMON_EVEN_PRI DT_SILABS_EFM32_GPIO_40088400_IRQ_GPIO_EVEN_PRIORITY +#define DT_GPIO_GECKO_COMMON_ODD_IRQ DT_SILABS_EFM32_GPIO_40088400_IRQ_GPIO_ODD +#define DT_GPIO_GECKO_COMMON_ODD_PRI DT_SILABS_EFM32_GPIO_40088400_IRQ_GPIO_ODD_PRIORITY +#define DT_GPIO_GECKO_SWO_LOCATION DT_SILABS_EFM32_GPIO_40088400_LOCATION_SWO + +#define DT_GPIO_GECKO_PORTA_NAME DT_SILABS_EFM32_GPIO_PORT_40088000_LABEL +#define DT_GPIO_GECKO_PORTB_NAME DT_SILABS_EFM32_GPIO_PORT_40088030_LABEL +#define DT_GPIO_GECKO_PORTC_NAME DT_SILABS_EFM32_GPIO_PORT_40088060_LABEL +#define DT_GPIO_GECKO_PORTD_NAME DT_SILABS_EFM32_GPIO_PORT_40088090_LABEL +#define DT_GPIO_GECKO_PORTE_NAME DT_SILABS_EFM32_GPIO_PORT_400880C0_LABEL +#define DT_GPIO_GECKO_PORTF_NAME DT_SILABS_EFM32_GPIO_PORT_400880F0_LABEL +#define DT_GPIO_GECKO_PORTG_NAME DT_SILABS_EFM32_GPIO_PORT_40088120_LABEL +#define DT_GPIO_GECKO_PORTH_NAME DT_SILABS_EFM32_GPIO_PORT_40088150_LABEL +#define DT_GPIO_GECKO_PORTI_NAME DT_SILABS_EFM32_GPIO_PORT_40088180_LABEL + +#define DT_RTC_0_NAME DT_INST_0_SILABS_GECKO_RTCC_LABEL + +/* End of SoC Level DTS fixup file */ diff --git a/soc/arm/silabs_exx32/efm32gg11b/linker.ld b/soc/arm/silabs_exx32/efm32gg11b/linker.ld new file mode 100644 index 00000000000..3ec497b4c14 --- /dev/null +++ b/soc/arm/silabs_exx32/efm32gg11b/linker.ld @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2019 Interay Solutions B.V. + * Copyright (c) 2019 Oane Kingma + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * @file + * @brief Linker command/script file + * + * This is the linker script for both standard images. + */ + +#include + +#include diff --git a/soc/arm/silabs_exx32/efm32gg11b/soc.h b/soc/arm/silabs_exx32/efm32gg11b/soc.h new file mode 100644 index 00000000000..66dbcfa1faf --- /dev/null +++ b/soc/arm/silabs_exx32/efm32gg11b/soc.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2019 Interay Solutions B.V. + * Copyright (c) 2019 Oane Kingma + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * @file + * @brief Board configuration macros for the efm32gg soc + * + */ + +#ifndef _SOC__H_ +#define _SOC__H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _ASMLANGUAGE + +#include +#include +#include + +#include "soc_pinmap.h" +#include "../common/soc_gpio.h" + +#endif /* !_ASMLANGUAGE */ + +#ifdef __cplusplus +} +#endif + +#endif /* _SOC__H_ */ diff --git a/soc/arm/silabs_exx32/efm32gg11b/soc_pinmap.h b/soc/arm/silabs_exx32/efm32gg11b/soc_pinmap.h new file mode 100644 index 00000000000..06ce6059114 --- /dev/null +++ b/soc/arm/silabs_exx32/efm32gg11b/soc_pinmap.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2019 Interay Solutions B.V. + * Copyright (c) 2019 Oane Kingma + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/** @file + * @brief Silabs EFM32GG11B MCU pin definitions. + * + * This file contains pin configuration data required by different MCU + * modules to correctly configure GPIO controller. + */ + +#ifndef _SILABS_EFM32GG11B_SOC_PINMAP_H_ +#define _SILABS_EFM32GG11B_SOC_PINMAP_H_ + +#include +#include + +#ifdef CONFIG_GPIO_GECKO +/* Serial Wire Output (SWO) */ +#if (DT_GPIO_GECKO_SWO_LOCATION == 0) +#define PIN_SWO {gpioPortF, 2, gpioModePushPull, 1} +#elif (DT_GPIO_GECKO_SWO_LOCATION == 1) +#define PIN_SWO {gpioPortC, 15, gpioModePushPull, 1} +#elif (DT_GPIO_GECKO_SWO_LOCATION == 2) +#define PIN_SWO {gpioPortD, 1, gpioModePushPull, 1} +#elif (DT_GPIO_GECKO_SWO_LOCATION == 3) +#define PIN_SWO {gpioPortD, 2, gpioModePushPull, 1} +#elif (DT_GPIO_GECKO_SWO_LOCATION >= 4) +#error ("Invalid SWO pin location") +#endif +#endif /* CONFIG_GPIO_GECKO */ + +#endif /* _SILABS_EFM32GG11B_SOC_PINMAP_H_ */ diff --git a/west.yml b/west.yml index bac7b35496d..17d4354ba2d 100644 --- a/west.yml +++ b/west.yml @@ -56,7 +56,7 @@ manifest: revision: 85302959c0c659311cf90ac51d133e5ce19c9288 path: modules/hal/microchip - name: hal_silabs - revision: 9151e614c23997074acd1096a3e8a9e5c255d5b9 + revision: ff34fe15b64f82ce7ed507cccae75877c540d9ab path: modules/hal/silabs - name: hal_st revision: fa481784b3c49780f18d50bafe00390ccb62b2ec