mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
Fix nxstyle errors and warnings
Signed-off-by: Michal Lenc <lencmich@fel.cvut.cz>
This commit is contained in:
committed by
Alan Carvalho de Assis
parent
1f323fe6be
commit
b5e9961036
@@ -1,57 +1,39 @@
|
||||
/****************************************************************************************************
|
||||
/****************************************************************************
|
||||
* arch/arm/src/imxrt/hardware/imxrt_flexcan.h
|
||||
*
|
||||
* Copyright (C) 2020 Gregory Nutt. All rights reserved.
|
||||
* Author: Michal Lenc <lencmich@fel.cvut.cz>
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you 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
|
||||
*
|
||||
* Based on: arch/arm/src/s32k1xx/hardware/s32k1xx_flexcan.h
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 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.
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. 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.
|
||||
* 3. Neither the name NuttX 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 OWNER 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 __ARCH_ARM_SRC_IMXRT_HARDWARE_IMXRT_FLEXCAN_H
|
||||
#define __ARCH_ARM_SRC_IMXRT_HARDWARE_IMXRT_FLEXCAN_H
|
||||
|
||||
/****************************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include "chip.h"
|
||||
|
||||
/****************************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* Register Offsets *********************************************************************************/
|
||||
/* Register Offsets *********************************************************/
|
||||
|
||||
#define IMXRT_CAN_MCR_OFFSET 0x0000 /* Module Configuration Register */
|
||||
#define IMXRT_CAN_CTRL1_OFFSET 0x0004 /* Control 1 Register */
|
||||
@@ -146,7 +128,7 @@
|
||||
#define IMXRT_CAN_FDCRC_OFFSET 0x0c08 /* CAN FD CRC register */
|
||||
#endif /* CONFIG_IMXRT_FLEXCAN3 */
|
||||
|
||||
/* Register Bit Definitions *************************************************************************/
|
||||
/* Register Bit Definitions *************************************************/
|
||||
|
||||
/* Module Configuration Register */
|
||||
|
||||
@@ -470,13 +452,12 @@
|
||||
/* an incoming Remote Request Frame. */
|
||||
#define CAN_TXMB_NOTUSED 0xF /* Not used.*/
|
||||
|
||||
|
||||
/****************************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_IMXRT_HARDWARE_IMXRT_FLEXCAN_H */
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
/* Register offsets *****************************************************************************************/
|
||||
|
||||
#define IMXRT_CCM_CCR_OFFSET 0x0000 /* CCM Control Register */
|
||||
/* 0x0004 Reserved */
|
||||
/* 0x0004 Reserved */
|
||||
#define IMXRT_CCM_CSR_OFFSET 0x0008 /* CCM Status Register */
|
||||
#define IMXRT_CCM_CCSR_OFFSET 0x000c /* CCM Clock Switcher Register */
|
||||
#define IMXRT_CCM_CACRR_OFFSET 0x0010 /* CCM Arm Clock Root Register */
|
||||
@@ -63,14 +63,14 @@
|
||||
#define IMXRT_CCM_CS1CDR_OFFSET 0x0028 /* CCM Clock Divider Register */
|
||||
#define IMXRT_CCM_CS2CDR_OFFSET 0x002c /* CCM Clock Divider Register */
|
||||
#define IMXRT_CCM_CDCDR_OFFSET 0x0030 /* CCM D1 Clock Divider Register */
|
||||
/* 0x0034 Reserved */
|
||||
/* 0x0034 Reserved */
|
||||
#define IMXRT_CCM_CSCDR2_OFFSET 0x0038 /* CCM Serial Clock Divider Register 2 */
|
||||
#define IMXRT_CCM_CSCDR3_OFFSET 0x003c /* CCM Serial Clock Divider Register 3 */
|
||||
/* 0x0040 Reserved */
|
||||
/* 0x0044 Reserved */
|
||||
/* 0x0040 Reserved */
|
||||
/* 0x0044 Reserved */
|
||||
#define IMXRT_CCM_CDHIPR_OFFSET 0x0048 /* CCM Divider Handshake In-Process Register */
|
||||
/* 0x004c Reserved */
|
||||
/* 0x0050 Reserved */
|
||||
/* 0x004c Reserved */
|
||||
/* 0x0050 Reserved */
|
||||
#define IMXRT_CCM_CLPCR_OFFSET 0x0054 /* CCM Low Power Control Register */
|
||||
|
||||
#define IMXRT_CCM_CISR_OFFSET 0x0058 /* CCM Interrupt Status Register */
|
||||
@@ -85,7 +85,7 @@
|
||||
#define IMXRT_CCM_CCGR5_OFFSET 0x007c /* CCM Clock Gating Register 5 */
|
||||
#define IMXRT_CCM_CCGR6_OFFSET 0x0080 /* CCM Clock Gating Register 6 */
|
||||
#define IMXRT_CCM_CCGR7_OFFSET 0x0084 /* CCM Clock Gating Register 7 */
|
||||
/* 0x0084 Reserved */
|
||||
/* 0x0084 Reserved */
|
||||
#define IMXRT_CCM_CMEOR_OFFSET 0x0088 /* CCM Module Enable Override Register */
|
||||
|
||||
/* Analog */
|
||||
@@ -182,6 +182,7 @@
|
||||
# define CCM_CCR_REG_BYPASS_COUNT(n) ((uint32_t)(n) << CCM_CCR_REG_BYPASS_COUNT_SHIFT)
|
||||
#define CCM_CCR_RBC_EN (1 << 27) /* Bit 27: Enable for REG_BYPASS_COUNTER */
|
||||
/* Bits 28-31: Reserved */
|
||||
|
||||
/* Status Register */
|
||||
|
||||
#define CCM_CSR_REF_EN_B (1 << 0) /* Bit 0: Status of the value of CCM_REF_EN_B */
|
||||
@@ -190,6 +191,7 @@
|
||||
/* Bit 4: Reserved */
|
||||
#define CCM_CSR_COSC_READY (5 << 0) /* Bit 5: Status indication of on board oscillator */
|
||||
/* Bits 6-31: Reserved */
|
||||
|
||||
/* Clock Switcher Register */
|
||||
|
||||
#define CCM_CCSR_PLL3_SW_CLK_SEL (1 << 0) /* Bit 0: Selects source to generate pll3_sw_clk */
|
||||
@@ -489,6 +491,7 @@
|
||||
# define CCM_CLPCR_LPM_RUN ((uint32_t)(0) << CCM_CLPCR_LPM_SHIFT) /* Remain in run mode */
|
||||
# define CCM_CLPCR_LPM_WAIT ((uint32_t)(1) << CCM_CLPCR_LPM_SHIFT) /* Transfer to wait mode */
|
||||
# define CCM_CLPCR_LPM_STOP ((uint32_t)(2) << CCM_CLPCR_LPM_SHIFT) /* Transfer to stop mode */
|
||||
|
||||
/* Bits 2-4: Reserved */
|
||||
#define CCM_CLPCR_ARM_CLK_DIS_ON_LPM (1 << 5) /* Bit 5: ARM clocks disabled on wait mode */
|
||||
#define CCM_CLPCR_SBYOS (1 << 6) /* Bit 6: Standby clock oscillator bit */
|
||||
@@ -799,7 +802,8 @@
|
||||
#define CCM_ANALOG_PLL_ARM_BYPASS_CLK_SRC_MASK (0x3 << CCM_ANALOG_PLL_ARM_BYPASS_CLK_SRC_SHIFT)
|
||||
# define CCM_ANALOG_PLL_ARM_BYPASS_CLK_SRC_REF_24M ((uint32_t)(0) << CCM_ANALOG_PLL_ARM_BYPASS_CLK_SRC_SHIFT) /* Select 24Mhz Osc as source */
|
||||
# define CCM_ANALOG_PLL_ARM_BYPASS_CLK_SRC_CLK1 ((uint32_t)(1) << CCM_ANALOG_PLL_ARM_BYPASS_CLK_SRC_SHIFT) /* Select the CLK1_N / CLK1_P as source */
|
||||
#define CCM_ANALOG_PLL_ARM_BYPASS (1 << 16) /* Bit 16: Bypass the PLL */
|
||||
#define CCM_ANALOG_PLL_ARM_BYPASS (1 << 16) /* Bit 16: Bypass the PLL */
|
||||
|
||||
/* Bits 17-18 Reserved */
|
||||
#define CCM_ANALOG_PLL_ARM_PLL_SEL (1 << 39) /* Bit 19: ? */
|
||||
#define CCM_ANALOG_PLL_ARM_LOCK (1 << 31) /* Bit 31: PLL is currently locked */
|
||||
@@ -820,7 +824,8 @@
|
||||
# define CCM_ANALOG_PLL_USB1_BYPASS_CLK_SRC_CLK1 ((uint32_t)(1) << CCM_ANALOG_PLL_USB1_BYPASS_CLK_SRC_SHIFT) /* Select the CLK1_N / CLK1_P as source */
|
||||
# define CCM_ANALOG_PLL_USB1_BYPASS_CLK_SRC_GPANAIO ((uint32_t)(2) << CCM_ANALOG_PLL_USB1_BYPASS_CLK_SRC_SHIFT) /* */
|
||||
# define CCM_ANALOG_PLL_USB1_BYPASS_CLK_SRC_CHRG_DET_B ((uint32_t)(3) << CCM_ANALOG_PLL_USB1_BYPASS_CLK_SRC_SHIFT) /* */
|
||||
#define CCM_ANALOG_PLL_USB1_BYPASS (1 << 16) /* Bit 16: Bypass the PLL */
|
||||
#define CCM_ANALOG_PLL_USB1_BYPASS (1 << 16) /* Bit 16: Bypass the PLL */
|
||||
|
||||
/* Bits 17-30 Reserved */
|
||||
#define CCM_ANALOG_PLL_USB1_LOCK (1 << 31) /* Bit 31: PLL is currently locked */
|
||||
|
||||
@@ -838,7 +843,8 @@
|
||||
#define CCM_ANALOG_PLL_USB2_BYPASS_CLK_SRC_MASK (0x3 << CCM_ANALOG_PLL_USB2_BYPASS_CLK_SRC_SHIFT)
|
||||
# define CCM_ANALOG_PLL_USB2_BYPASS_CLK_SRC_REF_24M ((uint32_t)(0) << CCM_ANALOG_PLL_USB2_BYPASS_CLK_SRC_SHIFT) /* Select 24Mhz Osc as source */
|
||||
# define CCM_ANALOG_PLL_USB2_BYPASS_CLK_SRC_CLK1 ((uint32_t)(1) << CCM_ANALOG_PLL_USB2_BYPASS_CLK_SRC_SHIFT) /* Select the CLK1_N / CLK1_P as source */
|
||||
#define CCM_ANALOG_PLL_USB2_BYPASS (1 << 16) /* Bit 16: Bypass the PLL */
|
||||
#define CCM_ANALOG_PLL_USB2_BYPASS (1 << 16) /* Bit 16: Bypass the PLL */
|
||||
|
||||
/* Bits 17-30 Reserved */
|
||||
#define CCM_ANALOG_PLL_USB2_LOCK (1 << 31) /* Bit 31: PLL is currently locked */
|
||||
|
||||
@@ -857,9 +863,11 @@
|
||||
# define CCM_ANALOG_PLL_SYS_BYPASS_CLK_SRC_CLK1 ((uint32_t)(1) << CCM_ANALOG_PLL_SYS_BYPASS_CLK_SRC_SHIFT) /* Select the CLK1_N / CLK1_P as source */
|
||||
# define CCM_ANALOG_PLL_SYS_BYPASS_CLK_SRC_GPANAIO ((uint32_t)(2) << CCM_ANALOG_PLL_SYS_BYPASS_CLK_SRC_SHIFT) /* */
|
||||
# define CCM_ANALOG_PLL_SYS_BYPASS_CLK_SRC_CHRG_DET_B ((uint32_t)(3) << CCM_ANALOG_PLL_SYS_BYPASS_CLK_SRC_SHIFT) /* */
|
||||
#define CCM_ANALOG_PLL_SYS_BYPASS (1 << 16) /* Bit 16: Bypass the PLL */
|
||||
#define CCM_ANALOG_PLL_SYS_BYPASS (1 << 16) /* Bit 16: Bypass the PLL */
|
||||
|
||||
/* Bit 17: Reserved */
|
||||
#define CCM_ANALOG_PLL_SYS_PFD_OFFSET_EN (1 << 18) /* Bit 18: Enables an offset in the phase frequency detector */
|
||||
|
||||
/* Bits 19-30 Reserved */
|
||||
#define CCM_ANALOG_PLL_SYS_LOCK (1 << 31) /* Bit 31: PLL is currently locked */
|
||||
|
||||
@@ -899,7 +907,8 @@
|
||||
#define CCM_ANALOG_PLL_AUDIO_BYPASS_CLK_SRC_MASK (0x3 << CCM_ANALOG_PLL_AUDIO_BYPASS_CLK_SRC_SHIFT)
|
||||
# define CCM_ANALOG_PLL_AUDIO_BYPASS_CLK_SRC_REF_24M ((uint32_t)(0) << CCM_ANALOG_PLL_AUDIO_BYPASS_CLK_SRC_SHIFT) /* Select 24Mhz Osc as source */
|
||||
# define CCM_ANALOG_PLL_AUDIO_BYPASS_CLK_SRC_CLK1 ((uint32_t)(1) << CCM_ANALOG_PLL_AUDIO_BYPASS_CLK_SRC_SHIFT) /* Select the CLK1_N / CLK1_P as source */
|
||||
#define CCM_ANALOG_PLL_AUDIO_BYPASS (1 << 16) /* Bit 16: Bypass the PLL */
|
||||
#define CCM_ANALOG_PLL_AUDIO_BYPASS (1 << 16) /* Bit 16: Bypass the PLL */
|
||||
|
||||
/* Bit 17: Reserved */
|
||||
#define CCM_ANALOG_PLL_AUDIO_PFD_OFFSET_EN (1 << 18) /* Bit 18: Enables an offset in the phase frequency detector */
|
||||
#define CCM_ANALOG_PLL_AUDIO_POST_DIV_SELECT_SHIFT (19) /* Bits 19-20: These bits implement a divider after the PLL */
|
||||
@@ -922,7 +931,8 @@
|
||||
#define CCM_ANALOG_PLL_AUDIO_DENOM_B_SHIFT (0) /* Bits 0-29: 30 bit numerator (A) */
|
||||
#define CCM_ANALOG_PLL_AUDIO_DENOM_B_MASK (0x3FFFFFFF << CCM_ANALOG_PLL_AUDIO_DENOM_B_SHIFT)
|
||||
#define CCM_ANALOG_PLL_AUDIO_DENOM_B(n) ((uint32_t)(n) << CCM_ANALOG_PLL_AUDIO_DENOM_B_SHIFT)
|
||||
/* Bits 30-31: Reserved */
|
||||
/* Bits 30-31: Reserved */
|
||||
|
||||
/* Analog Video PLL control Register */
|
||||
|
||||
#define CCM_ANALOG_PLL_VIDEO_DIV_SELECT_SHIFT (0) /* Bits 0-6: This field controls the PLL loop divider: 27-54 */
|
||||
@@ -935,7 +945,8 @@
|
||||
#define CCM_ANALOG_PLL_VIDEO_BYPASS_CLK_SRC_MASK (0x3 << CCM_ANALOG_PLL_VIDEO_BYPASS_CLK_SRC_SHIFT)
|
||||
# define CCM_ANALOG_PLL_VIDEO_BYPASS_CLK_SRC_REF_24M ((uint32_t)(0) << CCM_ANALOG_PLL_VIDEO_BYPASS_CLK_SRC_SHIFT) /* Select 24Mhz Osc as source */
|
||||
# define CCM_ANALOG_PLL_VIDEO_BYPASS_CLK_SRC_CLK1 ((uint32_t)(1) << CCM_ANALOG_PLL_VIDEO_BYPASS_CLK_SRC_SHIFT) /* Select the CLK1_N / CLK1_P as source */
|
||||
#define CCM_ANALOG_PLL_VIDEO_BYPASS (1 << 16) /* Bit 16: Bypass the PLL */
|
||||
#define CCM_ANALOG_PLL_VIDEO_BYPASS (1 << 16) /* Bit 16: Bypass the PLL */
|
||||
|
||||
/* Bit 17: Reserved */
|
||||
#define CCM_ANALOG_PLL_VIDEO_PFD_OFFSET_EN (1 << 18) /* Bit 18: Enables an offset in the phase frequency detector */
|
||||
#define CCM_ANALOG_PLL_VIDEO_POST_DIV_SELECT_SHIFT (19) /* Bits 19-20: These bits implement a divider after the PLL */
|
||||
@@ -977,11 +988,12 @@
|
||||
/* Bits 4-11: Reserved */
|
||||
#define CCM_ANALOG_PLL_ENET_POWERDOWN (1 << 12) /* Bit 12: Powers down the PLL */
|
||||
#define CCM_ANALOG_PLL_ENET_ENET1_125M_EN (1 << 13) /* Bit 13: Enable the PLL providing the ENET1 125 MHz reference clock */
|
||||
#define CCM_ANALOG_PLL_ENET_BYPASS_CLK_SRC_SHIFT (14) /* Bits 14-15: Determines the bypass source */
|
||||
#define CCM_ANALOG_PLL_ENET_BYPASS_CLK_SRC_SHIFT (14) /* Bits 14-15: Determines the bypass source */
|
||||
#define CCM_ANALOG_PLL_ENET_BYPASS_CLK_SRC_MASK (0x3 << CCM_ANALOG_PLL_ENET_BYPASS_CLK_SRC_SHIFT)
|
||||
# define CCM_ANALOG_PLL_ENET_BYPASS_CLK_SRC_REF_24M ((uint32_t)(0) << CCM_ANALOG_PLL_ENET_BYPASS_CLK_SRC_SHIFT) /* Select 24Mhz Osc as source */
|
||||
# define CCM_ANALOG_PLL_ENET_BYPASS_CLK_SRC_CLK1 ((uint32_t)(1) << CCM_ANALOG_PLL_ENET_BYPASS_CLK_SRC_SHIFT) /* Select the CLK1_N / CLK1_P as source */
|
||||
#define CCM_ANALOG_PLL_ENET_BYPASS (1 << 16) /* Bit 16: Bypass the PLL */
|
||||
#define CCM_ANALOG_PLL_ENET_BYPASS (1 << 16) /* Bit 16: Bypass the PLL */
|
||||
|
||||
/* Bit 17: Reserved */
|
||||
#define CCM_ANALOG_PLL_ENET_PFD_OFFSET_EN (1 << 18) /* Bit 18: Enables an offset in the phase frequency detector */
|
||||
#define CCM_ANALOG_PLL_ENET_ENABLE_125M (1 << 19) /* Bit 19: */
|
||||
|
||||
@@ -621,20 +621,23 @@ void imxrt_clockconfig(void)
|
||||
|
||||
#ifdef CONFIG_IMXRT_FLEXCAN
|
||||
/* Set FlexCAN clock source to PLL3 80M */
|
||||
|
||||
reg = getreg32(IMXRT_CCM_CSCMR2);
|
||||
reg &= ~CCM_CSCMR2_CAN_CLK_SEL_MASK;
|
||||
reg |= IMXRT_CAN_CLK_SELECT;
|
||||
putreg32(reg, IMXRT_CCM_CSCMR2);
|
||||
|
||||
/* Set FlexCAN dividet to 1 for 80 MHz */
|
||||
|
||||
reg = getreg32(IMXRT_CCM_CSCMR2);
|
||||
reg &= ~CCM_CSCMR2_CAN_CLK_PODF_MASK;
|
||||
reg |= CCM_CSCMR2_CAN_CLK_PODF(
|
||||
CCM_PODF_FROM_DIVISOR(IMXRT_CAN_PODF_DIVIDER)
|
||||
);
|
||||
putreg32(reg, IMXRT_CCM_CSCMR2);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef CONFIG_IMXRT_LPSPI
|
||||
/* Set LPSPI clock source to PLL3 PFD0 */
|
||||
|
||||
|
||||
@@ -1687,7 +1687,6 @@ int imxrt_caninitialize(int intf)
|
||||
{
|
||||
struct imxrt_driver_s *priv;
|
||||
int ret;
|
||||
uint32_t regval;
|
||||
#ifdef TX_TIMEOUT_WQ
|
||||
uint32_t i;
|
||||
#endif
|
||||
@@ -1845,7 +1844,6 @@ int imxrt_caninitialize(int intf)
|
||||
#if !defined(CONFIG_NETDEV_LATEINIT)
|
||||
void arm_netinitialize(void)
|
||||
{
|
||||
|
||||
#ifdef CONFIG_IMXRT_FLEXCAN1
|
||||
imxrt_caninitialize(1);
|
||||
#endif
|
||||
@@ -1857,7 +1855,6 @@ void arm_netinitialize(void)
|
||||
#ifdef CONFIG_IMXRT_FLEXCAN3
|
||||
imxrt_caninitialize(3);
|
||||
#endif
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,47 +1,29 @@
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* arch/arm/src/imxrt/imxrt_flexcan.h
|
||||
*
|
||||
* Copyright (C) 2020 Gregory Nutt. All rights reserved.
|
||||
* Author: Michal Lenc <lencmich@fel.cvut.cz>
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you 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
|
||||
*
|
||||
* Based on: arch/arm/src/s32k1xx/hardware/s32k1xx_flexcan.h
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 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.
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. 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.
|
||||
* 3. Neither the name NuttX 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 OWNER 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 __ARCH_ARM_SRC_IMXRT_IMXRT_FLEXCAN_H
|
||||
#define __ARCH_ARM_SRC_IMXRT_IMXRT_FLEXCAN_H
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
@@ -49,13 +31,13 @@
|
||||
|
||||
#ifdef CONFIG_IMXRT_FLEXCAN
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
@@ -68,8 +50,7 @@ extern "C"
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Function: arm_caninitialize
|
||||
*
|
||||
* Description:
|
||||
@@ -87,14 +68,13 @@ extern "C"
|
||||
* Assumptions:
|
||||
* Called very early in the initialization sequence.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_NETDEV_LATEINIT)
|
||||
|
||||
void arm_netinitialize(void);
|
||||
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Function: imxrt_caninitialize
|
||||
*
|
||||
* Description:
|
||||
@@ -109,7 +89,7 @@ void arm_netinitialize(void);
|
||||
*
|
||||
* Assumptions:
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#else
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/********************************************************************************************
|
||||
/************************************************************************************
|
||||
* arch/arm/src/imxrt/imxrt_periphclks.h
|
||||
*
|
||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||
@@ -31,22 +31,22 @@
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*********************************************************************************************/
|
||||
************************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_IMXRT_IMXRT_PERIPHCLKS_H
|
||||
#define __ARCH_ARM_SRC_IMXRT_IMXRT_PERIPHCLKS_H
|
||||
|
||||
/********************************************************************************************
|
||||
/************************************************************************************
|
||||
* Included Files
|
||||
*********************************************************************************************/
|
||||
************************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <stdint.h>
|
||||
#include "hardware/imxrt_ccm.h"
|
||||
|
||||
/********************************************************************************************
|
||||
/************************************************************************************
|
||||
* Pre-processor Definitions
|
||||
*********************************************************************************************/
|
||||
************************************************************************************/
|
||||
|
||||
/* Clock is off during all modes. Stop enter hardware handshake is disabled. */
|
||||
|
||||
@@ -390,11 +390,7 @@ extern "C"
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/********************************************************************************************
|
||||
* Public Functions
|
||||
*********************************************************************************************/
|
||||
|
||||
/********************************************************************************************
|
||||
/************************************************************************************
|
||||
* Name: imxrt_periphclk_configure
|
||||
*
|
||||
* Description:
|
||||
@@ -409,7 +405,7 @@ extern "C"
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
*********************************************************************************************/
|
||||
************************************************************************************/
|
||||
|
||||
void imxrt_periphclk_configure(uintptr_t regaddr, unsigned int index,
|
||||
unsigned int value);
|
||||
|
||||
@@ -64,7 +64,6 @@ CONFIG_NET_SOCKOPTS=y
|
||||
CONFIG_NET_STATISTICS=y
|
||||
CONFIG_NET_TIMESTAMP=y
|
||||
CONFIG_NFILE_DESCRIPTORS=8
|
||||
CONFIG_NFILE_STREAMS=8
|
||||
CONFIG_NSH_ARCHINIT=y
|
||||
CONFIG_NSH_BUILTIN_APPS=y
|
||||
CONFIG_NSH_FILEIOSIZE=512
|
||||
|
||||
@@ -65,7 +65,6 @@ CONFIG_NET_CAN_SOCK_OPTS=y
|
||||
CONFIG_NET_STATISTICS=y
|
||||
CONFIG_NET_TIMESTAMP=y
|
||||
CONFIG_NFILE_DESCRIPTORS=8
|
||||
CONFIG_NFILE_STREAMS=8
|
||||
CONFIG_NSH_ARCHINIT=y
|
||||
CONFIG_NSH_BUILTIN_APPS=y
|
||||
CONFIG_NSH_FILEIOSIZE=512
|
||||
|
||||
@@ -326,7 +326,6 @@
|
||||
#define GPIO_LPSPI3_MISO (GPIO_LPSPI3_SDI_2|IOMUX_LPSPI_DEFAULT) /* GPIO_AD_B0_02 */
|
||||
#define GPIO_LPSPI3_MOSI (GPIO_LPSPI3_SDO_2|IOMUX_LPSPI_DEFAULT) /* GPIO_AD_B0_01 */
|
||||
|
||||
|
||||
/* FlexCAN */
|
||||
|
||||
#define GPIO_FLEXCAN2_TX (GPIO_FLEXCAN2_TX_3|IOMUX_CAN_DEFAULT)
|
||||
|
||||
@@ -85,6 +85,7 @@ int board_app_initialize(uintptr_t arg)
|
||||
{
|
||||
#ifdef HAVE_LEDS
|
||||
/* Register the LED driver */
|
||||
|
||||
int ret;
|
||||
ret = userled_lower_initialize(LED_DRIVER_PATH);
|
||||
if (ret < 0)
|
||||
|
||||
@@ -1,33 +1,20 @@
|
||||
/****************************************************************************
|
||||
* boards/arm/imxrt/imxrt1060-evk/src/imxrt_flexcan.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you 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
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. 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.
|
||||
* 3. Neither the name NuttX 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 OWNER 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.
|
||||
* 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
@@ -64,7 +51,7 @@ int imxrt_can_setup(void)
|
||||
{
|
||||
int ret;
|
||||
#if defined(CONFIG_IMXRT_FLEXCAN3) && defined(CONFIG_IMXRT_FLEXCAN2)
|
||||
canerr("ERROR: Only one FlexCAN interface can be defined at the same time on imxrt1060-evk\n");
|
||||
canerr("ERROR: Only one FlexCAN can be defined at the same time\n");
|
||||
return -ENODEV;
|
||||
#endif
|
||||
|
||||
@@ -85,7 +72,7 @@ int imxrt_can_setup(void)
|
||||
return -ENODEV;
|
||||
}
|
||||
#elif CONFIG_IMXRT_FLEXCAN1
|
||||
canerr("ERROR: FlexCAN1 is not available on imxrt1060-evk. Please choose FlexCAN2 or FlexCAN3 (CAN_FD available)\n");
|
||||
canerr("ERROR: FlexCAN1 is not available on imxrt1060-evk\n");
|
||||
return -ENODEV;
|
||||
#else
|
||||
return -ENODEV;
|
||||
|
||||
Reference in New Issue
Block a user