ksdk: Add Makefile support for ksdk device and CPU
Translate the SOC name and part number into the ksdk device path and CPU macro respectively. This will be used by future ksdk shim drivers and by the ksdk itself. Change-Id: I40e94441ee032bfbed7df834be8000d95be53250 Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
This commit is contained in:
parent
8afe6078e1
commit
280eadffdd
3 changed files with 43 additions and 0 deletions
1
Makefile
1
Makefile
|
@ -49,6 +49,7 @@ unexport GREP_OPTIONS
|
|||
|
||||
DQUOTE = "
|
||||
#This comment line is to fix the highlighting of some editors due the quote effect."
|
||||
export DQUOTE
|
||||
|
||||
# We are using a recursive build, so we need to do a little thinking
|
||||
# to get the ordering right.
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
include $(srctree)/ext/hal/cmsis/Makefile
|
||||
|
||||
include $(srctree)/ext/hal/ksdk/Makefile
|
||||
|
||||
include $(srctree)/ext/hal/nordic/mdk/Makefile
|
||||
|
||||
include $(srctree)/ext/hal/qmsi/Makefile
|
||||
|
|
40
ext/hal/ksdk/Makefile
Normal file
40
ext/hal/ksdk/Makefile
Normal file
|
@ -0,0 +1,40 @@
|
|||
# Makefile - Kinetis SDK
|
||||
#
|
||||
# Copyright (c) 2016, Freescale Semiconductor, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
# Translate the SOC name and part number into the ksdk device and CPU name
|
||||
# respectively.
|
||||
KSDK_DEVICE = $(shell echo $(CONFIG_SOC) | tr '[:lower:]' '[:upper:]')
|
||||
KSDK_CPU = CPU_$(subst $(DQUOTE),,$(CONFIG_SOC_PART_NUMBER))
|
||||
|
||||
ifdef CONFIG_HAS_KSDK
|
||||
ZEPHYRINCLUDE += -I$(srctree)/ext/hal/ksdk/devices/$(KSDK_DEVICE)
|
||||
ZEPHYRINCLUDE += -I$(srctree)/ext/hal/ksdk/drivers
|
||||
|
||||
# The ksdk uses the CPU name to expose SOC-specific features of a given
|
||||
# peripheral. For example, the UART peripheral may be instantiated with/without
|
||||
# a hardware FIFO, and the size of that FIFO may be different for each instance
|
||||
# in a given SOC. See fsl_device_registers.h and $(KSDK_DEVICE)_features.h
|
||||
KBUILD_CFLAGS += -D$(KSDK_CPU)
|
||||
|
||||
# Soon we will add support here to build the CMSIS-CORE system configuration
|
||||
# object using the ksdk device name. For example:
|
||||
# obj-y += devices/$(KSDK_DEVICE)/system_$(KSDK_DEVICE).o
|
||||
#
|
||||
# Although it is not normal Kbuild practice, drilling down like this avoids the
|
||||
# need for repetitive Makefiles for every ksdk device.
|
||||
|
||||
endif
|
Loading…
Add table
Add a link
Reference in a new issue