Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note

Note – Take your time while identifying where your designated SD-Card is mapped on your linux system. Failure to do so can result in overwriting an arbitrary disk on your system!

SATA

This section assumes that you have a device running linux, and the target sata drive attached to it. This can be any device! Optionally create an MBR partition table, and any partitions you may want.

The Boot-ROM searches for the SPL after the first 1024 bytes. The SPL then looks for the full u-boot binary at 69k. The dd command can be used for writing SPL and u-boot to these locations on your sata drive. Substitute sdX by the device node of your sata drive.

Code Block
dd if=SPL of=/dev/sdX bs=1k seek=1 conv=sync
dd if=u-boot.img of=/dev/sdX bs=1k seek=69 conv=sync
Note

Note – Take your time while identifying where your designated SD-Card is mapped on your linux system. Failure to do so can result in overwriting an arbitrary disk on your system!

Booting from USB (OTG)

An unfused i.MX6 SoM will fall back to booting from USB when it has not found any bootable code on the attached storage. Therefore it can be used to deploy software to a new system. Since the HummingBoard 2 there are also boot select jumpers that allow explicitly selecting USB as the boot source. The particulars can be found HummingBoard Edge/Gate Boot Jumpers .

...

Code Block
Copying data from PC to DFU device
Download        [=========================] 100%        52224 bytes
Download done.
state(7) = dfuMANIFEST, status(0) = No error condition is present
state(2) = dfuIDLE, status(0) = No error condition is present
Done!The Hard Way:

...

Using U-Boot console and USB Flash Drive:

If Linux is already running on the device, the procedure is identical to microSD. In this case the previous section can be used, where sdX is replaced with mmcblk1.

...

Code Block
# select eMMC (mmc1)
mmc dev 1 0

usb start
# expected output: 1 Storage Device(s) found

load usb 0:1 ${kernel_addr_r} SPLspl-imx6-emmc
# expected output: 52224 bytes read in 24 ms (2.1 MiB/s)
mmc write ${kernel_addr_r} 0x2 0x66
# expected output: MMC write: dev # 1, block # 2, count 102 ... 102 blocks written: OK

load usb 0:1 ${kernel_addr_r} u-boot-imx6-emmc.img
# expected output: 329312 bytes read in 38 ms (8.3 MiB/s)
mmc write ${kernel_addr_r} 0x8A 0x284
# expected output: MMC write: dev # 1, block # 138, count 644 ... 644 blocks written: OK

# select eMMC boot partition
mmc partconf 1 0 7 0

There are many magic numbers in this short script that require attention!:

  • mmc dev 1: 0 is microSD, 1 is eMMCx y:

    • x = 0 is microSD, x = 1 is eMMC

    • y = 0 is eMMC main (data) partition

    • y = 1 is eMMC hardware boot0 partition, y = 2 is eMMC hardware boot1 partition

  • mmc write ${kernel_addr_r} 0x2 0x66:

    • 0x2 = destination block number in hexadecimal. Here one block is 512 bytes –> SPL goes to block 2 (1024 bytes)

    • 0x66: The size of SPL in blocks in hexadecimal. This is the ceiling of filesize divided by 512, in this example 52224 / 512 = 102 = 0x66

  • mmc write ${kernel_addr_r} 0x8A 0x284

    • 0x8A: SPL is expected at 69kB –> 138 = 0x8A0x284: ceil(329312 / 512) = ceil(643,1875) = 644 = 0x284at 69kB –> 138 = 0x8A

    • 0x284: ceil(329312 / 512) = ceil(643,1875) = 644 = 0x284

  • mmc partconf x a y b:

    • x = 0 is microSD, x = 1 is eMMC

    • a = 0 is disable acknowledge to boot-rom

    • y = 7 is eMMC main (data) partition

    • y = 1 is eMMC hardware boot0 partition, y = 2 is eMMC hardware boot1 partition

    • y = 0 is disable eMMC boot

    • b is partition access enable, values same as y: 0, 1, 2, 7

Note

It is highly recommended to write U-Boot from either Linux, or over the USB OTG port with DFU, which are both easier to use!

...