Hi all,
I've added some detailed info on the wiki about how to go about building bootable images for the big.LITTLE components, here:
https://wiki.linaro.org/Internal/Projects/Big.Little.Switcher/ARMFastModelsH...
For the benefit of anyone who can't see that page, I've also pasted it here -- if anyone knows a better place to post this stuff, please let me know!
Note that although the instructions give details of how to build a filesystem image, there is essentially nothing b.L or model-specific there -- it just serves as background for explaining how to work around some issues which you may encounter.
These images are not supposed to present a fully working big.LITTLE system -- they are there to help people understand how booting works, where the sources are and how to work with the model.
Note also that the bootwrapper will change soon (when I get there) to support loading of the kernel, initramfs from the host filesystem using semihosting, just like the kvm bootwrapper, but this isn't implemented for now.
Cheers ---Dave
== Filesystem ==
We need to create an SD card image with a filesystem on it, with the rootfs partition matching the bootargs set previously. The following example generates a suitable image using developer. The hardware pack is largely irrelevant because we're not getting the kernel, modules, bootloader or command-line from there -- but it keeps l-m-c happy.
{{{ $ wget http://releases.linaro.org/12.02/ubuntu/oneiric-images/developer/linaro-o-de... $ wget http://releases.linaro.org/12.02/ubuntu/oneiric-images/developer/hwpack_lina... }}}
Note that the ARM fast model's MMC interface emulation is currently limited to 2G. Make the image a bit smaller than that to be on the safe side:
{{{ $ sudo linaro-media-create --dev vexpress --image_file mmc.bin --image_size 2000M --hwpack hwpack_linaro-lt-vexpress-a9_20120221-1_armel_suupported.tar.gz --binary linaro-o-developer-tar-20120221-0.tar.gz }}}
After generating the filesystem, you probably want to customize it:
* Disable address layout randomization (mitigates a memory consumption issue with the model, but not so important on host machines with >4GB of RAM): {{{ echo sys.kernel.randomize_va_space = 0 >>etc/sysctl.conf }}}
* Disable DHCP for the network (otherwise boot will stall): {{{ sed -i '/auto.*eth0/d; s/^(iface.*eth0.*)dhcp/\1manual/' etc/network/interfaces }}}
* Edit fstab to put the real device name into /etc/fstab in place of UUID=<uuid>. This may not be necessary (mountall was getting confused, but that may have been caused by not having an initramfs).
Finally, extract the initramfs image (whatever /initrd.img in the filesystem image points to).
== Kernel, switcher and bootwrapper ==
Clone the big.LITTLE switcher:
{{{ $ git clone --branch gnu-build git://git.linaro.org/people/dmart/arm-virt-bl.git }}}
Clone the kernel to run on the model. (Eventually we shouldn't need a special tree for this. There are a few model-specific tweaks in this tree, but nothing big.LITTLE-specific yet.)
{{{ $ git clone --branch arm/vexpressdt-rtsm git://git.linaro.org/people/dmart/linux-2.6-arm.git }}}
Now build the kernel:
{{{ $ cd linux-2.6-arm/
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- vexpress_rtsm_defconfig $ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- zImage dtbs }}}
The bootwrapper doesn't support device tree yet, so for now append a suitable device tree blob to the zImage. This should match the model you intend to run on:
{{{ $ cat arch/arm/boot/zImage arch/arm/boot/vexprress-v2p-ca15x4-rtsm.dtb >../zBlob }}}
Now, build the bootwrapper using the kernel you just built:
{{{ $ cd ../arm-virt-bl/bootwrapper }}}
Configure some things:
In Makefile, add the following argument to BOOTARGS: {{{ root=/dev/mmcblk0p2 }}}
Due to current bugginess introduced by the ARM->GNU toolchain migration, the switcher is not currently stable. For now, we turn off autonomous asynchronous switching so that we can see the system booting:
In big-little/Makefile, add change the line {{{ ASYNC ?= TRUE }}} to {{{ ASYNC ?= FALSE }}}
Plug in the kernel and initramfs images from the previous steps:
{{{ $ : >payload/fsimg $ cp ../../zBlob payload/kernel $ cp initrd.img payload/fsimg }}}
... and build:
{{{ $ make [...] LD img.axf }}}
img.axf is the boot payload which is needed to start the model. It contains the big.LITTLE switcher code and the kernel, along with a minimal bootloader.
== Running ==
OK, so now we have:
* A boot image containing the switcher and kernel: img.axf * A filesystem MMC card image: mmc.bin * A model binary
Sample payload images can be found in http://people.linaro.org/~dmart/bl-images/model-images-20120228.tar.bz2
Run like this:
{{{ $ ./RTSM_VE_Cortex-A15x4-A7x4 -C motherboard.mmc.p_mmc_file=mmc.bin -a coretile.cluster0.*=img.axf }}}
This should be enough to boot to a prompt on the simulated UART.
Beware though -- it can take up to 10 minutes or so to get there, depending on your machine.