Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boards/saml1x-based: Model features in Kconfig #14485

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions boards/common/saml1x/Kconfig
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions boards/saml10-xpro/Kconfig
Original file line number Diff line number Diff line change
@@ -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"
1 change: 0 additions & 1 deletion boards/saml10-xpro/Makefile.include
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
CPU_FAM = saml10
CFLAGS += -D__SAML10E16A__

include $(RIOTBOARD)/common/saml1x/Makefile.include
16 changes: 16 additions & 0 deletions boards/saml11-xpro/Kconfig
Original file line number Diff line number Diff line change
@@ -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"
1 change: 0 additions & 1 deletion boards/saml11-xpro/Makefile.include
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
CPU_FAM = saml11
CFLAGS += -D__SAML11E16A__

include $(RIOTBOARD)/common/saml1x/Makefile.include
43 changes: 43 additions & 0 deletions cpu/saml1x/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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"
9 changes: 8 additions & 1 deletion cpu/saml1x/Makefile.features
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions tests/kconfig_features/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ BOARD_WHITELIST += 6lowpan-clicker \
remote-revb \
ruuvitag \
same54-xpro \
saml10-xpro \
saml11-xpro \
samr21-xpro \
slstk3401a \
slstk3402a \
Expand Down