Skip to content

Commit

Permalink
arm64/imx9: Add board for imx93-evk
Browse files Browse the repository at this point in the history
Adds board definition for imx93-evk board

- Support for the Cortex-A55 core in i.MX93, support for the Cortex-M33
  core is _not_ provided
- "nsh" profile is provided, this includes a minimalistic feature set
  which boots the SoM to nsh console
- A bootloader is required, u-boot has been tested
  • Loading branch information
pussuw committed Mar 21, 2024
1 parent 0b061bd commit 913410d
Show file tree
Hide file tree
Showing 15 changed files with 905 additions and 0 deletions.
145 changes: 145 additions & 0 deletions Documentation/platforms/arm64/imx9/boards/imx93-evk/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
README.txt
==========

The kit i.MX93 Evaluation Kit has a pre-installed Linux image which contains
u-boot and the i.MX93 reference Linux installation.

u-boot is required to boot NuttX (for now) as it initializes the hardware for
us, i.e. DDR, clocks, I/O muxes etc.

==========================================

How to run nuttx on i.MX93 Evaluation Kit.

==========================================

Below is a set of instructions on how to run NuttX on the i.MX93 EVK

==========================================

Pre-requisites

==========================================

- imx93_ca55.JLinkScript which is a custom file, put it wherever you want

==========================================

U-Boot configuration

==========================================

Two things need to be configured on u-boot before NuttX can be loaded:

- u-boot data cache must be turned off
- u-boot must stop to the u-boot console, i.e. the Linux payload must not be loaded

Manual option:

1. Disable u-boot autostart (needs to be done only once):

Hit any key to stop autoboot: 0
u-boot=> setenv bootdelay -1
u-boot=> saveenv
Saving Environment to MMC... Writing to MMC(0)... OK
u-boot=> reset

2. On every boot, the data cache must be disabled for options 2 and 3 to work

u-boot=> dcache off

Automated option:

1. Replace the default bootcmd to disable dcache automatically:

u-boot=> setenv bootcmd dcache off
u-boot=> saveenv
Saving Environment to MMC... Writing to MMC(0)... OK
u-boot=> reset

To restore the default bootcmd which starts Linux automatically:

u-boot=> setenv bootcmd run distro_bootcmd;run bsp_bootcmd
u-boot=> saveenv
Saving Environment to MMC... Writing to MMC(0)... OK
u-boot=> reset

The default bootcmd is:

u-boot=> env print bootcmd
bootcmd=run distro_bootcmd;run bsp_bootcmd

==========================================

Loading and running the NuttX image

==========================================

You have three options:

1 - Load via u-boot from SD-card
2 - Load via gdb
3 - Load via JLink

==========================================

Option 1: load via u-boot from SD-card:

==========================================

1. Build nuttx, and move nuttx.bin to SD-card

2. Load from SD-card and start nuttx payload

u-boot=> dcache off; fatload mmc 1 0x80000000 nuttx.bin; go 0x80000000

==========================================

Option 2: start via gdb:

==========================================

1. Start JLinkGDBServer

JLinkGDBServer -device CORTEX-A55 -JLinkScriptFile <path_to>/imx93_ca55.JLinkScript

2. Start gdb

$ aarch64-none-elf-gdb

2.1 Attach and load nuttx

(gdb) target remote localhost:2331
(gdb) set mem inaccessible-by-default off
(gdb) load <path_to>/nuttx
(gdb) monitor go

==========================================

Option 3: load with JLink:

==========================================

1. Start JLink

$ JLinkExe -device CORTEX-A55 -if JTAG -jtagconf -1,-1 -speed 4000 -JLinkScriptFile <path_to>/imx93_ca55.JLinkScript

1.1 Add -AutoConnect 1 to connect automatically

$ JLinkExe -device CORTEX-A55 -if JTAG -jtagconf -1,-1 -speed 4000 -JLinkScriptFile <path_to>/imx93_ca55.JLinkScript -AutoConnect 1

2. Connect JLink

2.1 Connect to the debugger

Type "connect" to establish a target connection, '?' for help
J-Link>connect

You should now have a JLink prompt.

Cortex-A55 identified.
J-Link>

3. Load nuttx. Note that JLink expects the .elf extension, the default build output of nuttx is just "nuttx" without the extension, so it must be added to the file...

J-Link>LoadFile <path_to>/nuttx.elf
6 changes: 6 additions & 0 deletions Documentation/platforms/arm64/imx9/boards/imx93-evk/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
==========
imx93-evk
==========

.. include:: README.txt
:literal:
12 changes: 12 additions & 0 deletions Documentation/platforms/arm64/imx9/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
=========
NXP i.MX9
=========

Supported Boards
================

.. toctree::
:glob:
:maxdepth: 1

boards/*/*
12 changes: 12 additions & 0 deletions boards/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2115,6 +2115,14 @@ config ARCH_BOARD_IMX8QM_MEK
This options selects support for NuttX on the NXP i.MX8 QuadMax CPUs MEK
configure board with ARM Cortex-A53.

config ARCH_BOARD_IMX93_EVK
bool "NXP i.MX93 CPUs EVK board"
depends on ARCH_CHIP_IMX93
select ARCH_HAVE_IRQBUTTONS
---help---
This options selects support for NuttX on the NXP i.MX93 CPUs EVK
board with ARM Cortex-A55.

config ARCH_BOARD_SAMA5D2_XULT
bool "Atmel SAMA5D2 Xplained Ultra development board"
depends on ARCH_CHIP_ATSAMA5D27
Expand Down Expand Up @@ -3284,6 +3292,7 @@ config ARCH_BOARD
default "fvp-armv8r" if ARCH_BOARD_FVP_ARMV8R
default "fvp-armv8r-aarch32" if ARCH_BOARD_FVP_ARMV8R_AARCH32
default "imx8qm-mek" if ARCH_BOARD_IMX8QM_MEK
default "imx93-evk" if ARCH_BOARD_IMX93_EVK
default "sama5d2-xult" if ARCH_BOARD_SAMA5D2_XULT
default "giant-board" if ARCH_BOARD_GIANT_BOARD
default "jupiter-nano" if ARCH_BOARD_JUPITER_NANO
Expand Down Expand Up @@ -3497,6 +3506,9 @@ endif
if ARCH_BOARD_IMX8QM_MEK
source "boards/arm64/imx8/imx8qm-mek/Kconfig"
endif
if ARCH_BOARD_IMX93_EVK
source "boards/arm64/imx9/imx93-evk/Kconfig"
endif
if ARCH_BOARD_IMXRT1020_EVK
source "boards/arm/imxrt/imxrt1020-evk/Kconfig"
endif
Expand Down
7 changes: 7 additions & 0 deletions boards/arm64/imx9/imx93-evk/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#

if ARCH_BOARD_IMX9QM_MEK
endif
61 changes: 61 additions & 0 deletions boards/arm64/imx9/imx93-evk/configs/nsh/defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#
# 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="arm64"
CONFIG_ARCH_ARM64=y
CONFIG_ARCH_BOARD="imx93-evk"
CONFIG_ARCH_BOARD_IMX93_EVK=y
CONFIG_ARCH_CHIP="imx9"
CONFIG_ARCH_CHIP_IMX93=y
CONFIG_ARCH_CHIP_IMX9=y
CONFIG_ARCH_EARLY_PRINT=y
CONFIG_ARCH_INTERRUPTSTACK=4096
CONFIG_BUILTIN=y
CONFIG_DEBUG_ASSERTIONS=y
CONFIG_DEBUG_FEATURES=y
CONFIG_DEBUG_FULLOPT=y
CONFIG_DEBUG_SCHED=y
CONFIG_DEBUG_SCHED_ERROR=y
CONFIG_DEBUG_SCHED_INFO=y
CONFIG_DEBUG_SCHED_WARN=y
CONFIG_DEBUG_SYMBOLS=y
CONFIG_DEFAULT_TASK_STACKSIZE=8192
CONFIG_DEV_ZERO=y
CONFIG_EXAMPLES_HELLO=y
CONFIG_EXPERIMENTAL=y
CONFIG_FS_PROCFS=y
CONFIG_FS_ROMFS=y
CONFIG_HAVE_CXX=y
CONFIG_HAVE_CXXINITIALIZE=y
CONFIG_IDLETHREAD_STACKSIZE=8192
CONFIG_IMX9_UART1=y
CONFIG_INIT_ENTRYPOINT="nsh_main"
CONFIG_INTELHEX_BINARY=y
CONFIG_NSH_ARCHINIT=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_FILEIOSIZE=512
CONFIG_NSH_READLINE=y
CONFIG_PREALLOC_TIMERS=4
CONFIG_RAMLOG=y
CONFIG_RAM_SIZE=134217728
CONFIG_RAM_START=0x80000000
CONFIG_RAW_BINARY=y
CONFIG_READLINE_CMD_HISTORY=y
CONFIG_RR_INTERVAL=200
CONFIG_SCHED_HPWORK=y
CONFIG_SCHED_HPWORKPRIORITY=192
CONFIG_SPINLOCK=y
CONFIG_STACK_COLORATION=y
CONFIG_START_MONTH=3
CONFIG_START_YEAR=2022
CONFIG_SYMTAB_ORDEREDBYNAME=y
CONFIG_SYSTEM_NSH=y
CONFIG_SYSTEM_SYSTEM=y
CONFIG_SYSTEM_TIME64=y
CONFIG_TESTING_GETPRIME=y
CONFIG_TESTING_OSTEST=y
CONFIG_UART1_SERIAL_CONSOLE=y
59 changes: 59 additions & 0 deletions boards/arm64/imx9/imx93-evk/include/board.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/****************************************************************************
* boards/arm64/imx9/imx93-evk/include/board.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_ARM64_IMX9_IMX93_EVK_INCLUDE_BOARD_H
#define __BOARDS_ARM64_IMX9_IMX93_EVK_INCLUDE_BOARD_H

/****************************************************************************
* Included Files
****************************************************************************/

#include <nuttx/config.h>

/****************************************************************************
* Pre-processor Definitions
****************************************************************************/

/****************************************************************************
* Public Data
****************************************************************************/

#ifndef __ASSEMBLY__

#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif

/****************************************************************************
* Public Function Prototypes
****************************************************************************/

#undef EXTERN
#if defined(__cplusplus)
}
#endif

#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_ARM64_IMX9_IMX93_EVK_INCLUDE_BOARD_H */
59 changes: 59 additions & 0 deletions boards/arm64/imx9/imx93-evk/include/board_memorymap.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/****************************************************************************
* boards/arm64/imx9/imx93-evk/include/board_memorymap.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_ARM64_IMX9_IMX93_EVK_INCLUDE_BOARD_MEMORYMAP_H
#define __BOARDS_ARM64_IMX9_IMX93_EVK_INCLUDE_BOARD_MEMORYMAP_H

/****************************************************************************
* Included Files
****************************************************************************/

#include <nuttx/config.h>

/****************************************************************************
* Pre-processor Definitions
****************************************************************************/

/****************************************************************************
* Public Data
****************************************************************************/

#ifndef __ASSEMBLY__

#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif

/****************************************************************************
* Public Function Prototypes
****************************************************************************/

#undef EXTERN
#if defined(__cplusplus)
}
#endif

#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_ARM64_IMX9_IMX93_EVK_INCLUDE_BOARD_MEMORYMAP_H */
Loading

0 comments on commit 913410d

Please sign in to comment.