Skip to content

arch/arm/soc/nxp_imx: added support to imx7d m4 core #5330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*.swp
*.swo
*~
*.DS_Store
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really sure we should be adding this, and if it should be in a separate PR/commit.

build
cscope.*
.dir
Expand Down
10 changes: 10 additions & 0 deletions arch/arm/soc/nxp_imx/mcimx7_m4/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#
# Copyright (c) 2017, NXP
#
# SPDX-License-Identifier: Apache-2.0
#

zephyr_sources(
soc.c
)

49 changes: 49 additions & 0 deletions arch/arm/soc/nxp_imx/mcimx7_m4/Kconfig.defconfig.mcimx7_m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Kconfig - i.MX RT1052
#
# Copyright (c) 2017, NXP
#
# SPDX-License-Identifier: Apache-2.0
#

if SOC_MCIMX7_M4

config SOC
string
default mcimx7d

config SYS_CLOCK_TICKS_PER_SEC
int
default 1000

config SYS_CLOCK_HW_CYCLES_PER_SEC
int
default 200000000

config RDC_IMX_RDC
def_bool y

if CLOCK_CONTROL

config CLOCK_CONTROL_IMX_CCM
def_bool y

endif # CLOCK_CONTROL

config GPIO
def_bool y

if GPIO

config GPIO_IMX_IGPIO
def_bool y

endif # GPIO

if SERIAL

config UART_IMX_UART
def_bool y

endif # SERIAL

endif # SOC_MCIMX7_M4
24 changes: 24 additions & 0 deletions arch/arm/soc/nxp_imx/mcimx7_m4/Kconfig.defconfig.series
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Kconfig - iMX7 M4 core series
#
# Copyright (c) 2017, NXP
#
# SPDX-License-Identifier: Apache-2.0
#

if SOC_SERIES_IMX7_M4

config SOC_SERIES
default mcimx7_m4

config NUM_IRQ_PRIO_BITS
int
default 4

config NUM_IRQS
int
# must be >= the highest interrupt number used
default 127

source "arch/arm/soc/nxp_imx/mcimx7_m4/Kconfig.defconfig.mcimx7_m4"

endif # SOC_SERIES_IMX7_M4
17 changes: 17 additions & 0 deletions arch/arm/soc/nxp_imx/mcimx7_m4/Kconfig.series
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Kconfig - iMX7 M4 core series
#
# Copyright (c) 2017, NXP
#
# SPDX-License-Identifier: Apache-2.0
#

config SOC_SERIES_IMX7_M4
bool "i.MX7 M4 Core Series"
select CPU_CORTEX_M
select CPU_CORTEX_M4
select SOC_FAMILY_IMX
select SYS_POWER_LOW_POWER_STATE_SUPPORTED
select CPU_HAS_SYSTICK
select CLOCK_CONTROL
help
Enable support for i.MX7 M4 MCU series
31 changes: 31 additions & 0 deletions arch/arm/soc/nxp_imx/mcimx7_m4/Kconfig.soc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Kconfig - iMX7 M4 core series
#
# Copyright (c) 2017, NXP
#
# SPDX-License-Identifier: Apache-2.0
#

choice
prompt "i.MX7 M4 Selection"
depends on SOC_SERIES_IMX7_M4

config SOC_MCIMX7_M4
bool "SOC_MCIMX7_M4"
select HAS_IMX_HAL

endchoice

if SOC_MCIMX7_M4

config SOC_PART_NUMBER_MCIMX7D5EVM10SC
bool

config SOC_PART_NUMBER_IMX7_M4
string
default "MCIMX7D5EVM10SC" if SOC_PART_NUMBER_MCIMX7D5EVM10SC
help
This string holds the full part number of the SoC. It is a hidden option
that you should not set directly. The part number selection choice defines
the default value for this string.

endif # SOC_SERIES_IMX7_M4
7 changes: 7 additions & 0 deletions arch/arm/soc/nxp_imx/mcimx7_m4/linker.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright (c) 2014 Wind River Systems, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <arch/arm/cortex_m/scripts/linker.ld>
13 changes: 13 additions & 0 deletions arch/arm/soc/nxp_imx/mcimx7_m4/soc.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <device.h>
#include <init.h>
#include <soc.h>


static int nxp_mcimx7_init(struct device *arg)
{
ARG_UNUSED(arg);

return 0;
}

SYS_INIT(nxp_mcimx7_init, PRE_KERNEL_1, 0);
27 changes: 27 additions & 0 deletions arch/arm/soc/nxp_imx/mcimx7_m4/soc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright (c) 2017, NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

#ifndef _SOC__H_
#define _SOC__H_

#include <misc/util.h>

#ifdef __cplusplus
extern "C" {
#endif

#ifndef _ASMLANGUAGE

#include <device.h>
#include <misc/util.h>

#endif /* !_ASMLANGUAGE */

#ifdef __cplusplus
}
#endif

#endif /* _SOC__H_ */
9 changes: 9 additions & 0 deletions boards/arm/colibri_imx7d_m4/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# Copyright (c) 2017, NXP
#
# SPDX-License-Identifier: Apache-2.0
#

zephyr_library()
zephyr_library_include_directories(${PROJECT_SOURCE_DIR}/drivers)
zephyr_library_sources(board.c)
5 changes: 5 additions & 0 deletions boards/arm/colibri_imx7d_m4/Kconfig.board
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

config BOARD_COLIBRI_IMX7D_M4
bool "Toradex Colibri iMX7 Dual"
depends on SOC_SERIES_IMX7_M4
select SOC_PART_NUMBER_MCIMX7D5EVM10SC
23 changes: 23 additions & 0 deletions boards/arm/colibri_imx7d_m4/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Kconfig - Colibri iMX7D M4 board
#
# 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace with SPDX header as in other files

#

if BOARD_COLIBRI_IMX7D_M4

config BOARD
default colibri_imx7d_m4

endif # BOARD_COLIBRI_IMX7D_M4
92 changes: 92 additions & 0 deletions boards/arm/colibri_imx7d_m4/board.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/*
* Copyright (c) 2015, 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, we need to keep MCUXpresso SDK files in ext/ only. For this particular case, I think it makes more sense to reimplement the board pinmuxing; see boards/mimxrt1050_evk/pinmux.c for an example.

*/

#include <stdio.h>
#include <init.h>
#include "board.h"
#include "ccm_imx7d.h"
#include "rdc.h"
#include "wdog_imx.h"
#include "uart_imx.h"

static void configure_uart_pins(UART_Type* base)
{
switch((uint32_t)base)
{
case UART2_BASE:
// UART2 iomux configuration
IOMUXC_SW_MUX_CTL_PAD_UART2_RX_DATA = IOMUXC_SW_MUX_CTL_PAD_UART2_RX_DATA_MUX_MODE(0);
IOMUXC_SW_MUX_CTL_PAD_UART2_TX_DATA = IOMUXC_SW_MUX_CTL_PAD_UART2_TX_DATA_MUX_MODE(0);
IOMUXC_SW_PAD_CTL_PAD_UART2_RX_DATA = IOMUXC_SW_PAD_CTL_PAD_UART2_RX_DATA_PE_MASK |
IOMUXC_SW_PAD_CTL_PAD_UART2_RX_DATA_PS(3) |
IOMUXC_SW_PAD_CTL_PAD_UART2_RX_DATA_HYS_MASK |
IOMUXC_SW_PAD_CTL_PAD_UART2_RX_DATA_DSE(0);
IOMUXC_SW_PAD_CTL_PAD_UART2_TX_DATA = IOMUXC_SW_PAD_CTL_PAD_UART2_TX_DATA_PE_MASK |
IOMUXC_SW_PAD_CTL_PAD_UART2_TX_DATA_PS(3) |
IOMUXC_SW_PAD_CTL_PAD_UART2_RX_DATA_HYS_MASK |
IOMUXC_SW_PAD_CTL_PAD_UART2_TX_DATA_DSE(0);
IOMUXC_UART2_RX_DATA_SELECT_INPUT = IOMUXC_UART2_RX_DATA_SELECT_INPUT_DAISY(3); /* Select TX_PAD for RX data (DTE mode...) */
break;
default:
break;
}
}


static void board_clock_init(void)
{
}

/* Initialize debug console. */
static void board_dbg_uart_init(void)
{
}

static void board_rdc_init(void)
{
}

static int colibri_imx7d_init(struct device *dev)
{
ARG_UNUSED(dev);

board_clock_init();
board_rdc_init();
configure_uart_pins(UART2);
board_dbg_uart_init();

return 0;
}

SYS_INIT(colibri_imx7d_init, PRE_KERNEL_1, 0);

/*******************************************************************************
* EOF
******************************************************************************/
50 changes: 50 additions & 0 deletions boards/arm/colibri_imx7d_m4/board.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Copyright (c) 2015, Freescale Semiconductor, Inc.
* Copyright (c) 2016, Toradex AG
* 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace with SPDX Apache header

*/

#if !defined(__BOARD_H__)
#define __BOARD_H__
#ifndef _ASMLANGUAGE

/* The board name */
#define BOARD_NAME "IMX7_COLIBRI_M4"
#define BOARD_DOMAIN_ID (1)


#if defined(__cplusplus)
extern "C" {
#endif /* __cplusplus */


#if defined(__cplusplus)
}
#endif /* __cplusplus */
#endif /* #ifndef _ASMLANGUAGE */
#endif /* __BOARD_H__ */
Loading