rpi.env 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /* environment for Raspberry Pi boards */
  3. dhcpuboot=usb start; dhcp u-boot.uimg; bootm
  4. /* Environment */
  5. stdin=serial,usbkbd
  6. stdout=serial,vidconsole
  7. stderr=serial,vidconsole
  8. /* DFU over USB/UDC */
  9. #ifdef CONFIG_CMD_DFU
  10. dfu_alt_info=u-boot.bin fat 0 1;uboot.env fat 0 1;
  11. config.txt fat 0 1;
  12. #ifdef CONFIG_ARM64
  13. dfu_alt_info+=Image fat 0 1
  14. #else
  15. dfu_alt_info+=zImage fat 0 1
  16. #endif
  17. #endif /* CONFIG_CMD_DFU */
  18. /*
  19. * Memory layout for where various images get loaded by boot scripts:
  20. *
  21. * I suspect address 0 is used as the SMP pen on the RPi2, so avoid this.
  22. *
  23. * Older versions of the boot firmware place the firmware-loaded DTB at 0x100,
  24. * newer versions place it in high memory. So prevent U-Boot from doing its own
  25. * DTB + initrd relocation so that we won't accidentally relocate the initrd
  26. * over the firmware-loaded DTB and generally try to lay out things starting
  27. * from the bottom of RAM.
  28. *
  29. * kernel_addr_r has different constraints on ARM and Aarch64. For 32-bit ARM,
  30. * it must be within the first 128M of RAM in order for the kernel's
  31. * CONFIG_AUTO_ZRELADDR option to work. The kernel itself will be decompressed
  32. * to 0x8000 but the decompressor clobbers 0x4000-0x8000 as well. The
  33. * decompressor also likes to relocate itself to right past the end of the
  34. * decompressed kernel, so in total the sum of the compressed and
  35. * decompressed kernel needs to be reserved.
  36. *
  37. * For Aarch64, the kernel image is uncompressed and must be loaded at
  38. * text_offset bytes (specified in the header of the Image) into a 2MB
  39. * boundary. The 'booti' command relocates the image if necessary. Linux uses
  40. * a default text_offset of 0x80000. In summary, loading at 0x80000
  41. * satisfies all these constraints and reserving memory up to 0x02400000
  42. * permits fairly large (roughly 36M) kernels.
  43. *
  44. * scriptaddr and pxefile_addr_r can be pretty much anywhere that doesn't
  45. * conflict with something else. Reserving 1M for each of them at
  46. * 0x02400000-0x02500000 and 0x02500000-0x02600000 should be plenty.
  47. *
  48. * On ARM, both the DTB and any possible initrd must be loaded such that they
  49. * fit inside the lowmem mapping in Linux. In practice, this usually means not
  50. * more than ~700M away from the start of the kernel image but this number can
  51. * be larger OR smaller depending on e.g. the 'vmalloc=xxxM' command line
  52. * parameter given to the kernel. So reserving memory from low to high
  53. * satisfies this constraint again. Reserving 1M at 0x02600000-0x02700000 for
  54. * the DTB leaves rest of the free RAM to the initrd starting at 0x02700000.
  55. * Even with the smallest possible CPU-GPU memory split of the CPU getting
  56. * only 64M, the remaining 25M starting at 0x02700000 should allow quite
  57. * large initrds before they start colliding with U-Boot.
  58. */
  59. #ifdef CONFIG_ARM64
  60. fdt_high=ffffffffffffffff
  61. initrd_high=ffffffffffffffff
  62. #else
  63. fdt_high=ffffffff
  64. initrd_high=ffffffff
  65. #endif
  66. kernel_addr_r=0x00080000
  67. scriptaddr=0x02400000
  68. pxefile_addr_r=0x02500000
  69. fdt_addr_r=0x02600000
  70. ramdisk_addr_r=0x02700000
  71. boot_targets=mmc usb pxe dhcp