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