BSP 可支持操作系统更好地运行于硬件主板。BSP(Board Support Package)指板级支持包。对于一般的嵌入式系统,硬件部分需要嵌入式硬件工程师设计硬件电路,而新出厂的电路板需要BSP 来保证其能稳定工作,在此基础之上才能进行下一步的软件开发。BSP 是介于主板硬件和操作系统之间的系统软件之一,主要目的是为了支持操作系统,使之能够更好的运行于硬件主板。
BSP 是相对于操作系统而言的,不同的操作系统对应于不同定义形式的 BSP。
例如 VxWorks 的BSP 和 Linux 的 BSP 相对于某一 CPU 来说尽管实现的功能一样,可是写法和接口定义是完全不同的,所以写 BSP 一定要按照该系统 BSP 的定义形式来写,这样才能与上层 OS 保持正确的接口。由于 BSP 处于在硬件和操作系统、上层应用程序之间,因此 BSP 程序员需要对硬件、软件和操作系统都要有一定的了解。
![](https://img-blog.csdnimg.cn/img_convert/2b8020c5fcffc2511850b88d6305abe7.png)
Linux BSP 板集支持包
- Linux Board Support Package(BSP) contains various components as shown in the picture.
- These components work together to create complete Linux system running on NXP’s S32V2 processors.
![](https://img-blog.csdnimg.cn/20210729113505639.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3Vzc3RtaXJhY2xl,size_16,color_FFFFFF,t_70)
U-boot
It is a boot loader program.
u-boot是一个引导加载程序。
Provides architectural and platform support
提供架构和平台支持
Provides minimal drivers and does initial configurations
提供最少的驱动程序并执行初始配置
Supports different booting flows (sdhc/ftp/qspi, secure boot)
支持不同的引导流(sdhc/ftp/qspi、安全引导)
![](https://img-blog.csdnimg.cn/20210729113718512.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3Vzc3RtaXJhY2xl,size_16,color_FFFFFF,t_70)
U-boot是什么?
- 一个通用的引导加载程序
- 一个硬件平台的开源固件
- Bootloader广泛应用于嵌入式领域
U-boot它有什么作用?
- 使电路板在复位后处于正常状态
- 将OS(Linux)映像加载到板上并启动操作系统
U-boot的启动过程:
- Reset vector points to SRAM
- Begins execution in SRAM
- Initializes UART
- Checks info on version numbers, clocks and displays on screen
- Initializes DDR
- Relocates itself to RAM
- Continues execution in RAM
- Initializes higher level devices : Ethernet, SDHC, etc.
- Begins command interpreter
- Starts Kernel
U-boot的启动过程:
- 将矢量点重置为SRAM
- 在SRAM中开始执行
- 初始化UART
- 检查屏幕上的版本号、时钟和显示信息
- 初始化DDR
- 将自身重新定位到RAM
- 在RAM中继续执行
- 初始化更高级别的设备:以太网、SDHC等。
- 开始命令解释器
- 启动内核
![](https://img-blog.csdnimg.cn/400f89f9cef348c1b04ef0f479473ae7.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBAYUZha2VQcm9ncmFtZXI=,size_18,color_FFFFFF,t_70,g_se,x_16)
![](https://img-blog.csdnimg.cn/30c27aa1e48b4792b246a724dce0e452.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBAYUZha2VQcm9ncmFtZXI=,size_20,color_FFFFFF,t_70,g_se,x_16)
![](https://img-blog.csdnimg.cn/b6c5a1dec2c0418ebdc8beefeafa639e.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBAYUZha2VQcm9ncmFtZXI=,size_20,color_FFFFFF,t_70,g_se,x_16)
Linux Kernel
It is actual Linux Kernel and core of the OS.
它是真正的Linux内核和操作系统的核心。
Provides architectural and platform support
提供架构和平台支持
Full support for device drivers and device tree
完全支持设备驱动程序和设备树
Continues the HW initialization of the target.
Provides HW and user space interfaces.
继续目标的硬件初始化。
提供硬件和用户空间接口。
![](https://img-blog.csdnimg.cn/20210729113808998.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3Vzc3RtaXJhY2xl,size_16,color_FFFFFF,t_70)
Linux Kernel: Device Tree
- Linux Kernel comes with Device Tree Blob(.dtb) file
- A device tree is a tree data structure that describes the physical devices in a system − So, it isolates hardware configuration from actual Linux Kernel
- This makes Linux Kernel independent of the description of the machine hardware. − This also makes Linux Kernel easy to port to new platforms and removes lot of redundant code
- Device Tree is OS independent
- Supported platforms: ARM, PowerPC, MIPS
- DTS format is technically described in ePAPR (Embedded Power Architecture Platform Requirements) specification
- DeviceTree 链接---------------------------------》
Linux Kernel: Device Tree
Linux内核附带设备树Blob(.dtb)文件
设备树是描述系统中物理设备的树数据结构− 因此,它将硬件配置与实际的Linux内核隔离开来
这使得Linux内核独立于机器硬件的描述。− 这也使得Linux内核易于移植到新平台,并删除了大量冗余代码
设备树与操作系统无关
支持的平台:ARM、PowerPC、MIPS
DTS格式在ePAPR(嵌入式电力架构平台需求)规范中有技术描述
![](https://img-blog.csdnimg.cn/e8681890fe07477da942f011a35e0075.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBAYUZha2VQcm9ncmFtZXI=,size_20,color_FFFFFF,t_70,g_se,x_16)
![](https://img-blog.csdnimg.cn/f1cc720ac209408fb90b21ed13422d2b.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBAYUZha2VQcm9ncmFtZXI=,size_20,color_FFFFFF,t_70,g_se,x_16)
![](https://img-blog.csdnimg.cn/8c659db23c6a4a6486312c8a9c07fc85.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBAYUZha2VQcm9ncmFtZXI=,size_20,color_FFFFFF,t_70,g_se,x_16)
![](https://img-blog.csdnimg.cn/b6f1506b1bdd40b0b1afa762603c3489.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBAYUZha2VQcm9ncmFtZXI=,size_20,color_FFFFFF,t_70,g_se,x_16)
![](https://img-blog.csdnimg.cn/1f93d71c88cc4262b1684f8323ccdcb9.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBAYUZha2VQcm9ncmFtZXI=,size_20,color_FFFFFF,t_70,g_se,x_16)
Resources
-
http://free electrons.com/ com/+ LXR
-
http://elinux.org/Device_Tree
-
http://elinux.org/Device_drivers
-
https://lwn.net/Kernel/LDD3/
-
www.devicetree.org/
-
https://www.kernel.org/doc/Documentation/arm64/booting.txt
-
https://www.yoctoproject.org/
Board Support Package顾名思义,就是板级支持包,说白了就是最底层底层的驱动+与某种操作系统的接口。
学过单片机或arm的都知道驱动,如果这些驱动能够支持某种操作系统(如linux)运行在这个板子上,那么就说它是这个操作系统在这个板子上的bsp。
比如你编译不同版本嵌入式linux操作系统时,低的版本可能只支持到2410,2440,高的支持到6410板子以上,通用的linux已经根据一定标准把流行的几种的硬件板子的bsp都做好了,所以不用开发bsp,但是特殊的板子或者特殊的需求(比如有的功能需要绕开操作系统做到最底层)都需要开发bsp,没有它操作系统运行不了
软件定义汽车时代下,智能汽车软件架构逐步向 SOA 演进_搜狐汽车_搜狐网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)