diff options
Diffstat (limited to 'gnu/bootloader')
| -rw-r--r-- | gnu/bootloader/u-boot.scm | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm index 349bb724184..5d341e97fe8 100644 --- a/gnu/bootloader/u-boot.scm +++ b/gnu/bootloader/u-boot.scm | |||
| @@ -36,6 +36,7 @@ | |||
| 36 | u-boot-a20-olinuxino-lime2-bootloader | 36 | u-boot-a20-olinuxino-lime2-bootloader |
| 37 | u-boot-a20-olinuxino-micro-bootloader | 37 | u-boot-a20-olinuxino-micro-bootloader |
| 38 | u-boot-bananapi-m2-ultra-bootloader | 38 | u-boot-bananapi-m2-ultra-bootloader |
| 39 | u-boot-am335x-evm-bootloader | ||
| 39 | u-boot-beaglebone-black-bootloader | 40 | u-boot-beaglebone-black-bootloader |
| 40 | u-boot-cubietruck-bootloader | 41 | u-boot-cubietruck-bootloader |
| 41 | u-boot-firefly-rk3399-bootloader | 42 | u-boot-firefly-rk3399-bootloader |
| @@ -97,6 +98,48 @@ is BLOCK-SIZE * COUNT, or FILE size if COUNT is not given." | |||
| 97 | (if bootloader | 98 | (if bootloader |
| 98 | (error "Failed to install U-Boot")))) | 99 | (error "Failed to install U-Boot")))) |
| 99 | 100 | ||
| 101 | (define install-am335x-evm-u-boot | ||
| 102 | (write-u-boot-image | ||
| 103 | ;; According to the "26.1.8.5.5 MMC/SD Read Sector Procedure in Raw Mode" | ||
| 104 | ;; section in the "AM335x and AMIC110 Sitaraâ„¢ Processors Technical | ||
| 105 | ;; Reference Manual", we have offset, the bootrom tries to load code at the | ||
| 106 | ;; offsets 0x0, 0x20000 (128KB), 0x40000 (256KB) and 0x60000 (384KB). | ||
| 107 | ;; | ||
| 108 | ;; The MBR is 512 Bytes | ||
| 109 | ;; (https://en.wikipedia.org/wiki/Master_boot_record#Sector_layout). | ||
| 110 | ;; | ||
| 111 | ;; At the time of writing, u-boot.img is 1.4 MiB, and it is at offset | ||
| 112 | ;; 0x60000 (384KB) as per CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR. | ||
| 113 | ;; | ||
| 114 | ;; We also need to align the first partition to make sure read/writes are | ||
| 115 | ;; properly aligned. | ||
| 116 | ;; | ||
| 117 | ;; Given these constraints, we chose the following partitioning: | ||
| 118 | ;; | ||
| 119 | ;; 0 512 Bytes 128 KiB | ||
| 120 | ;; | | (0x20000) 256 KiB | ||
| 121 | ;; | | / (0x40000) 384 KiB 4 MiB | ||
| 122 | ;; | | / | (0x60000) | | ||
| 123 | ;; | | / | | | | ||
| 124 | ;; v v / v v v | ||
| 125 | ;; +-------+ +--------------+---------------+----------------+ | ||
| 126 | ;; | MBR | ... | First MLO | Second MLO | u-boot.img | | ||
| 127 | ;; +-------+ +--------------+---------------+----------------+ | ||
| 128 | ;; <-512 B-> ... <-- 128 KiB --> <-- 128 KiB --> <-- 3712 KiB --> | ||
| 129 | ;; | ||
| 130 | ;; The rationale for that is as follows: | ||
| 131 | ;; | ||
| 132 | ;; - We add a second copy of the MLO at 256 KiB for improving reliability | ||
| 133 | ;; as the doc/board/ti/am335x_evm.rst documentation in u-boot advise us | ||
| 134 | ;; to do that, and also because the space there isn't used. | ||
| 135 | ;; | ||
| 136 | ;; - All can fit into 2MiB (u-boot.img can grow up to 1664 KiB), but we | ||
| 137 | ;; want a bit more space in case u-boot.img grows over time, so we allow | ||
| 138 | ;; u-boot to grow until the 4 MiB offset. | ||
| 139 | '(("MLO" 256 256) ;; First MLO | ||
| 140 | ("MLO" 256 512) ;; Second MLO | ||
| 141 | ("u-boot.img" 7424 768)) 512)) | ||
| 142 | |||
| 100 | (define install-beaglebone-black-u-boot | 143 | (define install-beaglebone-black-u-boot |
| 101 | ;; http://wiki.beyondlogic.org/index.php?title=BeagleBoneBlack_Upgrading_uBoot | 144 | ;; http://wiki.beyondlogic.org/index.php?title=BeagleBoneBlack_Upgrading_uBoot |
| 102 | ;; This first stage bootloader called MLO (U-Boot SPL) is expected at | 145 | ;; This first stage bootloader called MLO (U-Boot SPL) is expected at |
| @@ -158,6 +201,33 @@ is BLOCK-SIZE * COUNT, or FILE size if COUNT is not given." | |||
| 158 | (installer #f) | 201 | (installer #f) |
| 159 | (disk-image-installer install-u-boot))) | 202 | (disk-image-installer install-u-boot))) |
| 160 | 203 | ||
| 204 | (define u-boot-am335x-evm-bootloader | ||
| 205 | (bootloader | ||
| 206 | (inherit u-boot-bootloader) | ||
| 207 | ;; This bootloader supports the following computers: | ||
| 208 | ;; - SanCloud BeagleBone Enhanced | ||
| 209 | ;; - SanCloud BeagleBone Enhanced Extended WiFi | ||
| 210 | ;; - SanCloud BeagleBone Enhanced Lite | ||
| 211 | ;; - Seeed Studio BeagleBone Green Eco | ||
| 212 | ;; - TI AM3359 ICE-V2 | ||
| 213 | ;; - TI AM335x BeagleBone | ||
| 214 | ;; - TI AM335x BeagleBone Black | ||
| 215 | ;; - TI AM335x BeagleBone Green | ||
| 216 | ;; - TI AM335x EVM | ||
| 217 | ;; - TI AM335x EVM-SK | ||
| 218 | ;; - TI AM335x PocketBeagle | ||
| 219 | ;; | ||
| 220 | ;; This list was made by retrieving the list of Devicetrees used in | ||
| 221 | ;; configs/am335x_evm_defconfig in u-boot source code. Once we have that we | ||
| 222 | ;; can look at each Devicetree in arch/arm/boot/dts/ti/omap/ inside Linux, | ||
| 223 | ;; and in each file, look at the model property to find the name of the | ||
| 224 | ;; computers that this image supports. | ||
| 225 | (package u-boot-am335x-evm) | ||
| 226 | ;; At the time of writing, our u-boot.img is 1.4 MiB. This is why we can't | ||
| 227 | ;; reuse install-beaglebone-black-u-boot. And having the same image being | ||
| 228 | ;; able to boot on multiple computers is useful. | ||
| 229 | (disk-image-installer install-am335x-evm-u-boot))) | ||
| 230 | |||
| 161 | (define u-boot-beaglebone-black-bootloader | 231 | (define u-boot-beaglebone-black-bootloader |
| 162 | (bootloader | 232 | (bootloader |
| 163 | (inherit u-boot-bootloader) | 233 | (inherit u-boot-bootloader) |
