歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux編程 >> Linux編程 >> u-boot中的go和reset命令

u-boot中的go和reset命令

日期:2017/3/1 9:57:35   编辑:Linux編程

[u-boot: v2013.04]

[Author: Bo Shen [email protected]]

1. 源代碼

<common/cmd_boot.c>

在此文件中定義兩個命令,一個是go命令,另外一個是reset命令。

1.1 go命令

如果定義了CONFIG_CMD_GO,則會有go命令。CONFIG_CMD_GO是在<include/config_cmd_defaults.h>裡面定義的。在通過mkconfig生成<include/config.h>文件的時候,<include/config_cmd_defaults.h>文件則會被自動包含進來。所以默認就定義CONFIG_CMD_GO,所以就會有go命令。

1.2 reset命令

在編譯u-boot的時候,cmd_boot是直接包含的,所以無論如何都會有reset命令。

reset <common/cmd_boot.c> ---> do_reset <arch/arm/lib/reset.c> ---> reset_cpu <arch/arch/cpu/arm926ejs/at91/reset.c>

其中do_reset還做了三件事情後才調用reset_cpu:

---- 打印:resetting ...

---- 延時50 ms

---- disable_interrupts <include/common.h> <arch/arm/lib/interrupts.c>

---- 如果系統沒有定義CONFIG_USE_IRQ,則do_interrupts直接返回0;

---- 如果系統定義CONFIG_USE_IRQ, 則做具體的事情去disable IRQ/FIQ interrupts.

Copyright © Linux教程網 All Rights Reserved