天嵌 ARM开发社区

 找回密码
 注册
查看: 2628|回复: 0

UBOOT中Boot_init.c关于从NAND拷贝代码到SDRAM

[复制链接]
fengc234 发表于 2012-7-13 09:23:45 | 显示全部楼层 |阅读模式
在函数int nand_read_ll_lp(unsigned char *buf, unsigned long start_addr, int size)里有这样一段代码
/* Check Bad Block */
if(1){
        int col, page;

        col = i & NAND_BLOCK_MASK_LP;
        page = i / NAND_SECTOR_SIZE_LP;

        write_cmd(0x00);

        *p = 5;
        for(j=0; j<10; j++);
        *p = 8;
        for(j=0; j<10; j++);
        *p = page & 0xff;        /* Row Address A12~A19 */
        for(j=0; j<10; j++);
        *p = (page >> 8) & 0xff;        /* Row Address A20~A27 */
        for(j=0; j<10; j++);
if (b128MB == 0)
        *p = (page >> 16) & 0x03;        /* Row Address A28~A29 */
        for(j=0; j<10; j++);

        write_cmd(0x30);
        wait_idle();

        dat = read_data();
        nand_deselect_chip();
        if(dat != 0xff)
            i += 131072;        // 1 Block = 2048*64= 131072
/* Read Page */
        nand_select_chip();
}
问题1:        *p = 5;
        for(j=0; j<10; j++);
        *p = 8;
        for(j=0; j<10; j++);这个地址是怎么来的?
问题2:如果检测到是坏块,这里面也没看到做什么处理?


您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号-2 )

GMT+8, 2025-8-15 18:50 , Processed in 2.035378 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表