六、Nand初始化

puts ("NAND:  ");

nand_init();

void nand_init(void)

{

int i;

unsigned int size = 0;

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

nand_init_chip(&nand_info[i], &nand_chip[i], base_address[i]);

size += nand_info[i].size / 1024;

if (nand_curr_device == -1)

nand_curr_device = i;

}

printf("%u MiB\n", size / 1024);

}

#define CONFIG_SYS_MAX_NAND_DEVICE 1

struct mtd_info nand_info[CONFIG_SYS_MAX_NAND_DEVICE];

static struct nand_chip nand_chip[CONFIG_SYS_MAX_NAND_DEVICE];

static ulong base_address[CONFIG_SYS_MAX_NAND_DEVICE] = CONFIG_SYS_NAND_BASE_LIST;

#define CONFIG_SYS_NAND_BASE 0x4e000000

#define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }

 

你可能感兴趣的:(二刷uboot,uboot)