U-boot 之 fdt

VERSION = 2016
PATCHLEVEL = 01
SUBLEVEL =
EXTRAVERSION = -rc3
NAME =

Now, I will describle the u-boot fdt init draft flow.

board_f.c-->

init_sequence_f-->

fdtdec_setup: gd->fdt_blob = (ulong *)&__bss_end; -->

reserve_fdt-->

reloc_fdt: gd->fdt_blob = gd->new_fdt; -->

 

When we have done the fdt initialize. Then we can parse the fdt parameter.

for example: get nand infomation when init nand flash.

fdtdec_next_compatible-->

  fdt_decode_nand-->

    Now we can use flow command get the nand flash base address register.

    (struct nand_ctlr *)fdtdec_get_addr(blob, node, "reg"); 

    fdtdec_get_int(blob, node, "nand-width", 8); //to get nand-width parameter.

In the end, before boot kernel we can reserved the fdt memory by "boot_fdt_add_mem_rsv_regions" in bootm.c(MIPS)

  

    

 

 

 

  

posted @ 2015-12-29 22:46  JustRelax  阅读(1275)  评论(0)    收藏  举报