Mainline U-Boot

Amlogic U-Boot is based off of the 2015.01 (Jan) release as can be seen during boot:

U-Boot 2015.01-g101afee (Dec 11 2016 - 13:35:15)

Is anyone else interested in porting the changes to the current release, which will be 2017.03 soon?

Das U-Boot – the Universal Boot Loader


Pinned globally for 7 days! And change the name.

1 Like

After looking at mainline u-boot a bit compared to the changes that Amlogic made, it looks like it might be a better option to just rewrite what Amlogic did to fit the way standard u-boot works rather than try to just port the old code to the new release. That may be why they are still stuck on the 2015.01 codebase.

I think that the VIM will probably work with fastboot mode when updated since the Type C has otg support. However I’m not sure if the other vendors boards have otg support or not, most of the boards look like they have 3-4 regular Type A ports so I’m not sure if it would somehow work.

Ouch, thats going to take some time to go through:

1069 files changed, 257582 insertions(+), 8440 deletions(-)

1 Like

I think it is a big work because this port should support not only S905X but also S905, S905D, S912 SoCs. For example Amlogic U-Boot from 2015-11-04 can bring up S905 based boards but Amlogic U-Boot 2016-09-30 cannot. Also eMMC partitions have different support in different Amlogic releases of U-Boot 2015.01.

But any case the community will be interest in this work.

Andrey K.

1 Like

There is already a port for S905 ‘gxb’ in mainline for ODROID-C2.

I have a S905X (Khadas VIM) and a S912 (SunnyTV Q9S). I think I will start by making the S905X port similar to the S905 one already in mainline and then look at what else should be done. The S905D/S905X/S912 all use the same codebase ‘gxl’ as far as I can tell, the difference between boards is mostly/all in the device tree dts. That doesn’t make it easy but its not quite as bad as 4 completely different ports.

There are differences between S905 and S905X related to u-boot for eMMC. S905 we have u-boot at zero offset at start of eMMC, but S905X u-boot starts from 512th byte which allows to have normal partition table in MBR.

I not sure that Amlogic will spent time for redesign binary files (delivered in u-boot sourses) for normal behavior of S905 SoC.

Andrey K.

There is some fairly active development going on in mainline u-boot at the moment for S905 but its not in the tree yet, just the mailing list. I’m basing the S905X work on top of that code but it will probably be some time before its anywhere near ready to replace the amlogic fork.

1 Like

By the way the primary binary files in u-boot source is the ATF, mentioned in separate thread. Someone familiar with ARM assembly might be able to get something useful out of it with IDA Pro. The source for ATF itself is open and on github but the changes made by Amlogic unfortunately are not.

1 Like

Are there any news on getting mainline u-boot running on the Khadas VIM?

This could should make the mkimage part obsolete as the “Image” can be booted via EFI directly when building own Linux image.

I posted patches to support basic mainline U-boot on GXL (S905X), it should work on the VIM if packages with the same ATF binaries from Khadas’s u-boot github repo.

The main issue was Linux blocked while booting, I just send a bunch of patches to solve this.

The remaining work to have mainline U-boot fully working:

  • Add internal ethernet PHY support
  • Add DWC3 USB PHY+Controller support

If you only need SDCard booting, it should already work since the eMMC+SDCard driver is already working.


Hi Neil,

Where can I find the patches?


You can find the U-boot changes:
The Linux changes:


@narmstrong what do you mean by that? Can you give me an example?

You should find everything here :


Tks @narmstrong

Now, @Terry @numbqq and @Gouwa
Could you update the fenix process to use neil’s patches on uboot and kernel ?

Hi ravelo,

Maybe more testing is needed for mainline u-boot.:smiley:

trying to subsitute legacy u-boot w/ mainline u-boot in the existing automatic khadas building process (fenix for now) is probably needed to check if the u-boot and kernel still can be built without error; then we will need to check that there is no regression on the functional point of view for uboot, then for uboot+kernel+ubuntu

Hi ravelo,

I’ve tried Neil’s mainline u-boot, and booted successed, uart and ethernet can work, but sdcard can’t work.And many others.And I’ll add a mainline u-boot branch to Fenix for testing.


Hi @numbqq, do you mean that the internal functions of the mainline u-boot modified by neil are not anymore able to use the SDCARD ?

if so, then this is a roadblock (unless the OS to boot is on the EMMC),
I understand that, once ubuntu (or android) is booted, that OS can use all the hardware like if it was booted by the legacy u-boot, correct ?

1 Like