新唐NUC977开发板uboot代码解析2-nandflash初始化及nand相关命令

初始化部分

board_init_r -> (arch/arm/lib/board.c)

nand_init -> (drivers/mtd/nand/nand.c)

nand_init_chip -> (drivers/mtd/nand/nand.c);

board_nand_init -> (drivers/mtd/nand/nuc970_nand.c)

nand_scan_ident -> (drivers/mtd/nand/nand_base.c)

nand_set_defaults -> (drivers/mtd/nand/nand_base.c)

nand_get_flash_type -> (drivers/mtd/nand/nand_base.c)

nand_scan -> (drivers/mtd/nand/nand_base.c)

nand_scan_ident -> (drivers/mtd/nand/nand_base.c)

nand_scan_tail -> (drivers/mtd/nand/nand_base.c)

******************************************************************************* void nand_init(void)

{

int i;

for (i = 0; i < CONFIG_SYS_MAX_NAND_DEVICE; i++)

nand_init_chip(i)-> (drivers/mtd/nand/nand.c);

******************************************************************************* static void nand_init_chip(int i)

{

struct mtd_info *mtd = &nand_info[i];

struct nand_chip *nand = &nand_chip[i];

ulong base_addr = base_address[i];

int maxchips = CONFIG_SYS_NAND_MAX_CHIPS;

if (maxchips < 1)

maxchips = 1;

mtd->priv = nand;

nand->IO_ADDR_R = nand->IO_ADDR_W = (void __iomem *)base_addr;

if (board_nand_init(nand))-> (drivers/mtd/nand/nuc970_nand.c)

******************************************************************************* int board_nand_init(struct nand_chip *nand)

{

struct mtd_info *mtd;

nuc970_nand = kzalloc(sizeof(struct nuc970_nand_info), GFP_KERNEL);

相关文档
相关主题
热门文档