h2. License The use of Juno software is subject to the terms of the Juno "End User License Agreement":https://releases.linaro.org/14.06/android/images/armv8-juice-juno-lsk/#tabs-5. h1. Accessing Source Code h2. Linaro Android Source Code Run the "linaro_android_build_cmds.sh":http://releases.linaro.org/14.06/android/images/armv8-juice-juno-lsk/linaro_android_build_cmds.sh script, it will download the entire source code for both Android and the kernel and attempt to build it. The pinned and source manifests can be found here: * "Pinned Manifest":http://releases.linaro.org/14.06/android/images/armv8-juice-juno-lsk/pinned-manifest.xml ("?":https://wiki.linaro.org/Platform/Android/ReproduceABuildExactly) * "Source Manifest":http://releases.linaro.org/14.06/android/images/armv8-juice-juno-lsk/source-manifest.xml h2. Compiling Linaro Android RootFS+Kernel The following simple steps download, install and compile a complete Linaro Android distribution * Download and install Ubuntu 12.04 64 bit or newer ("download":http://www.ubuntu.com) * Install the following packages: bc. sudo apt-get update sudo apt-get install zip curl flex bison build-essential git-core gnupg gperf zlib1g-dev libx11-dev x11proto-core-dev \ gcc-multilib g++-multilib libc6-dev-i386 ia32-libs lib32z-dev gcc-4.5 g++-4.5 cpp-4.5 gcc-4.5-multilib g++-4.5-multilib \ uuid-dev openjdk-7-jdk ant lib32ncurses5-dev xsltproc sudo update-alternatives --config java sudo update-alternatives --config javac sudo update-alternatives --config javadoc * Download the Android building script for this release from "here":http://releases.linaro.org/14.06/android/images/armv8-juice-juno-lsk/linaro_android_build_cmds.sh or from the list of artifacts listed above. * Run the script bc. chmod a+x linaro_android_build_cmds.sh ./linaro_android_build_cmds.sh -t h3. Installing Android on your board * Insert a USB drive and note the assigned @'/dev/sdX'@ or @'/dev/mmcblk0'@ bc. dmesg | less Look for a line that looks like the following at the end of the log @[288582.790722] sdc: sdc1 sdc2 sdc3 sdc4 @ Or, if your machine uses '/dev/mmcblkX', you may see a line line this: @[10770.938042] mmcblk0: p1 p2 p3 p4 < p5 p6 >@ *WARNING:* In the next step, make sure you use /dev/"whatever you see above". *You can erase your hard drive* with the wrong parameter. * Create media bc. cd android/out/target/product/juice sudo linaro-android-media-create --mmc /dev/sdX --dev vexpress --boot boot.tar.bz2 --system system.tar.bz2 --userdata userdata.tar.bz2 * Insert the USB drive into your board and reboot it p. You must configure UEFI exach time you create a new disk image. h1. Building Firmware From Source h2. Prerequisites The following tools and environment are required: * Ubuntu desktop OS and the following packages. ARM have only tested with Ubuntu 12.04.02 (64-bit). ** `git` package to obtain source code ** `ia32-libs` package ** `build-essential` and `uuid-dev` packages for building the UEFI and Firmware Image Package (FIP) tool * Baremetal GNU GCC tools. Can be downloaded from Linaro ** "http://releases.linaro.org/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz":http://releases.linaro.org/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz * The instructions on this page below assume that the environment variable $JUNO_ROOT_DIR has been initialised to a working directory. bc. $ export JUNO_ROOT_DIR=/ h2. SCP Firmware The SCP Firmware is only available as a pre-built binary.   h2. ARM Trusted Firmware The ARM trusted firmware consists of the following images: |Filename|Image Type|Image Name| |bl1.bin|BL1|ARM Trusted ROM image| |bl2.bin|BL2|ARM Trusted Firmware| |bl31.bin|BL3-1|EL3 runtime| |bl32.bin (optional)|BL3-2|Test Secure Payload| The bl2.bin, bl31.bin and bl32.bin images are inputs to the process of creating a Firmware Image Package. h3. Obtaining sources Clone the ARM Trusted Firmware repository from GitHub: bc. $ cd $JUNO_ROOT_DIR $ git clone https://github.com/ARM-software/arm-trusted-firmware.git $ cd arm-trusted-firmware $ git checkout v0.4-Juno-0.5 h3. Configuration Set the compiler path bc. $ export CROSS_COMPILE=/bin/aarch64-none-elf- h3. Building 1. Change to the trusted firmware directory: bc. $ cd $JUNO_ROOT_DIR/arm-trusted-firmware 2. Build the different firmware images: bc. $ make PLAT=juno all To build the optional bl3-2 Test Secure Payload component, use the following commands instead (the 'make realclean' is important): bc. $ make realclean $ make PLAT=juno SPD=tspd all By default the preceding commands produce a release version of the build. To produce a debug version instead and make the build more verbose use: bc. $ make PLAT=juno DEBUG=1 V=1 all The build process creates products in a `build` directory tree, building the objects for each boot loader stage in separate sub-directories. The following boot loader binary files are created: * @build/juno//bl1.bin@ * @build/juno//bl2.bin@ * @build/juno//bl31.bin@ * @build/juno//bl32.bin@ (if the 'SPD=tspd' flag is used) ... where @@ is either `debug` or `release`. To clean the ARM Trusted Firmware source tree (warning, this will remove the binaries too): bc. $ make realclean   h2. UEFI UEFI is a single bl33.bin image that is an input to the process of creating a Firmware Image Package. h3. Obtaining sources Clone the Juno UEFI Github repository: bc. $ cd $JUNO_ROOT_DIR $ git clone https://github.com/ARM-software/edk2.git -b juno $ cd edk2 $ git checkout v1.0-rc0   h3. Configuration 1. Define the AArch64 GCC toolchain: bc. $ export GCC48_AARCH64_PREFIX=/bin/aarch64-none-elf- 2. Configure Tianocore environment: bc. $ cd $JUNO_ROOT_DIR/edk2 $ . edksetup.sh $ make -C BaseTools h3. Building 1. Change to the EDK2 directory: bc. $ cd $JUNO_ROOT_DIR/edk2 2. To build DEBUG version of UEFI firmware: bc. $ make -f ArmPlatformPkg/ArmJunoPkg/Makefile The build produces the binary $JUNO_ROOT_DIR/edk2/Build/ArmJuno/DEBUG_GCC48/FV/BL33_AP_UEFI.fd that should be used as 'bl33.bin' when generating the Firmware Image Package binary. To build RELEASE version of UEFI firmware: bc. $ make -f ArmPlatformPkg/ArmJunoPkg/Makefile EDK2_BUILD=RELEASE Use the release binary $JUNO_ROOT_DIR/edk2/Build/ArmJuno/RELEASE_GCC48/FV/BL33_AP_UEFI.fd as bl33.bin when generating the Firmware Image Package binary. To clean EDK2 source tree: bc. $ make -f ArmPlatformPkg/ArmJunoPkg/Makefile clean   h2. Packaging the binaries ARM Trusted Firmware uses the Firmware Image Package (FIP) binary blob to load images into the system, so that the firmware can avoid managing lots of smaller images. The FIP will contain: * BL2 and BL3-1 boot loader images * Test Secure Payload (BL3-2 image - optional) * UEFI firmware (BL3-3 image) * SCP firmware (BL3-0 image) Note: BL1 image is NOT part of the FIP. h3. Building a FIP binary The steps to create a FIP are as follows: 1. Build the 'fip_create' tool. bc. $ cd $JUNO_ROOT_DIR/arm-trusted-firmware $ make fiptool 2. Define the FIP environment. Specifically, include the FIP tool in the path. bc. $ export PATH=$JUNO_ROOT_DIR/arm-trusted-firmware/tools/fip_create:$PATH 3. Download the "firmware image artefacts":https://wiki.linaro.org/ARM/Juno?action=AttachFile&do=get&target=juno-firmware-beta-0.7.5.zip and extract to a working directory (hereafter referred to as @""@). 4. Gather the binary files (the following example is for release builds only). bc. $ cd $JUNO_ROOT_DIR $ mkdir fip $ cd fip $ cp /bl30.bin . $ cp $JUNO_ROOT_DIR/arm-trusted-firmware/build/juno/release/bl2.bin . $ cp $JUNO_ROOT_DIR/arm-trusted-firmware/build/juno/release/bl31.bin . $ cp $JUNO_ROOT_DIR/arm-trusted-firmware/build/juno/release/bl32.bin . $ cp $JUNO_ROOT_DIR/edk2/Build/ArmJuno/RELEASE_GCC48/FV/BL33_AP_UEFI.fd  bl33.bin If you wish to use the pre-built ARM trusted firmware and UEFI EDK2 images instead of building them from source, then the last four lines of the above block can independently be replaced with the following: bc. $ cp /bl2.bin . $ cp /bl31.bin . $ cp /bl32.bin . $ cp /bl33.bin . 5. Create the FIP file: bc. $ fip_create --dump \ --bl2 bl2.bin \ --bl30 bl30.bin \ --bl31 bl31.bin \ --bl32 bl32.bin \ (if the optional bl32 image is present) --bl33 bl33.bin \ fip.bin The previous command will display the FIP layout: bc. Firmware Image Package ToC: --------------------------- - Trusted Boot Firmware BL2: offset=0xD8, size=0x5268 - SCP Firmware BL3-0: offset=0x5340, size=0x9C64 - EL3 Runtime Firmware BL3-1: offset=0xEFA4, size=0x82A0 - Non-Trusted Firmware BL3-3: offset=0x17244, size=0xF0000 --------------------------- Creating "fip.bin"; 6. Optional: the `fip_create` tool can be used in the exact same way to update individual images inside an existing FIP file. For example, to update the SCP Firmware BL3-0 image: bc. $ fip_create --dump --bl30 new_bl30.bin fip.bin The previous command will again display the FIP layout: bc. Firmware Image Package ToC: --------------------------- - Trusted Boot Firmware BL2: offset=0xD8, size=0x5268 - SCP Firmware BL3-0: offset=0x5340, size=0x9C64 file: 'new_bl30.bin' - EL3 Runtime Firmware BL3-1: offset=0xEFA4, size=0x82A0 - Non-Trusted Firmware BL3-3: offset=0x17244, size=0xF0000 --------------------------- Updating "fip.bin" For more details and options about the `fip_create` tool: bc. $ fip_create --help