Skip to content

Commit

Permalink
Merge pull request microsoft#16 from jordanrh1/master
Browse files Browse the repository at this point in the history
Update build instructions for new u-boot repository
  • Loading branch information
jordanrh1 authored Dec 7, 2017
2 parents e8552f8 + 40c444d commit edf54b5
Showing 1 changed file with 33 additions and 71 deletions.
104 changes: 33 additions & 71 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,107 +91,69 @@ Linux environment setup:
sudo apt-get install build-essential python python-crypto python-wand

cd ~
wget https://releases.linaro.org/components/toolchain/binaries/4.9-2017.01/arm-linux-gnueabi/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi.tar.xz
tar xf gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi.tar.xz
wget https://releases.linaro.org/components/toolchain/binaries/6.4-2017.11/arm-linux-gnueabihf/gcc-linaro-6.4.1-2017.11-x86_64_arm-linux-gnueabihf.tar.xz
tar xf gcc-linaro-6.4.1-2017.11-x86_64_arm-linux-gnueabihf.tar.xz

## Building Sabre firmware from source

### Building U-Boot
## Building U-Boot
U-Boot must be built on Ubuntu Linux or Windows Subsystem for Linux.

git clone -b develop https://github.com/Microsoft/u-boot-iMX6.git
cd u-boot-iMX6
git clone -b master-mx6 https://github.com/ms-iot/SolidRun-u-boot.git
cd SolidRun-u-boot

export CROSS_COMPILE=~/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi/bin/arm-linux-gnueabi-
export CROSS_COMPILE=~/gcc-linaro-6.4.1-2017.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
export ARCH=arm

make mx6sabresd_SECURE_BOOT_defconfig
For Hummingboard:

make mx6cuboxi_nt_defconfig
make


This will produce SPL and u-boot.img in the root of the project. SPL and u-boot.img must be written to reserved sectors of an SD card. The X in PhysicalDriveX must be replaced with the disk number for your SD card as shown in Disk Management. Be certain the disk number is for your SD card, dd will not ask for confirmation.

dd if=SPL of=\\.\PhysicalDriveX bs=512 seek=2
dd if=u-boot.img of=\\.\PhysicalDriveX bs=512 seek=138

### Building OP-TEE
OP-TEE must be built on Ubuntu Linux or Windows Subsystem for Linux.

git clone -b ms-iot https://github.com/ms-iot/optee_os.git
cd optee_os

export CROSS_COMPILE=~/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi/bin/arm-linux-gnueabi-

make PLATFORM=imx-mx6qsabresd CFG_PSCI_ARM32=y CFG_REE_FS=y CFG_RPMB_FS=y CFG_RPMB_WRITE_KEY=y CFG_RPMB_TESTKEY=y CFG_RPMB_RESET_FAT=y CFG_TA_HELLO_WORLD=n CFG_TA_RPC=y CFG_WITH_USER_TA=y CFG_PAGED_USER_TA=n CFG_WITH_PAGER=n CFG_CRYPTO_SIZE_OPTIMIZATION=y platform-cflags-optimization=-Os CFG_UNWIND=n CFG_TEE_CORE_DEBUG=n CFG_TEE_CORE_LOG_LEVEL=2 CFG_BOOT_SECONDARY_REQUEST=y CFG_CYREP=y

This will produce a file named tee.bin which must be written to the SD card. The X in PhysicalDriveX must be replaced with the disk number for your SD card as shown in Disk Management. Be certain the disk number is for your SD card, dd will not ask for confirmation.

dd if=out/arm-plat-imx/core/tee.bin of=\\.\PhysicalDriveX bs=512 seek=2186

### Building UEFI
UEFI must be built on Windows.

git clone -b ms-iot https://github.com/ms-iot/EDK2-Next.git

Download and unzip the [GCC4.9 cross-compiler](https://releases.linaro.org/archive/14.09/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.9-2014.09_win32.zip) to ..\Toolchains\ArmGCC49. For example if the repo is cloned to C:\github\EDK2-Next then the installation path would be C:\github\Toolchains\ArmGCC49. ArmGCC49 should contain the arm-none-eabi, bin, lib, libexec, share folders directly. You can also unzip it to the directory of your choice and run `set GCC_TOOLCHAIN_DIR=<path\to\Toolchains\ArmGCC49\>` before building.

cd EDK2-Next
iMX6Pkg\BuildIMX6Board.bat SABRESD_IMX6Q_1GB

BuildIMX6Board.bat also supports /debug, /secure, and /noparallel flags before the board name
* /debug will build a debug version of UEFI.
* /secure enables UEFI security features: Authenticated Variables, SecureBoot, and fTPM.
* /noparallel disables multithreaded compilation.

This will produce a file named IMX6BOARD_EFI.fd which must be copied to the root of the EFIESP partition.

copy Build\SABRESD_IMX6Q_1GB\RELEASE_GCC49\FV\IMX6BOARD_EFI.fd [EFIESP drive]:\

## Building Hummingboard firmware from source

### Building U-Boot
U-Boot must be built on Ubuntu Linux or Windows Subsystem for Linux.

git clone -b master-mx6 https://github.com/ms-iot/SolidRun-u-boot.git
cd SolidRun-u-boot-imx6

export CROSS_COMPILE=~/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi/bin/arm-linux-gnueabi-
export ARCH=arm

make mx6cuboxi_nt_config
For Sabre:

make mx6sabresd_nt_defconfig
make
./tools/mkimage -C none -A arm -T script -d ./scripts/imx-sd-boot.txt boot.scr


This will produce SPL, u-boot.img, and boot.scr in the root of the project. boot.scr must be copied to the EFIESP partition. SPL and u-boot.img must be written to reserved sectors of an SD card. The X in PhysicalDriveX must be replaced with the disk number for your SD card as shown in Disk Management. Be certain the disk number is for your SD card, dd will not ask for confirmation.
This will produce SPL and u-boot-ivt.img in the root of the project. SPL and u-boot-ivt.img must be written to reserved sectors of an SD card. The X in PhysicalDriveX must be replaced with the disk number for your SD card as shown in Disk Management. Be certain the disk number is for your SD card. DD will not ask for confirmation.

copy boot.scr [EFIESP drive]:\
dd if=SPL of=\\.\PhysicalDriveX bs=512 seek=2
dd if=u-boot.img of=\\.\PhysicalDriveX bs=512 seek=138
dd if=u-boot-ivt.img of=\\.\PhysicalDriveX bs=512 seek=138

### Building OP-TEE
## Building OP-TEE
OP-TEE must be built on Ubuntu Linux or Windows Subsystem for Linux.

git clone -b ms-iot https://github.com/ms-iot/optee_os.git
cd optee_os

export CROSS_COMPILE=~/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi/bin/arm-linux-gnueabi-
export CROSS_COMPILE=~/gcc-linaro-6.4.1-2017.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-

make PLATFORM=imx-mx6qhmbedge CFG_PSCI_ARM32=y CFG_REE_FS=y CFG_RPMB_FS=y CFG_RPMB_WRITE_KEY=y CFG_RPMB_TESTKEY=y CFG_RPMB_RESET_FAT=y CFG_TA_HELLO_WORLD=n CFG_TA_RPC=y CFG_WITH_USER_TA=y CFG_PAGED_USER_TA=n CFG_WITH_PAGER=n CFG_CRYPTO_SIZE_OPTIMIZATION=y platform-cflags-optimization=-Os CFG_UNWIND=n CFG_TEE_CORE_DEBUG=n CFG_TEE_CORE_LOG_LEVEL=2 CFG_BOOT_SECONDARY_REQUEST=y CFG_NS_ENTRY_ADDR=0x10820000 CFG_CYREP=y
For Hummingboard:

make PLATFORM=imx-mx6qhmbedge CFG_PSCI_ARM32=y CFG_REE_FS=y CFG_RPMB_FS=y CFG_RPMB_WRITE_KEY=y CFG_RPMB_TESTKEY=y CFG_RPMB_RESET_FAT=y CFG_TA_HELLO_WORLD=n CFG_TA_RPC=y CFG_WITH_USER_TA=y CFG_PAGED_USER_TA=n CFG_WITH_PAGER=n CFG_CRYPTO_SIZE_OPTIMIZATION=y platform-cflags-optimization=-Os CFG_UNWIND=n CFG_TEE_CORE_DEBUG=n CFG_TEE_CORE_LOG_LEVEL=2 CFG_BOOT_SECONDARY_REQUEST=y CFG_CYREP=y

For Sabre:

make PLATFORM=imx-mx6qsabresd CFG_PSCI_ARM32=y CFG_REE_FS=y CFG_RPMB_FS=y CFG_RPMB_WRITE_KEY=y CFG_RPMB_TESTKEY=y CFG_RPMB_RESET_FAT=y CFG_TA_HELLO_WORLD=n CFG_TA_RPC=y CFG_WITH_USER_TA=y CFG_PAGED_USER_TA=n CFG_WITH_PAGER=n CFG_CRYPTO_SIZE_OPTIMIZATION=y platform-cflags-optimization=-Os CFG_UNWIND=n CFG_TEE_CORE_DEBUG=n CFG_TEE_CORE_LOG_LEVEL=2 CFG_BOOT_SECONDARY_REQUEST=y CFG_CYREP=y

This will produce a file named tee.bin which must be copied to the root of the EFIESP partition.
This will produce `out/arm-plat-imx/core/tee.bin` which must be written to the SD card. The X in PhysicalDriveX must be replaced with the disk number for your SD card as shown in Disk Management. Be certain the disk number is for your SD card. DD will not ask for confirmation.

copy out/arm-plat-imx/core/tee.bin [EFIESP drive]:\
dd if=tee.bin of=\\.\PhysicalDriveX bs=512 seek=2186

### Building UEFI
## Building UEFI
UEFI must be built on Windows.

git clone -b ms-iot https://github.com/ms-iot/EDK2-Next.git

Download and unzip the [GCC4.9 cross-compiler](https://releases.linaro.org/archive/14.09/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.9-2014.09_win32.zip) to ..\Toolchains\ArmGCC49. For example if the repo is cloned to C:\github\EDK2-Next then the installation path would be C:\github\Toolchains\ArmGCC49. ArmGCC49 should contain the arm-none-eabi, bin, lib, libexec, share folders directly. You can also unzip it to the directory of your choice and run `set GCC_TOOLCHAIN_DIR=<path\to\Toolchains\ArmGCC49\>` before building.

cd EDK2-Next

For Hummingboard:

iMX6Pkg\BuildIMX6Board.bat HUMMINGBOARD_EDGE_IMX6Q_2GB

For Sabre:

iMX6Pkg\BuildIMX6Board.bat SABRESD_IMX6Q_1GB

BuildIMX6Board.bat also supports /debug, /secure, and /noparallel flags before the board name
* /debug will build a debug version of UEFI.
Expand Down

0 comments on commit edf54b5

Please sign in to comment.