Thomas Fitzsimmons | b966be8 | 2023-02-13 11:21:27 -0500 | [diff] [blame^] | 1 | .. SPDX-License-Identifier: GPL-2.0+ |
| 2 | .. Copyright (C) 2018, 2023 Thomas Fitzsimmons <fitzsim@fitzsim.org> |
| 3 | |
| 4 | BCM7445 and BCM7260 |
| 5 | =================== |
| 6 | |
| 7 | This document describes how to use U-Boot on the Broadcom 7445 and |
| 8 | Broadcom 7260 SoC, as a third stage bootloader loaded by Broadcom's |
| 9 | BOLT bootloader. |
| 10 | |
| 11 | BOLT loads U-Boot as a generic ELF binary. Some U-Boot features such |
| 12 | as networking are not implemented but other important features are, |
| 13 | including: |
| 14 | |
| 15 | * ext4 file system traversal |
| 16 | * support for loading FIT images |
| 17 | * advanced scripting |
| 18 | * support for FIT-provided DTBs instead of relying on the BOLT-provided DTB |
| 19 | |
| 20 | A customized version of this port has been used in production. The |
| 21 | same approach may work on other BCM7xxx boards, with some |
| 22 | configuration adjustments and memory layout experimentation. |
| 23 | |
| 24 | Configure |
| 25 | --------- |
| 26 | |
| 27 | BCM7445 |
| 28 | ^^^^^^^ |
| 29 | |
| 30 | .. code-block:: console |
| 31 | |
| 32 | $ make bcm7445_defconfig |
| 33 | |
| 34 | BCM7260 |
| 35 | ^^^^^^^ |
| 36 | |
| 37 | .. code-block:: console |
| 38 | |
| 39 | $ make bcm7260_defconfig |
| 40 | |
| 41 | Build |
| 42 | ----- |
| 43 | |
| 44 | .. code-block:: console |
| 45 | |
| 46 | $ make |
| 47 | $ ${CROSS_COMPILE}strip u-boot |
| 48 | |
| 49 | Run |
| 50 | --- |
| 51 | |
| 52 | To tell U-Boot which serial port to use for its console, set the |
| 53 | ``stdout-path`` property in the ``/chosen`` node of the BOLT-generated |
| 54 | device tree. For example: |
| 55 | |
| 56 | :: |
| 57 | |
| 58 | BOLT> dt add prop chosen stdout-path s serial0:115200n8 |
| 59 | |
| 60 | Flash the ``u-boot`` binary into board storage, then invoke it from |
| 61 | BOLT. For example: |
| 62 | |
| 63 | :: |
| 64 | |
| 65 | BOLT> boot -bsu -elf flash0.u-boot1 |
| 66 | |
| 67 | This port assumes that I-cache and D-cache are already enabled when |
| 68 | U-Boot is entered. |
| 69 | |
| 70 | Flattened Image Tree Support |
| 71 | ---------------------------- |
| 72 | |
| 73 | What follows is an example FIT image source file. Build it with: |
| 74 | |
| 75 | .. code-block:: console |
| 76 | |
| 77 | $ mkimage -f image.its image.itb |
| 78 | |
| 79 | Booting the resulting ``image.itb`` was tested on BOLT v1.20, with the |
| 80 | following kernels: |
| 81 | |
| 82 | * https://github.com/Broadcom/stblinux-3.14 |
| 83 | * https://github.com/Broadcom/stblinux-4.1 |
| 84 | * https://github.com/Broadcom/stblinux-4.9 |
| 85 | |
| 86 | and with a generic ARMv7 root file system. |
| 87 | |
| 88 | **image.its** |
| 89 | |
| 90 | :: |
| 91 | |
| 92 | /dts-v1/; |
| 93 | / { |
| 94 | description = "BCM7445 FIT"; |
| 95 | images { |
| 96 | kernel@1 { |
| 97 | description = "Linux kernel"; |
| 98 | /* |
| 99 | * This kernel image output format can be |
| 100 | * generated with: |
| 101 | * |
| 102 | * make vmlinux |
| 103 | * ${CROSS_COMPILE}objcopy -O binary -S vmlinux vmlinux.bin |
| 104 | * gzip -9 vmlinux.bin |
| 105 | * |
| 106 | * For stblinux-3.14, the specific Broadcom |
| 107 | * board type should be configured in the |
| 108 | * kernel, for example CONFIG_BCM7445D0=y. |
| 109 | */ |
| 110 | data = /incbin/("<vmlinux.bin.gz>"); |
| 111 | type = "kernel"; |
| 112 | arch = "arm"; |
| 113 | os = "linux"; |
| 114 | compression = "gzip"; |
| 115 | load = <0x8000>; |
| 116 | entry = <0x8000>; |
| 117 | hash@1 { |
| 118 | algo = "sha256"; |
| 119 | }; |
| 120 | }; |
| 121 | ramdisk@1 { |
| 122 | description = "Initramfs root file system"; |
| 123 | data = /incbin/("<initramfs.cpio.gz>"); |
| 124 | type = "ramdisk"; |
| 125 | arch = "arm"; |
| 126 | os = "linux"; |
| 127 | compression = "gzip"; |
| 128 | /* |
| 129 | * Set the environment variable initrd_high to |
| 130 | * 0xffffffff, and set "load" and "entry" here |
| 131 | * to 0x0 to keep initramfs in-place and to |
| 132 | * accommodate stblinux bmem/CMA reservations. |
| 133 | */ |
| 134 | load = <0x0>; |
| 135 | entry = <0x0>; |
| 136 | hash@1 { |
| 137 | algo = "sha256"; |
| 138 | }; |
| 139 | }; |
| 140 | fdt@1 { |
| 141 | description = "Device tree dumped from BOLT"; |
| 142 | /* |
| 143 | * This DTB should be similar to the |
| 144 | * BOLT-generated device tree, after BOLT has |
| 145 | * done its runtime modifications to it. For |
| 146 | * example, it can be dumped from within |
| 147 | * U-Boot (at ${fdtcontroladdr}), after BOLT |
| 148 | * has loaded U-Boot. The result can be added |
| 149 | * to the Linux source tree as a .dts file. |
| 150 | * |
| 151 | * To support modifications to the device tree |
| 152 | * in-place in U-Boot, add to Linux's |
| 153 | * arch/arm/boot/dts/Makefile: |
| 154 | * |
| 155 | * DTC_FLAGS ?= -p 4096 |
| 156 | * |
| 157 | * This will leave some padding in the DTB and |
| 158 | * thus reserve room for node additions. |
| 159 | * |
| 160 | * Also, set the environment variable fdt_high |
| 161 | * to 0xffffffff to keep the DTB in-place and |
| 162 | * to accommodate stblinux bmem/CMA |
| 163 | * reservations. |
| 164 | */ |
| 165 | data = /incbin/("<bolt-<version>.dtb"); |
| 166 | type = "flat_dt"; |
| 167 | arch = "arm"; |
| 168 | compression = "none"; |
| 169 | hash@1 { |
| 170 | algo = "sha256"; |
| 171 | }; |
| 172 | }; |
| 173 | }; |
| 174 | configurations { |
| 175 | default = "conf@bcm7445"; |
| 176 | conf@bcm7445 { |
| 177 | description = "BCM7445 configuration"; |
| 178 | kernel = "kernel@1"; |
| 179 | ramdisk = "ramdisk@1"; |
| 180 | fdt = "fdt@1"; |
| 181 | }; |
| 182 | }; |
| 183 | }; |