ODROID/u-boot

From Linux Exynos
Jump to: navigation, search

The following instructions are currently aimed at ODROID devices with a Samsung Exynos Prime 4412 or a Samsung Exynos 4412 SoC. For more information you can send an e-mail to our mailing list, or you can visit #linux-exynos.

Partitioning

Partitioning the SD-card can be done using fdisk. The u-boot that we will be building expects the first or second partition to be the boot partition formatted as FAT32. In addition to that you'll need a partition for the root filesystem (can be anything you want, as long as the Linux kernel supports it) at minimum.

Building u-boot

Start by cloning Hardkernel's repository for u-boot.

git clone https://github.com/hardkernel/u-boot.git u-boot
cd u-boot

Note: If you used Gentoo Crossdev and are cross compiling, you should prefix all your make commands with:

CROSS_COMPILE=armv7a-hardfloat-linux-gnueabi- ARCH=arm

After that we'll have to configure u-boot for the board we want to use. The ODROID-XU requires smdk5410_config, which is not available yet within Hardkernel's repository.

make smdk4412_config

If you get compilation errors, apply the following patch:

diff --git a/arch/arm/cpu/armv7/config.mk b/arch/arm/cpu/armv7/config.mk
index 7f9b171..71b3b75 100644
--- a/arch/arm/cpu/armv7/config.mk
+++ b/arch/arm/cpu/armv7/config.mk
@@ -20,7 +20,8 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 # MA 02111-1307 USA
 #
-PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
+#PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
+PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -mfloat-abi=hard -mfpu=vfpv3  
 
 # Make ARMv5 to allow more compilers to work, even though its v7a.
 PLATFORM_CPPFLAGS += -march=armv7-a

Now that u-boot has been configured, we can build it:

make -j3

When the build has completed, u-boot.bin will be available in your u-boot source tree. Let's write that to the SD-card (/dev/mmcblk0, for instance), in addition to some signed binary blobs that are required for it to work.

dd if=sd_fuse/bl1.HardKernel of=/dev/mmcblk0 seek=1
dd if=sd_fuse/bl2.HardKernel of=/dev/mmcblk0 seek=31
dd if=u-boot.bin of=/dev/mmcblk0 seek=63
dd if=sd_fuse/tzsw.HardKernel of=/dev/mmcblk0 seek=2111

Boot script

The only missing part for u-boot to work is a boot script. In the case of ODROID, the boot script tells where to find the kernel image, and what arguments should be passed to the kernel in order to set up HDMI and a serial framebuffer. Write the following to boot.txt (this is usually located in the root of the boot partition for back-up purposes):

setenv initrd_high "0xffffffff"
setenv fdt_high "0xffffffff"
setenv fb_x_res "1920"
setenv fb_y_res "1080"
setenv hdmi_phy_res "1080"
setenv bootcmd "fatload mmc 0:1 0x40008000 zImage; bootm 0x40008000"
setenv bootargs "console=tty1 console=ttySAC1,115200n8 fb_x_res=${fb_x_res} fb_y_res=${fb_y_res} hdmi_phy_res=${hdmi_phy_res} root=/dev/mmcblk0p3 rootwait ro mem=2047M"
boot

You may want to modify the script to your needs. If you are done, you can proceed making the boot script boot.scr, which should be stored in the root of your boot partition:

mkimage -A arm -C none -T script -d boot.txt boot.scr