当前位置: 代码迷 >> 综合 >> uboot nandflsh
  详细解决方案

uboot nandflsh

热度:8   发布时间:2023-12-08 20:22:30.0

打了printf的uboot文件,u-boot-2010-c.bin

运行输出文件,uboot-nand-c.TXT

 

 

实验结果, nandflash的操作函数  实在 nand_base.c中实现,

 

问题:

int nand_scan_tail(struct mtd_info *mtd)函数实现了 ,

   mtd->write = nand_write;

nandflash操作函数的初始化

   mtd->write = nand_write;

 

 应用层nand_util.c调用的是rval = nand_write (nand, offset, length, buffer);

但是nand_write有2个实现,

Nand.h (t\include):

static inline int nand_write(nand_info_t *info, loff_t ofs, size_t *len, u_char *buf)
{
 
 return info->write(info, ofs, *len, (size_t *)len, buf);
}

Nand_base.c (t\drivers\mtd\nand):static int nand_write(struct mtd_info *mtd, loff_t to, size_t len,

write函数在n个源文件中实现了, 但是 uboot是怎么选择了 nand_base.c中的这个 write函数的定义的呢??????

 

 

 

 

 

 

 

附录


---- nand_scan_tail Matches (7 in 4 files) ----
Changelog (t):    core code in nand_scan_tail, plus current oobavail values are wrong for
Nand.h (t\include\linux\mtd):extern int nand_scan_tail(struct mtd_info *mtd);
Nand_base.c (t\drivers\mtd\nand): * nand_scan_tail - [NAND Interface] Scan for the NAND device
Nand_base.c (t\drivers\mtd\nand):int nand_scan_tail(struct mtd_info *mtd)
Nand_base.c (t\drivers\mtd\nand):  ret = nand_scan_tail(mtd);
Nand_base.c (t\drivers\mtd\nand):EXPORT_SYMBOL_GPL(nand_scan_tail);
Omap_gpmc.c (t\drivers\mtd\nand): nand_scan_tail(mtd);
---- nand_scan Matches (55 in 16 files) ----
Bfin_nand.c (t\drivers\mtd\nand): *   nand_scan about special functionality. See the defines for further
Diskonchip.c (t\drivers\mtd\nand): if ((ret = nand_scan(mtd, numchips))) {
Mpc5121_nfc.c (t\drivers\mtd\nand): if (nand_scan(mtd, 1)) {
Nand.c (t\drivers\mtd\nand):  if (nand_scan(mtd, maxchips) == 0) {
---- nand_init_chip Matches (2 in 1 files) ----
Nand.c (t\drivers\mtd\nand):static void nand_init_chip(struct mtd_info *mtd, struct nand_chip *nand,
Nand.c (t\drivers\mtd\nand):  nand_init_chip(&nand_info[i], &nand_chip[i], base_address[i]);
---- nand_init Matches (70 in 35 files) ----
Board.c (t\lib_arm): nand_init();  /* go init the NAND */
Makefile (t\nand_spl\board\freescale\mpc8313erdb):COBJS = nand_boot_fsl_elbc.o $(BOARD).o sdram.o ns16550.o nand_init.o \
Makefile (t\nand_spl\board\freescale\mpc8313erdb):$(obj)nand_init.c:
Makefile (t\nand_spl\board\freescale\mpc8313erdb): ln -sf $(SRCTREE)/cpu/mpc83xx/nand_init.c $(obj)nand_init.c
Makefile (t\nand_spl\board\freescale\mpc8315erdb):COBJS = nand_boot_fsl_elbc.o $(BOARD).o sdram.o ns16550.o nand_init.o \
Makefile (t\nand_spl\board\freescale\mpc8315erdb):$(obj)nand_init.c:
Makefile (t\nand_spl\board\freescale\mpc8315erdb): ln -sf $(SRCTREE)/cpu/mpc83xx/nand_init.c $(obj)nand_init.c
Makefile (t\nand_spl\board\sheldon\simpc8313):COBJS = nand_boot_fsl_elbc.o $(BOARD).o sdram.o ns16550.o nand_init.o \
Makefile (t\nand_spl\board\sheldon\simpc8313):$(obj)nand_init.c:
Makefile (t\nand_spl\board\sheldon\simpc8313): ln -s $(SRCTREE)/cpu/mpc83xx/nand_init.c $@
Nand.c (t\drivers\mtd\nand):void nand_init(void)
Nand.h (t\include):extern void nand_init(void);