Installing FreeBSD On U-Boot based PowerPC Targets
Some install notes from building and installing on AmigaOne A1222 and AmigaOne X5000, but should be relevant to most U-Boot PowerPC targets.
As of r344242 bsdinstaller will place ubldr on its own FAT filesystem, which can then be loaded by uboot as follows:
fatload $medium $part $loadaddr ubldr fatload $medium $part $fdtaddr $fdtfile fdt addr $fdtaddr fdt boardsetup bootelf $loadaddr
With '$medium' and '$part' being the device FreeBSD is installed to, with the partition ubldr is installed to. For example:
fatload sata 0:1 $loadaddr ubldr fatload sata 0:1 $fdtaddr $fdtfile fdt addr $fdtaddr fdt boardsetup bootelf $loadaddr
Building the World and Kernel
The targets tested with are:
AmigaOne A1222 - MPC85XXSPE (powerpcspe)
AmigaOne X5000 - QORIQ64 (powerpc64)
Example with 64-bit target:
make -s -j3 buildworld buildkernel TARGET_ARCH=powerpc64 KERNCONF=QORIQ64 make -C release cdrom
You should be able to boot the CDROM image on a USB stick, if U-boot can read ISO9660, otherwise you will need to use another means (FAT volume) to get ubldr into U-boot's memory, along with the FDT blob.
On Freescale hardware with SATA, you can install to SATA for local booting. This includes the AmigaOne A1222 and X5000 I tested. Notes for this are:
- SATA disk needs to be partitioned MBR, with a FAT volume for booting. I make this 128MB, so there's plenty of space for kernels, the dtb, and any other needed files.
- If you plan to only use FreeBSD, dedicate slice 2 to FreeBSD.
My GEOM map:
# gpart show ada0 => 63 234441585 ada0 MBR (112G) 63 1 - free - (512B) 64 262144 1 fat16 (128M) 262208 234179432 2 freebsd (112G) 234441640 8 - free - (4.0K) => 0 234179432 ada0s2 BSD (112G) 0 41943040 1 freebsd-ufs (20G) 41943040 8388608 2 freebsd-swap (4.0G) 50331648 183847784 4 freebsd-zfs (88G)
Once FreeBSD is installed, set bootargs in ubldr, and set SATA boot:
setenv bootcmd_sata 'sata start; fatload sata 0:1 ${loadaddr} ubldr; fatload sata 0:1 ${fdtaddr} ${fdtfile}; fdt addr ${fdtaddr}; fdt boardsetup; bootelf ${loadaddr}' setenv bootcmd_old ${bootcmd} setenv bootcmd run bootcmd_sata saveenv
Be sure to use single quotes when setting bootcmd_sata, so the environment variables aren't expanded immediately, and can be updated later if needed.