diff --git a/boards/frdm-common/Makefile.include b/boards/frdm-common/Makefile.include index b88c3a260e6fe0d7c7988ab03baaf19dfe3f4e36..b88ed26267fce7010d6b5fe5c141dd52c2b1fa09 100644 --- a/boards/frdm-common/Makefile.include +++ b/boards/frdm-common/Makefile.include @@ -19,12 +19,12 @@ ifeq (1,$(USE_OLD_OPENOCD)) # wdog-disable.bin is a precompiled binary which will disable the watchdog and # return control to the debugger (OpenOCD) export OPENOCD_PRE_VERIFY_CMDS += \ - -c 'load_image $(RIOTCPU)/kinetis_common/dist/wdog-disable.bin 0x20000000 bin' \ + -c 'load_image $(RIOTCPU)/$(CPU)/dist/wdog-disable.bin 0x20000000 bin' \ -c 'resume 0x20000000' export OPENOCD_EXTRA_INIT .PHONY: flash -flash: $(RIOTCPU)/kinetis_common/dist/wdog-disable.bin +flash: $(RIOTCPU)/$(CPU)/dist/wdog-disable.bin # Reset the default goal. .DEFAULT_GOAL := @@ -36,7 +36,7 @@ endif export OPENOCD_CONFIG ?= $(RIOTBOARD)/frdm-common/dist/openocd-$(FRDM_IFACE)-$(CPU_FAMILY).cfg # Check the flash configuration field before flashing -export PRE_FLASH_CHECK_SCRIPT = $(RIOTCPU)/kinetis_common/dist/check-fcfield-elf.sh +export PRE_FLASH_CHECK_SCRIPT = $(RIOTCPU)/$(CPU)/dist/check-fcfield-elf.sh # setup serial terminal include $(RIOTMAKE)/tools/serial.inc.mk diff --git a/boards/frdm-k22f/Makefile.dep b/boards/frdm-k22f/Makefile.dep index 6ff51fd647fe18137b8bcf268a2d2adc4882af49..a73981801a5eee89e5b935091142213aa29098ae 100644 --- a/boards/frdm-k22f/Makefile.dep +++ b/boards/frdm-k22f/Makefile.dep @@ -3,4 +3,4 @@ ifneq (,$(filter saul_default,$(USEMODULE))) USEMODULE += saul_adc endif --include $(RIOTCPU)/k22f/Makefile.dep +include $(RIOTCPU)/kinetis/Makefile.dep diff --git a/boards/frdm-k22f/Makefile.features b/boards/frdm-k22f/Makefile.features index b9d64e4911db170509f03cc846c6046961baddd1..6a5f7c94c3ae586af53927abea666774b2d0320d 100644 --- a/boards/frdm-k22f/Makefile.features +++ b/boards/frdm-k22f/Makefile.features @@ -1,6 +1,5 @@ # Put defined MCU peripherals here (in alphabetical order) FEATURES_PROVIDED += periph_adc -FEATURES_PROVIDED += periph_gpio FEATURES_PROVIDED += periph_i2c FEATURES_PROVIDED += periph_pwm FEATURES_PROVIDED += periph_rtc @@ -12,4 +11,4 @@ FEATURES_PROVIDED += periph_uart # The board MPU family (used for grouping by the CI system) FEATURES_MCU_GROUP = cortex_m4_1 --include $(RIOTCPU)/k22f/Makefile.features +include $(RIOTCPU)/kinetis/Makefile.features diff --git a/boards/frdm-k22f/Makefile.include b/boards/frdm-k22f/Makefile.include index 5251374c9279a2373a343c5cb6cbf89cac3c26b1..d6d6feec03cdec61f4eceb5a8bae21a2e403b0fb 100644 --- a/boards/frdm-k22f/Makefile.include +++ b/boards/frdm-k22f/Makefile.include @@ -1,5 +1,5 @@ # define the cpu used by the board -export CPU = k22f +export CPU = kinetis export CPU_MODEL = mk22fn512vlh12 # Include default FRDM board config diff --git a/boards/frdm-k22f/include/periph_conf.h b/boards/frdm-k22f/include/periph_conf.h index ea8e753bfa3e0d5b142a79ebf87c4b6f6df69103..937399c37767ac4b294d957883112531c8c5d22e 100644 --- a/boards/frdm-k22f/include/periph_conf.h +++ b/boards/frdm-k22f/include/periph_conf.h @@ -161,7 +161,7 @@ static const pwm_conf_t pwm_config[] = { * Clock configuration values based on the configured 48Mhz module clock. * * Auto-generated by: - * cpu/kinetis_common/dist/calc_spi_scalers/calc_spi_scalers.c + * cpu/kinetis/dist/calc_spi_scalers/calc_spi_scalers.c * * @{ */ diff --git a/boards/frdm-k64f/Makefile.dep b/boards/frdm-k64f/Makefile.dep index 45e7479a382fa6bba2d389d3da06e545883e8cd1..98782c48fb8dbd934945a727ab081f5d2694689a 100644 --- a/boards/frdm-k64f/Makefile.dep +++ b/boards/frdm-k64f/Makefile.dep @@ -1 +1 @@ --include $(RIOTCPU)/k64f/Makefile.dep +include $(RIOTCPU)/kinetis/Makefile.dep diff --git a/boards/frdm-k64f/Makefile.features b/boards/frdm-k64f/Makefile.features index 0c12be814eaf472fa616c3986ef67919b25ac1ba..6a5f7c94c3ae586af53927abea666774b2d0320d 100644 --- a/boards/frdm-k64f/Makefile.features +++ b/boards/frdm-k64f/Makefile.features @@ -1,6 +1,5 @@ # Put defined MCU peripherals here (in alphabetical order) FEATURES_PROVIDED += periph_adc -FEATURES_PROVIDED += periph_gpio FEATURES_PROVIDED += periph_i2c FEATURES_PROVIDED += periph_pwm FEATURES_PROVIDED += periph_rtc @@ -12,4 +11,4 @@ FEATURES_PROVIDED += periph_uart # The board MPU family (used for grouping by the CI system) FEATURES_MCU_GROUP = cortex_m4_1 --include $(RIOTCPU)/k64f/Makefile.features +include $(RIOTCPU)/kinetis/Makefile.features diff --git a/boards/frdm-k64f/Makefile.include b/boards/frdm-k64f/Makefile.include index 4747c0d79136cb5a2bb4a3b3d710e5f2b4acb376..0599e132bd9a82228708b7e235a963287cf96bd4 100644 --- a/boards/frdm-k64f/Makefile.include +++ b/boards/frdm-k64f/Makefile.include @@ -1,5 +1,5 @@ # define the cpu used by the FRDM-K64F board -export CPU = k64f +export CPU = kinetis export CPU_MODEL = mk64fn1m0vll12 # Include default FRDM board config diff --git a/boards/frdm-k64f/include/periph_conf.h b/boards/frdm-k64f/include/periph_conf.h index ba79176c59f7e4b7cf50296fbc88cf637c009b70..f99f67e4f459b791066c82606d74e3b1b288d44a 100644 --- a/boards/frdm-k64f/include/periph_conf.h +++ b/boards/frdm-k64f/include/periph_conf.h @@ -156,7 +156,7 @@ static const pwm_conf_t pwm_config[] = { * Clock configuration values based on the configured 30Mhz module clock. * * Auto-generated by: - * cpu/kinetis_common/dist/calc_spi_scalers/calc_spi_scalers.c + * cpu/kinetis/dist/calc_spi_scalers/calc_spi_scalers.c * * @{ */ diff --git a/boards/mulle/Makefile.dep b/boards/mulle/Makefile.dep index fe3cb539a2aaec903f9cf3b8900f82454e420090..f6ca7bf86ec4d9e8b7783200dc773a79acac7181 100644 --- a/boards/mulle/Makefile.dep +++ b/boards/mulle/Makefile.dep @@ -12,10 +12,12 @@ USEMODULE += nvram USEMODULE += devfs USEMODULE += mtd_spi_nor -# mulle always uses it's rtt +# mulle always uses the rtt for the oscillator USEMODULE += periph_rtt ifneq (,$(filter saul_default,$(USEMODULE))) USEMODULE += saul_gpio USEMODULE += saul_adc endif + +include $(RIOTCPU)/kinetis/Makefile.dep diff --git a/boards/mulle/Makefile.features b/boards/mulle/Makefile.features index 519a78a3f43ddc0aaf5567548a9a38cac6d801bf..83519b33a04a3dbe4396150788c59d51fff86edd 100644 --- a/boards/mulle/Makefile.features +++ b/boards/mulle/Makefile.features @@ -1,7 +1,6 @@ # Put defined MCU peripherals here (in alphabetical order) FEATURES_PROVIDED += periph_adc FEATURES_PROVIDED += periph_dac -FEATURES_PROVIDED += periph_gpio FEATURES_PROVIDED += periph_i2c FEATURES_PROVIDED += periph_pwm FEATURES_PROVIDED += periph_rtc @@ -13,4 +12,4 @@ FEATURES_PROVIDED += periph_uart # The board MPU family (used for grouping by the CI system) FEATURES_MCU_GROUP = cortex_m4_2 --include $(RIOTCPU)/k60/Makefile.features +include $(RIOTCPU)/kinetis/Makefile.features diff --git a/boards/mulle/Makefile.include b/boards/mulle/Makefile.include index fa6f4baa7a605eaad32c41be4ef0e9be74091fa6..620be56ca0fca6d9f7155b70b4589b7cfba83edb 100644 --- a/boards/mulle/Makefile.include +++ b/boards/mulle/Makefile.include @@ -1,5 +1,5 @@ # define the cpu used by the Mulle board -export CPU = k60 +export CPU = kinetis # Default GDB port export GDBPORT ?= 3333 @@ -84,13 +84,13 @@ endif # wdog-disable.bin is a precompiled binary which will disable the watchdog and # return control to the debugger (OpenOCD) export OPENOCD_PRE_VERIFY_CMDS += \ - -c 'load_image $(RIOTCPU)/kinetis_common/dist/wdog-disable.bin 0x20000000 bin' \ + -c 'load_image $(RIOTCPU)/$(CPU)/dist/wdog-disable.bin 0x20000000 bin' \ -c 'resume 0x20000000' export OPENOCD_EXTRA_INIT -export PRE_FLASH_CHECK_SCRIPT = $(RIOTCPU)/kinetis_common/dist/check-fcfield-elf.sh +export PRE_FLASH_CHECK_SCRIPT = $(RIOTCPU)/$(CPU)/dist/check-fcfield-elf.sh .PHONY: flash -flash: $(RIOTCPU)/kinetis_common/dist/wdog-disable.bin +flash: $(RIOTCPU)/$(CPU)/dist/wdog-disable.bin # Reset the default goal. .DEFAULT_GOAL := diff --git a/boards/mulle/include/periph_conf.h b/boards/mulle/include/periph_conf.h index 8be821e34390198527a0756414423b1683c5ddc0..d9a3dd0c45d1f8e1d079ad5c4eeb0acbda504527 100644 --- a/boards/mulle/include/periph_conf.h +++ b/boards/mulle/include/periph_conf.h @@ -238,7 +238,7 @@ static const pwm_conf_t pwm_config[] = { * Clock configuration values based on the configured 47988736Hz module clock. * * Auto-generated by: - * cpu/kinetis_common/dist/calc_spi_scalers/calc_spi_scalers.c + * cpu/kinetis/dist/calc_spi_scalers/calc_spi_scalers.c * * @{ */ diff --git a/boards/pba-d-01-kw2x/Makefile.dep b/boards/pba-d-01-kw2x/Makefile.dep index 28cd67a5dcf4ce5c5ad6b81d324de7352e0d1fb6..d35a2e11ea2e69f5805590a067212386ab985a3c 100644 --- a/boards/pba-d-01-kw2x/Makefile.dep +++ b/boards/pba-d-01-kw2x/Makefile.dep @@ -12,4 +12,4 @@ ifneq (,$(filter saul_default,$(USEMODULE))) USEMODULE += tmp006 endif --include $(RIOTCPU)/kw2xd/Makefile.dep +include $(RIOTCPU)/kinetis/Makefile.dep diff --git a/boards/pba-d-01-kw2x/Makefile.features b/boards/pba-d-01-kw2x/Makefile.features index 51ba5500b99834983477cab8b87117615ac4e35d..ee69accdd4d9f3b5843dd5dc68f5efc470e6d37f 100644 --- a/boards/pba-d-01-kw2x/Makefile.features +++ b/boards/pba-d-01-kw2x/Makefile.features @@ -1,6 +1,5 @@ # Put defined MCU peripherals here (in alphabetical order) FEATURES_PROVIDED += periph_adc -FEATURES_PROVIDED += periph_gpio FEATURES_PROVIDED += periph_i2c FEATURES_PROVIDED += periph_pwm FEATURES_PROVIDED += periph_rtc @@ -12,4 +11,4 @@ FEATURES_PROVIDED += periph_uart # The board MPU family (used for grouping by the CI system) FEATURES_MCU_GROUP = cortex_m4_3 --include $(RIOTCPU)/kw2xd/Makefile.features +include $(RIOTCPU)/kinetis/Makefile.features diff --git a/boards/pba-d-01-kw2x/Makefile.include b/boards/pba-d-01-kw2x/Makefile.include index 7d9871dd4d35a5f89696bd28756dc5b199a409f6..84b620e03d0616bf62c6aab7e72c1000e2aa021e 100644 --- a/boards/pba-d-01-kw2x/Makefile.include +++ b/boards/pba-d-01-kw2x/Makefile.include @@ -1,10 +1,10 @@ # define the cpu used by the phyWAVE-KW22 board -export CPU = kw2xd +export CPU = kinetis # the pba-d-01-kw2x board can embed either a kw21d256, kw21d512 or kw22d512 cpu. # The default set up is kw21d256, the variable is overrideable to use the other # cpu if needed. -export CPU_MODEL ?= kw21d256 +export CPU_MODEL ?= mkw21d256vha5 export MCPU = cortex-m4 @@ -13,7 +13,7 @@ PORT_LINUX ?= /dev/ttyACM0 PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) .PHONY: flash -flash: $(RIOTCPU)/kinetis_common/dist/wdog-disable.bin +flash: $(RIOTCPU)/$(CPU)/dist/wdog-disable.bin # Reset the default goal. .DEFAULT_GOAL := @@ -23,10 +23,10 @@ flash: $(RIOTCPU)/kinetis_common/dist/wdog-disable.bin # wdog-disable.bin is a precompiled binary which will disable the watchdog and # return control to the debugger (OpenOCD) export OPENOCD_PRE_VERIFY_CMDS += \ - -c 'load_image $(RIOTCPU)/kinetis_common/dist/wdog-disable.bin 0x20000000 bin' \ + -c 'load_image $(RIOTCPU)/$(CPU)/dist/wdog-disable.bin 0x20000000 bin' \ -c 'resume 0x20000000' export OPENOCD_EXTRA_INIT -export PRE_FLASH_CHECK_SCRIPT = $(RIOTCPU)/kinetis_common/dist/check-fcfield-elf.sh +export PRE_FLASH_CHECK_SCRIPT = $(RIOTCPU)/$(CPU)/dist/check-fcfield-elf.sh # Add board selector (USB serial) to OpenOCD options if specified. # Use /dist/tools/usb-serial/list-ttys.sh to find out serial number. diff --git a/boards/pba-d-01-kw2x/include/periph_conf.h b/boards/pba-d-01-kw2x/include/periph_conf.h index 25ea7dbdb1f234d90f53c7a40359f8dbc1d557ef..1e11edfe906adfb7174825518bb32afa026799f2 100644 --- a/boards/pba-d-01-kw2x/include/periph_conf.h +++ b/boards/pba-d-01-kw2x/include/periph_conf.h @@ -171,7 +171,7 @@ static const pwm_conf_t pwm_config[] = { * Clock configuration values based on the configured 48Mhz module clock. * * Auto-generated by: - * cpu/kinetis_common/dist/calc_spi_scalers/calc_spi_scalers.c + * cpu/kinetis/dist/calc_spi_scalers/calc_spi_scalers.c * * @{ */ diff --git a/cpu/k22f/Makefile b/cpu/k22f/Makefile deleted file mode 100644 index 4e53b72929a07013e564b710b65e06d318086ea6..0000000000000000000000000000000000000000 --- a/cpu/k22f/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# define the module that is build -MODULE = cpu - -# add a list of subdirectories that should also be built -DIRS = periph $(RIOTCPU)/cortexm_common $(KINETIS_COMMON) - -include $(RIOTBASE)/Makefile.base diff --git a/cpu/k22f/Makefile.dep b/cpu/k22f/Makefile.dep deleted file mode 100644 index 419f33923eb5d3490326f640e7d32b7e71b94acd..0000000000000000000000000000000000000000 --- a/cpu/k22f/Makefile.dep +++ /dev/null @@ -1 +0,0 @@ --include $(RIOTCPU)/kinetis_common/Makefile.dep diff --git a/cpu/k22f/Makefile.features b/cpu/k22f/Makefile.features deleted file mode 100644 index e08d42cd2691ef25c0a446c43a8116197109bdef..0000000000000000000000000000000000000000 --- a/cpu/k22f/Makefile.features +++ /dev/null @@ -1 +0,0 @@ --include $(RIOTCPU)/kinetis_common/Makefile.features diff --git a/cpu/k22f/Makefile.include b/cpu/k22f/Makefile.include deleted file mode 100644 index 6d518675004cefaf6175ed0091a4be66d4d73a50..0000000000000000000000000000000000000000 --- a/cpu/k22f/Makefile.include +++ /dev/null @@ -1,22 +0,0 @@ -# define the CPU architecture for the k22f -export CPU_ARCH = cortex-m4 -export CPU_FAMILY = kx - -# map CPU models to generic Kinetis linker script -LD_MK22FN512VLH12 = kinetis_f512l64u64.ld -LD_MK22FN512VLL12 = kinetis_f512l64u64.ld -LD_MK22FN512VDC12 = kinetis_f512l64u64.ld -LD_MK22FN512VMP12 = kinetis_f512l64u64.ld - -# tell the build system that the CPU depends on the Kinetis common files -export USEMODULE += kinetis_common - -# define path to kinetis module, which is needed for this CPU -export KINETIS_COMMON = $(RIOTCPU)/kinetis_common/ -# CPU depends on the kinetis module, so include it -include $(KINETIS_COMMON)Makefile.include - -# this CPU implementation is using kinetis common startup -export COMMON_STARTUP = $(KINETIS_COMMON) - -include $(RIOTMAKE)/arch/cortexm.inc.mk diff --git a/cpu/k60/Makefile b/cpu/k60/Makefile deleted file mode 100644 index 12ba41f9cf16d9b3e8b1e8fcf75cc0bcfa85f04c..0000000000000000000000000000000000000000 --- a/cpu/k60/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# define the module that is build -MODULE = cpu - -# add a list of subdirectories, that should also be build -DIRS = periph $(RIOTCPU)/cortexm_common $(KINETIS_COMMON) - -include $(RIOTBASE)/Makefile.base diff --git a/cpu/k60/Makefile.features b/cpu/k60/Makefile.features deleted file mode 100644 index e08d42cd2691ef25c0a446c43a8116197109bdef..0000000000000000000000000000000000000000 --- a/cpu/k60/Makefile.features +++ /dev/null @@ -1 +0,0 @@ --include $(RIOTCPU)/kinetis_common/Makefile.features diff --git a/cpu/k60/Makefile.include b/cpu/k60/Makefile.include deleted file mode 100644 index f5fb57871633b47f455356b8926381e68e4fe075..0000000000000000000000000000000000000000 --- a/cpu/k60/Makefile.include +++ /dev/null @@ -1,19 +0,0 @@ -# define the CPU architecture for the k60 -export CPU_ARCH = cortex-m4 - -# map CPU models to generic Kinetis linkerscript -LD_MK60DN256VLL10 = kinetis_f256l16u16.ld -LD_MK60DN512VLL10 = kinetis_f512l64u64.ld - -# tell the build system that the CPU depends on the Kinetis common files -export USEMODULE += kinetis_common - -# define path to kinetis module, which is needed for this CPU -export KINETIS_COMMON = $(RIOTCPU)/kinetis_common/ -# CPU depends on the kinetis module, so include it -include $(KINETIS_COMMON)Makefile.include - -# this CPU implementation is using kinetis common startup -export COMMON_STARTUP = $(KINETIS_COMMON) - -include $(RIOTMAKE)/arch/cortexm.inc.mk diff --git a/cpu/k60/include/cpu_conf.h b/cpu/k60/include/cpu_conf.h deleted file mode 100644 index 942d954bcd25df5e744410753227e82cae8458e5..0000000000000000000000000000000000000000 --- a/cpu/k60/include/cpu_conf.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2015 Eistec AB - * - * 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. - */ - -/** - * @defgroup cpu_k60 NXP Kinetis K60 - * @ingroup cpu - * @brief CPU specific implementations for the NXP Kinetis K60 - * Cortex-M4 MCU - * @{ - * - * @file - * @brief Implementation specific CPU configuration options - * - * @author Joakim Nohlgård <joakim.nohlgard@eistec.se> - */ - -#ifndef CPU_CONF_H -#define CPU_CONF_H - -#if defined(CPU_MODEL_MK60DN512VLL10) || defined(CPU_MODEL_MK60DN256VLL10) -#include "vendor/MK60D10.h" - -/* K60 rev 2.x replaced the RNG module in 1.x by the RNGA PRNG module */ -#define KINETIS_RNGA (RNG) -#else -#error Unknown CPU model. Update Makefile.include in the board directory. -#endif - -#include "cpu_conf_kinetis.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - * @brief This CPU provides an additional ADC clock divider as CFG1[ADICLK]=1 - */ -#define KINETIS_HAVE_ADICLK_BUS_DIV_2 1 - -#ifdef __cplusplus -} -#endif - -#endif /* CPU_CONF_H */ -/** @} */ diff --git a/cpu/k60/periph/Makefile b/cpu/k60/periph/Makefile deleted file mode 100644 index a36df249ac1d4a0ead5f30efdd1d75b3a4911340..0000000000000000000000000000000000000000 --- a/cpu/k60/periph/Makefile +++ /dev/null @@ -1 +0,0 @@ -include $(RIOTMAKE)/periph.mk diff --git a/cpu/k64f/Makefile b/cpu/k64f/Makefile deleted file mode 100644 index 12ba41f9cf16d9b3e8b1e8fcf75cc0bcfa85f04c..0000000000000000000000000000000000000000 --- a/cpu/k64f/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# define the module that is build -MODULE = cpu - -# add a list of subdirectories, that should also be build -DIRS = periph $(RIOTCPU)/cortexm_common $(KINETIS_COMMON) - -include $(RIOTBASE)/Makefile.base diff --git a/cpu/k64f/Makefile.dep b/cpu/k64f/Makefile.dep deleted file mode 100644 index 419f33923eb5d3490326f640e7d32b7e71b94acd..0000000000000000000000000000000000000000 --- a/cpu/k64f/Makefile.dep +++ /dev/null @@ -1 +0,0 @@ --include $(RIOTCPU)/kinetis_common/Makefile.dep diff --git a/cpu/k64f/Makefile.features b/cpu/k64f/Makefile.features deleted file mode 100644 index e08d42cd2691ef25c0a446c43a8116197109bdef..0000000000000000000000000000000000000000 --- a/cpu/k64f/Makefile.features +++ /dev/null @@ -1 +0,0 @@ --include $(RIOTCPU)/kinetis_common/Makefile.features diff --git a/cpu/k64f/Makefile.include b/cpu/k64f/Makefile.include deleted file mode 100644 index 3d0eb9a1cd8e6abb3bf476b844c0c03721d12ec7..0000000000000000000000000000000000000000 --- a/cpu/k64f/Makefile.include +++ /dev/null @@ -1,19 +0,0 @@ -# define the CPU architecture for the k64f -export CPU_ARCH = cortex-m4 -export CPU_FAMILY = kx - -# map CPU models to generic Kinetis linkerscript -LD_MK64FN1M0VLL12 = kinetis_f1024l64u192.ld - -# tell the build system that the CPU depends on the Kinetis common files -export USEMODULE += kinetis_common - -# define path to kinetis module, which is needed for this CPU -export KINETIS_COMMON = $(RIOTCPU)/kinetis_common/ -# CPU depends on the kinetis module, so include it -include $(KINETIS_COMMON)Makefile.include - -# this CPU implementation is using kinetis common startup -export COMMON_STARTUP = $(KINETIS_COMMON) - -include $(RIOTMAKE)/arch/cortexm.inc.mk diff --git a/cpu/k64f/include/cpu_conf.h b/cpu/k64f/include/cpu_conf.h deleted file mode 100644 index ce8840a03025c0bc2b35093498018f43839d99b5..0000000000000000000000000000000000000000 --- a/cpu/k64f/include/cpu_conf.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2015 Freie Universität Berlin - * Copyright (C) 2015 PHYTEC Messtechnik GmbH - * - * 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. - */ - -/** - * @defgroup cpu_k64f NXP Kinetis K64F - * @ingroup cpu - * @brief CPU specific implementations for the NXP Kinetis K64F - * Cortex-M4 MCU - * @{ - * - * @file - * @brief Implementation specific CPU configuration options - * - * @author Hauke Petersen <hauke.petersen@fu-berlin.de> - * @author Johann Fischer <j.fischer@phytec.de> - */ - -#ifndef CPU_CONF_H -#define CPU_CONF_H - -#ifdef CPU_MODEL_MK64FN1M0VLL12 -#include "vendor/MK64F12.h" -#else -#error "undefined CPU_MODEL" -#endif - -#include "cpu_conf_kinetis.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* CPU_CONF_H */ -/** @} */ diff --git a/cpu/k64f/periph/Makefile b/cpu/k64f/periph/Makefile deleted file mode 100644 index a36df249ac1d4a0ead5f30efdd1d75b3a4911340..0000000000000000000000000000000000000000 --- a/cpu/k64f/periph/Makefile +++ /dev/null @@ -1 +0,0 @@ -include $(RIOTMAKE)/periph.mk diff --git a/cpu/kinetis/Makefile b/cpu/kinetis/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..88d8b3d2f00ffbe7d9fed9432a90229ad3a27e5b --- /dev/null +++ b/cpu/kinetis/Makefile @@ -0,0 +1,10 @@ +# define the module that is build +MODULE = cpu + +# add a list of subdirectories that should also be built +DIRS = periph $(RIOTCPU)/cortexm_common + +# (file triggers compiler bug. see https://github.com/RIOT-OS/RIOT/issues/5775) +SRC_NOLTO += vectors.c + +include $(RIOTBASE)/Makefile.base diff --git a/cpu/kinetis_common/Makefile.dep b/cpu/kinetis/Makefile.dep similarity index 100% rename from cpu/kinetis_common/Makefile.dep rename to cpu/kinetis/Makefile.dep diff --git a/cpu/kinetis/Makefile.features b/cpu/kinetis/Makefile.features new file mode 100644 index 0000000000000000000000000000000000000000..2045a3cedd3928f6482b961ec476b6ccba6bdc0e --- /dev/null +++ b/cpu/kinetis/Makefile.features @@ -0,0 +1,5 @@ +FEATURES_PROVIDED += periph_cpuid +FEATURES_PROVIDED += periph_hwrng +FEATURES_PROVIDED += periph_gpio + +include $(RIOTCPU)/cortexm_common/Makefile.features diff --git a/cpu/kinetis_common/Makefile.include b/cpu/kinetis/Makefile.include similarity index 69% rename from cpu/kinetis_common/Makefile.include rename to cpu/kinetis/Makefile.include index 24ece8ab4c8338cecd8e0f1694dab1990de1130d..046337a006e3e539e5f429e47edc7458e0e14596 100644 --- a/cpu/kinetis_common/Makefile.include +++ b/cpu/kinetis/Makefile.include @@ -4,11 +4,8 @@ ifeq (,$(KINETIS_SERIES)) include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/kinetis-info.mk endif -# include module specific includes -export INCLUDES += -I$(RIOTCPU)/kinetis_common/include - # Add search path for linker scripts -export LINKFLAGS += -L$(RIOTCPU)/kinetis_common/ldscripts +LINKFLAGS += -L$(RIOTCPU)/$(CPU)/ldscripts # Use generic linker script for all Kinetis based CPUs LINKER_SCRIPT = kinetis.ld @@ -33,14 +30,10 @@ LINKFLAGS += $(LINKFLAGPREFIX)--defsym=_ram_start_addr=$(RAM_START_ADDR) LINKFLAGS += $(LINKFLAGPREFIX)--defsym=_rom_length=$(ROM_LEN) LINKFLAGS += $(LINKFLAGPREFIX)--defsym=_ram_length=$(RAM_LEN) -# add the CPU specific code for the linker -export UNDEF += $(BINDIR)/kinetis_common/fcfield.o - -# add the CPU specific interrupt vector table definition for the linker -export UNDEF += $(BINDIR)/kinetis_common/vectors.o +# add the CPU specific flash configuration field for the linker +export UNDEF += $(BINDIR)/cpu/fcfield.o -# include kinetis common periph drivers -USEMODULE += kinetis_common_periph +# include common periph drivers USEMODULE += periph_common # select kinetis periph drivers @@ -48,8 +41,10 @@ USEMODULE += periph_mcg USEMODULE += periph_wdog # Define a recipe to build the watchdog disable binary, used when flashing -$(RIOTCPU)/kinetis_common/dist/wdog-disable.bin: $(RIOTCPU)/kinetis_common/dist/wdog-disable.s - $(Q)$(MAKE) -C $(RIOTCPU)/kinetis_common/dist/ $(notdir $@) +$(RIOTCPU)/$(CPU)/dist/wdog-disable.bin: $(RIOTCPU)/$(CPU)/dist/wdog-disable.s + $(Q)$(MAKE) -C $(RIOTCPU)/$(CPU)/dist/ $(notdir $@) # Reset the default goal to not make wdog-disable.bin the default target. .DEFAULT_GOAL := + +include $(RIOTMAKE)/arch/cortexm.inc.mk diff --git a/cpu/kinetis_common/cpu.c b/cpu/kinetis/cpu.c similarity index 96% rename from cpu/kinetis_common/cpu.c rename to cpu/kinetis/cpu.c index b4182c7334c5884e33a41493f17692f60ccc9277..2460cb7894e30dcf0355b23b7843dfe99f4ca8aa 100644 --- a/cpu/kinetis_common/cpu.c +++ b/cpu/kinetis/cpu.c @@ -7,7 +7,7 @@ */ /** - * @ingroup cpu_kinetis_common + * @ingroup cpu_kinetis * @{ * * @file diff --git a/cpu/kinetis_common/dist/Makefile b/cpu/kinetis/dist/Makefile similarity index 100% rename from cpu/kinetis_common/dist/Makefile rename to cpu/kinetis/dist/Makefile diff --git a/cpu/kinetis_common/dist/README.md b/cpu/kinetis/dist/README.md similarity index 100% rename from cpu/kinetis_common/dist/README.md rename to cpu/kinetis/dist/README.md diff --git a/cpu/kinetis_common/dist/calc_spi_scalers/Makefile b/cpu/kinetis/dist/calc_spi_scalers/Makefile similarity index 100% rename from cpu/kinetis_common/dist/calc_spi_scalers/Makefile rename to cpu/kinetis/dist/calc_spi_scalers/Makefile diff --git a/cpu/kinetis_common/dist/calc_spi_scalers/calc_spi_scalers.c b/cpu/kinetis/dist/calc_spi_scalers/calc_spi_scalers.c similarity index 100% rename from cpu/kinetis_common/dist/calc_spi_scalers/calc_spi_scalers.c rename to cpu/kinetis/dist/calc_spi_scalers/calc_spi_scalers.c diff --git a/cpu/kinetis_common/dist/check-fcfield-elf.sh b/cpu/kinetis/dist/check-fcfield-elf.sh similarity index 100% rename from cpu/kinetis_common/dist/check-fcfield-elf.sh rename to cpu/kinetis/dist/check-fcfield-elf.sh diff --git a/cpu/kinetis_common/dist/check-fcfield-hex.sh b/cpu/kinetis/dist/check-fcfield-hex.sh similarity index 100% rename from cpu/kinetis_common/dist/check-fcfield-hex.sh rename to cpu/kinetis/dist/check-fcfield-hex.sh diff --git a/cpu/kinetis_common/dist/wdog-disable.s b/cpu/kinetis/dist/wdog-disable.s similarity index 100% rename from cpu/kinetis_common/dist/wdog-disable.s rename to cpu/kinetis/dist/wdog-disable.s diff --git a/cpu/kinetis_common/doc.txt b/cpu/kinetis/doc.txt similarity index 89% rename from cpu/kinetis_common/doc.txt rename to cpu/kinetis/doc.txt index 0eddb153120f868e658c9a4e5360392e5a1dfb64..d1461f2fbb3062cabc145661bc6dfcdc4a999f57 100644 --- a/cpu/kinetis_common/doc.txt +++ b/cpu/kinetis/doc.txt @@ -1,13 +1,13 @@ /** - * @defgroup cpu_kinetis_common NXP Kinetis MCU + * @defgroup cpu_kinetis NXP Kinetis * @ingroup cpu - * @brief NXP Kinetis CPU peripheral drivers + * @brief NXP Kinetis Cortex-M MCU specific implementation */ /** - * @defgroup cpu_kinetis_common_adc Kinetis ADC - * @ingroup cpu_kinetis_common - * @brief ADC driver + * @defgroup cpu_kinetis_adc Kinetis ADC + * @ingroup cpu_kinetis + * @brief Kinetis ADC driver * * ### ADC configuration example (for periph_conf.h) ### * @@ -25,17 +25,17 @@ */ /** - * @defgroup cpu_kinetis_common_cpuid Kinetis CPUID - * @ingroup cpu_kinetis_common - * @brief CPUID driver + * @defgroup cpu_kinetis_cpuid Kinetis CPUID + * @ingroup cpu_kinetis + * @brief Kinetis CPUID driver * * No configuration is necessary. */ /** - * @defgroup cpu_kinetis_common_gpio Kinetis GPIO - * @ingroup cpu_kinetis_common - * @brief GPIO driver + * @defgroup cpu_kinetis_gpio Kinetis GPIO + * @ingroup cpu_kinetis + * @brief Kinetis GPIO driver * * The GPIO driver uses the @ref GPIO_PIN(port, pin) macro to declare pins. * @@ -43,9 +43,9 @@ */ /** - * @defgroup cpu_kinetis_common_i2c Kinetis I2C - * @ingroup cpu_kinetis_common - * @brief I2C driver + * @defgroup cpu_kinetis_i2c Kinetis I2C + * @ingroup cpu_kinetis + * @brief Kinetis I2C driver * * ### I2C configuration example (for periph_conf.h) ### * @@ -81,9 +81,9 @@ */ /** - * @defgroup cpu_kinetis_common_pwm Kinetis PWM - * @ingroup cpu_kinetis_common - * @brief PWM driver + * @defgroup cpu_kinetis_pwm Kinetis PWM + * @ingroup cpu_kinetis + * @brief Kinetis PWM driver * * ### PWM configuration example (for periph_conf.h) ### * @@ -112,9 +112,9 @@ */ /** - * @defgroup cpu_kinetis_common_rnga Kinetis RNGA - * @ingroup cpu_kinetis_common - * @brief Driver for Freescale's RNGA module. RNGA generates data that + * @defgroup cpu_kinetis_rnga Kinetis RNGA + * @ingroup cpu_kinetis + * @brief Driver for NXP Kinetis RNGA module. RNGA generates data that * looks random. Reference Manual recommends to use the RNGA as entropy * source. * @@ -127,10 +127,10 @@ */ /** - * @defgroup cpu_kinetis_common_rngb Kinetis RNGB - * @ingroup cpu_kinetis_common + * @defgroup cpu_kinetis_rngb Kinetis RNGB + * @ingroup cpu_kinetis * @brief Low-level random number generator driver implementation. - * Driver for Freescale's RNGB module. RNGB generates data that + * Driver for NXP Kinetis RNGB module. RNGB generates data that * looks random. Reference Manual recommends to use the RNGB as entropy * source. * @@ -143,9 +143,12 @@ */ /** - * @defgroup cpu_kinetis_common_rtc Kinetis RTC - * @ingroup cpu_kinetis_common - * @brief RTC is clocked by a 32.768 kHz clock. + * @defgroup cpu_kinetis_rtc Kinetis RTC + * @ingroup cpu_kinetis + * @brief Kinetis RTC driver + * + * RTC is clocked by a 32.768 kHz clock. + * * Please note the manual of your MCU or SiP for the * clock setting for the RTC module. After initialization * Time Seconds Register (TSR) increments once a second. @@ -168,16 +171,16 @@ */ /** - * @defgroup cpu_kinetis_common_spi Kinetis SPI - * @ingroup cpu_kinetis_common - * @brief Kinetis SPI driver for MCUs with Cortex-M4 core. + * @defgroup cpu_kinetis_spi Kinetis SPI + * @ingroup cpu_kinetis + * @brief Kinetis SPI driver * * The SPI baud rate and other timings are generated from the bus * clock via prescalers, the hardware module allows for very * detailed timing configuration, but a tool exists to generate a * standard timing configuration for any given module clock frequency. * The timing configuration tool is found in - * cpu/kinetis_common/dist/calc_spi_scalers + * cpu/kinetis/dist/calc_spi_scalers * * Finer tuning of timings than the RIOT SPI API is capable of is * supported by modifying the generated configuration. See the @@ -203,7 +206,7 @@ * ### SPI configuration example (for periph_conf.h): ### * * static const uint32_t spi_clk_config[] = { - * // Use cpu/kinetis_common/dist/calc_spi_scalers to + * // Use cpu/kinetis/dist/calc_spi_scalers to * // generate the timing configuration * }; * @@ -244,8 +247,8 @@ */ /** - * @defgroup cpu_kinetis_common_timer Kinetis Timer - * @ingroup cpu_kinetis_common + * @defgroup cpu_kinetis_timer Kinetis Timer + * @ingroup cpu_kinetis * @brief Periodic Interrupt Timer (PIT) and Low-Power Timer (LPTMR) driver. * * The PIT is a count down timer, in order to use it with riot-os @@ -289,9 +292,10 @@ */ /** - * @defgroup cpu_kinetis_common_uart Kinetis UART - * @ingroup cpu_kinetis_common - * @brief Kinetis UART driver. + * @defgroup cpu_kinetis_uart Kinetis UART + * @ingroup cpu_kinetis + * @brief Kinetis UART driver + * * There are different implementations of the UART interface. * The treatment of interrupts is also slightly different. * The register UARTx_BDH to UARTx_C4 look almost the same. diff --git a/cpu/kinetis_common/fcfield.c b/cpu/kinetis/fcfield.c similarity index 97% rename from cpu/kinetis_common/fcfield.c rename to cpu/kinetis/fcfield.c index b09202416dc5c94a4286cafca668bdf9df58ab0b..10e986919d78e1a2fc3e44259794dea12814396d 100644 --- a/cpu/kinetis_common/fcfield.c +++ b/cpu/kinetis/fcfield.c @@ -8,7 +8,7 @@ */ /** - * @ingroup cpu_kinetis_common + * @ingroup cpu_kinetis * @{ * * @file diff --git a/cpu/kinetis/include/cpu_conf.h b/cpu/kinetis/include/cpu_conf.h new file mode 100644 index 0000000000000000000000000000000000000000..c3391b19fe2b92c00fbe9565f5934f4284a71da1 --- /dev/null +++ b/cpu/kinetis/include/cpu_conf.h @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2017 Eistec AB + * + * 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. + */ + +/** + * @ingroup cpu_kinetis + * @{ + * + * @file + * @brief Implementation specific CPU configuration options + * + * @author Joakim Nohlgård <joakim.nohlgard@eistec.se> + */ + +#ifndef CPU_CONF_H +#define CPU_CONF_H + +/* Dispatch to a separate file per family */ +#if defined(KINETIS_SERIES_K) +#include "cpu_conf_kinetis_k.h" +#elif defined(KINETIS_SERIES_L) +#include "cpu_conf_kinetis_l.h" +#elif defined(KINETIS_SERIES_M) +#include "cpu_conf_kinetis_m.h" +#elif defined(KINETIS_SERIES_V) +#include "cpu_conf_kinetis_v.h" +#elif defined(KINETIS_SERIES_W) +#include "cpu_conf_kinetis_w.h" +#endif /* defined(KINETIS_SERIES_x) */ + +#ifndef MCU_MEM_MAP_VERSION +#error Missing vendor header for the chosen CPU_MODEL +#endif +#include "cpu_conf_kinetis.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* CPU_CONF_H */ +/** @} */ diff --git a/cpu/kinetis_common/include/cpu_conf_kinetis.h b/cpu/kinetis/include/cpu_conf_kinetis.h similarity index 98% rename from cpu/kinetis_common/include/cpu_conf_kinetis.h rename to cpu/kinetis/include/cpu_conf_kinetis.h index 6a2299b595f653783fd580a2e5ad01e61e4fb1c0..dd5ef1da8314e400dd00715371acc204308fe9ee 100644 --- a/cpu/kinetis_common/include/cpu_conf_kinetis.h +++ b/cpu/kinetis/include/cpu_conf_kinetis.h @@ -7,7 +7,7 @@ */ /** - * @ingroup cpu_kinetis_common + * @ingroup cpu_kinetis * @{ * * @file diff --git a/cpu/kinetis/include/cpu_conf_kinetis_k.h b/cpu/kinetis/include/cpu_conf_kinetis_k.h new file mode 100644 index 0000000000000000000000000000000000000000..9a3ac1aa277d1e87f3d96e3a924a1af3a32f52c5 --- /dev/null +++ b/cpu/kinetis/include/cpu_conf_kinetis_k.h @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2017 Eistec AB + * + * 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. + */ + +/** + * @ingroup cpu_kinetis + * @brief CPU specific implementations for the NXP Kinetis K series of + * Cortex-M MCUs + * @{ + * + * @file + * @brief Implementation specific CPU configuration options + * + * @author Joakim Nohlgård <joakim.nohlgard@eistec.se> + */ + +#ifndef CPU_CONF_KINETIS_K_H +#define CPU_CONF_KINETIS_K_H + +#if (KINETIS_FAMILY == 2) +#if (KINETIS_SUBFAMILY == 2) +/* Kinetis K22 */ +#if defined(CPU_MODEL_MK22FX512VLH12) || \ + defined(CPU_MODEL_MK22FN1M0VLH12) || \ + defined(CPU_MODEL_MK22FX512VLK12) || \ + defined(CPU_MODEL_MK22FN1M0VLK12) || \ + defined(CPU_MODEL_MK22FX512VLL12) || \ + defined(CPU_MODEL_MK22FN1M0VLL12) || \ + defined(CPU_MODEL_MK22FX512VLQ12) || \ + defined(CPU_MODEL_MK22FN1M0VLQ12) || \ + defined(CPU_MODEL_MK22FX512VMC12) || \ + defined(CPU_MODEL_MK22FN1M0VMC12) || \ + defined(CPU_MODEL_MK22FX512VMD12) || \ + defined(CPU_MODEL_MK22FN1M0VMD12) +#include "vendor/MK22F12.h" +#elif defined(CPU_MODEL_MK22FN128VDC10) || \ + defined(CPU_MODEL_MK22FN128VLH10) || \ + defined(CPU_MODEL_MK22FN128VLL10) || \ + defined(CPU_MODEL_MK22FN128VMP10) +#include "vendor/MK22F12810.h" +#elif defined(CPU_MODEL_MK22FN128CAH12) || \ + defined(CPU_MODEL_MK22FN256CAH12) || \ + defined(CPU_MODEL_MK22FN256VDC12) || \ + defined(CPU_MODEL_MK22FN256VLH12) || \ + defined(CPU_MODEL_MK22FN256VLL12) || \ + defined(CPU_MODEL_MK22FN256VMP12) +#include "vendor/MK22F25612.h" +#elif defined(CPU_MODEL_MK22FN512CAP12) || \ + defined(CPU_MODEL_MK22FN512VDC12) || \ + defined(CPU_MODEL_MK22FN512VFX12) || \ + defined(CPU_MODEL_MK22FN512VLH12) || \ + defined(CPU_MODEL_MK22FN512VLL12) || \ + defined(CPU_MODEL_MK22FN512VMP12) +#include "vendor/MK22F51212.h" +#elif defined(CPU_MODEL_MK22FN1M0AVLH12) || \ + defined(CPU_MODEL_MK22FN1M0AVLK12) || \ + defined(CPU_MODEL_MK22FN1M0AVLL12) || \ + defined(CPU_MODEL_MK22FN1M0AVLQ12) || \ + defined(CPU_MODEL_MK22FN1M0AVMC12) || \ + defined(CPU_MODEL_MK22FN1M0AVMD12) || \ + defined(CPU_MODEL_MK22FX512AVLH12) || \ + defined(CPU_MODEL_MK22FX512AVLK12) || \ + defined(CPU_MODEL_MK22FX512AVLL12) || \ + defined(CPU_MODEL_MK22FX512AVLQ12) || \ + defined(CPU_MODEL_MK22FX512AVMC12) || \ + defined(CPU_MODEL_MK22FX512AVMD12) +#include "vendor/MK22FA12.h" +#endif +#endif /* (KINETIS_SUBFAMILY == y) */ +#elif (KINETIS_FAMILY == 6) +#if (KINETIS_SUBFAMILY == 0) +#if defined(CPU_MODEL_MK60DN256VLL10) || \ + defined(CPU_MODEL_MK60DN256VLQ10) || \ + defined(CPU_MODEL_MK60DN256VMC10) || \ + defined(CPU_MODEL_MK60DN256VMD10) || \ + defined(CPU_MODEL_MK60DN512VLL10) || \ + defined(CPU_MODEL_MK60DN512VLQ10) || \ + defined(CPU_MODEL_MK60DN512VMC10) || \ + defined(CPU_MODEL_MK60DN512VMD10) || \ + defined(CPU_MODEL_MK60DX256VLL10) || \ + defined(CPU_MODEL_MK60DX256VLQ10) || \ + defined(CPU_MODEL_MK60DX256VMC10) || \ + defined(CPU_MODEL_MK60DX256VMD10) +#include "vendor/MK60D10.h" +#endif +/** + * @brief This CPU provides an additional ADC clock divider as CFG1[ADICLK]=1 + */ +#define KINETIS_HAVE_ADICLK_BUS_DIV_2 1 + +#elif (KINETIS_SUBFAMILY == 4) +#if defined(CPU_MODEL_MK64FN1M0CAJ12) || \ + defined(CPU_MODEL_MK64FN1M0VDC12) || \ + defined(CPU_MODEL_MK64FN1M0VLL12) || \ + defined(CPU_MODEL_MK64FN1M0VLQ12) || \ + defined(CPU_MODEL_MK64FN1M0VMD12) || \ + defined(CPU_MODEL_MK64FX512VDC12) || \ + defined(CPU_MODEL_MK64FX512VLL12) || \ + defined(CPU_MODEL_MK64FX512VLQ12) || \ + defined(CPU_MODEL_MK64FX512VMD12) +#include "vendor/MK64F12.h" +#endif +#endif /* (KINETIS_SUBFAMILY == y) */ +#endif /* (KINETIS_FAMILY == x) */ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* CPU_CONF_KINETIS_K_H */ +/** @} */ diff --git a/cpu/k22f/include/cpu_conf.h b/cpu/kinetis/include/cpu_conf_kinetis_l.h similarity index 60% rename from cpu/k22f/include/cpu_conf.h rename to cpu/kinetis/include/cpu_conf_kinetis_l.h index 935d694ea5e9c75fedf726f20acd60fbad9380b2..e9e446e1b7932b3d501b2622058df2f8dc5be97c 100644 --- a/cpu/k22f/include/cpu_conf.h +++ b/cpu/kinetis/include/cpu_conf_kinetis_l.h @@ -7,10 +7,9 @@ */ /** - * @defgroup cpu_k22f NXP Kinetis K22F - * @ingroup cpu - * @brief CPU specific implementations for the NXP Kinetis K22F - * Cortex-M4 MCU + * @ingroup cpu_kinetis + * @brief CPU specific implementations for the NXP Kinetis L series of + * Cortex-M MCUs * @{ * * @file @@ -19,16 +18,14 @@ * @author Joakim Nohlgård <joakim.nohlgard@eistec.se> */ -#ifndef CPU_CONF_H -#define CPU_CONF_H +#ifndef CPU_CONF_KINETIS_L_H +#define CPU_CONF_KINETIS_L_H -#ifdef CPU_MODEL_MK22FN512VLH12 -#include "vendor/MK22F51212.h" -#else -#error "undefined CPU_MODEL" -#endif - -#include "cpu_conf_kinetis.h" +#if (KINETIS_FAMILY == 2) +#if (KINETIS_SUBFAMILY == 2) +/* Put your vendor includes here */ +#endif /* (KINETIS_SUBFAMILY == y) */ +#endif /* (KINETIS_FAMILY == x) */ #ifdef __cplusplus extern "C" @@ -39,5 +36,5 @@ extern "C" } #endif -#endif /* CPU_CONF_H */ +#endif /* CPU_CONF_KINETIS_L_H */ /** @} */ diff --git a/cpu/kinetis/include/cpu_conf_kinetis_m.h b/cpu/kinetis/include/cpu_conf_kinetis_m.h new file mode 100644 index 0000000000000000000000000000000000000000..3df55c06517e6ecfee956d19ecf4253a3fe5bf02 --- /dev/null +++ b/cpu/kinetis/include/cpu_conf_kinetis_m.h @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2017 Eistec AB + * + * 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. + */ + +/** + * @ingroup cpu_kinetis + * @brief CPU specific implementations for the NXP Kinetis M series of + * Cortex-M MCUs + * @{ + * + * @file + * @brief Implementation specific CPU configuration options + * + * @author Joakim Nohlgård <joakim.nohlgard@eistec.se> + */ + +#ifndef CPU_CONF_KINETIS_M_H +#define CPU_CONF_KINETIS_M_H + +#if (KINETIS_FAMILY == 2) +#if (KINETIS_SUBFAMILY == 2) +/* Put your vendor includes here */ +#endif /* (KINETIS_SUBFAMILY == y) */ +#endif /* (KINETIS_FAMILY == x) */ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* CPU_CONF_KINETIS_M_H */ +/** @} */ diff --git a/cpu/kinetis/include/cpu_conf_kinetis_v.h b/cpu/kinetis/include/cpu_conf_kinetis_v.h new file mode 100644 index 0000000000000000000000000000000000000000..bffb164cf1463dcb401ec8d867e4dcd7f94edaed --- /dev/null +++ b/cpu/kinetis/include/cpu_conf_kinetis_v.h @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2017 Eistec AB + * + * 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. + */ + +/** + * @ingroup cpu_kinetis + * @brief CPU specific implementations for the NXP Kinetis V series of + * Cortex-M MCUs + * @{ + * + * @file + * @brief Implementation specific CPU configuration options + * + * @author Joakim Nohlgård <joakim.nohlgard@eistec.se> + */ + +#ifndef CPU_CONF_KINETIS_V_H +#define CPU_CONF_KINETIS_V_H + +#if (KINETIS_FAMILY == 2) +#if (KINETIS_SUBFAMILY == 2) +/* Put your vendor includes here */ +#endif /* (KINETIS_SUBFAMILY == y) */ +#endif /* (KINETIS_FAMILY == x) */ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* CPU_CONF_KINETIS_V_H */ +/** @} */ diff --git a/cpu/kinetis/include/cpu_conf_kinetis_w.h b/cpu/kinetis/include/cpu_conf_kinetis_w.h new file mode 100644 index 0000000000000000000000000000000000000000..48ada52039bbfe8f474b9555eb1ecb465befceda --- /dev/null +++ b/cpu/kinetis/include/cpu_conf_kinetis_w.h @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2017 Eistec AB + * + * 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. + */ + +/** + * @ingroup cpu_kinetis + * @brief CPU specific implementations for the NXP Kinetis K series of + * Cortex-M MCUs + * @{ + * + * @file + * @brief Implementation specific CPU configuration options + * + * @author Joakim Nohlgård <joakim.nohlgard@eistec.se> + */ + +#ifndef CPU_CONF_KINETIS_W_H +#define CPU_CONF_KINETIS_W_H + +#if defined(KINETIS_CORE_D) +/* Kinetis KW2xD */ +#if defined(CPU_MODEL_MKW21D256VHA5) || \ + defined(CPU_MODEL_MKW21D512VHA5) +#include "vendor/MKW21D5.h" +#elif defined(CPU_MODEL_MKW22D512VHA5) +#include "vendor/MKW22D5.h" +#elif defined(CPU_MODEL_MKW24D512VHA5) +#include "vendor/MKW24D5.h" +#endif + +/** + * @brief This CPU provides an additional ADC clock divider as CFG1[ADICLK]=1 + */ +#define KINETIS_HAVE_ADICLK_BUS_DIV_2 1 +/** + * @name KW2XD SiP internal interconnects between MCU and radio + * + * @{ + */ +#define KW2XDRF_PORT_DEV PORTB /**< MCU Port connected to radio*/ +#define KW2XDRF_PORT PORT_B /**< MCU Port connected to radio*/ +#define KW2XDRF_GPIO GPIOB /**< GPIO Device connected to radio */ +#define KW2XDRF_PORT_IRQn PORTB_IRQn +/** Clock Enable for PORTB */ +#define KW2XDRF_PORT_CLKEN() (BITBAND_REG32(SIM->SCGC5, SIM_SCGC5_PORTB_SHIFT) = 1) +#define KW2XDRF_PIN_AF 2 /**< Pin Muxing Parameter for GPIO Device*/ +#define KW2XDRF_PCS0_PIN 10 /**< Radio SPI chip select pin */ +#define KW2XDRF_SCK_PIN 11 /**< Radio SPI clock pin */ +#define KW2XDRF_SOUT_PIN 16 /**< Radio SPI MOSI pin */ +#define KW2XDRF_SIN_PIN 17 /**< Radio SPI MISO pin */ +#define KW2XDRF_RST_PIN 19 /**< Radio reset pin */ +#define KW2XDRF_IRQ_PIN 3 /**< radio IRQ pin (active low) */ +#define KW2XDRF_CLK_CTRL_PORT PORT_C /**< CLK_OUT control pin port */ +#define KW2XDRF_CLK_CTRL_PORT_DEV PORTC /**< CLK_OUT control pin PORT device */ +#define KW2XDRF_CLK_CTRL_GPIO GPIOC /**< CLK_OUT control pin GPIO device */ +#define KW2XDRF_CLK_CTRL_CLKEN() (BITBAND_REG32(SIM->SCGC5, SIM_SCGC5_PORTC_SHIFT) = 1) +#define KW2XDRF_CLK_CTRL_PIN 0 /**< CLK_OUT control pin */ +/** @} */ + +#elif defined(KINETIS_CORE_Z) +/* Kinetis KWxxZ */ +/* TODO */ +#endif /* KINETIS_CORE_x */ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* CPU_CONF_KINETIS_W_H */ +/** @} */ diff --git a/cpu/kinetis_common/include/mcg.h b/cpu/kinetis/include/mcg.h similarity index 98% rename from cpu/kinetis_common/include/mcg.h rename to cpu/kinetis/include/mcg.h index 04ebabb56db47d0be598d9de08e5ab8b0d3b6ea9..241ed38f8accd58716c2a0ceb56535b88f8173da 100644 --- a/cpu/kinetis_common/include/mcg.h +++ b/cpu/kinetis/include/mcg.h @@ -8,8 +8,8 @@ */ /** - * @defgroup cpu_kinetis_common_mcg Kinetis MCG - * @ingroup cpu_kinetis_common + * @defgroup cpu_kinetis_mcg Kinetis MCG + * @ingroup cpu_kinetis * @brief Implementation of the Kinetis Multipurpose Clock Generator * (MCG) driver * diff --git a/cpu/kinetis_common/include/periph_cpu.h b/cpu/kinetis/include/periph_cpu.h similarity index 99% rename from cpu/kinetis_common/include/periph_cpu.h rename to cpu/kinetis/include/periph_cpu.h index 246fb0e87d142d0ba65fa82a3d9d93d5a18285c4..ba5f4a2da9105b12e5489573c56387d3496921e1 100644 --- a/cpu/kinetis_common/include/periph_cpu.h +++ b/cpu/kinetis/include/periph_cpu.h @@ -7,7 +7,7 @@ */ /** - * @ingroup cpu_kinetis_common + * @ingroup cpu_kinetis * @{ * * @file diff --git a/cpu/kinetis_common/include/vectors_kinetis.h b/cpu/kinetis/include/vectors_kinetis.h similarity index 100% rename from cpu/kinetis_common/include/vectors_kinetis.h rename to cpu/kinetis/include/vectors_kinetis.h diff --git a/cpu/k22f/include/vendor/MK22F12.h b/cpu/kinetis/include/vendor/MK22F12.h similarity index 100% rename from cpu/k22f/include/vendor/MK22F12.h rename to cpu/kinetis/include/vendor/MK22F12.h diff --git a/cpu/k22f/include/vendor/MK22F12810.h b/cpu/kinetis/include/vendor/MK22F12810.h similarity index 100% rename from cpu/k22f/include/vendor/MK22F12810.h rename to cpu/kinetis/include/vendor/MK22F12810.h diff --git a/cpu/k22f/include/vendor/MK22F25612.h b/cpu/kinetis/include/vendor/MK22F25612.h similarity index 100% rename from cpu/k22f/include/vendor/MK22F25612.h rename to cpu/kinetis/include/vendor/MK22F25612.h diff --git a/cpu/k22f/include/vendor/MK22F51212.h b/cpu/kinetis/include/vendor/MK22F51212.h similarity index 100% rename from cpu/k22f/include/vendor/MK22F51212.h rename to cpu/kinetis/include/vendor/MK22F51212.h diff --git a/cpu/k22f/include/vendor/MK22FA12.h b/cpu/kinetis/include/vendor/MK22FA12.h similarity index 100% rename from cpu/k22f/include/vendor/MK22FA12.h rename to cpu/kinetis/include/vendor/MK22FA12.h diff --git a/cpu/k60/include/vendor/MK60D10.h b/cpu/kinetis/include/vendor/MK60D10.h similarity index 100% rename from cpu/k60/include/vendor/MK60D10.h rename to cpu/kinetis/include/vendor/MK60D10.h diff --git a/cpu/k64f/include/vendor/MK64F12.h b/cpu/kinetis/include/vendor/MK64F12.h similarity index 100% rename from cpu/k64f/include/vendor/MK64F12.h rename to cpu/kinetis/include/vendor/MK64F12.h diff --git a/cpu/kw2xd/include/vendor/MKW21D5.h b/cpu/kinetis/include/vendor/MKW21D5.h similarity index 100% rename from cpu/kw2xd/include/vendor/MKW21D5.h rename to cpu/kinetis/include/vendor/MKW21D5.h diff --git a/cpu/kw2xd/include/vendor/MKW22D5.h b/cpu/kinetis/include/vendor/MKW22D5.h similarity index 100% rename from cpu/kw2xd/include/vendor/MKW22D5.h rename to cpu/kinetis/include/vendor/MKW22D5.h diff --git a/cpu/kw2xd/include/vendor/MKW24D5.h b/cpu/kinetis/include/vendor/MKW24D5.h similarity index 100% rename from cpu/kw2xd/include/vendor/MKW24D5.h rename to cpu/kinetis/include/vendor/MKW24D5.h diff --git a/cpu/kinetis_common/include/wdog.h b/cpu/kinetis/include/wdog.h similarity index 94% rename from cpu/kinetis_common/include/wdog.h rename to cpu/kinetis/include/wdog.h index 1f28e8685f23a76c80257759896a93be56ea1f4e..56870adb8e06e43712993ec8ab4e967cf879ac92 100644 --- a/cpu/kinetis_common/include/wdog.h +++ b/cpu/kinetis/include/wdog.h @@ -8,8 +8,8 @@ */ /** - * @defgroup cpu_kinetis_common_wdog Kinetis WDOG - * @ingroup cpu_kinetis_common + * @defgroup cpu_kinetis_wdog Kinetis WDOG + * @ingroup cpu_kinetis * @brief Driver for Freescale WDOG device. * There are different implementations of the Watchdog devices. * Currently, it is only possible to turn the Watchdog off. diff --git a/cpu/kinetis_common/isr_kinetis.c b/cpu/kinetis/isr_kinetis.c similarity index 99% rename from cpu/kinetis_common/isr_kinetis.c rename to cpu/kinetis/isr_kinetis.c index 0ce5c0fbafee68f851ebc063ea76e5f53385d4cb..2fa00cd8faa25ef18eb1b6f2d8a3f0e9805d5ddd 100644 --- a/cpu/kinetis_common/isr_kinetis.c +++ b/cpu/kinetis/isr_kinetis.c @@ -7,7 +7,7 @@ */ /** - * @ingroup cpu_kinetis_common + * @ingroup cpu_kinetis * @{ * * @file diff --git a/cpu/kinetis_common/kinetis-info.mk b/cpu/kinetis/kinetis-info.mk similarity index 100% rename from cpu/kinetis_common/kinetis-info.mk rename to cpu/kinetis/kinetis-info.mk diff --git a/cpu/kinetis_common/ldscripts/kinetis.ld b/cpu/kinetis/ldscripts/kinetis.ld similarity index 100% rename from cpu/kinetis_common/ldscripts/kinetis.ld rename to cpu/kinetis/ldscripts/kinetis.ld diff --git a/cpu/k22f/periph/Makefile b/cpu/kinetis/periph/Makefile similarity index 100% rename from cpu/k22f/periph/Makefile rename to cpu/kinetis/periph/Makefile diff --git a/cpu/kinetis_common/periph/adc.c b/cpu/kinetis/periph/adc.c similarity index 99% rename from cpu/kinetis_common/periph/adc.c rename to cpu/kinetis/periph/adc.c index 15b6fc788cefc63c55059bb29bd19a96d7342ce9..072c64a6e02a02a790f59031e6496095c1fa4777 100644 --- a/cpu/kinetis_common/periph/adc.c +++ b/cpu/kinetis/periph/adc.c @@ -9,7 +9,7 @@ */ /** - * @ingroup cpu_kinetis_common + * @ingroup cpu_kinetis * @ingroup drivers_periph_adc * @{ * diff --git a/cpu/kinetis_common/periph/dac.c b/cpu/kinetis/periph/dac.c similarity index 98% rename from cpu/kinetis_common/periph/dac.c rename to cpu/kinetis/periph/dac.c index b8034a6a64e1b83db4c8b965c6234b7873ae55df..36e4ac0c13939d521e675016de136dcd0cf03301 100644 --- a/cpu/kinetis_common/periph/dac.c +++ b/cpu/kinetis/periph/dac.c @@ -7,7 +7,7 @@ */ /** - * @ingroup cpu_kinetis_common + * @ingroup cpu_kinetis * @ingroup drivers_periph_dac * * @{ diff --git a/cpu/kinetis_common/periph/gpio.c b/cpu/kinetis/periph/gpio.c similarity index 99% rename from cpu/kinetis_common/periph/gpio.c rename to cpu/kinetis/periph/gpio.c index f665123c5adac38b80131cc0c924e0d0e27ccf75..c01ae9fa016c5ef4aea0461102c66970fb3200ca 100644 --- a/cpu/kinetis_common/periph/gpio.c +++ b/cpu/kinetis/periph/gpio.c @@ -9,7 +9,7 @@ */ /** - * @ingroup cpu_kinetis_common + * @ingroup cpu_kinetis * @ingroup drivers_periph_gpio * * @{ diff --git a/cpu/kinetis_common/periph/hwrng.c b/cpu/kinetis/periph/hwrng.c similarity index 97% rename from cpu/kinetis_common/periph/hwrng.c rename to cpu/kinetis/periph/hwrng.c index a2d749e6c206ef13a52ced26febca7e2330b4da7..0348102b5999d6f905999ff2fec129b003a0eabd 100644 --- a/cpu/kinetis_common/periph/hwrng.c +++ b/cpu/kinetis/periph/hwrng.c @@ -8,7 +8,7 @@ */ /** - * @ingroup cpu_kinetis_common + * @ingroup cpu_kinetis * @ingroup drivers_periph_hwng * * @{ diff --git a/cpu/kinetis_common/periph/i2c.c b/cpu/kinetis/periph/i2c.c similarity index 100% rename from cpu/kinetis_common/periph/i2c.c rename to cpu/kinetis/periph/i2c.c diff --git a/cpu/kinetis_common/periph/mcg.c b/cpu/kinetis/periph/mcg.c similarity index 99% rename from cpu/kinetis_common/periph/mcg.c rename to cpu/kinetis/periph/mcg.c index b5eaa3f734a739908975519a802c25e439687353..6179fb1d3f96ef86d3e5fa88020a51cf7028b793 100644 --- a/cpu/kinetis_common/periph/mcg.c +++ b/cpu/kinetis/periph/mcg.c @@ -8,7 +8,7 @@ */ /** - * @ingroup cpu_kinetis_common + * @ingroup cpu_kinetis * @ingroup drivers_periph_mcg * @{ * diff --git a/cpu/kinetis_common/periph/pm.c b/cpu/kinetis/periph/pm.c similarity index 96% rename from cpu/kinetis_common/periph/pm.c rename to cpu/kinetis/periph/pm.c index 63373a87a9377c56d504ff818374d76afc6c0623..4a9961ba7ab01a96550d2bc1103b94d61c0ae600 100644 --- a/cpu/kinetis_common/periph/pm.c +++ b/cpu/kinetis/periph/pm.c @@ -9,7 +9,7 @@ */ /** - * @ingroup cpu_kinetis_common + * @ingroup cpu_kinetis * @ingroup drivers_periph_pm * @{ * diff --git a/cpu/kinetis_common/periph/pwm.c b/cpu/kinetis/periph/pwm.c similarity index 99% rename from cpu/kinetis_common/periph/pwm.c rename to cpu/kinetis/periph/pwm.c index e5494ba58afc36a406fff1fb37916fada22543ed..5f2fd448b731b4c8a28c8ea7b8e7567f1a3a3f1e 100644 --- a/cpu/kinetis_common/periph/pwm.c +++ b/cpu/kinetis/periph/pwm.c @@ -9,7 +9,7 @@ */ /** - * @ingroup cpu_kinetis_common + * @ingroup cpu_kinetis * @ingroup drivers_periph_pwm * * @{ diff --git a/cpu/kinetis_common/periph/rtc.c b/cpu/kinetis/periph/rtc.c similarity index 98% rename from cpu/kinetis_common/periph/rtc.c rename to cpu/kinetis/periph/rtc.c index fe5489fcbd09fb80515259122c8926d1955a4b1d..f0d877a4c987951a6f5059a814f54ab2969c8351 100644 --- a/cpu/kinetis_common/periph/rtc.c +++ b/cpu/kinetis/periph/rtc.c @@ -7,7 +7,7 @@ */ /** - * @ingroup cpu_kinetis_common + * @ingroup cpu_kinetis * @ingroup drivers_periph_rtc * * @{ diff --git a/cpu/kinetis_common/periph/rtt.c b/cpu/kinetis/periph/rtt.c similarity index 99% rename from cpu/kinetis_common/periph/rtt.c rename to cpu/kinetis/periph/rtt.c index 5fdbed8df69987831f2015bbc3fd4aa5ebba701b..1f5874bfb7d9225b1db52b35a4eb4f28b5720ee3 100644 --- a/cpu/kinetis_common/periph/rtt.c +++ b/cpu/kinetis/periph/rtt.c @@ -8,7 +8,7 @@ */ /** - * @ingroup cpu_kinetis_common + * @ingroup cpu_kinetis * @ingroup drivers_periph_rtt * * @{ diff --git a/cpu/kinetis_common/periph/spi.c b/cpu/kinetis/periph/spi.c similarity index 99% rename from cpu/kinetis_common/periph/spi.c rename to cpu/kinetis/periph/spi.c index 095fa50419325065a26e5aa4f1e84537b47d3882..9ed06bd4965e8f21b9eb1901898026100ba80380 100644 --- a/cpu/kinetis_common/periph/spi.c +++ b/cpu/kinetis/periph/spi.c @@ -10,7 +10,7 @@ */ /** - * @ingroup cpu_kinetis_common + * @ingroup cpu_kinetis * @ingroup drivers_periph_spi * * @{ diff --git a/cpu/kinetis_common/periph/timer.c b/cpu/kinetis/periph/timer.c similarity index 99% rename from cpu/kinetis_common/periph/timer.c rename to cpu/kinetis/periph/timer.c index f92894442004eff5c0eed812f96d843dd66b34e9..ca1ea8130cab3bd0fdc63f03f509727d60f5eec1 100644 --- a/cpu/kinetis_common/periph/timer.c +++ b/cpu/kinetis/periph/timer.c @@ -9,7 +9,7 @@ */ /** - * @ingroup cpu_kinetis_common + * @ingroup cpu_kinetis * @ingroup drivers_periph_timer * * @{ diff --git a/cpu/kinetis_common/periph/uart.c b/cpu/kinetis/periph/uart.c similarity index 99% rename from cpu/kinetis_common/periph/uart.c rename to cpu/kinetis/periph/uart.c index 40b153ad09de09c72e28f99078781e7fe565a563..892701b57e3e3dfa1571660dc47579b047be3900 100644 --- a/cpu/kinetis_common/periph/uart.c +++ b/cpu/kinetis/periph/uart.c @@ -9,7 +9,7 @@ */ /** - * @ingroup cpu_kinetis_common + * @ingroup cpu_kinetis * @ingroup drivers_periph_uart * * @{ diff --git a/cpu/kinetis_common/periph/wdog.c b/cpu/kinetis/periph/wdog.c similarity index 98% rename from cpu/kinetis_common/periph/wdog.c rename to cpu/kinetis/periph/wdog.c index 530ba7a285647b916b66a6eaf25e12b76f0bab82..e0c995678a893eb16bac30543f6f9c01330f619a 100644 --- a/cpu/kinetis_common/periph/wdog.c +++ b/cpu/kinetis/periph/wdog.c @@ -8,7 +8,7 @@ */ /** - * @ingroup cpu_kinetis_common + * @ingroup cpu_kinetis * @ingroup drivers_periph_watchdog * * @{ diff --git a/cpu/kinetis_common/vectors.c b/cpu/kinetis/vectors.c similarity index 100% rename from cpu/kinetis_common/vectors.c rename to cpu/kinetis/vectors.c diff --git a/cpu/kinetis_common/Makefile b/cpu/kinetis_common/Makefile deleted file mode 100644 index 8b1b43dea4d66b3da111da96f7e80c3c0615fcb5..0000000000000000000000000000000000000000 --- a/cpu/kinetis_common/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -# define the module that is build -MODULE = kinetis_common - -DIRS += periph - -# (file triggers compiler bug. see #5775) -SRC_NOLTO += vectors.c - -include $(RIOTBASE)/Makefile.base diff --git a/cpu/kinetis_common/Makefile.features b/cpu/kinetis_common/Makefile.features deleted file mode 100644 index 894817aedbb104737480d729247c59737efec8df..0000000000000000000000000000000000000000 --- a/cpu/kinetis_common/Makefile.features +++ /dev/null @@ -1,4 +0,0 @@ -FEATURES_PROVIDED += periph_cpuid -FEATURES_PROVIDED += periph_hwrng - --include $(RIOTCPU)/cortexm_common/Makefile.features diff --git a/cpu/kinetis_common/periph/Makefile b/cpu/kinetis_common/periph/Makefile deleted file mode 100644 index 4cc46a1c00c570e85085da8f2942cbc04ef0f4d3..0000000000000000000000000000000000000000 --- a/cpu/kinetis_common/periph/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -MODULE = kinetis_common_periph - -include $(RIOTMAKE)/periph.mk diff --git a/cpu/kinetis_common/periph/hwrng_rngb.c b/cpu/kinetis_common/periph/hwrng_rngb.c deleted file mode 100644 index 0a42eccf757af3be1c501ee9b23da6b581548220..0000000000000000000000000000000000000000 --- a/cpu/kinetis_common/periph/hwrng_rngb.c +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2014-2016 Freie Universität Berlin - * Copyright (C) 2014 PHYTEC Messtechnik GmbH - * Copyright (C) 2015 Eistec AB - * - * 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. - */ - -/** - * @ingroup cpu_kinetis_common - * @ingroup drivers_periph_hwng - * @{ - * - * @file - * @brief HWRNG interface implementation - * - * @author Joakim Nohlgård <joakim.nohlgard@eistec.se> (adaption for Freescale's RNGB) - * @author Johann Fischer <j.fischer@phytec.de> (adaption for Freescale's RNGA) - * @author Hauke Petersen <hauke.petersen@fu-berlin.de> - * - * @} - */ - -#include "cpu.h" -#include "periph/hwrng.h" -#include "periph_conf.h" - -#ifdef KINETIS_RNGB - -void hwrng_init(void) -{ - /* nothing to be done here */ -} - -void hwrng_read(void *buf, unsigned int num) -{ - unsigned int count = 0; - uint8_t *b = (uint8_t *)buf; - - HWRNG_CLKEN(); - - if ((KINETIS_RNGB->VER & RNG_VER_TYPE_MASK) != 0b0001) { - /* Wrong type of RNG */ - /* TODO: Handle */ - } - - /* Software reset, bit is self-clearing */ - BITBAND_REG32(KINETIS_RNGB->CMD, RNG_CMD_SR_SHIFT) = 1; - /* Set up automatic reseed */ - KINETIS_RNGB->CR = RNG_CR_AR_MASK | RNG_CR_MASKERR_MASK | RNG_CR_MASKDONE_MASK; - - while (count < num) { - uint32_t tmp; - - /* wait for random data to be ready to read */ - while (!(KINETIS_RNGB->SR & RNG_SR_FIFO_LVL_MASK)); - - tmp = KINETIS_RNGB->OUT; - - /* copy data into result vector */ - for (int i = 0; i < 4 && count < num; i++) { - b[count++] = (uint8_t)tmp; - tmp = tmp >> 8; - } - } - - KINETIS_RNGB->CR = 0; - HWRNG_CLKDIS(); -} - -#endif /* KINETIS_RNGB */ diff --git a/cpu/kw2xd/Makefile b/cpu/kw2xd/Makefile deleted file mode 100644 index 12ba41f9cf16d9b3e8b1e8fcf75cc0bcfa85f04c..0000000000000000000000000000000000000000 --- a/cpu/kw2xd/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# define the module that is build -MODULE = cpu - -# add a list of subdirectories, that should also be build -DIRS = periph $(RIOTCPU)/cortexm_common $(KINETIS_COMMON) - -include $(RIOTBASE)/Makefile.base diff --git a/cpu/kw2xd/Makefile.dep b/cpu/kw2xd/Makefile.dep deleted file mode 100644 index 419f33923eb5d3490326f640e7d32b7e71b94acd..0000000000000000000000000000000000000000 --- a/cpu/kw2xd/Makefile.dep +++ /dev/null @@ -1 +0,0 @@ --include $(RIOTCPU)/kinetis_common/Makefile.dep diff --git a/cpu/kw2xd/Makefile.features b/cpu/kw2xd/Makefile.features deleted file mode 100644 index e08d42cd2691ef25c0a446c43a8116197109bdef..0000000000000000000000000000000000000000 --- a/cpu/kw2xd/Makefile.features +++ /dev/null @@ -1 +0,0 @@ --include $(RIOTCPU)/kinetis_common/Makefile.features diff --git a/cpu/kw2xd/Makefile.include b/cpu/kw2xd/Makefile.include deleted file mode 100644 index 7d634d17e54f385cda6a98bdc940f4940d5dd037..0000000000000000000000000000000000000000 --- a/cpu/kw2xd/Makefile.include +++ /dev/null @@ -1,20 +0,0 @@ -# define the CPU architecture for the kw2xd -export CPU_ARCH = cortex-m4 - -# map CPU models to generic Kinetis linkerscript -LD_KW21D256 = kinetis_f256l16u16.ld -LD_KW21D512 = kinetis_f512l32u32.ld -LD_KW22D512 = kinetis_f512l32u32.ld - -# tell the build system that the CPU depends on the Kinetis common files -export USEMODULE += kinetis_common - -# define path to kinetis module, which is needed for this CPU -export KINETIS_COMMON = $(RIOTCPU)/kinetis_common/ -# CPU depends on the kinetis module, so include it -include $(KINETIS_COMMON)Makefile.include - -# this CPU implementation is using kinetis common startup -export COMMON_STARTUP = $(KINETIS_COMMON) - -include $(RIOTMAKE)/arch/cortexm.inc.mk diff --git a/cpu/kw2xd/include/cpu_conf.h b/cpu/kw2xd/include/cpu_conf.h deleted file mode 100644 index 53331f54edfd2d11bb20d2cdd24a7709b33f7ff8..0000000000000000000000000000000000000000 --- a/cpu/kw2xd/include/cpu_conf.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (C) 2014 Freie Universität Berlin - * Copyright (C) 2014 PHYTEC Messtechnik GmbH - * - * 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. - */ - -/** - * @defgroup cpu_kw2xd NXP Kinetis KW2xD - * @ingroup cpu - * @brief CPU specific implementations for the NXP Kinetis KW2xD SiP - * - * The SiP incorporates a low power 2.4 GHz transceiver, and a - * Kinetis Cortex-M4 MCU. - * - * From the register map and functional description it seems - * like the transceiver is a close relative of the NXP MCR20A. - * @{ - * - * @file - * @brief Implementation specific CPU configuration options - * - * @author Hauke Petersen <hauke.petersen@fu-berlin.de> - * @author Johann Fischer <j.fischer@phytec.de> - */ - -#ifndef CPU_CONF_H -#define CPU_CONF_H - -#ifdef CPU_MODEL_KW21D256 -#include "vendor/MKW22D5.h" -#elif CPU_MODEL_KW21D512 -#include "vendor/MKW22D5.h" -#elif CPU_MODEL_KW22D512 -#include "vendor/MKW22D5.h" -#else -#error "undefined CPU_MODEL" -#endif - -#include "cpu_conf_kinetis.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - * @brief This CPU provides an additional ADC clock divider as CFG1[ADICLK]=1 - */ -#define KINETIS_HAVE_ADICLK_BUS_DIV_2 1 - -/** @name PORT module clock gates */ -/** @{ */ -#define PORTA_CLOCK_GATE (BITBAND_REG32(SIM->SCGC5, SIM_SCGC5_PORTA_SHIFT)) -#define PORTB_CLOCK_GATE (BITBAND_REG32(SIM->SCGC5, SIM_SCGC5_PORTB_SHIFT)) -#define PORTC_CLOCK_GATE (BITBAND_REG32(SIM->SCGC5, SIM_SCGC5_PORTC_SHIFT)) -#define PORTD_CLOCK_GATE (BITBAND_REG32(SIM->SCGC5, SIM_SCGC5_PORTD_SHIFT)) -#define PORTE_CLOCK_GATE (BITBAND_REG32(SIM->SCGC5, SIM_SCGC5_PORTE_SHIFT)) -/** @} */ - -/** - * @name KW2XD SiP internal interconnects between MCU and Modem. - * - * @{ - */ -#define KW2XDRF_PORT_DEV PORTB /**< MCU Port connected to Modem*/ -#define KW2XDRF_PORT PORT_B /**< MCU Port connected to Modem*/ -#define KW2XDRF_GPIO GPIOB /**< GPIO Device connected to Modem */ -#define KW2XDRF_PORT_IRQn PORTB_IRQn -/** Clock Enable for PORTB*/ -#define KW2XDRF_PORT_CLKEN() (PORTB_CLOCK_GATE = 1) -#define KW2XDRF_PIN_AF 2 /**< Pin Muxing Parameter for GPIO Device*/ -#define KW2XDRF_PCS0_PIN 10 /**< SPI Slave Select Pin */ -#define KW2XDRF_SCK_PIN 11 /**< SPI Clock Output Pin */ -#define KW2XDRF_SOUT_PIN 16 /**< SPI Master Data Output Pin */ -#define KW2XDRF_SIN_PIN 17 /**< SPI Master Data Input Pin */ -#define KW2XDRF_RST_PIN 19 /**< Reset pin */ -#define KW2XDRF_IRQ_PIN 3 /**< Modem's IRQ Output (activ low) */ -#define KW2XDRF_CLK_CTRL_PORT PORT_C /**< CLK_OUT control pin port */ -#define KW2XDRF_CLK_CTRL_PORT_DEV PORTC /**< CLK_OUT control pin PORT device */ -#define KW2XDRF_CLK_CTRL_GPIO GPIOC /**< CLK_OUT control pin GPIO device */ -#define KW2XDRF_CLK_CTRL_CLKEN() (PORTC_CLOCK_GATE = 1) -#define KW2XDRF_CLK_CTRL_PIN 0 /**< CLK_OUT control pin */ - -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif /* CPU_CONF_H */ -/** @} */ diff --git a/cpu/kw2xd/periph/Makefile b/cpu/kw2xd/periph/Makefile deleted file mode 100644 index a36df249ac1d4a0ead5f30efdd1d75b3a4911340..0000000000000000000000000000000000000000 --- a/cpu/kw2xd/periph/Makefile +++ /dev/null @@ -1 +0,0 @@ -include $(RIOTMAKE)/periph.mk diff --git a/doc/doxygen/src/mainpage.md b/doc/doxygen/src/mainpage.md index 2fcadd939457e3465b4aef6f9f222576183f6e04..e3c5adaf1eba45bd6aa4b6ae2c87256d8f9c0030 100644 --- a/doc/doxygen/src/mainpage.md +++ b/doc/doxygen/src/mainpage.md @@ -150,7 +150,7 @@ CPUs share the same code for task switching and interrupt handling). This shared code is put in its own directories, following a `xxxxx_common` naming scheme. Examples for this is code shared across architectures (e.g. `cortexm_common`, `msp430_comon`) or code shared among vendors (e.g. -`kinetis_common`). +`stm32_common`). See @ref cpu for more detailed informtation.