主题 : mini2440光盘中的u-boot源码中的一些疑惑 复制链接 | 浏览器收藏 | 打印
级别: 骑士
UID: 4234
精华: 0
发帖: 152
金钱: 1420 两
威望: 1142 点
综合积分: 304 分
注册时间: 2009-03-05
最后登录: 2012-08-18
楼主  发表于: 2009-03-31 18:57

 mini2440光盘中的u-boot源码中的一些疑惑

我用了几天的时间把mini2440光盘中的u-boot源码好好看了下,发现了几个地方不知道是干什么的,请大家多多指教!
1.、include/configs/qq2440.h中的
#define CONFIG_SETUP_MEMORY_TAGS    1
#define CONFIG_CMDLINE_TAG          1
是什么对什么设备进行定义
2.cpu\arm920t\start.S中的stack_setup:是不是没有被调用,如果调用了在哪里?
3.drivers\nand\nand_base.c中
#if 0
static struct nand_oobinfo nand_oob_16 = {
    .useecc = MTD_NANDECC_AUTOPLACE,
    .eccbytes = 6,
    .eccpos = {0, 1, 2, 3, 6, 7},
    .oobfree = { {8, 8} }
};
#else
static struct nand_oobinfo nand_oob_16 = {
        .useecc = MTD_NANDECC_AUTOPLACE,
        .eccbytes = 6,
        .eccpos = { 8, 9, 10, 13, 14, 15 },
        .oobfree = { { 0, 4 }, { 6, 2 }, { 11, 2 }, { 4, 1 } }
};
#endif
是定义的什么?
5.drivers\nand\nand_base.c中
int nand_scan (struct mtd_info *mtd, int maxchips)函数是什么作用?
哪位大侠多多指教下小弟!谢谢
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2009-03-31 21:56
1.、include/configs/qq2440.h中的
#define CONFIG_SETUP_MEMORY_TAGS    1
#define CONFIG_CMDLINE_TAG          1
是什么对什么设备进行定义

这是用来标识是否为启动内核建立MEMORY和CMDLINE的ATAG的,那是一种bootloader给内核传递启动参数的方式,详细内容参考http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html

3.drivers\nand\nand_base.c中
#if 0
static struct nand_oobinfo nand_oob_16 = {

那是定义NAND Flash OOB(Out Of Band)区域的Layout的

5.drivers\nand\nand_base.c中
int nand_scan (struct mtd_info *mtd, int maxchips)函数是什么作用?

“扫描”NAND Flash芯片, 用来初始化NAND Flash驱动的
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 骑士
UID: 4234
精华: 0
发帖: 152
金钱: 1420 两
威望: 1142 点
综合积分: 304 分
注册时间: 2009-03-05
最后登录: 2012-08-18
2楼  发表于: 2009-04-01 11:06
谢谢大侠!
级别: 骑士
UID: 4234
精华: 0
发帖: 152
金钱: 1420 两
威望: 1142 点
综合积分: 304 分
注册时间: 2009-03-05
最后登录: 2012-08-18
3楼  发表于: 2009-04-01 11:08
2.cpu\arm920t\start.S中的stack_setup:是不是没有被调用,如果调用了在哪里?
这个问题!!
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
4楼  发表于: 2009-04-01 13:46

 回 3楼(feiyangczm) 的帖子

有調用, 就在這個文件里, 從reset函數順序調用下來的。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."