Chinaunix首页 | 论坛 | 博客
  • 博客访问: 198335
  • 博文数量: 23
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 428
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-05 12:46
个人简介

博客转移至CU。之前的百度空间博客http://hi.baidu.com/williwill。

文章分类

全部博文(23)

文章存档

2014年(18)

2013年(5)

我的朋友

分类: 嵌入式

2013-11-10 00:50:20

关于移植的基本方法可以先阅读u-boot的README文档

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.  Add a new configuration option for your board to the toplevel
    "Makefile" and to the "MAKEALL" script, using the existing
    entries as examples. Note that here and at many other places
    boards and other names are listed in alphabetical sort order. Please
    keep this order.
参考已有记录,在顶层目录的Makefile和MAKEALL脚本添加新的配置项。注意这里和其它很多地方,
开发板和其它的名字都是按照字母表顺序排列。请保持此顺序。(个人注:新版本中大部分配置项已移至
一个单独的文件——boards.cfg
 
2.  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", a ".c", "flash.c" and "u-boot.lds".
创建新的目录,存放开发板相关代码。添加必要的文件在开发板目录,至少包括
"Makefile"、".c"、 "flash.c" 和"u-boot.lds"。
3. Create a new configuration file "include/configs/.h" for your board
为目标板创建新的配置文件"include/configs/.h"

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.
如果是为一个新的CPU移植,需要创建一个新的目录存放CPU相关代码。添加需要的文件。

4.  Run "make _config" with your new name.
执行"make _config"。

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.]
Debug并解决出现的问题。[当然,最后一步比听起来难得多。]

点击(此处)折叠或打开

  1. U-Boot Porting Guide:
  2. ----------------------

  3. [Based on messages by Jerry Van Baren in the U-Boot-Users mailing
  4. list, October 2002]


  5. int main(int argc, char *argv[])
  6. {
  7.     sighandler_t no_more_time;

  8.     signal(SIGALRM, no_more_time);
  9.     alarm(PROJECT_DEADLINE - toSec (3 * WEEK));

  10.     if (available_money > available_manpower) {
  11.         Pay consultant to port U-Boot;
  12.         return 0;
  13.     }

  14.     Download latest U-Boot source;

  15.     Subscribe to u-boot mailing list;

  16.     if (clueless)
  17.         email("Hi, I am new to U-Boot, how do I get started?");

  18.     while (learning) {
  19.         Read the README file in the top level directory;
  20.         Read http://www.denx.de/twiki/bin/view/DULG/Manual;
  21.         Read applicable doc/*.README;
  22.         Read the source, Luke;
  23.         /* find . -name "*.[chS]" | xargs grep -i <keyword> */
  24.     }

  25.     if (available_money > toLocalCurrency ($2500))
  26.         Buy a BDI3000;
  27.     else
  28.         Add a lot of aggravation and time;

  29.     if (a similar board exists) { /* hopefully... */
  30.         cp -a board/<similar> board/<myboard>
  31.         cp include/configs/<similar>.h include/configs/<myboard>.h
  32.     } else {
  33.         Create your own board support subdirectory;
  34.         Create your own board include/configs/<myboard>.h file;
  35.     }
  36.     Edit new board/<myboard> files
  37.     Edit new include/configs/<myboard>.h

  38.     while (!accepted) {
  39.         while (!running) {
  40.             do {
  41.                 Add / modify source code;
  42.             } until (compiles);
  43.             Debug;
  44.             if (clueless)
  45.                 email("Hi, I am having problems...");
  46.         }
  47.         Send patch file to the U-Boot email list;
  48.         if (reasonable critiques)
  49.             Incorporate improvements from email list code review;
  50.         else
  51.             Defend code as written;
  52.     }

  53.     return 0;
  54. }

  55. void no_more_time (int sig)
  56. {
  57.       hire_a_guru();
  58. }

阅读(1852) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:booting the kernel后无内核启动信息的调试方法

给主人留下些什么吧!~~