patacongo commented on a change in pull request #2463: URL: https://github.com/apache/incubator-nuttx/pull/2463#discussion_r536114220
########## File path: boards/arm/imxrt/teensy-4.x/README.txt ########## @@ -0,0 +1,177 @@ +README +====== + + This README file provides information about the port of NuttX to the Teensy 4.x board. This board features the + MIMXRT1062DVL6A MCU. Some of the features of this board include: + + o Processor + + - MIMXRT1062DVL6A processor + + o Memory + + - 1 Mb RAM memory + - 2 Mb QSPI Flash + - 1 SDIO (4 bit) native SD + + o Connectivity + + - Micro USB host + - CAN transceivers + - 41 digital pins + - 14 analog pins, 2 ADCs on chip + +Contents +======== + + o LEDs + o Configurations + - Configuration sub-directories + +LEDs and buttons +================ + + LEDs + ---- + + There are two LED status indicators located on the Teensy-4.x board. + The functions of these LEDs include: + + - RED LED (loading status) + - dim: ready + - bright: writing + - blink: no USB + - USER LED(D8) + + Only a single LED, D8, is under software control. + + This LED is not used by the board port unless CONFIG_ARCH_LEDS is + defined. In that case, the usage by the board port is defined in + include/board.h and src/imxrt_autoleds.c. The LED is used to encode + OS-related events as follows: + + ------------------- ----------------------- ------ + SYMBOL Meaning LED + ------------------- ----------------------- ------ + LED_STARTED NuttX has been started OFF + LED_HEAPALLOCATE Heap has been allocated OFF + LED_IRQSENABLED Interrupts enabled OFF + LED_STACKCREATED Idle stack created ON + LED_INIRQ In an interrupt N/C + LED_SIGNAL In a signal handler N/C + LED_ASSERTION An assertion failed N/C + LED_PANIC The system has crashed FLASH + + Thus if the LED is statically on, NuttX has successfully booted and is, + apparently, running normally. If the LED is flashing at approximately + 2Hz, then a fatal error has been detected and the system has halted. + +Configurations +============== + + Information Common to All Configurations + ---------------------------------------- + Each Teensy-4.x configuration is maintained in a sub-directory and + can be selected as follow: + + tools/configure.sh [OPTIONS] teensy-4.x:<subdir> + + Where typical options are -l to configure to build on Linux or -c to + configure for Cygwin under Linux. 'tools/configure.sh -h' will show + you all of the options. + + Before building, make sure the PATH environment variable include the + correct path to the directory than holds your toolchain binaries. + + And then build NuttX by simply typing the following. At the conclusion of + the make, the nuttx binary will reside in an ELF file called, simply, nuttx. + + make + + The <subdir> that is provided above as an argument to the tools/configure.sh + must be is one of the following. + + NOTES: + + 1. These configurations use the mconf-based configuration tool. To + change any of these configurations using that tool, you should: + + a. Build and install the kconfig-mconf tool. See nuttx/README.txt + see additional README.txt files in the NuttX tools repository. + + b. Execute 'make menuconfig' in nuttx/ in order to start the + reconfiguration process. + + 2. All of these configurations are set up to build under Windows using the + "GNU Tools for ARM Embedded Processors" that is maintained by ARM + (unless stated otherwise in the description of the configuration). + + https://developer.arm.com/open-source/gnu-toolchain/gnu-rm + + That toolchain selection can easily be reconfigured using + 'make menuconfig'. Here are the relevant current settings: + + Build Setup: + CONFIG_HOST_WINDOWS=y : Window environment + CONFIG_WINDOWS_CYGWIN=y : Cywin under Windows + + System Type -> Toolchain: + CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIW=y : GNU ARM EABI toolchain + +Configuration sub-directories +----------------------------- + + + nsh-4.0: Review comment: Extra blank line ########## File path: boards/arm/imxrt/teensy-4.x/configs/can-4.1/defconfig ########## @@ -0,0 +1,80 @@ +# +# This file is autogenerated: PLEASE DO NOT EDIT IT. +# +# You can use "make menuconfig" to make any modifications to the installed .config file. +# You can then do "make savedefconfig" to generate a new defconfig file that includes your +# modifications. +# +# CONFIG_NET_CAN_CANFD is not set +# CONFIG_NET_ETHERNET is not set +# CONFIG_NET_IPv4 is not set +CONFIG_ARCH="arm" +CONFIG_ARCH_BOARD="teensy-4.x" +CONFIG_ARCH_BOARD_TEENSY_4X=y +CONFIG_ARCH_CHIP="imxrt" +CONFIG_ARCH_CHIP_IMXRT=y +CONFIG_ARCH_CHIP_MIMXRT1062DVL6A=y +CONFIG_ARCH_STACKDUMP=y +CONFIG_ARMV7M_DCACHE=y +CONFIG_ARMV7M_DCACHE_WRITETHROUGH=y +CONFIG_ARMV7M_ICACHE=y +CONFIG_ARMV7M_USEBASEPRI=y +CONFIG_BOARD_LOOPSPERMSEC=104926 +CONFIG_BUILTIN=y +CONFIG_CAN=y +CONFIG_CANUTILS_CANDUMP=y +CONFIG_CANUTILS_CANSEND=y +CONFIG_DEBUG_BINFMT=y +CONFIG_DEBUG_BINFMT_ERROR=y +CONFIG_DEBUG_BINFMT_INFO=y +CONFIG_DEBUG_BINFMT_WARN=y +CONFIG_DEBUG_CAN=y +CONFIG_DEBUG_CAN_ERROR=y +CONFIG_DEBUG_CAN_INFO=y +CONFIG_DEBUG_CAN_WARN=y +CONFIG_DEBUG_ERROR=y +CONFIG_DEBUG_FEATURES=y +CONFIG_DEBUG_FULLOPT=y +CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_IRQ=y +CONFIG_DEBUG_IRQ_ERROR=y +CONFIG_DEBUG_IRQ_INFO=y +CONFIG_DEBUG_IRQ_WARN=y +CONFIG_DEBUG_NET=y +CONFIG_DEBUG_NET_ERROR=y +CONFIG_DEBUG_NET_INFO=y +CONFIG_DEBUG_NET_WARN=y +CONFIG_DEBUG_SYMBOLS=y +CONFIG_DEBUG_WARN=y +CONFIG_FS_PROCFS=y Review comment: DEBUG features should be disabled in all defconfig files. These should be considered as "production" configurations with no debug enabled. The presents the best to new users: Smallest size and best performance. We have discussed some options to automate enabling of debug options when the configuration is instantiated. That is would be a better solution. ########## File path: boards/arm/imxrt/teensy-4.x/configs/netnsh-4.1/defconfig ########## @@ -0,0 +1,77 @@ +# +# This file is autogenerated: PLEASE DO NOT EDIT IT. +# +# You can use "make menuconfig" to make any modifications to the installed .config file. +# You can then do "make savedefconfig" to generate a new defconfig file that includes your +# modifications. +# +# CONFIG_ARCH_LEDS is not set +CONFIG_ARCH="arm" +CONFIG_ARCH_BOARD="teensy-4.x" +CONFIG_ARCH_BOARD_TEENSY_4X=y +CONFIG_ARCH_CHIP="imxrt" +CONFIG_ARCH_CHIP_IMXRT=y +CONFIG_ARCH_CHIP_MIMXRT1062DVL6A=y +CONFIG_ARCH_STACKDUMP=y +CONFIG_ARMV7M_DCACHE=y +CONFIG_ARMV7M_DCACHE_WRITETHROUGH=y +CONFIG_ARMV7M_ICACHE=y +CONFIG_ARMV7M_USEBASEPRI=y +CONFIG_BOARD_LOOPSPERMSEC=104926 +CONFIG_BUILTIN=y +CONFIG_DEBUG_ERROR=y +CONFIG_DEBUG_FEATURES=y +CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_NET=y +CONFIG_DEBUG_NET_ERROR=y +CONFIG_DEBUG_NET_INFO=y +CONFIG_DEBUG_NET_WARN=y +CONFIG_DEBUG_WARN=y +CONFIG_ETH0_PHY_DP83825I=y Review comment: See comments above regarding DEBUG options in defconfig files. ########## File path: boards/arm/imxrt/teensy-4.x/src/imxrt_adc.c ########## @@ -0,0 +1,112 @@ +/**************************************************************************** + * boards/arm/imxrt/teensy-4.x/src/imxrt_adc.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 + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <nuttx/config.h> + +#include <errno.h> +#include <debug.h> + +#include <nuttx/board.h> +#include <nuttx/analog/adc.h> +#include <arch/board/board.h> + +#include "chip.h" +#include "arm_arch.h" + +#include "imxrt_adc.h" +#include "teensy-4.h" + +#ifdef CONFIG_IMXRT_ADC + +/* channels 1 and 2 have the same number of pins on Teensy */ + +#define ADC_NCHANNELS 16 + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +static const uint8_t g_chanlist[ADC_NCHANNELS] = + { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15 + }; + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: imxrt_adc_setup + * + * Description: + * Initialize and register the ADC driver. + * + ****************************************************************************/ + +int imxrt_adc_initialize(void) +{ + struct adc_dev_s *adc; + int ret; + + /* Call imxrt_adcinitialize() to get an instance of the ADC interface */ + #ifdef CONFIG_IMXRT_ADC1 Review comment: A blank line is required after all comments. nxstyle did not catch this? ########## File path: boards/arm/imxrt/teensy-4.x/src/imxrt_flexspi_nor_boot.h ########## @@ -0,0 +1,157 @@ +/**************************************************************************** + * boards/arm/imxrt/teensy-4.x/src/imxrt_flexspi_nor_boot.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. + * + ****************************************************************************/ + +#ifndef __BOARDS_ARM_IMXRT_TEENSY_4X_SRC_IMXRT_FLEXSPI_NOR_BOOT_H +# define __BOARDS_ARM_IMXRT_TEENSY_4X_SRC_IMXRT_FLEXSPI_NOR_BOOT_H + Review comment: This two space indentation is an artifact and an error introduced by tools/indent.sh. sed -i -e "s/# /#/g" will fix it. ########## File path: boards/arm/imxrt/teensy-4.x/src/imxrt_flexspi_nor_boot.c ########## @@ -0,0 +1,58 @@ +/**************************************************************************** + * boards/arm/imxrt/teensy-4.x/src/imxrt_flexspi_nor_boot.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 + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "imxrt_flexspi_nor_boot.h" + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +__attribute__((section(".boot_hdr.ivt"))) + const struct ivt_s g_image_vector_table = + { + IVT_HEADER, /* IVT Header */ + IMAGE_ENTRY_ADDRESS, /* Image Entry Function */ + IVT_RSVD, /* Reserved = 0 */ + (uint32_t) DCD_ADDRESS, /* Address where DCD information is + * stored */ + (uint32_t) BOOT_DATA_ADDRESS, /* Address where BOOT Data Structure + * is stored */ + (uint32_t) IMAG_VECTOR_TABLE, /* Pointer to IVT Self (absolute + * address */ + (uint32_t) CSF_ADDRESS, /* Address where CSF file is stored */ + IVT_RSVD /* Reserved = 0 */ + }; + +__attribute__((section(".boot_hdr.boot_data"))) + const struct boot_data_s g_boot_data = + { + IMAGE_DEST, /* boot start location */ + (IMAGE_DEST_END - IMAGE_DEST), /* size */ + PLUGIN_FLAG, /* Plugin flag */ + 0xffffffff /* empty - extra data word */ + }; Review comment: Should be indented by two spaces, not one. There should be no indentation on the braces. ########## File path: boards/arm/imxrt/teensy-4.x/configs/sd-4.1/defconfig ########## @@ -0,0 +1,65 @@ +# +# This file is autogenerated: PLEASE DO NOT EDIT IT. +# +# You can use "make menuconfig" to make any modifications to the installed .config file. +# You can then do "make savedefconfig" to generate a new defconfig file that includes your +# modifications. +# +# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set +# CONFIG_MMCSD_SPI is not set +CONFIG_ARCH="arm" +CONFIG_ARCH_BOARD="teensy-4.x" +CONFIG_ARCH_BOARD_TEENSY_4X=y +CONFIG_ARCH_CHIP="imxrt" +CONFIG_ARCH_CHIP_IMXRT=y +CONFIG_ARCH_CHIP_MIMXRT1062DVL6A=y +CONFIG_ARCH_STACKDUMP=y +CONFIG_ARMV7M_DCACHE=y +CONFIG_ARMV7M_DCACHE_WRITETHROUGH=y +CONFIG_ARMV7M_ICACHE=y +CONFIG_ARMV7M_USEBASEPRI=y +CONFIG_BOARD_LOOPSPERMSEC=104926 +CONFIG_BUILTIN=y +CONFIG_DEBUG_ASSERTIONS=y +CONFIG_DEBUG_ERROR=y +CONFIG_DEBUG_FEATURES=y +CONFIG_DEBUG_FS=y +CONFIG_DEBUG_FS_ERROR=y +CONFIG_DEBUG_FS_INFO=y +CONFIG_DEBUG_FS_WARN=y +CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_WARN=y +CONFIG_FAT_LCNAMES=y Review comment: See previous comments about DEBUG options in defconfig files. ########## File path: boards/arm/imxrt/teensy-4.x/src/imxrt_flexspi_nor_flash.h ########## @@ -0,0 +1,364 @@ +/**************************************************************************** + * boards/arm/imxrt/teensy-4.x/src/imxrt_flexspi_nor_flash.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. + * + ****************************************************************************/ +#ifndef __BOARDS_ARM_IMXRT_TEENSY_4X_SRC_IMXRT_FLEXSPI_NOR_FLASH_H +# define __BOARDS_ARM_IMXRT_TEENSY_4X_SRC_IMXRT_FLEXSPI_NOR_FLASH_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +# include <stdint.h> +# include <stdbool.h> + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* FLEXSPI memory config block related definitions */ + +# define FLEXSPI_CFG_BLK_TAG (0x42464346ul) +# define FLEXSPI_CFG_BLK_VERSION (0x56010100ul) +# define FLEXSPI_CFG_BLK_SIZE (512) + +/* FLEXSPI Feature related definitions */ + +# define FLEXSPI_FEATURE_HAS_PARALLEL_MODE 1 + +/* Lookup table related definitions */ + +# define CMD_INDEX_READ 0 +# define CMD_INDEX_READSTATUS 1 +# define CMD_INDEX_WRITEENABLE 2 +# define CMD_INDEX_WRITE 4 + +# define CMD_LUT_SEQ_IDX_READ 0 +# define CMD_LUT_SEQ_IDX_READSTATUS 1 +# define CMD_LUT_SEQ_IDX_WRITEENABLE 3 +# define CMD_LUT_SEQ_IDX_WRITE 9 + +# define CMD_SDR 0x01 +# define CMD_DDR 0x21 +# define RADDR_SDR 0x02 +# define RADDR_DDR 0x22 +# define CADDR_SDR 0x03 +# define CADDR_DDR 0x23 +# define MODE1_SDR 0x04 +# define MODE1_DDR 0x24 +# define MODE2_SDR 0x05 +# define MODE2_DDR 0x25 +# define MODE4_SDR 0x06 +# define MODE4_DDR 0x26 +# define MODE8_SDR 0x07 +# define MODE8_DDR 0x27 +# define WRITE_SDR 0x08 +# define WRITE_DDR 0x28 +# define READ_SDR 0x09 +# define READ_DDR 0x29 +# define LEARN_SDR 0x0a +# define LEARN_DDR 0x2a +# define DATSZ_SDR 0x0b +# define DATSZ_DDR 0x2b +# define DUMMY_SDR 0x0c +# define DUMMY_DDR 0x2c +# define DUMMY_RWDS_SDR 0x0d +# define DUMMY_RWDS_DDR 0x2d +# define JMP_ON_CS 0x1f +# define STOP 0 + +# define FLEXSPI_1PAD 0 +# define FLEXSPI_2PAD 1 +# define FLEXSPI_4PAD 2 +# define FLEXSPI_8PAD 3 + +# define FLEXSPI_LUT_OPERAND0_MASK (0xffu) +# define FLEXSPI_LUT_OPERAND0_SHIFT (0U) +# define FLEXSPI_LUT_OPERAND0(x) (((uint32_t) \ + (((uint32_t)(x)) << FLEXSPI_LUT_OPERAND0_SHIFT)) & \ + FLEXSPI_LUT_OPERAND0_MASK) +# define FLEXSPI_LUT_NUM_PADS0_MASK (0x300u) +# define FLEXSPI_LUT_NUM_PADS0_SHIFT (8u) +# define FLEXSPI_LUT_NUM_PADS0(x) (((uint32_t) \ + (((uint32_t)(x)) << FLEXSPI_LUT_NUM_PADS0_SHIFT)) & \ + FLEXSPI_LUT_NUM_PADS0_MASK) +# define FLEXSPI_LUT_OPCODE0_MASK (0xfc00u) +# define FLEXSPI_LUT_OPCODE0_SHIFT (10u) +# define FLEXSPI_LUT_OPCODE0(x) (((uint32_t) \ + (((uint32_t)(x)) << FLEXSPI_LUT_OPCODE0_SHIFT)) & \ + FLEXSPI_LUT_OPCODE0_MASK) +# define FLEXSPI_LUT_OPERAND1_MASK (0xff0000u) +# define FLEXSPI_LUT_OPERAND1_SHIFT (16U) +# define FLEXSPI_LUT_OPERAND1(x) (((uint32_t) \ + (((uint32_t)(x)) << FLEXSPI_LUT_OPERAND1_SHIFT)) & \ + FLEXSPI_LUT_OPERAND1_MASK) +# define FLEXSPI_LUT_NUM_PADS1_MASK (0x3000000u) +# define FLEXSPI_LUT_NUM_PADS1_SHIFT (24u) +# define FLEXSPI_LUT_NUM_PADS1(x) (((uint32_t) \ + (((uint32_t)(x)) << FLEXSPI_LUT_NUM_PADS1_SHIFT)) & \ + FLEXSPI_LUT_NUM_PADS1_MASK) +# define FLEXSPI_LUT_OPCODE1_MASK (0xfc000000u) +# define FLEXSPI_LUT_OPCODE1_SHIFT (26u) +# define FLEXSPI_LUT_OPCODE1(x) (((uint32_t)(((uint32_t)(x)) << FLEXSPI_LUT_OPCODE1_SHIFT)) & \ + FLEXSPI_LUT_OPCODE1_MASK) + +# define FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) \ + (FLEXSPI_LUT_OPERAND0(op0) | FLEXSPI_LUT_NUM_PADS0(pad0) | \ + FLEXSPI_LUT_OPCODE0(cmd0) | FLEXSPI_LUT_OPERAND1(op1) | \ + FLEXSPI_LUT_NUM_PADS1(pad1) | FLEXSPI_LUT_OPCODE1(cmd1)) + +/* */ + +# define NOR_CMD_INDEX_READ CMD_INDEX_READ +# define NOR_CMD_INDEX_READSTATUS CMD_INDEX_READSTATUS +# define NOR_CMD_INDEX_WRITEENABLE CMD_INDEX_WRITEENABLE +# define NOR_CMD_INDEX_ERASESECTOR 3 +# define NOR_CMD_INDEX_PAGEPROGRAM CMD_INDEX_WRITE +# define NOR_CMD_INDEX_CHIPERASE 5 +# define NOR_CMD_INDEX_DUMMY 6 +# define NOR_CMD_INDEX_ERASEBLOCK 7 + +/* READ LUT sequence id in lookupTable stored in config block */ + +# define NOR_CMD_LUT_SEQ_IDX_READ CMD_LUT_SEQ_IDX_READ + +/* Read Status LUT sequence id in lookupTable stored in config block */ + +# define NOR_CMD_LUT_SEQ_IDX_READSTATUS CMD_LUT_SEQ_IDX_READSTATUS + +/* 2 Read status DPI/QPI/OPI sequence id in LUT stored in config block */ + +# define NOR_CMD_LUT_SEQ_IDX_READSTATUS_XPI 2 + +/* 3 Write Enable sequence id in lookupTable stored in config block */ + +# define NOR_CMD_LUT_SEQ_IDX_WRITEENABLE CMD_LUT_SEQ_IDX_WRITEENABLE + +/* 4 Write Enable DPI/QPI/OPI sequence id in LUT stored in config block */ + +# define NOR_CMD_LUT_SEQ_IDX_WRITEENABLE_XPI 4 + +/* 5 Erase Sector sequence id in lookupTable stored in config block */ + +# define NOR_CMD_LUT_SEQ_IDX_ERASESECTOR 5 + +/* 8 Erase Block sequence id in lookupTable stored in config block */ + +# define NOR_CMD_LUT_SEQ_IDX_ERASEBLOCK 8 + +/* 9 Program sequence id in lookupTable stored in config block */ + +# define NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM CMD_LUT_SEQ_IDX_WRITE + +/* 11 Chip Erase sequence in lookupTable id stored in config block */ + +# define NOR_CMD_LUT_SEQ_IDX_CHIPERASE 11 + +/* 13 Read SFDP sequence in lookupTable id stored in config block */ + +# define NOR_CMD_LUT_SEQ_IDX_READ_SFDP 13 + +/* 14 Restore 0-4-4/0-8-8 mode sequence id in LUT stored in config block */ + +# define NOR_CMD_LUT_SEQ_IDX_RESTORE_NOCMD 14 + +/* 15 Exit 0-4-4/0-8-8 mode sequence id in LUT stored in config blobk */ + +# define NOR_CMD_LUT_SEQ_IDX_EXIT_NOCMD 15 + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +/* Definitions for FlexSPI Serial Clock Frequency */ + +enum flexspi_serial_clkfreq_e + { + FLEXSPI_SERIAL_CLKFREQ_30MHz = 1, Review comment: braces should be at column 1. This is another tools/indent.sh artifact. ########## File path: boards/arm/imxrt/teensy-4.x/scripts/flash-ocram.ld ########## @@ -0,0 +1,186 @@ +/**************************************************************************** + * boards/arm/imxrt/teensy-4.x/scripts/flash-ocram.ld + * + * 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. + * + ****************************************************************************/ + +/* Specify the memory areas */ + +/* The imxrt162-evk has 8MiB of QSPI FLASH beginning at address, + * 0x0060:0000, Upto 512Kb of DTCM RAM beginning at 0x2000:0000, and 1MiB OCRAM + * beginning at 0x2020:0000. Neither DTCM or SDRAM are used in this + * configuration. + * + * The default flexram setting on the iMXRT 1062 is + * 256Kib to OCRRAM, 128Kib ITCM and 128Kib DTCM. + * This can be changed by using a dcd by minipulating + * IOMUX GPR16 and GPR17. + * The configuartion we will use is 384Kib to OCRRAM, 0Kib ITCM and + * 128Kib DTCM. + * + * This is the OCRAM inker script. + * The NXP ROM bootloader will move the FLASH image to OCRAM. + * We must reserve 32K for the bootloader' OCRAM usage from the OCRAM Size + * and an additinal 8K for the ivt_s which is IVT_SIZE(8K) This 40K can be + * reused once the application is running. + * + * 0x2020:A000 to 0x202d:ffff - The application Image's vector table + * 0x2020:8000 to 0x2020:A000 - IVT + * 0x2020:0000 to 0x2020:7fff - NXP ROM bootloader. + * + * We artificially split the FLASH to allow locating sections that we do not + * want loaded inoto OCRAM. This is to save on OCRAM where the speen of the + * code does not matter. + * + */ + +MEMORY +{ + flash (rx) : ORIGIN = 0x60000000, LENGTH = 7M + flashxip (rx) : ORIGIN = 0x60700000, LENGTH = 1M + /* Vectors @ boot+ivt OCRAM2 Flex RAM Boot IVT */ + sram (rwx) : ORIGIN = 0x2020A000, LENGTH = 512K + 256K + 128K - (32K + 8K) + itcm (rwx) : ORIGIN = 0x00000000, LENGTH = 0K + dtcm (rwx) : ORIGIN = 0x20000000, LENGTH = 128K +} + +OUTPUT_ARCH(arm) +EXTERN(_vectors) +EXTERN(g_flash_config) +EXTERN(g_image_vector_table) +EXTERN(g_boot_data) +EXTERN(g_dcd_data) + +ENTRY(_stext) + +SECTIONS +{ + /* Image Vector Table and Boot Data for booting from external flash */ + + .boot_hdr : ALIGN(4) + { + FILL(0xff) + __boot_hdr_start__ = ABSOLUTE(.) ; + KEEP(*(.boot_hdr.conf)) + . = 0x1000 ; + KEEP(*(.boot_hdr.ivt)) + . = 0x1020 ; + KEEP(*(.boot_hdr.boot_data)) + . = 0x1030 ; + KEEP(*(.boot_hdr.dcd_data)) + __boot_hdr_end__ = ABSOLUTE(.) ; + . = 0x2000 ; + } > flash + + /* Catch all the section we want not in OCRAM so that the *(.text .text.*) in flash does not */ + + .flashxip : ALIGN(4) + { + FILL(0xff) + + /* Order matters */ + + imxrt_start.o(.text) + imxrt_boot.o(.text) + + *(.slow_memory) + *(.rodata .rodata.*) + KEEP(*(__param*)) + *(.fixup) + *(.gnu.warning) + *(.gnu.linkonce.t.*) + *(.glue_7) + *(.glue_7t) + *(.got) + *(.gcc_except_table) + *(.gnu.linkonce.r.*) + Review comment: It looks like some places indent with spaces and others with TABs. ########## File path: boards/arm/imxrt/teensy-4.x/src/imxrt_flexspi_nor_boot.c ########## @@ -0,0 +1,58 @@ +/**************************************************************************** + * boards/arm/imxrt/teensy-4.x/src/imxrt_flexspi_nor_boot.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 + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "imxrt_flexspi_nor_boot.h" + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +__attribute__((section(".boot_hdr.ivt"))) + const struct ivt_s g_image_vector_table = + { + IVT_HEADER, /* IVT Header */ + IMAGE_ENTRY_ADDRESS, /* Image Entry Function */ + IVT_RSVD, /* Reserved = 0 */ + (uint32_t) DCD_ADDRESS, /* Address where DCD information is + * stored */ + (uint32_t) BOOT_DATA_ADDRESS, /* Address where BOOT Data Structure + * is stored */ + (uint32_t) IMAG_VECTOR_TABLE, /* Pointer to IVT Self (absolute + * address */ + (uint32_t) CSF_ADDRESS, /* Address where CSF file is stored */ + IVT_RSVD /* Reserved = 0 */ + }; Review comment: Should be indented by two spaces, not one. There should be no indentation on the braces. ########## File path: boards/arm/imxrt/teensy-4.x/src/imxrt_flexspi_nor_flash.h ########## @@ -0,0 +1,364 @@ +/**************************************************************************** + * boards/arm/imxrt/teensy-4.x/src/imxrt_flexspi_nor_flash.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. + * + ****************************************************************************/ +#ifndef __BOARDS_ARM_IMXRT_TEENSY_4X_SRC_IMXRT_FLEXSPI_NOR_FLASH_H +# define __BOARDS_ARM_IMXRT_TEENSY_4X_SRC_IMXRT_FLEXSPI_NOR_FLASH_H + Review comment: Same indentation error introduced by tools/indent.sh. ########## File path: boards/arm/imxrt/teensy-4.x/src/teensy-4.h ########## @@ -0,0 +1,195 @@ +/**************************************************************************** + * boards/arm/imxrt/teensy-4.x/src/teensy-4.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. + * + ****************************************************************************/ + +#ifndef __BOARDS_ARM_IMXRT_TEENSY_4X_SRC_TEENSY_4_H +# define __BOARDS_ARM_IMXRT_TEENSY_4X_SRC_TEENSY_4_H + Review comment: Same tools/indent.sh problem. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org