From b9e209e4fc49941e84f9256f8bffaccc1dfeb0fa Mon Sep 17 00:00:00 2001 From: Maureen Helm Date: Wed, 5 Apr 2017 14:51:00 -0500 Subject: [PATCH] ext: mcux: Adapt ksdk 1.3 for kw40z to work with mcux 2.x drivers Reuses the kw41z clock driver for kw40z via preprocessor includes. Copies the kw41z fsl_device_registers.h to kw40z and subset devices with minor modifications for each device. Jira: ZEP-1388 Change-Id: Ifae16eb9b7e7d18fc13c22dc51887fc1d8a5e21d Signed-off-by: Maureen Helm --- .../devices/MKW20Z4/fsl_device_registers.h | 56 +++++++++++++++++++ .../devices/MKW30Z4/fsl_device_registers.h | 56 +++++++++++++++++++ ext/hal/nxp/mcux/devices/MKW40Z4/fsl_clock.c | 1 + ext/hal/nxp/mcux/devices/MKW40Z4/fsl_clock.h | 1 + .../devices/MKW40Z4/fsl_device_registers.h | 56 +++++++++++++++++++ 5 files changed, 170 insertions(+) create mode 100644 ext/hal/nxp/mcux/devices/MKW20Z4/fsl_device_registers.h create mode 100644 ext/hal/nxp/mcux/devices/MKW30Z4/fsl_device_registers.h create mode 100644 ext/hal/nxp/mcux/devices/MKW40Z4/fsl_clock.c create mode 100644 ext/hal/nxp/mcux/devices/MKW40Z4/fsl_clock.h create mode 100644 ext/hal/nxp/mcux/devices/MKW40Z4/fsl_device_registers.h diff --git a/ext/hal/nxp/mcux/devices/MKW20Z4/fsl_device_registers.h b/ext/hal/nxp/mcux/devices/MKW20Z4/fsl_device_registers.h new file mode 100644 index 0000000000..d260bb5f86 --- /dev/null +++ b/ext/hal/nxp/mcux/devices/MKW20Z4/fsl_device_registers.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2014 - 2016, Freescale Semiconductor, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * o Redistributions of source code must retain the above copyright notice, this list + * of conditions and the following disclaimer. + * + * o Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * o Neither the name of Freescale Semiconductor, Inc. nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __FSL_DEVICE_REGISTERS_H__ +#define __FSL_DEVICE_REGISTERS_H__ + +/* + * Include the cpu specific register header files. + * + * The CPU macro should be declared in the project or makefile. + */ +#if (defined(CPU_MKW20Z160VHT4)) + +#define KW20Z4_SERIES + +/* CMSIS-style register definitions */ +#include "MKW20Z4.h" +/* CPU specific feature definitions */ +#include "MKW20Z4_features.h" + +#else + #error "No valid CPU defined!" +#endif + +#endif /* __FSL_DEVICE_REGISTERS_H__ */ + +/******************************************************************************* + * EOF + ******************************************************************************/ diff --git a/ext/hal/nxp/mcux/devices/MKW30Z4/fsl_device_registers.h b/ext/hal/nxp/mcux/devices/MKW30Z4/fsl_device_registers.h new file mode 100644 index 0000000000..3af268592b --- /dev/null +++ b/ext/hal/nxp/mcux/devices/MKW30Z4/fsl_device_registers.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2014 - 2016, Freescale Semiconductor, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * o Redistributions of source code must retain the above copyright notice, this list + * of conditions and the following disclaimer. + * + * o Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * o Neither the name of Freescale Semiconductor, Inc. nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __FSL_DEVICE_REGISTERS_H__ +#define __FSL_DEVICE_REGISTERS_H__ + +/* + * Include the cpu specific register header files. + * + * The CPU macro should be declared in the project or makefile. + */ +#if (defined(CPU_MKW30Z160VHM4)) + +#define KW30Z4_SERIES + +/* CMSIS-style register definitions */ +#include "MKW30Z4.h" +/* CPU specific feature definitions */ +#include "MKW30Z4_features.h" + +#else + #error "No valid CPU defined!" +#endif + +#endif /* __FSL_DEVICE_REGISTERS_H__ */ + +/******************************************************************************* + * EOF + ******************************************************************************/ diff --git a/ext/hal/nxp/mcux/devices/MKW40Z4/fsl_clock.c b/ext/hal/nxp/mcux/devices/MKW40Z4/fsl_clock.c new file mode 100644 index 0000000000..abb65fc8fe --- /dev/null +++ b/ext/hal/nxp/mcux/devices/MKW40Z4/fsl_clock.c @@ -0,0 +1 @@ +#include "../MKW41Z4/fsl_clock.c" diff --git a/ext/hal/nxp/mcux/devices/MKW40Z4/fsl_clock.h b/ext/hal/nxp/mcux/devices/MKW40Z4/fsl_clock.h new file mode 100644 index 0000000000..a63e953dce --- /dev/null +++ b/ext/hal/nxp/mcux/devices/MKW40Z4/fsl_clock.h @@ -0,0 +1 @@ +#include "../MKW41Z4/fsl_clock.h" diff --git a/ext/hal/nxp/mcux/devices/MKW40Z4/fsl_device_registers.h b/ext/hal/nxp/mcux/devices/MKW40Z4/fsl_device_registers.h new file mode 100644 index 0000000000..3265221ceb --- /dev/null +++ b/ext/hal/nxp/mcux/devices/MKW40Z4/fsl_device_registers.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2014 - 2016, Freescale Semiconductor, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * o Redistributions of source code must retain the above copyright notice, this list + * of conditions and the following disclaimer. + * + * o Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * o Neither the name of Freescale Semiconductor, Inc. nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __FSL_DEVICE_REGISTERS_H__ +#define __FSL_DEVICE_REGISTERS_H__ + +/* + * Include the cpu specific register header files. + * + * The CPU macro should be declared in the project or makefile. + */ +#if (defined(CPU_MKW40Z160VHT4)) + +#define KW40Z4_SERIES + +/* CMSIS-style register definitions */ +#include "MKW40Z4.h" +/* CPU specific feature definitions */ +#include "MKW40Z4_features.h" + +#else + #error "No valid CPU defined!" +#endif + +#endif /* __FSL_DEVICE_REGISTERS_H__ */ + +/******************************************************************************* + * EOF + ******************************************************************************/