#860834 u-boot-amlogic: u-boot.bin is not directly usable

#860834#5
Date:
2017-04-20 19:24:18 UTC
From:
To:
Dear Vagrant,

thank you for creating this package.

Unfortunately this package alone is insufficient to set up U-Boot on the
Odroid C2.

The following tools are missing:
- fip_create from
https://github.com/hardkernel/u-boot/tree/odroidc2-v2015.01
- amlbootsig from
https://github.com/afaerber/meson-tools

Furthermore the firmware is needed. The source is possibly contained in
http://openlinux.amlogic.com:8000/download/ARM/u-boot/uboot-2016-08-18-edd7f116ab.tar.gz

The finished binaries are available from
https://github.com/hardkernel/u-boot/tree/odroidc2-v2015.01

My idea is that we should create three packages:
- fip_create (BSD)
- meson-tools (GPLv2+)
- odroidc2-firmware (BSD if built form source)

What are your thoughts about this?

Best regards

Heinrich Schuchardt

#860834#10
Date:
2017-04-20 20:20:01 UTC
From:
To:
Right, the install process should be documented in:

  /usr/share/doc/u-boot-amlogic/README

Ah, wasn't aware of this one, thanks!

I don't see source code for the firmware in there. e.g. fip/gx* only
includes binaries.

Both of those look feasible, sure, though fip_create could perhaps just
be included with u-boot-tools.

No source, no package...


live well,
  vagrant

#860834#15
Date:
2017-04-20 21:30:09 UTC
From:
To:
8-edd7f116ab.tar.gz

The hardkernel binaries are fip/gx based. I will try to understand the
details.

See also
https://github.com/hardkernel/u-boot_firmware/tree/odroidc2-bl301
with description in
http://odroid.com/dokuwiki/doku.php?id=en:c2_building_u-boot
Chapter "How to build u-boot with bl301 firmware"

fip_create seems to be rather Amlogic specific.
So merging with meson-tools might be a better option?

I guess for non-free firmware package we would at least need a
specific license.

Regards

Heinrich

#860834#20
Date:
2017-04-20 21:58:15 UTC
From:
To:
8-edd7f116ab.tar.gz
I don't see source code for the firmware in there. e.g. fip/gx* only
You have to look into these directories:
arch/arm/cpu/armv8/gx*/firmware/scp_task

Regards

Heinrich

#860834#25
Date:
2017-04-21 00:47:01 UTC
From:
To:
** FIP_CREATE **

Hardkernel's fip_create is based on the tool of the same name in
ARM Trusted Platform, version 0.4
https://github.com/ARM-software/arm-trusted-firmware

toc_entry_lookup_list contains an Amlogic specific entry:
{ "SCP Firmware BL3-0-1", UUID_SCP_FIRMWARE_BL301,
          "bl301", NULL, FLAG_FILENAME},
#define UUID_SCP_FIRMWARE_BL301 \
        {0xAABBCCDD, 0xABCD, 0xEFEF, 0xAB, 0xCD, {0x12, 0x34, 0x56,
0x78, 0xAB, 0xCD} }

The only other difference is image_offset and toc_size having hard
coded values. I wonder if this is relevant for booting or only nice
for debugging.

ARM Trusted Platform, version 1.3 has replaced fip_create by fiptool.

So maybe we simply want to package 1.3 with the additional UUId for bl30
1.

** FIRMWARE **

All of the firmware blobs are based on the Arm Trusted Firmware and
therefore should be subject to the ARM BSD license.

bl31.bin for the Odroid C2 is based on
Arm Trusted Firmware, version 1.1 with some gxbb specific enhancements.

#860834#30
Date:
2017-04-21 07:34:01 UTC
From:
To:
Hi Vagrant and Heinrich,

https://github.com/hardkernel/u-boot_firmware/tree/odroidc2-bl301 should
have the latest sources. Its LICENSE file indicates GPLv3.
Note that this differs from the Amlogic sources Heinrich pointed to.
Both differ from ATF, complicating upstreaming.

The u-boot_firmware repository does not include BL1 sources, which are
binary-only and have no explicit license. I opened an issue for this:

https://github.com/hardkernel/u-boot/issues/39

Also beware that not just the odd UUID was added to fip_create, but it
also has some alignment logic that differs from the one recently added
to fiptool. This would need to be compensated by my amlbootsig, which
today mimics aml_encrypt_gxb behavior only, for comparability.

https://github.com/afaerber/meson-tools/issues/3

Regards,
Andreas

#860834#35
Date:
2017-06-08 19:17:23 UTC
From:
To:
...

I've started work on packaging meson-tools for Debian; with xypron's
autotools branch it's quite straightforward!

https://github.com/xypron/meson-tools/tree/autotools

That said, I haven't actually tried using it yet, only
compile-testing...


Unfortunately, meson-tools needs a license exception for using OpenSSL
with GPLed code, at least for inclusion in Debian:

https://github.com/afaerber/meson-tools/issues/5

Alternately, using one of the other ssl implementations might be
possible.


live well,
  vagrant

#860834#40
Date:
2017-12-09 16:14:15 UTC
From:
To:
Hello Vagrant,

I tried to install u-boot from the u-boot-amlogic package.
I have followed the process documented in the
/usr/share/doc/u-boot-amlogic/README file.
So, in the fip_create command, I replaced u-boot.bin by the compiled
u-boot in the package :
/usr/lib/u-boot/odroid-c2/u-boot.bin

$DIR/fip/fip_create --bl30  $DIR/fip/gxb/bl30.bin \
                       --bl301 $DIR/fip/gxb/bl301.bin \
                       --bl31  $DIR/fip/gxb/bl31.bin \
                       --bl33  /usr/lib/u-boot/odroid-c2/u-boot.bin \
                       $DIR/fip.bin


But, I did not succeed to boot my odroid-c2 with this compiled u-boot.

If I follow this installation process with u-boot compiled from the
https://github.com/hardkernel/u-boot.git repository, the odroid-c2
card boot.

Do you know where is the problem with the packaged u-boot ?
Thanks for you help !
Thomas

#860834#45
Date:
2017-12-09 17:28:14 UTC
From:
To:
What do you mean by "compiled" here?

I presume you also followed the rest of the instructions in the README?

Are you installing u-boot to eMMC or microsd?

What version did you try? I last tried with 2017.09+dfsg1-1, with the
following script (BL1 was installed from a previous iteration), and
commit eb5d2d16fd45f52ec49e9b4ff9d562630c08e61c
From https://github.com/hardkernel/u-boot/ -b odroidc2-v2015.01

#!/bin/sh

set -e
set -x

dev=$1
test -n "$dev"
ubootbin=$2
test -n "$ubootbin"

./fip_create --bl30 fip/gxb/bl30.bin \
			 --bl301 fip/gxb/bl301.bin \
			 --bl31 fip/gxb/bl31.bin \
			 --bl33 "$ubootbin" \
			 fip.bin
./fip_create --dump fip.bin
cat fip/gxb/bl2.package fip.bin > boot_new.bin
./fip/gxb/aml_encrypt_gxb --bootsig \
						  --input boot_new.bin \
						  --output u-boot.img

# assume BL1 is already installed, so comment BL1 lines out
#BL1=$DIR/sd_fuse/bl1.bin.hardkernel
#dd if=$BL1 of=$dev conv=fsync bs=1 count=442
#dd if=$BL1 of=$dev conv=fsync bs=512 skip=1 seek=1
dd if=u-boot.img of=u-boot.gxbb bs=512 skip=96
sudo dd if=u-boot.gxbb of=$dev conv=fsync bs=512 seek=97
#-------------------------------------------------------

Since you have a working image, you could installing just the new u-boot
with the above script.


live well,
  vagrant

#860834#50
Date:
2017-12-16 09:50:05 UTC
From:
To:
Hi