1*4882a593SmuzhiyunSummary 2*4882a593Smuzhiyun======= 3*4882a593Smuzhiyun 4*4882a593SmuzhiyunThis document describes how to use U-Boot on the Broadcom 7445 SoC, as 5*4882a593Smuzhiyuna third stage bootloader loaded by Broadcom's BOLT bootloader. 6*4882a593Smuzhiyun 7*4882a593SmuzhiyunBOLT loads U-Boot as a generic ELF binary. Some U-Boot features such 8*4882a593Smuzhiyunas networking are not yet available but other important features are, 9*4882a593Smuzhiyunincluding: 10*4882a593Smuzhiyun 11*4882a593Smuzhiyun - ext4 file system traversal 12*4882a593Smuzhiyun 13*4882a593Smuzhiyun - support for loading FIT images 14*4882a593Smuzhiyun 15*4882a593Smuzhiyun - advanced scripting 16*4882a593Smuzhiyun 17*4882a593Smuzhiyun - support for FIT-provided DTBs instead of relying on the 18*4882a593Smuzhiyun BOLT-provided DTB 19*4882a593Smuzhiyun 20*4882a593SmuzhiyunA customized version of this port has been used in production. The 21*4882a593Smuzhiyunsame approach may work on other BCM7xxx boards, with some 22*4882a593Smuzhiyunconfiguration adjustments and memory layout experimentation. 23*4882a593Smuzhiyun 24*4882a593SmuzhiyunBuild 25*4882a593Smuzhiyun===== 26*4882a593Smuzhiyun 27*4882a593Smuzhiyunmake bcm7445_defconfig 28*4882a593Smuzhiyunmake 29*4882a593Smuzhiyun${CROSS_COMPILE}strip u-boot 30*4882a593Smuzhiyun 31*4882a593SmuzhiyunRun 32*4882a593Smuzhiyun=== 33*4882a593Smuzhiyun 34*4882a593SmuzhiyunFlash the u-boot binary into board storage, then invoke it from BOLT. 35*4882a593SmuzhiyunFor example: 36*4882a593Smuzhiyun 37*4882a593SmuzhiyunBOLT> boot -bsu -elf flash0.u-boot1 38*4882a593Smuzhiyun 39*4882a593SmuzhiyunThis port assumes that I-cache and D-cache are already enabled when 40*4882a593SmuzhiyunU-Boot is entered. 41*4882a593Smuzhiyun 42*4882a593SmuzhiyunFlattened Image Tree Support 43*4882a593Smuzhiyun============================ 44*4882a593Smuzhiyun 45*4882a593SmuzhiyunWhat follows is an example FIT image source file. Build it with: 46*4882a593Smuzhiyun 47*4882a593Smuzhiyunmkimage -f image.its image.itb 48*4882a593Smuzhiyun 49*4882a593SmuzhiyunBooting the resulting image.itb was tested on BOLT v1.20, with the 50*4882a593Smuzhiyunfollowing kernels: 51*4882a593Smuzhiyun 52*4882a593Smuzhiyunhttps://github.com/Broadcom/stblinux-3.14 53*4882a593Smuzhiyunhttps://github.com/Broadcom/stblinux-4.1 54*4882a593Smuzhiyunhttps://github.com/Broadcom/stblinux-4.9 55*4882a593Smuzhiyun 56*4882a593Smuzhiyunand with a generic ARMv7 root file system. 57*4882a593Smuzhiyun 58*4882a593Smuzhiyunimage.its: 59*4882a593Smuzhiyun/dts-v1/; 60*4882a593Smuzhiyun/ { 61*4882a593Smuzhiyun description = "BCM7445 FIT"; 62*4882a593Smuzhiyun images { 63*4882a593Smuzhiyun kernel@1 { 64*4882a593Smuzhiyun description = "Linux kernel"; 65*4882a593Smuzhiyun /* 66*4882a593Smuzhiyun * This kernel image output format can be 67*4882a593Smuzhiyun * generated with: 68*4882a593Smuzhiyun * 69*4882a593Smuzhiyun * make vmlinux 70*4882a593Smuzhiyun * ${CROSS_COMPILE}objcopy -O binary -S vmlinux vmlinux.bin 71*4882a593Smuzhiyun * gzip -9 vmlinux.bin 72*4882a593Smuzhiyun * 73*4882a593Smuzhiyun * For stblinux-3.14, the specific Broadcom 74*4882a593Smuzhiyun * board type should be configured in the 75*4882a593Smuzhiyun * kernel, for example CONFIG_BCM7445D0=y. 76*4882a593Smuzhiyun */ 77*4882a593Smuzhiyun data = /incbin/("<vmlinux.bin.gz>"); 78*4882a593Smuzhiyun type = "kernel"; 79*4882a593Smuzhiyun arch = "arm"; 80*4882a593Smuzhiyun os = "linux"; 81*4882a593Smuzhiyun compression = "gzip"; 82*4882a593Smuzhiyun load = <0x8000>; 83*4882a593Smuzhiyun entry = <0x8000>; 84*4882a593Smuzhiyun hash@1 { 85*4882a593Smuzhiyun algo = "sha256"; 86*4882a593Smuzhiyun }; 87*4882a593Smuzhiyun }; 88*4882a593Smuzhiyun ramdisk@1 { 89*4882a593Smuzhiyun description = "Initramfs root file system"; 90*4882a593Smuzhiyun data = /incbin/("<initramfs.cpio.gz>"); 91*4882a593Smuzhiyun type = "ramdisk"; 92*4882a593Smuzhiyun arch = "arm"; 93*4882a593Smuzhiyun os = "linux"; 94*4882a593Smuzhiyun compression = "gzip"; 95*4882a593Smuzhiyun /* 96*4882a593Smuzhiyun * Set the environment variable initrd_high to 97*4882a593Smuzhiyun * 0xffffffff, and set "load" and "entry" here 98*4882a593Smuzhiyun * to 0x0 to keep initramfs in-place and to 99*4882a593Smuzhiyun * accommodate stblinux bmem/CMA reservations. 100*4882a593Smuzhiyun */ 101*4882a593Smuzhiyun load = <0x0>; 102*4882a593Smuzhiyun entry = <0x0>; 103*4882a593Smuzhiyun hash@1 { 104*4882a593Smuzhiyun algo = "sha256"; 105*4882a593Smuzhiyun }; 106*4882a593Smuzhiyun }; 107*4882a593Smuzhiyun fdt@1 { 108*4882a593Smuzhiyun description = "Device tree dumped from BOLT"; 109*4882a593Smuzhiyun /* 110*4882a593Smuzhiyun * This DTB should be similar to the 111*4882a593Smuzhiyun * BOLT-generated device tree, after BOLT has 112*4882a593Smuzhiyun * done its runtime modifications to it. For 113*4882a593Smuzhiyun * example, it can be dumped from within 114*4882a593Smuzhiyun * U-Boot (at ${fdtcontroladdr}), after BOLT 115*4882a593Smuzhiyun * has loaded U-Boot. The result can be added 116*4882a593Smuzhiyun * to the Linux source tree as a .dts file. 117*4882a593Smuzhiyun * 118*4882a593Smuzhiyun * To support modifications to the device tree 119*4882a593Smuzhiyun * in-place in U-Boot, add to Linux's 120*4882a593Smuzhiyun * arch/arm/boot/dts/Makefile: 121*4882a593Smuzhiyun * 122*4882a593Smuzhiyun * DTC_FLAGS ?= -p 4096 123*4882a593Smuzhiyun * 124*4882a593Smuzhiyun * This will leave some padding in the DTB and 125*4882a593Smuzhiyun * thus reserve room for node additions. 126*4882a593Smuzhiyun * 127*4882a593Smuzhiyun * Also, set the environment variable fdt_high 128*4882a593Smuzhiyun * to 0xffffffff to keep the DTB in-place and 129*4882a593Smuzhiyun * to accommodate stblinux bmem/CMA 130*4882a593Smuzhiyun * reservations. 131*4882a593Smuzhiyun */ 132*4882a593Smuzhiyun data = /incbin/("<bolt-<version>.dtb"); 133*4882a593Smuzhiyun type = "flat_dt"; 134*4882a593Smuzhiyun arch = "arm"; 135*4882a593Smuzhiyun compression = "none"; 136*4882a593Smuzhiyun hash@1 { 137*4882a593Smuzhiyun algo = "sha256"; 138*4882a593Smuzhiyun }; 139*4882a593Smuzhiyun }; 140*4882a593Smuzhiyun }; 141*4882a593Smuzhiyun configurations { 142*4882a593Smuzhiyun default = "conf@bcm7445"; 143*4882a593Smuzhiyun conf@bcm7445 { 144*4882a593Smuzhiyun description = "BCM7445 configuration"; 145*4882a593Smuzhiyun kernel = "kernel@1"; 146*4882a593Smuzhiyun ramdisk = "ramdisk@1"; 147*4882a593Smuzhiyun fdt = "fdt@1"; 148*4882a593Smuzhiyun }; 149*4882a593Smuzhiyun }; 150*4882a593Smuzhiyun}; 151