Skip to content

Commit cc65804

Browse files
committed
[bsp][nxp][imx] Add FRDM-i.MX91 support
1 parent 69980f8 commit cc65804

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+157411
-0
lines changed

bsp/nxp/imx/imx91/.config

Lines changed: 1477 additions & 0 deletions
Large diffs are not rendered by default.

bsp/nxp/imx/imx91/Kconfig

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
mainmenu "RT-Thread Project Configuration"
2+
3+
BSP_DIR := .
4+
5+
RTT_DIR := ../../../..
6+
7+
PKGS_DIR := packages
8+
9+
source "$(RTT_DIR)/Kconfig"
10+
osource "$PKGS_DIR/Kconfig"
11+
12+
config BOARD_IMX91
13+
bool
14+
select ARCH_ARM_CORTEX_A55
15+
select BSP_USING_GICV3
16+
select BSP_USING_GIC
17+
default y
18+
19+
config SOC_MIMX91X1D
20+
bool
21+
select ARCH_ARMV8
22+
select ARCH_CPU_64BIT
23+
select RT_USING_CACHE
24+
select RT_USING_COMPONENTS_INIT
25+
select RT_USING_USER_MAIN
26+
select ARCH_ARM_BOOTWITH_FLUSH_CACHE
27+
default y
28+
29+
source "$(BSP_DIR)/drivers/Kconfig"

bsp/nxp/imx/imx91/Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
scons:=python ${SCONS}\scons.py
2+
3+
all:
4+
@$(scons)
5+
6+
clean:
7+
@$(scons) -c
8+
9+
copy:
10+
@$(scons) --copy -s

bsp/nxp/imx/imx91/README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# FRDM-IMX91 RT-Thread BSP
2+
3+
This folder contains the RT-Thread BSP for the NXP FRDM-IMX91 development board.
4+
5+
## Board Overview
6+
7+
## Build and Run
8+
9+
### Setup RT-Thread Development Environment
10+
11+
### Setup Network and TFTP Server for FRDM-IMX91
12+
13+
### Build RT-Thread BSP for FRDM-IMX91
14+
15+
1. Clone the RT-Thread repository:
16+
```
17+
git clone https://github.com/RT-Thread/rt-thread.git
18+
```
19+
20+
2. Navigate to the BSP folder:
21+
```
22+
cd rt-thread/bsp/nxp/imx/imx91
23+
```
24+
25+
3. Build the BSP:
26+
```
27+
scons -j 8
28+
```
29+
30+
4. copy the `rtthread.bin` to the TFTP server working directory:
31+
```
32+
cp rtthread.bin /path/to/tftp_work_dir/
33+
```
34+
35+
### Run RT-Thread on FRDM-IMX91 with u-boot
36+
37+
```sh
38+
setenv bootcmd "tftp 0x80000000 rtthread.bin; dcache flush; icache flush; go 0x80000000"
39+
saveenv
40+
reset
41+
```

bsp/nxp/imx/imx91/SConscript

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# for module compiling
2+
import os
3+
from building import *
4+
5+
cwd = GetCurrentDir()
6+
objs = []
7+
list = os.listdir(cwd)
8+
9+
for d in list:
10+
path = os.path.join(cwd, d)
11+
if os.path.isfile(os.path.join(path, 'SConscript')):
12+
objs = objs + SConscript(os.path.join(d, 'SConscript'))
13+
14+
Return('objs')

bsp/nxp/imx/imx91/SConstruct

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import os
2+
import sys
3+
import rtconfig
4+
5+
if os.getenv('RTT_ROOT'):
6+
RTT_ROOT = os.getenv('RTT_ROOT')
7+
else:
8+
RTT_ROOT = os.path.join(os.getcwd(), '..', '..', '..', '..')
9+
10+
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
11+
from building import *
12+
13+
TARGET = 'rtthread.' + rtconfig.TARGET_EXT
14+
15+
DefaultEnvironment(tools=[])
16+
env = Environment(tools = ['mingw'],
17+
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
18+
CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS,
19+
CXX= rtconfig.CXX, CXXFLAGS = rtconfig.CFLAGS,
20+
AR = rtconfig.AR, ARFLAGS = '-rc',
21+
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
22+
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
23+
env['ASCOM'] = env['ASPPCOM']
24+
env['LINKCOM'] = '$LINK -o $TARGET $LINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS -Wl,--start-group $_LIBFLAGS -Wl,--end-group'
25+
26+
Export('RTT_ROOT')
27+
Export('rtconfig')
28+
29+
# prepare building environment
30+
objs = PrepareBuilding(env, RTT_ROOT)
31+
32+
# make a building
33+
DoBuilding(TARGET, objs)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from building import *
2+
3+
cwd = GetCurrentDir()
4+
src = Glob('*.c') + Glob('*.cpp')
5+
CPPPATH = [cwd]
6+
7+
group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH)
8+
9+
Return('group')
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright (c) 2006-2022, RT-Thread Development Team
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Change Logs:
7+
* Date Author Notes
8+
* 2017-5-30 Bernard the first version
9+
*/
10+
11+
#include <rtthread.h>
12+
13+
int main(int argc, char** argv)
14+
{
15+
rt_kprintf("Hi, this is RT-Thread!!\n");
16+
17+
return 0;
18+
}

bsp/nxp/imx/imx91/drivers/Kconfig

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
menu "Hardware Drivers Config"
2+
3+
config BSP_USING_EARLY_CONSOLE
4+
bool "Enable early console"
5+
default n
6+
7+
config BSP_USING_UART1
8+
bool "Enable UART1"
9+
default y
10+
11+
config BSP_USING_GIC
12+
bool "Enalbe GIC"
13+
default y
14+
15+
config BSP_USING_GICV3
16+
bool "Enable GICv3"
17+
default y
18+
19+
config KERNEL_ASPACE_START
20+
hex "Kernel aspace start address"
21+
default 0x80100000
22+
23+
endmenu
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from building import *
2+
3+
cwd = GetCurrentDir()
4+
src = Glob('*.c') #+ Glob('iomux/*.c')
5+
# src = []
6+
7+
CPPPATH = [cwd]
8+
9+
objs = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH)
10+
11+
for item in os.listdir(cwd):
12+
sconsfile = os.path.join(cwd, item, 'SConscript')
13+
if os.path.isfile(sconsfile):
14+
objs += SConscript(sconsfile)
15+
16+
Return('objs')

0 commit comments

Comments
 (0)