nuttx/boards/arm/imxrt/imxrt1170-evk/src/imxrt1170-evk.h
Peter van der Perk 9906163beb Base IMXRT1170 port
Co-authored-by: Jari van Ewijk <jari.vanewijk@nxp.com>

Co-authored-by: David Sidrane <david.sidrane@nscdg.com>

Co-authored-by: Peter van der Perk <peter.vanderperk@nxp.com>

imxrt:Kconfig fix formatting

imxrt:usbphy move IMXRT_USBPHY{1|[2]}_BASE to memory map

imxrt:lpspi Fix build breakage from adding 1170

imxrt:Finish 1170 iomux and clockconfig versioning

imxrt:Remove duplicate imxrt_clock{off|all}_lpi2c4

imxrt:pmu remove duplicate dcd non 117x header

imxrt:lpspi Fix unused var warnings

imxrt:lpi2c Fix unused var warnings

imxrt:lowputs Fix unused var warnings

imxrt:imxrt117x_dmamux fix duplicate entries

imxtr:serial Use IOMUX_PULL_{UP|DOWN} and map IOMUX V1 to them

imxrt:MPU Support the 1170

imxrt:dmamux Alias IMXRT_DMAMUX0_BASE as IMXRT_DMAMUX_BASE

imx1170:ccm Alias CCM_CCGR_DMA & CCM_CCGR_SNVS_LP for compatiblity

Author: Peter van der Perk <peter.vanderperk@nxp.com>

IMXRT7 Add LPUART 9/10/11/12 support

Author: David Sidrane <david.sidrane@nscdg.com>

imxrt:1170pinmux Add QTIMER pins

imxrt:1170pinmux Add GPT pins

imxrt:1170pinmux Add FLEXPWM pins

imxrt1170:pinmap Add GPIO_ENET_1G pinning

imxrt:enet Support ENET_1G

imxrt:periphclks rt1170 does not have canX_serial clock

imxrt:flexcan:Layer imxrt_ioctl

imxrt117x:memorymap added CAN3

imxrt:ADC support ver1 and ver2 for imxrt117x

imxrt:imxrt117x_ccm Align timer naming with other imxrt QTIMERn->TIMERn

imxrt:imxrt117x_ccm align CCM names with rt106x

imxrt:XBAR support larger number of selects needed on imxrt1170

Co-authored-by: Peter van der Perk <peter.vanderperk@nxp.com>

FlexSPI AHB Region support, PIT rename for compatiblity

imxrt:USB Analog add VBUS_VALID_3V

FlexSPI expand prefetch registers for IMXRT117X

imxrt:Support Initialization of FlexRam without Running from OCRAM

imxrt: ocotp add UNIQUE_ID register definition

imxrt: enet use ocotp unique_id

imxrt: enet fixes for imxrt117x

imxrt: ethernet pinmux sion enable

imxrt:imxrt_periphclk_configure add memory sync

   Flush the pipeline to prevent bus faults, by insuring a
   peripheral is clocked before being accessed on return from
   this function.

imxrt:Restructure gpioN to padmux mapping

imxrt:Add imxrt1170 daisy

imxrt: correct power modes for imxrt117x fixing hang on WFI

imxrt: imxrt117x TCM MPU config

imxrt: FlexRAM clocking DIV0 setup

imxrt: 117x periphclocks wait for status bit

imxrt: iomucx set pad settings correctly and allow reconfiguration

imxrt: enet align buffers 64-byte for optimal performance

Add DSC barriers for write-through cache support

imxrt: imxrt1170 use FlexCAN FD/ECC features

imxrt:iomuxc_ver2 (117x) SD_B1 and DISP_B1 use PULL feild not PUE/PUS

imxrt:Fix 1170 SNVS addressing

imxrt: enet set mii clock after ifdown so that phy keep working

nxstyle fixes

imxrt: preprocessor and include fixes

Fix configs

imxrt1170-evk clean defconfig
2023-12-07 03:48:19 -08:00

340 lines
11 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/****************************************************************************
* boards/arm/imxrt/imxrt1170-evk/src/imxrt1170-evk.h
*
* 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
*
* 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.
*
****************************************************************************/
/* Copyright 2022 NXP */
#ifndef __BOARDS_ARM_IMXRT_IMXRT1170_EVK_SRC_IMXRT1170_EVK_H
#define __BOARDS_ARM_IMXRT_IMXRT1170_EVK_SRC_IMXRT1170_EVK_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
#include <stdbool.h>
#include <arch/irq.h>
#include <nuttx/irq.h>
#include "imxrt_gpio.h"
#include "imxrt_iomuxc.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Touchscreen definitions **************************************************/
/* The i.MX RT1170 EVK has a connector (J48) for RK055AHD091-CTG or
* RK055IQH091-CTG LCDs. The RK055AHD091-CTG comes with the GT911
* touchscreen driver chip integrated. GT911 is connected to the LPI2C5 bus.
*/
/* LPI2C address of the GT911 touchscreen driver chip */
#define GT911_I2C_ADDRESS 0x5d
/* i.MX RT 1176 GPIO Pin Definitions ****************************************/
/* LEDs */
/* There are five LED status indicators located on the EVK Board.
* The functions of these LEDs include:
*
* - Main Power Supply (D16)
* Green: DC 5V main supply is normal.
* Red: J43 input voltage is over 5.6V.
* Off: The board is not powered.
* - Reset LED - Red (D7)
* - OpenSDA LED - Red (D5)
* - USER LED 1 - Green (D6)
* - USER LED 2 - Red (D34)
*
* Only two LEDs, D6 & D34, are under software control.
*/
#define GPIO_LED1 (GPIO_OUTPUT | IOMUX_LED_DEFAULT | GPIO_OUTPUT_ZERO | \
GPIO_PORT3 | GPIO_PIN3) /* GPIO_AD_04 */
#define GPIO_LED2 (GPIO_OUTPUT | IOMUX_LED_DEFAULT | GPIO_OUTPUT_ZERO | \
GPIO_PORT3 | GPIO_PIN25) /* GPIO_AD_26 */
#define LED_DRIVER_PATH "/dev/userleds"
/* Buttons ******************************************************************/
/* The IMXRT1170-EVK board has seven (sets of) switches or buttons:
*
* - External boot configuration switches (SW1)
* - External boot configuration switches (SW2)
* - MCU reset button (SW3)
* - System Reset Button / POR_BUTTON (SW4)
* - 5V power switch (SW5)
* - CPU ONOFF Button (SW6)
* - CPU Wakeup Button / USER_BUTTON (SW7)
*
* Only one button, SW7, can be used for user input.
*/
#define GPIO_SW7 (GPIO_INTERRUPT | GPIO_INTBOTH_EDGES | \
IOMUX_SW_DEFAULT | GPIO_PORT13 | \
GPIO_PIN0) /* WAKEUP */
#define GPIO_SW7_INT (_IMXRT_GPIO13_BASE+0)
/* LCD Backlight */
#define GPIO_LCD_BL (GPIO_OUTPUT | GPIO_OUTPUT_ZERO | GPIO_PORT3 | \
GPIO_PIN30 | IOMUX_LCD_BL_DEFAULT) /* GPIO_AD_30 */
/* 10/100 Mbps Ethernet & Gigabit Ethernet */
/* 10/100 Mbps Ethernet Interrupt: GPIO_AD_12
* Gigabit Ethernet Interrupt: GPIO_DISP_B2_12
*
* This pin has a week pull-up within the PHY, is open-drain, and requires
* an external 1k ohm pull-up resistor (present on the EVK). A falling
* edge then indicates a change in state of the PHY.
*/
#define GPIO_ENET_INT (IOMUX_ENET_INT_DEFAULT | GPIO_OUTPUT | \
GPIO_PORT3 | GPIO_PIN11) /* GPIO_AD_12 */
#define GPIO_ENET_IRQ IMXRT_IRQ_GPIO3_0_15
#define GPIO_ENET1G_INT (IOMUX_ENET_INT_DEFAULT | \
GPIO_PORT5 | GPIO_PIN13) /* GPIO_DISP_B2_12 */
#define GPIO_ENET1G_IRQ IMXRT_IRQ_GPIO5_13
/* 10/100 Mbps Ethernet Reset: GPIO_LPSR_12
* Gigabit Ethernet Reset: GPIO_DISP_B2_13
*
* The #RST uses inverted logic. The initial value of zero will put the
* PHY into the reset state.
*/
#define GPIO_ENET_RST (GPIO_OUTPUT | GPIO_OUTPUT_ZERO | \
GPIO_PORT6 | GPIO_PIN12 | \
IOMUX_ENET_RST_DEFAULT) /* GPIO_LPSR_12 */
#define GPIO_ENET1G_RST (GPIO_OUTPUT | GPIO_OUTPUT_ZERO | \
GPIO_PORT5 | GPIO_PIN14 | \
IOMUX_ENET_RST_DEFAULT) /* GPIO_DISP_B2_13 */
/* LPSPI1 CS: GPIO_AD_29 */
#define IOMUX_LPSPI1_CS (IOMUX_SLEW_FAST | IOMUX_DRIVE_HIGHSTRENGTH | \
IOMUX_PULL_UP)
#define GPIO_LPSPI1_CS (GPIO_OUTPUT | GPIO_OUTPUT_ONE | \
GPIO_PORT3 | GPIO_PIN28 | \
IOMUX_LPSPI1_CS) /* GPIO_AD_29 */
/* LPSPI6 CS: GPIO_LPSR_09 */
#define IOMUX_LPSPI6_CS (IOMUX_SLEW_FAST | IOMUX_DRIVE_HIGHSTRENGTH | \
IOMUX_PULL_UP)
#define GPIO_LPSPI6_CS (GPIO_OUTPUT | GPIO_OUTPUT_ONE | \
GPIO_PORT6 | GPIO_PIN9 | \
IOMUX_LPSPI6_CS) /* GPIO_LPSR_09 */
/* Touchscreen
*
* Interrupt line: GPIO_AD_00
*
* The interrupt line coming from the GT911 touchscreen driver IC.
* The touchscreen driver is integrated into the optional RK055AHD091-CTG LCD
* panel and it's connected to the LPI2C5 bus.
*
* Reset line: GPIO_AD_01
*
* The reset line is active low.
*/
#define GPIO_GT911_INTR IMXRT_IRQ_GPIO2_31 /* GPIO_AD_00 */
#define IOMUX_GT911_RST (IOMUX_PULL_NONE | IOMUX_CMOS_OUTPUT | \
IOMUX_DRIVE_40OHM | IOMUX_SPEED_MEDIUM | \
IOMUX_SLEW_SLOW)
#define GPIO_GT911_CTRST_N (GPIO_OUTPUT | GPIO_OUTPUT_ZERO | \
GPIO_PORT3 | GPIO_PIN0 | \
IOMUX_GT911_RST) /* GPIO_AD_01 */
/* Test Pins ****************************************************************/
#define BOARD_NGPIOIN 0 /* Amount of GPIO Input pins */
#define BOARD_NGPIOOUT 4 /* Amount of GPIO Output pins */
#define BOARD_NGPIOINT 0 /* Amount of GPIO Input w/ Interruption pins */
#define GPIO_GOUT1 (GPIO_OUTPUT | GPIO_OUTPUT_ZERO | IOMUX_GOUT_DEFAULT | \
GPIO_PORT5 | GPIO_PIN12) /* GPIO_DISP_B2_11 */
#define GPIO_GOUT2 (GPIO_OUTPUT | GPIO_OUTPUT_ZERO | IOMUX_GOUT_DEFAULT | \
GPIO_PORT5 | GPIO_PIN11) /* GPIO_DISP_B2_10 */
#define GPIO_GOUT3 (GPIO_OUTPUT | GPIO_OUTPUT_ZERO | IOMUX_GOUT_DEFAULT | \
GPIO_PORT5 | GPIO_PIN13) /* GPIO_DISP_B2_12 */
#define GPIO_GOUT4 (GPIO_OUTPUT | GPIO_OUTPUT_ZERO | IOMUX_GOUT_DEFAULT | \
GPIO_PORT3 | GPIO_PIN3) /* GPIO_AD_04 */
/* USB OTG1 ID Pin GPIO_AD_09
* USB OTG2 ID Pin GPIO_AD_08
*/
#define GPIO_USBOTG1_ID (GPIO_USB_OTG1_ID_1 | IOMUX_USBOTG_ID_DEFAULT) /* GPIO_AD_09 */
#define GPIO_USBOTG2_ID (GPIO_USB_OTG2_ID_1 | IOMUX_USBOTG_ID_DEFAULT) /* GPIO_AD_08 */
/****************************************************************************
* Public Types
****************************************************************************/
/****************************************************************************
* Public data
****************************************************************************/
#ifndef __ASSEMBLY__
/****************************************************************************
* Name: imxrt_bringup
*
* Description:
* Bring up board features
*
****************************************************************************/
#if defined(CONFIG_BOARDCTL) || defined(CONFIG_BOARD_LATE_INITIALIZE)
int imxrt_bringup(void);
#endif
/****************************************************************************
* Name: imxrt_spidev_initialize
*
* Description:
* Called to configure SPI chip select GPIO pins for the i.MXRT1050 EVK.
*
****************************************************************************/
void imxrt_spidev_initialize(void);
/****************************************************************************
* Name: imxrt_mmcsd_spi_initialize
*
* Description:
* Initialize SPI-based SD card and card detect thread.
*
****************************************************************************/
#ifdef CONFIG_MMCSD_SPI
int imxrt_mmcsd_spi_initialize(int minor)
#endif
/****************************************************************************
* Name: imxrt_autoled_initialize
*
* Description:
* Initialize NuttX-controlled LED logic
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
#ifdef CONFIG_ARCH_LEDS
void imxrt_autoled_initialize(void);
#endif
/****************************************************************************
* Name: imxrt_gpio_initialize
*
* Description:
* Initialize GPIO drivers for use with /apps/examples/gpio
*
****************************************************************************/
#ifdef CONFIG_DEV_GPIO
int imxrt_gpio_initialize(void);
#endif
/****************************************************************************
* Name: imxrt_can_setup
*
* Description:
* Initialize CAN and register the CAN device
*
****************************************************************************/
#ifdef CONFIG_IMXRT_FLEXCAN
int imxrt_can_setup(void);
#endif
/****************************************************************************
* Name: imxrt_adc_initialize
*
* Description:
* Initialize ADC drivers
*
****************************************************************************/
#ifdef CONFIG_IMXRT_ADC
int imxrt_adc_initialize(void);
#endif
/****************************************************************************
* Name: imxrt_ft5x06_register
*
* Description:
* Initialize ft5x06 IC touchscreen driver
*
****************************************************************************/
#ifdef CONFIG_INPUT_FT5X06
int imxrt_ft5x06_register(void);
#endif
/****************************************************************************
* Name: imxrt_backlight
*
* Description:
* Initialize the backlight pins of the LCD and turn it ON
*
****************************************************************************/
#ifdef CONFIG_IMXRT_LCD
void imxrt_lcd_initialize(void);
#endif
#if defined(CONFIG_IMXRT_USBOTG) || defined(CONFIG_USBHOST)
int imxrt_usbhost_initialize(void);
#endif
#ifdef CONFIG_IMXRT1170_FLEXSPI_NOR
int imxrt_flexspi_nor_initialize(void);
#endif
#ifdef CONFIG_IMXRT1170_FLEXSPI_FRAM
int imxrt_flexspi_fram_initialize(void);
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_ARM_IMXRT_IMXRT1170_EVK_SRC_IMXRT1170_EVK_H */