From 84de2d8f7b1395bba6ddd7cbda03e0301110853c Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Fri, 10 Jul 2020 10:55:50 +0200 Subject: [PATCH 1/6] cpu/saml1x: Specify CPU_FAM only in Makefile.features --- boards/saml10-xpro/Makefile.include | 1 - boards/saml11-xpro/Makefile.include | 1 - cpu/saml1x/Makefile.features | 9 ++++++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/boards/saml10-xpro/Makefile.include b/boards/saml10-xpro/Makefile.include index 6901e1f502..4a14fb0cf7 100644 --- a/boards/saml10-xpro/Makefile.include +++ b/boards/saml10-xpro/Makefile.include @@ -1,4 +1,3 @@ -CPU_FAM = saml10 CFLAGS += -D__SAML10E16A__ include $(RIOTBOARD)/common/saml1x/Makefile.include diff --git a/boards/saml11-xpro/Makefile.include b/boards/saml11-xpro/Makefile.include index 4161a45cf2..1706953598 100644 --- a/boards/saml11-xpro/Makefile.include +++ b/boards/saml11-xpro/Makefile.include @@ -1,4 +1,3 @@ -CPU_FAM = saml11 CFLAGS += -D__SAML11E16A__ include $(RIOTBOARD)/common/saml1x/Makefile.include diff --git a/cpu/saml1x/Makefile.features b/cpu/saml1x/Makefile.features index 74b904eb6e..2b005dda64 100644 --- a/cpu/saml1x/Makefile.features +++ b/cpu/saml1x/Makefile.features @@ -1,5 +1,12 @@ CPU_CORE = cortex-m23 -CPU_FAM = saml1x + +ifneq (,$(filter saml10%,$(CPU_MODEL))) + CPU_FAM = saml10 +else ifneq (,$(filter saml11%,$(CPU_MODEL))) + CPU_FAM = saml11 +else + $(error Unknown saml1x CPU Model: $(CPU_MODEL)) +endif FEATURES_PROVIDED += cortexm_mpu FEATURES_PROVIDED += periph_hwrng From 38636a80890c11e6457a39d572738d535260d6c1 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Fri, 10 Jul 2020 10:56:57 +0200 Subject: [PATCH 2/6] cpu/saml1x: Add Kconfig symbols --- cpu/saml1x/Kconfig | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/cpu/saml1x/Kconfig b/cpu/saml1x/Kconfig index 7b86fbbc19..0ca51908ba 100644 --- a/cpu/saml1x/Kconfig +++ b/cpu/saml1x/Kconfig @@ -5,4 +5,47 @@ # directory for more details. # +config CPU_COMMON_SAML1X + bool + select CPU_COMMON_SAM0 + select CPU_CORE_CORTEX_M23 + select HAS_CORTEXM_MPU + select HAS_CPU_SAML1X + select HAS_PERIPH_HWRNG + +config CPU_FAM_SAML10 + bool + select CPU_COMMON_SAML1X + +config CPU_FAM_SAML11 + bool + select CPU_COMMON_SAML1X + +## CPU Models +config CPU_MODEL_SAML10E16A + bool + select CPU_FAM_SAML10 + +config CPU_MODEL_SAML11E16A + bool + select CPU_FAM_SAML11 + +## Declaration of specific features +config HAS_CPU_SAML1X + bool + help + Indicates that a 'saml1x' cpu is being used. + +## Common CPU symbols +config CPU_FAM + default "saml10" if CPU_FAM_SAML10 + default "saml11" if CPU_FAM_SAML11 + +config CPU_MODEL + default "saml10e16a" if CPU_MODEL_SAML10E16A + default "saml11e16a" if CPU_MODEL_SAML11E16A + +config CPU + default "saml1x" if CPU_COMMON_SAML1X + source "$(RIOTCPU)/sam0_common/Kconfig" From b85ee29ea2dad6e673a9fe39c439b7702b6b539e Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Fri, 10 Jul 2020 10:57:22 +0200 Subject: [PATCH 3/6] boards/common/saml1x: Add Kconfig symbols --- boards/common/saml1x/Kconfig | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 boards/common/saml1x/Kconfig diff --git a/boards/common/saml1x/Kconfig b/boards/common/saml1x/Kconfig new file mode 100644 index 0000000000..707dcbdde8 --- /dev/null +++ b/boards/common/saml1x/Kconfig @@ -0,0 +1,17 @@ +# Copyright (c) 2020 HAW Hamburg +# +# 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 BOARD_COMMON_SAML1X + bool + select HAS_PERIPH_ADC + select HAS_PERIPH_DAC + select HAS_PERIPH_I2C + select HAS_PERIPH_RTC + select HAS_PERIPH_RTT + select HAS_PERIPH_SPI + select HAS_PERIPH_TIMER + select HAS_PERIPH_UART + select HAS_RIOTBOOT From b5d21553679e2899cd0529c93da7969237caf292 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Fri, 10 Jul 2020 10:57:39 +0200 Subject: [PATCH 4/6] boards/saml10-xpro: Add Kconfig symbols --- boards/saml10-xpro/Kconfig | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 boards/saml10-xpro/Kconfig diff --git a/boards/saml10-xpro/Kconfig b/boards/saml10-xpro/Kconfig new file mode 100644 index 0000000000..50fba7e620 --- /dev/null +++ b/boards/saml10-xpro/Kconfig @@ -0,0 +1,16 @@ +# Copyright (c) 2020 HAW Hamburg +# +# 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 BOARD + default "saml10-xpro" if BOARD_SAML10_XPRO + +config BOARD_SAML10_XPRO + bool + default y + select BOARD_COMMON_SAML1X + select CPU_MODEL_SAML10E16A + +source "$(RIOTBOARD)/common/saml1x/Kconfig" From d6c2ec7e22d98dc005f8d1031c5fd141fa0c8193 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Fri, 10 Jul 2020 10:57:56 +0200 Subject: [PATCH 5/6] boards/saml11-xpro: Add Kconfig symbols --- boards/saml11-xpro/Kconfig | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 boards/saml11-xpro/Kconfig diff --git a/boards/saml11-xpro/Kconfig b/boards/saml11-xpro/Kconfig new file mode 100644 index 0000000000..523d75598f --- /dev/null +++ b/boards/saml11-xpro/Kconfig @@ -0,0 +1,16 @@ +# Copyright (c) 2020 HAW Hamburg +# +# 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 BOARD + default "saml11-xpro" if BOARD_SAML11_XPRO + +config BOARD_SAML11_XPRO + bool + default y + select BOARD_COMMON_SAML1X + select CPU_MODEL_SAML11E16A + +source "$(RIOTBOARD)/common/saml1x/Kconfig" From c44744998e375df0764bce37daf533145d3a7f73 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Fri, 10 Jul 2020 10:58:13 +0200 Subject: [PATCH 6/6] tests/kconfig_features: Add saml1x-based boards to whitelist --- tests/kconfig_features/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/kconfig_features/Makefile b/tests/kconfig_features/Makefile index 37b910e707..c2faf221f3 100644 --- a/tests/kconfig_features/Makefile +++ b/tests/kconfig_features/Makefile @@ -135,6 +135,8 @@ BOARD_WHITELIST += 6lowpan-clicker \ remote-revb \ ruuvitag \ same54-xpro \ + saml10-xpro \ + saml11-xpro \ samr21-xpro \ slstk3401a \ slstk3402a \