4

I have been working on implementing u-boot on a 64bit RPi4 for a few weeks. My last big mistake was that when booting the kernel in boot.cmd -> I was using the variable fdt_addr_r instead of fdt_addr.

Does anyone know the difference between the fdt_addr and fdt_addr_r variables? and why when loading the dtb we use fdt_addr_r ? and why we use fdt_addr when booting the kernel?

Thanks

Dams
  • 41
  • 2

1 Answers1

1

fdt_addr_r gives the location of the fdt in RAM the image will be loaded to and fdt_addr give the fdt's address in Flash.

The following image location variables contain the location of images
used in booting. The "Image" column gives the role of the image and is
not an environment variable name. The other columns are environment
variable names. "File Name" gives the name of the file on a TFTP
server, "RAM Address" gives the location in RAM the image will be
loaded to, and "Flash Location" gives the image's address in NOR
flash or offset in NAND flash.

*Note* - these variables don't have to be defined for all boards, some
boards currently use other variables for these purposes, and some
boards use these variables for other purposes.

Image            File Name       RAM Address       Flash Location
-----            ---------       -----------       --------------
u-boot           u-boot          u-boot_addr_r     u-boot_addr
Linux kernel     bootfile        kernel_addr_r     kernel_addr
device tree blob fdtfile         fdt_addr_r        fdt_addr
ramdisk          ramdiskfile     ramdisk_addr_r    ramdisk_addr

source: https://source.denx.de/u-boot/u-boot/-/blob/master/README#L3211

The FDT is prepared by the RPi first stage bootloader. The address of this FDT is stored in the variable ${fdt_addr}.

source: https://elinux.org/RPi_U-Boot#Booting_from_an_SD_card

apapillon
  • 116
  • 7