Skip to content

Commit 046d9d7

Browse files
committed
Fix i.MX91 BSP compile errors
1 parent ac5ba18 commit 046d9d7

Some content is hidden

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

81 files changed

+155423
-301
lines changed

bsp/nxp/imx/imx91/.config

Lines changed: 428 additions & 40 deletions
Large diffs are not rendered by default.

bsp/nxp/imx/imx91/Kconfig

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,32 @@ RTT_DIR := ../../../..
66

77
PKGS_DIR := packages
88

9+
source "$(RTT_DIR)/Kconfig"
10+
osource "$PKGS_DIR/Kconfig"
11+
912
config BOARD_IMX91
1013
bool
1114
select ARCH_ARM_CORTEX_A55
12-
select RT_USING_GIC_V2
15+
select BSP_USING_GICV3
16+
select BSP_USING_GIC
1317
default y
1418

15-
source "$(RTT_DIR)/Kconfig"
16-
osource "$PKGS_DIR/Kconfig"
17-
18-
source "$(BSP_DIR)/drivers/Kconfig"
19-
2019
config SOC_MIMX91X1D
2120
bool
21+
select ARCH_ARMV8
22+
select ARCH_CPU_64BIT
23+
select RT_USING_CACHE
2224
select RT_USING_COMPONENTS_INIT
2325
select RT_USING_USER_MAIN
26+
select ARCH_ARM_BOOTWITH_FLUSH_CACHE
2427
default y
28+
29+
config BSP_USING_GIC
30+
bool
31+
default y
32+
33+
config BSP_USING_GICV3
34+
bool
35+
default y
36+
37+
source "$(BSP_DIR)/drivers/Kconfig"

bsp/nxp/imx/imx91/SConscript

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# for module compiling
22
import os
3-
Import('RTT_ROOT')
3+
from building import *
44

5-
cwd = str(Dir('#'))
5+
cwd = GetCurrentDir()
66
objs = []
77
list = os.listdir(cwd)
88

bsp/nxp/imx/imx91/SConstruct

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,6 @@ else:
1010
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
1111
from building import *
1212

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-
3013
TARGET = 'rtthread.' + rtconfig.TARGET_EXT
3114

3215
DefaultEnvironment(tools=[])
Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
from building import *
2-
import os
32

4-
cwd = GetCurrentDir()
5-
src = Glob('*.c')
3+
cwd = GetCurrentDir()
4+
src = Glob('*.c') + Glob('*.cpp')
65
CPPPATH = [cwd]
76

87
group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH)
98

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-
159
Return('group')

bsp/nxp/imx/imx91/applications/application.c

Lines changed: 0 additions & 41 deletions
This file was deleted.
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/applications/startup.c

Lines changed: 0 additions & 70 deletions
This file was deleted.
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
from building import *
22

33
cwd = GetCurrentDir()
4-
src = Glob('*.c') + Glob('iomux/*.c')
4+
src = Glob('*.c') #+ Glob('iomux/*.c')
5+
# src = []
56

67
CPPPATH = [cwd, cwd + '/iomux']
78

8-
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH)
9+
objs = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH)
910

10-
Return('group')
11+
for item in os.listdir(cwd):
12+
sconsfile = os.path.join(cwd, item, 'SConscript')
13+
if os.path.isfile(sconsfile):
14+
objs = objs + SConscript(sconsfile)
15+
16+
Return('objs')

bsp/nxp/imx/imx91/drivers/board.c

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313

1414
#include "board.h"
1515

16-
#include <registers/regsarmglobaltimer.h>
17-
#include <registers/regsepit.h>
16+
// #include <registers/regsarmglobaltimer.h>
17+
// #include <registers/regsepit.h>
1818

19-
#include <imx_uart.h>
20-
#include <epit.h>
21-
#include <cortex_a.h>
19+
// #include <imx_uart.h>
20+
// #include <epit.h>
21+
// #include <cortex_a.h>
2222

2323
#include <mmu.h>
2424

@@ -32,38 +32,38 @@ const rt_uint32_t platform_mem_desc_size = sizeof(platform_mem_desc)/sizeof(plat
3232
static void rt_hw_timer_isr(int vector, void *param)
3333
{
3434
rt_tick_increase();
35-
epit_get_compare_event(HW_EPIT1);
35+
// epit_get_compare_event(HW_EPIT1);
3636
}
3737

3838
int rt_hw_timer_init(void)
3939
{
4040
uint32_t freq;
4141

4242
// Make sure the timer is off.
43-
HW_ARMGLOBALTIMER_CONTROL.B.TIMER_ENABLE = 0;
43+
// HW_ARMGLOBALTIMER_CONTROL.B.TIMER_ENABLE = 0;
4444

45-
HW_ARMGLOBALTIMER_CONTROL.B.FCR0 =1;
45+
// HW_ARMGLOBALTIMER_CONTROL.B.FCR0 =1;
4646

47-
HW_ARMGLOBALTIMER_CONTROL.B.FCR1 =0;
47+
// HW_ARMGLOBALTIMER_CONTROL.B.FCR1 =0;
4848

49-
HW_ARMGLOBALTIMER_CONTROL.B.DBG_ENABLE =0;
49+
// HW_ARMGLOBALTIMER_CONTROL.B.DBG_ENABLE =0;
5050

51-
// Clear counter.
52-
HW_ARMGLOBALTIMER_COUNTER_HI_WR(0);
53-
HW_ARMGLOBALTIMER_COUNTER_LO_WR(0);
51+
// // Clear counter.
52+
// HW_ARMGLOBALTIMER_COUNTER_HI_WR(0);
53+
// HW_ARMGLOBALTIMER_COUNTER_LO_WR(0);
5454

55-
// Now turn on the timer.
56-
HW_ARMGLOBALTIMER_CONTROL.B.TIMER_ENABLE = 1;
55+
// // Now turn on the timer.
56+
// HW_ARMGLOBALTIMER_CONTROL.B.TIMER_ENABLE = 1;
5757

58-
freq = get_main_clock(IPG_CLK);
58+
// freq = get_main_clock(IPG_CLK);
5959

60-
epit_init(HW_EPIT1, CLKSRC_IPG_CLK, freq / 1000000,
61-
SET_AND_FORGET, 10000, WAIT_MODE_EN | STOP_MODE_EN);
60+
// epit_init(HW_EPIT1, CLKSRC_IPG_CLK, freq / 1000000,
61+
// SET_AND_FORGET, 10000, WAIT_MODE_EN | STOP_MODE_EN);
6262

63-
epit_counter_enable(HW_EPIT1, 10000, IRQ_MODE);
63+
// epit_counter_enable(HW_EPIT1, 10000, IRQ_MODE);
6464

65-
rt_hw_interrupt_install(IMX_INT_EPIT1, rt_hw_timer_isr, RT_NULL, "tick");
66-
rt_hw_interrupt_umask(IMX_INT_EPIT1);
65+
// rt_hw_interrupt_install(IMX_INT_EPIT1, rt_hw_timer_isr, RT_NULL, "tick");
66+
// rt_hw_interrupt_umask(IMX_INT_EPIT1);
6767

6868
return 0;
6969
}
@@ -74,8 +74,8 @@ INIT_BOARD_EXPORT(rt_hw_timer_init);
7474
*/
7575
void rt_hw_board_init(void)
7676
{
77-
enable_neon_fpu();
78-
disable_strict_align_check();
77+
// enable_neon_fpu();
78+
// disable_strict_align_check();
7979

8080
rt_components_board_init();
8181
rt_console_set_device(RT_CONSOLE_DEVICE_NAME);

0 commit comments

Comments
 (0)