Skip to content

Commit 83186b6

Browse files
committed
[bsp][nxp][imx] Add FRDM-i.MX91 bsp
1 parent 3b93a78 commit 83186b6

22 files changed

+2351
-0
lines changed

bsp/nxp/imx/imx91/.config

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

bsp/nxp/imx/imx91/Kconfig

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

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: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# i.MX91
2+
3+
The i.MX 91 applications processor features an Arm® Cortex®-A55 running at up to 1.4 GHz and support for modern LPDDR4 memory to enable platform longevity and reliability; dual Gigabit Ethernet for gateway or multi-network segment support; dual USB ports; and the essential I/O for products in smart factory, smart home, smart office, medical device, metering, and cost-optimized
4+
system-on-module platforms.
5+
6+
The i.MX 91 may be used in applications such as:
7+
• EV Charging
8+
• Matter-enabled IoT Platforms
9+
• Smart Home, Office, and City
10+
• Building Automation and Monitoring
11+
• Industrial Monitoring and HMI
12+
• Portable or small form-factor Medical and Healthcare devices
13+
• Audio and Entertainment IoT

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+
Import('RTT_ROOT')
4+
5+
cwd = str(Dir('#'))
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: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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+
def bsp_pkg_check():
14+
import subprocess
15+
16+
check_paths = [
17+
os.path.join("packages", "nxp-imx91-sdk-latest"),
18+
]
19+
20+
need_update = not all(os.path.exists(p) for p in check_paths)
21+
22+
if need_update:
23+
print("\n==============================================================")
24+
print("Dependency packages missing, please running 'pkgs --update'...")
25+
print("==============================================================")
26+
exit(1)
27+
28+
RegisterPreBuildingAction(bsp_pkg_check)
29+
30+
TARGET = 'rtthread.' + rtconfig.TARGET_EXT
31+
32+
DefaultEnvironment(tools=[])
33+
env = Environment(tools = ['mingw'],
34+
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
35+
CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS,
36+
CXX= rtconfig.CXX, CXXFLAGS = rtconfig.CFLAGS,
37+
AR = rtconfig.AR, ARFLAGS = '-rc',
38+
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
39+
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
40+
env['ASCOM'] = env['ASPPCOM']
41+
42+
Export('RTT_ROOT')
43+
Export('rtconfig')
44+
45+
# prepare building environment
46+
objs = PrepareBuilding(env, RTT_ROOT)
47+
48+
# make a building
49+
DoBuilding(TARGET, objs)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from building import *
2+
import os
3+
4+
cwd = GetCurrentDir()
5+
src = Glob('*.c')
6+
CPPPATH = [cwd]
7+
8+
group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH)
9+
10+
list = os.listdir(cwd)
11+
for item in list:
12+
if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
13+
group = group + SConscript(os.path.join(item, 'SConscript'))
14+
15+
Return('group')
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright (c) 2006-2025, RT-Thread Development Team
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Change Logs:
7+
* Date Author Notes
8+
* 2025-07-12 BruceOu the first version
9+
*/
10+
11+
#include <rtthread.h>
12+
13+
#include <sdk_version.h>
14+
#include <ccm_pll.h>
15+
16+
void show_freq(void)
17+
{
18+
rt_kprintf("CPU: %d MHz\n", get_main_clock(CPU_CLK)/1000000);
19+
rt_kprintf("DDR: %d MHz\n", get_main_clock(MMDC_CH0_AXI_CLK)/1000000);
20+
rt_kprintf("IPG: %d MHz\n", get_main_clock(IPG_CLK)/1000000);
21+
}
22+
23+
void init_thread(void* parameter)
24+
{
25+
rt_kprintf("Freescale i.MX91 Platform SDK %s\n", SDK_VERSION_STRING);
26+
show_freq();
27+
28+
rt_components_init();
29+
}
30+
31+
int rt_application_init()
32+
{
33+
rt_thread_t tid;
34+
35+
tid = rt_thread_create("init", init_thread, RT_NULL,
36+
1024, RT_THREAD_PRIORITY_MAX/3, 10);
37+
if (tid != RT_NULL) rt_thread_startup(tid);
38+
39+
return 0;
40+
}
41+
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/*
2+
* Copyright (c) 2006-2025, RT-Thread Development Team
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Change Logs:
7+
* Date Author Notes
8+
* 2025-07-12 BruceOu the first version
9+
*/
10+
11+
#include <rthw.h>
12+
#include <rtthread.h>
13+
14+
#include <board.h>
15+
16+
extern int rt_application_init(void);
17+
extern void rt_hw_board_init(void);
18+
19+
/**
20+
* This function will startup RT-Thread RTOS.
21+
*/
22+
void rtthread_startup(void)
23+
{
24+
// platform_init();
25+
// print_version();
26+
27+
/* initialzie hardware interrupt */
28+
rt_hw_interrupt_init();
29+
30+
/* initialize board */
31+
rt_hw_board_init();
32+
33+
/* show RT-Thread version */
34+
rt_show_version();
35+
36+
/* initialize memory system */
37+
#ifdef RT_USING_HEAP
38+
rt_system_heap_init(HEAP_BEGIN, HEAP_END);
39+
#endif
40+
41+
/* initialize scheduler system */
42+
rt_system_scheduler_init();
43+
44+
/* initialize timer and soft timer thread */
45+
rt_system_timer_init();
46+
rt_system_timer_thread_init();
47+
48+
/* initialize application */
49+
rt_application_init();
50+
51+
/* initialize idle thread */
52+
rt_thread_idle_init();
53+
54+
/* start scheduler */
55+
rt_system_scheduler_start();
56+
57+
/* never reach here */
58+
return ;
59+
}
60+
61+
int main(void)
62+
{
63+
/* disable interrupt first */
64+
rt_hw_interrupt_disable();
65+
66+
/* invoke rtthread_startup */
67+
rtthread_startup();
68+
69+
return 0;
70+
}

bsp/nxp/imx/imx91/drivers/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
config RT_USING_UART1
2+
bool "Enable UART1"
3+
default y

0 commit comments

Comments
 (0)