AM335x

Revision as of 06:49, 15 September 2016 by StefanM (talk | contribs) (Created page with "==Buiding U-Boot== Make sure you have cross compiler: $ arm-linux-gnueabihf-gcc --version arm-linux-gnueabihf-gcc (Debian 5.4.0-6) 5.4.0 20160609 Copyright (C) 2015 ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Buiding U-Boot

Make sure you have cross compiler:

$ arm-linux-gnueabihf-gcc --version
arm-linux-gnueabihf-gcc (Debian 5.4.0-6) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
   

If you don't have run:

$ sudo apt-get install gcc-5-arm-linux-gnueabihf

Get sources:

$ git clone git://git.denx.de/u-boot.git
$ cd u-boot

The patch is built against specific commit, so reset repository:

$ git reset --hard b89dfcfd926b8224edd24608065eb9bb601c0d3b

Get and apply patch:

$ wget <patch name>
$ git apply <patch name>

Build image, where <board_defconfig> is am335x_olimex_som_defconfig or am335x_olimex_som_nandboot_defconfig:

$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- <board_defconfig>

This will produce two files:

  • MLO
  • u-boot.img


Prepare card

To make sure everything will run without problem wipe all data on the MMC:

$ sudo dd if=/dev/zero of=/dev/sdx bs=1k count=1024

Format the disk:

$ sudo fdisk /dev/sdx << __EOF__
> n
> 
> 
> 
> 
> w
> __EOF__

Make ext4 filesystem

$ sudo mkfs.ext4 -F -O ^metadata_csum,^64bit /dev/sdx1

NOTE: You MUST replace /dev/sdx with your device, e.g. /dev/sdc.


Writing U-Boot

Writing to MMC

Insert your card and write MLO and u-boot.img:

$ sudo dd if=MLO of=/dev/sdx count=1 seek=1 bs=128k
$ sudo dd if=u-boot.img of=/dev/sdx count=2 seek=1 bs=384k