【友晶科技Terasic】SOC FPGA 开发板的 BSEL 设置探究

如果你觉得查资料麻烦,就来关注我,我替你翻阅哦。

1. 什么时候用到BSEL

在Intel 的 SD卡 image 设计的入门教程https://rocketboards.org/foswiki/Documentation/EmbeddedLinuxBeginnerSGuide第3页有嵌入式linux启动的Boot Flow图,从这个图可以看到,Boot ROM代码会去读取BSEL的值(不同的值代表从不同的地方加载Preloader),为接下来程序跳到Preloader执行做准备:

img

(更多关于boot Flow的解说请参考:https://www.intel.cn/content/www/cn/zh/programmable/documentation/lro1404103165481.html

该教程的第3页还提到:

To know where the preloader (the second stage in the boot process) is located, the board designer will need to set the BSEL (Boot Select) pins. On the Atlas board, these pins have been hardcoded into a configuration that tells the Boot ROM to look on the SD Card to find the preloader.
翻译:需要知道preloader (boot过程中的第二阶段程序)位于哪里,然后电路板设计人员将对应地去设置BSEL(Boot Select)引脚。在DE10-Nano-SoC板上,这些引脚已经被硬编码到一个配置中,该配置告诉Boot ROM从SD卡找preloader 程序。

读到这里你可能很疑惑,DE10-Nano-SoC板上的BSEL引脚在实际硬件上被固定为什么值了,为什么就是从SD卡加载preloader 程序呢?

2. BSEL怎么设置

确实,DE0-Nano-SoC板子的BSEL 已经在硬件上固定了配置,已经硬编码为101了, 具体请查阅DE0-Nano- SoC_v.1.3.0_HWrevD0_SystemCD\Schematic\de0-nano-soc.pdf 电路图文档:

img

3.BSEL的值代表什么

BSEL的值代表的意思可以参考DE0-Nano-SoC_v.1.3.0_HWrevD0_SystemCD\Datasheet\FPGA\cyclone_5_datasheet.pdf里面的说明,该文档提到BSEL (启动选择字段)用来指定启动源,不同的值代表从不同的地方加载Preloader。 BSEL由Boot ROM代码在冷复位或热复位时读取,以确定启动源。 HPS BSEL引脚值在冷复位时采样 。

如下红框圈出,0x5 代表101,即从SD卡获取启动源:

img

所以我们后面在给DE0-Nano-SoC设计SD 卡 image的时候我们需要对应地把Preloader 放在SD卡当中,如果用的是您自己的SOC FPGA板子,那就视个人板子BSEL情况来定Preloader应该放在哪里了。

原文地址:https://www.cnblogs.com/DoreenLiu/p/15727486.html