cpu/kinetis: Provide features based on CPU series
Also, rename CPU_FAMILY to the standard CPU_FAM.
This commit is contained in:
parent
339e3faf21
commit
6ea04d146b
@ -11,7 +11,13 @@ DEBUG_ADAPTER ?= dap
|
||||
# For KW41Z, an OpenOCD version built from source is required. The support for
|
||||
# kw41z was introduced in
|
||||
# https://github.com/ntfreak/openocd/2c8602ed9f084d6680cec7d0ca1d5dc71c865a5f
|
||||
OPENOCD_CONFIG ?= $(RIOTBOARD)/common/frdm/dist/openocd-$(CPU_FAMILY).cfg
|
||||
ifeq ($(CPU_CORE), cortex-m0plus)
|
||||
OPENOCD_KINETIS_FAMILY = klx
|
||||
else
|
||||
OPENOCD_KINETIS_FAMILY = kx
|
||||
endif
|
||||
|
||||
OPENOCD_CONFIG ?= $(RIOTBOARD)/common/frdm/dist/openocd-$(OPENOCD_KINETIS_FAMILY).cfg
|
||||
|
||||
# Check the flash configuration field before flashing
|
||||
PRE_FLASH_CHECK_SCRIPT = $(RIOTCPU)/$(CPU)/dist/check-fcfield.sh
|
||||
|
||||
@ -13,22 +13,19 @@ endif
|
||||
FEATURES_PROVIDED += periph_gpio
|
||||
FEATURES_PROVIDED += periph_gpio_irq
|
||||
|
||||
# This applies to all Kinetis EA series, for now this is only s9keaz128aclh48
|
||||
ifeq (s9keaz128aclh48,$(CPU_MODEL))
|
||||
# Parse parameters from CPU_MODEL using the kinetis-info.mk script in the same
|
||||
# directory as this Makefile.
|
||||
include $(LAST_MAKEFILEDIR)/kinetis-info.mk
|
||||
|
||||
ifneq (,$(filter k w,$(CPU_FAM)))
|
||||
FEATURES_PROVIDED += periph_flashpage
|
||||
FEATURES_PROVIDED += periph_flashpage_raw
|
||||
endif
|
||||
|
||||
ifeq (ea,$(CPU_FAM))
|
||||
FEATURES_PROVIDED += periph_ics
|
||||
else
|
||||
FEATURES_PROVIDED += periph_mcg
|
||||
endif
|
||||
|
||||
# Since KINETIS_SERIES isn't available in Makefile.features filter according to
|
||||
# CPU_MODEL
|
||||
ifneq (,$(filter mkw% mk%,$(CPU_MODEL)))
|
||||
FEATURES_PROVIDED += periph_flashpage
|
||||
FEATURES_PROVIDED += periph_flashpage_raw
|
||||
endif
|
||||
|
||||
# Parse parameters from CPU_MODEL using the kinetis-info.mk script in the same
|
||||
# directory as this Makefile.
|
||||
include $(LAST_MAKEFILEDIR)/kinetis-info.mk
|
||||
|
||||
include $(RIOTCPU)/cortexm_common/Makefile.features
|
||||
|
||||
@ -32,18 +32,18 @@ export KINETIS_SPEED := $(word 11, $(KINETIS_INFO))
|
||||
ifeq ($(KINETIS_CORE), Z)
|
||||
# Cortex-M0+
|
||||
CPU_CORE = cortex-m0plus
|
||||
CPU_FAMILY = klx
|
||||
else ifeq ($(KINETIS_CORE), D)
|
||||
# Cortex-M4
|
||||
CPU_CORE = cortex-m4
|
||||
CPU_FAMILY = kx
|
||||
else ifeq ($(KINETIS_CORE), F)
|
||||
# Cortex-M4F or Cortex-M7
|
||||
# TODO: Add floating point support
|
||||
CPU_CORE = cortex-m4
|
||||
CPU_FAMILY = kx
|
||||
endif
|
||||
|
||||
# For the rest of the build system we expose the series as family
|
||||
CPU_FAM = $(call lowercase,$(KINETIS_SERIES))
|
||||
|
||||
# RAM sizes are a bit arbitrary, but are usually dependent on ROM size and core speed.
|
||||
# KINETIS_RAMSIZE is used inside a $(( )) shell arithmetic block, so it is OK to
|
||||
# use mathematical expressions here.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user