diff --git a/cpu/arm7_common/Kconfig b/cpu/arm7_common/Kconfig index 8d2959b5bf..edc4337c63 100644 --- a/cpu/arm7_common/Kconfig +++ b/cpu/arm7_common/Kconfig @@ -23,6 +23,7 @@ config CPU_CORE_ARM7TDMI_S ## Declaration of specific features config HAS_ARCH_ARM7 bool + select HAS_PICOLIBC help Indicates that the core is part of the ARM7 group of cores. diff --git a/cpu/arm7_common/Makefile.dep b/cpu/arm7_common/Makefile.dep index 2d3962bb58..fabfff3190 100644 --- a/cpu/arm7_common/Makefile.dep +++ b/cpu/arm7_common/Makefile.dep @@ -1,7 +1,7 @@ # use common ARM7 periph code USEMODULE += arm7_common_periph -ifeq (1,$(PICOLIBC)) +ifneq (,$(filter picolibc,$(FEATURES_USED))) # Use Picolibc when explicitly selected USEMODULE += picolibc else diff --git a/cpu/arm7_common/Makefile.features b/cpu/arm7_common/Makefile.features index f382f9a5d8..b4681a50cd 100644 --- a/cpu/arm7_common/Makefile.features +++ b/cpu/arm7_common/Makefile.features @@ -7,5 +7,6 @@ FEATURES_PROVIDED += arch_arm7 FEATURES_PROVIDED += cpp FEATURES_PROVIDED += libstdcpp FEATURES_PROVIDED += periph_pm +FEATURES_PROVIDED += picolibc FEATURES_PROVIDED += puf_sram FEATURES_PROVIDED += ssp diff --git a/cpu/cortexm_common/Kconfig b/cpu/cortexm_common/Kconfig index 13a67d2caa..ab3db98e04 100644 --- a/cpu/cortexm_common/Kconfig +++ b/cpu/cortexm_common/Kconfig @@ -39,6 +39,7 @@ config CPU_CORE_CORTEX_M select HAS_CPU_CORE_CORTEXM select HAS_PERIPH_PM select HAS_PUF_SRAM + select HAS_PICOLIBC select HAS_CPP select HAS_LIBSTDCPP select HAS_CPU_CHECK_ADDRESS diff --git a/cpu/cortexm_common/Makefile.dep b/cpu/cortexm_common/Makefile.dep index edc2835da9..d2b74c516f 100644 --- a/cpu/cortexm_common/Makefile.dep +++ b/cpu/cortexm_common/Makefile.dep @@ -4,7 +4,7 @@ USEMODULE += cortexm_common # include common periph code USEMODULE += cortexm_common_periph -ifeq (1,$(PICOLIBC)) +ifneq (,$(filter picolibc,$(FEATURES_USED))) # Use Picolibc when explicitly selected USEMODULE += picolibc else diff --git a/cpu/cortexm_common/Makefile.features b/cpu/cortexm_common/Makefile.features index 7527c079d0..4c5e44fb26 100644 --- a/cpu/cortexm_common/Makefile.features +++ b/cpu/cortexm_common/Makefile.features @@ -7,6 +7,7 @@ FEATURES_PROVIDED += cpu_core_cortexm FEATURES_PROVIDED += libstdcpp FEATURES_PROVIDED += periph_pm FEATURES_PROVIDED += puf_sram +FEATURES_PROVIDED += picolibc FEATURES_PROVIDED += ssp # cortex-m4f and cortex-m7 provide FPU support diff --git a/cpu/fe310/Kconfig b/cpu/fe310/Kconfig index bdadfff1b5..1dc1554eac 100644 --- a/cpu/fe310/Kconfig +++ b/cpu/fe310/Kconfig @@ -8,6 +8,7 @@ config CPU_ARCH_RISCV bool select HAS_ARCH_RISCV + select HAS_PICOLIBC config CPU_CORE_RV32M bool diff --git a/cpu/fe310/Makefile.dep b/cpu/fe310/Makefile.dep index ff4abe1366..99efb3df64 100644 --- a/cpu/fe310/Makefile.dep +++ b/cpu/fe310/Makefile.dep @@ -1,4 +1,4 @@ -ifeq (1,$(PICOLIBC)) +ifneq (,$(filter picolibc,$(FEATURES_USED))) USEMODULE += picolibc else USEMODULE += newlib_nano diff --git a/cpu/fe310/Makefile.features b/cpu/fe310/Makefile.features index 9f46d6ce83..b60d9bd97e 100644 --- a/cpu/fe310/Makefile.features +++ b/cpu/fe310/Makefile.features @@ -7,4 +7,5 @@ FEATURES_PROVIDED += periph_gpio periph_gpio_irq FEATURES_PROVIDED += periph_plic FEATURES_PROVIDED += periph_pm FEATURES_PROVIDED += periph_wdt +FEATURES_PROVIDED += picolibc FEATURES_PROVIDED += ssp diff --git a/kconfigs/Kconfig.features b/kconfigs/Kconfig.features index 057ee85e2d..120d0fe58c 100644 --- a/kconfigs/Kconfig.features +++ b/kconfigs/Kconfig.features @@ -288,6 +288,11 @@ config HAS_PERIPH_WDT_CB help Indicates that the WDT peripheral allows setting a callback. +config HAS_PICOLIBC + bool + help + Indicates that the picolibc C library is available for the platform. + config HAS_PUF_SRAM bool help