This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM6548: the address for loading the dtb from u-boot

Part Number: AM6548

Hi

It seems that in the TI sdk the dtb file is loaded to the fdtcontroladd. This value is set in uboot. Like to understand how this is calculated in u-boot? I assume it takes some values from the u-boot device tree and calculate teh address where to load the linux device tree.

Thanks    

  • Hi got more info for you gus 

    So it looks like in the ./lib/lmb.c file if finds the reserved area but I assume it should look at the dts uboot file. But I can’t match how the calculation for the reserved area is done. I found out that the dtb is not loaded into the fdtcontroladdr but in a different region. I got the below dump from the lmb.c using the #define DEBUG and using lmb_debug function call. My question is how does the reserved areas gets calculated if you anybody can help me with that it would be great.  Below is the dump from when the kernel starts 

    lmb_dump_all:

       memory.cnt             = 0x1

       memory.size           = 0x0

       memory.reg[0x0].base   = 0x80000000

                       .size   = 0x80000000

     

       reserved.cnt           = 0x3

       reserved.size         = 0x0

       reserved.reg[0x0].base = 0x80080000

                         .size = 0xdf0000

       reserved.reg[0x1].base = 0xfddc2000

                         .size = 0x115000

       reserved.reg[0x2].base = 0xfded7a40

                         .size = 0x21285c0

    bootm_mapsize   =80000000   bootm_low     = 80000000

    ## device tree at 0000000082000000 ... 0000000082111fff (len=1134592 [0x115000])

       Loading Device Tree to 00000000fddc2000, end 00000000fded6fff ... OK

    Thanks

  • Hi Mohsen,


    https://gitlab.denx.de/u-boot/u-boot/-/blob/master/README
    fdtcontroladdr- if set this is the address of the control flattened device tree used by U-Boot when CONFIG_OF_CONTROL is defined.

     fdtcontroladdr and that is for u-boot dtb and fdtaddr is used for Linux DTB loading. I believe now your question is more on reserved
    memory regions? Can you just double confirm the exact question you want the answer for.

    Is it how reserved memory regions are allocated?

    - Keerthy

  • Hi Keerthy

    I don't think that is true as i send you the output from u-boot. You can see that the fdt is loaded in section reserved.reg[0x1].base = 0xfddc2000 that is not the fdtcontroladdr. below you can see teh address for the 

    fdtaddr=0x82000000
    fdtcontroladdr=fded91f8

    that is why i am asking for the location of the fdt and why the reserved memory is important. 

  • Hi Kreeth

    below is what i have in the .config file

    #
    # Device Tree Control
    #
    CONFIG_OF_CONTROL=y

    so what you are talking about is set but still it does not use it. I guess there must be something else that i am missing here. Please take  a look at what i have above, it shows where the fdt is loaded.

    Thanks

  • Hi Mohsen,

    Since we had a call on this topic, do you want to summarize and close this thread?

    Regards

    Karthik

  • It seems that there is a bug in u-boot for reading the reserved-memory from the dtb file. This is being reviewed and hopefully a patch will be provided. In the mean time we have a work around for this. What needs to happen is to stop from relocating the linux dtb file in u-boot. That can happen by setting the below env in u-boot

    setenv fdt_high 0xffffffffffffffff

    saveenv

    This will keep the dtb in location 0x82000000

    Thanks

    regards

    Mohsen