pandaboard之启动过程

原文地址 : http://omappedia.org/wiki/Bootloader_Project

SYSBOOT Pins

The internal ROM Code can attempt to boot from several different peripheral and memory devices, including, but not limited to: Serial (UART3), SD Card, eMMC, NAND, and USB. The order in which these devices are searched for a valid first-stage booting image (x-loader) is determine by a set of GPIO configuration pins referred to as SYSBOOT. The TRM includes a table that shows the booting device list that each combination of the SYSBOOT pins refers to.

The SYSBOOT value can be read from physical address 0x480022f0, either using JTAG, or if you have linux running, use devmem2:

固化在芯片的程序可以从多种介质上启动,配置SYSBOOT Pins修改启动顺序。


First Stage Boot

For example, the SYSBOOT pins could be set such that booting device list consists of 1) serial (UART3), 2) SD card (MMC1), and 3) NAND flash. In this case, the ROM code would first look for a valid x-loader over the serial port, then in the SD card, then in the NAND flash. Whenever it finds a valid x-loader, it proceeds with execution of that binary.

Serial Boot

For serial boot, a simple ID is written out of the serial port. If the host responds correctly within a short window of time, the ROM will read from the serial port and transfer the data to the internal SRAM. Control is passed to the start of SDRAM if no errors are detected. UART3 is the only uart for which the ROM will attempt to load from.

SD Card Boot

If MMC is included in the booting device list, the ROM looks for an SD Card on the first MMC controller. If a card is found, the ROM then looks for the first FAT32 partition within the partition table. Once the partition is found, the root directory is scanned for a special signed file called "MLO" (which is the x-loader binary with a header containing the memory location to load the file to and the size of the file). Assuming all is well with the file, it is transfered into the internal SRAM and control is passed to it. Both MMC1 and MMC2 can be used for booting.

如果MMC在启动设备列表中,ROM 通过1号MMC控制器寻找SD卡,如何识别到SD卡,在SD卡的第一个FAT32分区上寻租MLO文件,如果MLO文件存在,将其复制到内部SRAM中并启动MLO程序。

NAND / eMMC Boot

If NAND is included in the booting device list, the ROM attempts to load the first sector of NAND. If the sector is bad, corrupt, or blank, the ROM will try the next sector (up to 4) before exiting. Once a good sector is found, the ROM transfers the contents to SRAM and transfers control to it. (The same steps are performed for eMMC if eMMC is included in the booting device list instead of NAND.)


x-loader

The x-loader is a small first stage bootloader derived from the u-boot base code. It is loaded into the internal static RAM by the OMAP ROM code. Due to the small size of the internal static RAM, the x-loader is stripped down to the essentials. The x-loader configures the pin muxing, clocks, DDR, and serial console, so that it can access and load the second stage bootloader (u-boot) into the DDR. This figure shows the code flow in the x-loader, beginning in start.S.

x-loader是一个运行在内部SRAM的程序,它负责外部pin、DDR、串口等设备的初始化,并将二级引导程序(例如u boot)复制到DDR中执行。


u-boot

The u-boot is a second stage bootloader that is loaded by the x-loader into DDR. It comes from  Das U-Boot . The u-boot can perform CPU dependent and board dependent initialization and configuration not done in the x-loader. The u-boot also includes fastboot functionality for partitioning and flashing the eMMC. The u-boot runs on the Master CPU (CPU ID 0), which is responsible for the initialization and booting; at the same time, the Slave CPU (CPU ID 1) is held in the “wait for event” state. This figure shows the code flow in the u-boot, beginning in start.S.

U boot是二级引导程序,它运行在主CPU(CPU ID 为0)上,从CPU(CPU ID 为1)被挂起。



编译x-loader 和 U boot

 http://omappedia.org/wiki/Android_Panda_Build_Source#Building_the_kernel_from_source

git clone git://git.linaro.org/boot/u-boot-linaro-stable.git
  cd u-boot-linaro-stable.git
  make CROSS_COMPILE=arm-none-linux-gnueabi- omap4_panda
  # Replace the CROSS_COMPILE with the name of your compiler
After the compile is done you should see two files named MLO and u-boot.img. u-boot.img is same as u-boot.bin with some header information. Copy the MLO file as MLO in the boot partition of the SD and copy the u-boot.img as u-boot.bin in the boot partition of the SD card.

(将MLO u-boot.bin复制到SD 的第一个FAT32分区,我的pandaboard是 Pandaboard ES Rev B1,使用上诉方法可以正常引导linux kernel)

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值