Skip to content

Commit

Permalink
Merge pull request #18739 from jue89/feature/pkg-gecko_sdk_41
Browse files Browse the repository at this point in the history
pkg/gecko_sdk: Bump to version 4.1.2
  • Loading branch information
maribu authored Oct 15, 2022
2 parents 485dcbd + f3d1773 commit c58817f
Show file tree
Hide file tree
Showing 16 changed files with 84 additions and 6 deletions.
6 changes: 6 additions & 0 deletions cpu/efm32/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ include $(RIOTCPU)/efm32/efm32-features.mk

CPU_CORE = $(EFM32_ARCHITECTURE)

# allow CPU families to add features individually
-include $(RIOTCPU)/efm32/families/$(CPU_FAM)/Makefile.features

# families without MPU
ifeq (,$(filter efm32zg efm32hg, $(CPU_FAM)))
FEATURES_PROVIDED += cortexm_mpu
Expand All @@ -22,6 +25,9 @@ FEATURES_PROVIDED += periph_wdt
FEATURES_CONFLICT += periph_rtc:periph_rtt
FEATURES_CONFLICT_MSG += "On the EFM32, the RTC and RTT map to the same hardware peripheral."

FEATURES_CONFLICT += cortexm_fpu:gecko_sdk_librail_nonfpu
FEATURES_CONFLICT_MSG += "Using librail with the FPU enabled is not supported on this CPU."

ifeq (1,$(EFM32_TRNG))
FEATURES_PROVIDED += periph_hwrng
endif
Expand Down
3 changes: 3 additions & 0 deletions cpu/efm32/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ include $(RIOTCPU)/efm32/efm32-info.mk
# `cpu_$(CPU_FAM)` for something that is MODULE related.
include $(RIOTCPU)/efm32/families/$(CPU_FAM)/Makefile.include

# Export vars for Gecko SDK librail Makefile
export EFM32_LIBRAIL_BLOB_NAME

ifeq (,$(EFM32_HEADER))
$(error Header file for $(CPU_MODEL) is missing)
endif
Expand Down
1 change: 1 addition & 0 deletions cpu/efm32/families/efr32mg12p/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ config CPU_FAM_EFR32MG12P
select CPU_EFM32_SERIES1
select HAS_PERIPH_HWRNG
select HAS_CORTEXM_MPU
select HAS_GECKO_SDK_LIBRAIL_NONFPU

config MODULE_CPU_EFR32MG12P
bool
Expand Down
1 change: 1 addition & 0 deletions cpu/efm32/families/efr32mg12p/Makefile.features
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FEATURES_PROVIDED += gecko_sdk_librail_nonfpu
7 changes: 6 additions & 1 deletion cpu/efm32/families/efr32mg12p/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@
# as easy as adding the header file only.
EFM32_HEADER = $(wildcard $(RIOTCPU)/efm32/families/efr32mg12p/include/vendor/$(CPU_MODEL).h)

# Names of librail related files
EFM32_LIBRAIL_BLOB_NAME = efr32xg12
EFM32_LIBRAIL_HEADER_NAME = efr32xg1x
EFM32_LIBRAIL_PA_HEADER_NAME = efr32xg1x

# include vendor device headers
INCLUDES += -I$(RIOTCPU)/efm32/families/efr32mg12p/include/vendor
INCLUDES += -I$(RIOTCPU)/efm32/families/efr32mg12p/include/vendor
1 change: 1 addition & 0 deletions cpu/efm32/families/efr32mg1b/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ config CPU_FAM_EFR32MG1B
select CPU_COMMON_EFM32
select CPU_EFM32_SERIES1
select HAS_CORTEXM_MPU
select HAS_GECKO_SDK_LIBRAIL_NONFPU

config MODULE_CPU_EFR32MG1B
bool
Expand Down
1 change: 1 addition & 0 deletions cpu/efm32/families/efr32mg1b/Makefile.features
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FEATURES_PROVIDED += gecko_sdk_librail_nonfpu
7 changes: 6 additions & 1 deletion cpu/efm32/families/efr32mg1b/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@
# as easy as adding the header file only.
EFM32_HEADER = $(wildcard $(RIOTCPU)/efm32/families/efr32mg1b/include/vendor/$(CPU_MODEL).h)

# Names of librail related files
EFM32_LIBRAIL_BLOB_NAME = efr32xg1
EFM32_LIBRAIL_HEADER_NAME = efr32xg1x
EFM32_LIBRAIL_PA_HEADER_NAME = efr32xg1x

# include vendor device headers
INCLUDES += -I$(RIOTCPU)/efm32/families/efr32mg1b/include/vendor
INCLUDES += -I$(RIOTCPU)/efm32/families/efr32mg1b/include/vendor
1 change: 1 addition & 0 deletions cpu/efm32/families/efr32mg1p/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ config CPU_FAM_EFR32MG1P
select CPU_COMMON_EFM32
select CPU_EFM32_SERIES1
select HAS_CORTEXM_MPU
select HAS_GECKO_SDK_LIBRAIL_NONFPU

config MODULE_CPU_EFR32MG1P
bool
Expand Down
1 change: 1 addition & 0 deletions cpu/efm32/families/efr32mg1p/Makefile.features
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FEATURES_PROVIDED += gecko_sdk_librail_nonfpu
5 changes: 5 additions & 0 deletions cpu/efm32/families/efr32mg1p/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@
# as easy as adding the header file only.
EFM32_HEADER = $(wildcard $(RIOTCPU)/efm32/families/efr32mg1p/include/vendor/$(CPU_MODEL).h)

# Names of librail related files
EFM32_LIBRAIL_BLOB_NAME = efr32xg1
EFM32_LIBRAIL_HEADER_NAME = efr32xg1x
EFM32_LIBRAIL_PA_HEADER_NAME = efr32xg1x

# include vendor device headers
INCLUDES += -I$(RIOTCPU)/efm32/families/efr32mg1p/include/vendor
4 changes: 2 additions & 2 deletions cpu/efm32/periph/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ int gpio_init_int(gpio_t pin, gpio_mode_t mode, gpio_flank_t flank,
isr_ctx[_pin_num(pin)].arg = arg;

/* enable interrupts */
GPIO_IntConfig(_port_num(pin), _pin_num(pin),
flank & GPIO_RISING, flank & GPIO_FALLING, true);
GPIO_ExtIntConfig(_port_num(pin), _pin_num(pin), _pin_num(pin),
flank & GPIO_RISING, flank & GPIO_FALLING, true);

NVIC_ClearPendingIRQ(GPIO_EVEN_IRQn);
NVIC_ClearPendingIRQ(GPIO_ODD_IRQn);
Expand Down
34 changes: 33 additions & 1 deletion pkg/gecko_sdk/Kconfig
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
# Copyright (c) 2021 HAW Hamburg
# 2022 SSV Software Systems GmbH
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
#

config PACKAGE_GECKO_SDK
## Definition of Gecko SDK specific features
config HAS_GECKO_SDK_LIBRAIL_NONFPU
bool
help
Indicates that the CPU offers librail support if the FPU is disabled.
Librail is shipped as pre-compiled blobs. Thus, we have to adapt to
their choice how to process floats.

config HAS_GECKO_SDK_LIBRAIL_FPU
bool
help
Indicates that the CPU offers librail support if the FPU is enabled.
Librail is shipped as pre-compiled blobs. Thus, we have to adapt to
their choice how to process floats.


## Provided modules
menuconfig PACKAGE_GECKO_SDK
bool "Vendor library for EFM/EFR/EZR32 MCUs"
depends on TEST_KCONFIG
help
Expand All @@ -27,4 +45,18 @@ config MODULE_GECKO_SDK_EMLIB_EXTRA
help
Extra utility methods from EMBLIB vendor library.

config MODULE_GECKO_SDK_LIBRAIL
bool "Radio Abstraction Interface Layer (RAIL)"
depends on (HAS_GECKO_SDK_LIBRAIL_NONFPU && !MODULE_CORTEXM_FPU) || (HAS_GECKO_SDK_LIBRAIL_FPU && MODULE_CORTEXM_FPU)
help
The Silicon Labs Radio Abstraction Interface Layer (RAIL) is required
to use the integrated radio offered by the EFR32 families.

config MODULE_GECKO_SDK_LIBRAIL_PA
bool "Power Amplifier Power Conversion Functions"
depends on MODULE_GECKO_SDK_LIBRAIL
help
Helper to convert between transmission power in dBm and the
chip- and circuit-specific raw power level.

endif # PACKAGE_GECKO_SDK
2 changes: 1 addition & 1 deletion pkg/gecko_sdk/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PKG_NAME=gecko_sdk
PKG_URL=https://github.com/basilfx/RIOT-gecko-sdk
PKG_VERSION=e291e7e0bb56d3f51f03ef7c0b8af138a8d1301a
PKG_VERSION=944639a57adce84fb110fe89e54f50e161607918
PKG_LICENSE=Zlib

include $(RIOTBASE)/pkg/pkg.mk
Expand Down
4 changes: 4 additions & 0 deletions pkg/gecko_sdk/Makefile.dep
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
USEMODULE += gecko_sdk_emlib
USEMODULE += gecko_sdk_emlib_extra

ifneq (,$(filter gecko_sdk_librail_pa,$(USEMODULE)))
USEMODULE += gecko_sdk_librail
endif
12 changes: 12 additions & 0 deletions pkg/gecko_sdk/Makefile.include
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
INCLUDES += -I$(PKGDIRBASE)/gecko_sdk/dist/common/inc
INCLUDES += -I$(PKGDIRBASE)/gecko_sdk/dist/emlib/inc
INCLUDES += -I$(PKGDIRBASE)/gecko_sdk/dist/emlib-extra/inc

ifneq (,$(filter gecko_sdk_librail,$(USEMODULE)))
ARCHIVES += $(BINDIR)/gecko_sdk_librail.a
INCLUDES += -I$(PKGDIRBASE)/gecko_sdk/dist/radio/rail_lib/common
INCLUDES += -I$(PKGDIRBASE)/gecko_sdk/dist/radio/rail_lib/chip/efr32/$(EFM32_LIBRAIL_HEADER_NAME)
endif

ifneq (,$(filter gecko_sdk_librail_pa,$(USEMODULE)))
INCLUDES += -I$(PKGDIRBASE)/gecko_sdk/dist/radio/rail_lib/plugin/pa-conversions
INCLUDES += -I$(PKGDIRBASE)/gecko_sdk/dist/radio/rail_lib/plugin/pa-conversions/$(EFM32_LIBRAIL_PA_HEADER_NAME)/config
endif

0 comments on commit c58817f

Please sign in to comment.