TA的每日心情 | 开心 2024-11-20 21:23 |
---|
签到天数: 597 天 连续签到: 1 天 [LV.9]以坛为家II
|
本帖最后由 robe.zhang 于 2019-5-27 22:51 编辑
uboot READER 文档,关于如何移植,一共只有两部分信息,截取出来,第一部分如下:
- If the system board that you have is not listed, then you will need
- to port U-Boot to your hardware platform. To do this, follow these
- steps:
- 1. Create a new directory to hold your board specific code. Add any
- files you need. In your board directory, you will need at least
- the "Makefile" and a "<board>.c".
- 2. Create a new configuration file "include/configs/<board>.h" for
- your board.
- 3. If you're porting U-Boot to a new CPU, then also create a new
- directory to hold your CPU specific code. Add any files you need.
- 4. Run "make <board>_defconfig" with your new name.
- 5. Type "make", and you should get a working "u-boot.srec" file
- to be installed on your target system.
- 6. Debug and solve any problems that might arise.
- [Of course, this last step is much harder than it sounds.]
复制代码 第二部分如下:典型的 c 代码,我加了注释:
- U-Boot Porting Guide:
- ----------------------
- [Based on messages by Jerry Van Baren in the U-Boot-Users mailing
- list, October 2002]
- int main(int argc, char *argv[])
- {
- sighandler_t no_more_time;
- signal(SIGALRM, no_more_time);
- alarm(PROJECT_DEADLINE - toSec (3 * WEEK));
- if (available_money > available_manpower) {
- Pay consultant to port U-Boot;
- return 0;
- }
- Download latest U-Boot source; # 下载源码
- Subscribe to u-boot mailing list; # 订阅邮件
- if (clueless)
- email("Hi, I am new to U-Boot, how do I get started?");
- while (learning) {
- Read the README file in the top level directory; # 读文档
- Read http://www.denx.de/twiki/bin/view/DULG/Manual;
- Read applicable doc/*.README;
- Read the source, Luke;
- /* find . -name "*.[chS]" | xargs grep -i <keyword> */
- }
- if (available_money > toLocalCurrency ($2500))
- Buy a BDI3000;
- else
- Add a lot of aggravation and time;
- if (a similar board exists) { /* hopefully... */
- cp -a board/<similar> board/<myboard> # 创建板子
- cp include/configs/<similar>.h include/configs/<myboard>.h # 创建配置
- } else {
- Create your own board support subdirectory;
- Create your own board include/configs/<myboard>.h file;
- }
- Edit new board/<myboard> files # 编辑文件
- Edit new include/configs/<myboard>.h # 编辑配置
- while (!accepted) {
- while (!running) {
- do {
- Add / modify source code; # 改源码先编译通过
- } until (compiles);
- Debug;
- if (clueless)
- email("Hi, I am having problems...");
- } # 改源码运行起来
- Send patch file to the U-Boot email list;
- if (reasonable critiques)
- Incorporate improvements from email list code review;
- else
- Defend code as written;
- } # 改源码直到自己满意
- return 0;
- }
- void no_more_time (int sig)
- {
- hire_a_guru();
- }
复制代码 两部分都是笼统的讲了一下,其实两部分的内容是一样的,第一部分还详细点,第二部分代入了工作场景。
大牛看一看就知道怎么移植,小鸟看了跟没看一样,还是云里雾里。
其实这个移植指导手册也对,只是太笼统了,细节一点没有,需要对 uboot 代码和结构等等都很熟悉,并且对单板也很熟悉,这样就容易移植了。
官方移植文档就这么多信息,剩下的我来慢慢写,可能很久也写不完,但是不是特别特别详细的话,也很快。所以还是需要有基础。但是门槛肯定比 uboot 官方的门槛低得多了。
以下是本人读 uboot 做的笔记,原汁原味,内容还是比较多,后续整理发帖出来可能还没有笔记全。
https://github.com/robe-zhang/mys_y6ulx/tree/master/note_robe/note_uboot
|
|