summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorMaureen Helm <maureen.helm@nxp.com>2016-06-11 09:33:31 -0500
committerMaureen Helm <maureen.helm@nxp.com>2016-06-20 17:38:47 +0000
commit280eadffdd4d7bbb3ce24752cb4b5e9a10f4ab5c (patch)
treea3a0a0252b7a3ca249eb5890ab60502807181896 /ext
parent8afe6078e1f594a6dcd36896e86769ece346c83e (diff)
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>
Diffstat (limited to 'ext')
-rw-r--r--ext/hal/Makefile2
-rw-r--r--ext/hal/ksdk/Makefile40
2 files changed, 42 insertions, 0 deletions
diff --git a/ext/hal/Makefile b/ext/hal/Makefile
index 8b366f4df..bab61d7a8 100644
--- a/ext/hal/Makefile
+++ b/ext/hal/Makefile
@@ -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
diff --git a/ext/hal/ksdk/Makefile b/ext/hal/ksdk/Makefile
new file mode 100644
index 000000000..239f952bd
--- /dev/null
+++ b/ext/hal/ksdk/Makefile
@@ -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