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 |
Simon Glass | 5432aba | 2024-12-19 17:34:46 -0700 | [diff] [blame^] | 51 | * 0x05400000-0x05500000 and 0x05500000-0x05600000 should be plenty. |
Simon Glass | 7a38f7c | 2023-07-27 15:54:30 -0600 | [diff] [blame] | 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 |
Simon Glass | 5432aba | 2024-12-19 17:34:46 -0700 | [diff] [blame^] | 58 | * satisfies this constraint again. Reserving 1M at 0x05600000-0x05700000 for |
| 59 | * the DTB leaves rest of the free RAM to the initrd starting at 0x05700000. |
| 60 | * This means that the board must have at least 128MB of RAM available to |
| 61 | * U-Boot, more if the initrd is large. |
Simon Glass | 581c4f9 | 2024-12-19 17:34:44 -0700 | [diff] [blame] | 62 | * |
Simon Glass | 5432aba | 2024-12-19 17:34:46 -0700 | [diff] [blame^] | 63 | * For compressed kernels, the maximum size is just under 32MB, with an area for |
| 64 | * decompression at 0x02000000 with space for 52MB, which is plenty for current |
| 65 | * kernels. |
| 66 | * |
| 67 | * limit bootm_size to 512MB so that all boot images stay within the bottom |
Simon Glass | 581c4f9 | 2024-12-19 17:34:44 -0700 | [diff] [blame] | 68 | * 512MB of memory |
Simon Glass | 7a38f7c | 2023-07-27 15:54:30 -0600 | [diff] [blame] | 69 | */ |
Simon Glass | 581c4f9 | 2024-12-19 17:34:44 -0700 | [diff] [blame] | 70 | bootm_size=0x20000000 |
| 71 | |
Simon Glass | 7a38f7c | 2023-07-27 15:54:30 -0600 | [diff] [blame] | 72 | kernel_addr_r=0x00080000 |
Simon Glass | 5432aba | 2024-12-19 17:34:46 -0700 | [diff] [blame^] | 73 | kernel_comp_addr_r=0x02000000 |
| 74 | kernel_comp_size=0x03400000 |
| 75 | scriptaddr=0x05400000 |
| 76 | pxefile_addr_r=0x05500000 |
| 77 | fdt_addr_r=0x05600000 |
| 78 | ramdisk_addr_r=0x05700000 |
Simon Glass | 7a38f7c | 2023-07-27 15:54:30 -0600 | [diff] [blame] | 79 | |
| 80 | boot_targets=mmc usb pxe dhcp |