Skip to content

Commit c1db349

Browse files
zhuzhuzhusRbb666
authored andcommitted
[rpi4b] add new bsp for qemu-rpi4b
1 parent 2b21b09 commit c1db349

31 files changed

+8821
-0
lines changed

bsp/raspberry-pi/raspi-dm2.0/.config

Lines changed: 1541 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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 BCM2711_SOC
13+
bool
14+
select ARCH_ARMV8
15+
select ARCH_ARM_MMU
16+
select RT_USING_CACHE
17+
select RT_USING_COMPONENTS_INIT
18+
select RT_USING_USER_MAIN
19+
select ARCH_CPU_64BIT
20+
default y
21+
22+
rsource "drivers/Kconfig"
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Raspberry PI 4-dm2.0BSP说明
2+
3+
## 1. 简介
4+
5+
树莓派4B的核心处理器为博通BCM2711(四核1.5GHz,Cortex A72架构,树莓派3是四核A53)。LPDDR4内存,由5V/3A USB-C供电或GPIO 5V。
6+
7+
外设支持上,引入了双频Wi-Fi,蓝牙5.0,千兆网卡,MIPI CSI相机接口,两个USB口,40个扩展帧。
8+
9+
这份RT-Thread BSP是针对 Raspberry Pi 4的一份移植,树莓派价格便宜, 使用者甚众,是研究和运行RT-Thread的可选平台之一。
10+
11+
12+
## 2. 编译说明
13+
14+
推荐使用[env工具](https://www.rt-thread.org/download.html#download-rt-thread-env-tool),可以在console下进入到`bsp\raspberry-pi\raspi4-64`目录中,运行以下命令:
15+
16+
```
17+
scons
18+
```
19+
20+
来编译这个板级支持包。如果编译正确无误,会产生 `rtthread.elf`, `rtthread.bin` 文件。
21+
22+
## 3. 支持情况
23+
24+
| 驱动 | 支持情况 | 备注 |
25+
| ------ | ---- | :------: |
26+
| UART | 支持 | pl011驱动 |
27+
| GPIO | 尚未支持 | 等待dm2.0相关代码合入主线 |
28+
| SPI | 尚未支持 | 等待gpio合入主线 |
29+
| WATCHDOG | 尚未支持 | 等待gpio合入主线 |
30+
| HDMI | 尚未支持 | 等待gpio合入主线 |
31+
| SDIO | 支持 | 能够正常运行在qemu,但是qemu对于raspi目前只支持pio传输,后续需要硬件进行详细测试 |
32+
| ETH | 尚未支持 | 等待gpio合入主线 |
33+
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')
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import os
2+
import sys
3+
import rtconfig
4+
5+
from rtconfig import RTT_ROOT
6+
7+
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
8+
from building import *
9+
10+
TARGET = 'rtthread.' + rtconfig.TARGET_EXT
11+
12+
DefaultEnvironment(tools=[])
13+
env = Environment(tools = ['mingw'],
14+
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
15+
CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS,
16+
CPP = rtconfig.CPP, CXXFLAGS = rtconfig.CXXFLAGS,
17+
AR = rtconfig.AR, ARFLAGS = '-rc',
18+
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
19+
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
20+
env['ASCOM'] = env['ASPPCOM']
21+
env['LINKCOM'] = '$LINK -o $TARGET $LINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS -Wl,--start-group $_LIBFLAGS -Wl,--end-group'
22+
23+
Export('RTT_ROOT')
24+
Export('rtconfig')
25+
26+
# prepare building environment
27+
objs = PrepareBuilding(env, RTT_ROOT)
28+
29+
# make a building
30+
DoBuilding(TARGET, objs)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from building import *
2+
3+
cwd = GetCurrentDir()
4+
src = Glob('*.c') + Glob('*.cpp')
5+
CPPPATH = [cwd, str(Dir('#'))]
6+
7+
group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH)
8+
9+
list = os.listdir(cwd)
10+
for item in list:
11+
if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
12+
group = group + SConscript(os.path.join(item, 'SConscript'))
13+
14+
Return('group')
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright (c) 2006-2024 RT-Thread Development Team
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Change Logs:
7+
* Date Author Notes
8+
* 2020-04-16 bigmagic first version
9+
*/
10+
11+
#include <rtthread.h>
12+
#include <rtdevice.h>
13+
#include <board.h>
14+
15+
int main(int argc, char** argv)
16+
{
17+
rt_kprintf("Hi, this is RT-Thread!!\n");
18+
return 0;
19+
}
48.7 KB
Binary file not shown.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
3+
menu "Hardware Drivers Config"
4+
config BSP_USING_PL011
5+
bool "Enable pl011 for uart"
6+
default n
7+
8+
config BSP_USING_SDHCI
9+
bool "Enable sdhci driver"
10+
select RT_USING_SDHCI
11+
default y
12+
rsource sdhci/Kconfig
13+
endmenu
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
from building import *
2+
3+
cwd = GetCurrentDir()
4+
src = ["board.c"]
5+
CPPPATH = [cwd, str(Dir('#'))]
6+
7+
if GetDepend(['BSP_USING_PL011']):
8+
src = src + ['drv_uart.c']
9+
10+
if GetDepend(['BSP_USING_SDHCI']):
11+
src = src + ['drv_sd.c']
12+
13+
group = DefineGroup('driver', src, depend = [''], CPPPATH = CPPPATH)
14+
15+
# build for sub-directory
16+
list = os.listdir(cwd)
17+
objs = []
18+
19+
for d in list:
20+
path = os.path.join(cwd, d)
21+
if os.path.isfile(os.path.join(path, 'SConscript')):
22+
objs = objs + SConscript(os.path.join(d, 'SConscript'))
23+
group = group + objs
24+
25+
Return('group')

0 commit comments

Comments
 (0)