U-boot + eMMC + MBR + standart partition

When developing a new system image 3in1 for VIM2, I accidentally mixed up the images and write to eMMC, copy the system image from the SD card (along with the bootloader u-boot from SD card u-boot.bin.sd.bin).
And oddly enough, this loader u-boot works on eMMC. Ie it turns out that binary file u-boot.bin and uboot.bin.sd.bin can boot from eMMC and can be combined with MBR partition table. Allowing you to place a markup on eMMC like a normal disk (with partitions as an SD card or USB flash drive or HDD) and can start the system with them as with conventional disks. :slight_smile:

5 Likes

Hi,

how did you write the uboot.bin to the eMMC? I did it the same way as writing on SD-Card (Docu), but the ROM won’t load the u-boot from eMMC.
I want to run a mainline kernel. Mainline-Kernel (4.15) do NOT understand the AML partitioning format.

Kind regards
Andreas

I’m using a conventional MBR partition table for both the VIM and VIM2. Keep in mind that the first partition should start after the persistent u-boot environment, otherwise a saveenv in the u-boot console will damage your file system in some way.

I’d like to see a mainline non-android u-boot firmware which respects the convention that all firmware related stuff has to take place within the first 2048 sectors.

@andreas As far as I know you can use mainline u-boot with Khadas VIM. You can folllow some hints from this page: https://github.com/BayLibre/u-boot

I know they are for a different SBC but they should work the same way.

1 Like

I have recorded a eMMC file u-boot.bin.sd.bin (collected from your set of source files). After writing u-boot start of the eMMC.

What u-boot files did you use (where did you get them from) ?

All cores 4.1 x excellent run from removable media and eMMC with regular u-boot. To do this, you need to use two patches in the Assembly, which allow the kernel to work with u-boot 2015.01 (which is used in all firmware for VIM\VIM2).

to boot a mainline kernel, just follow the steps mentioned here. At this time USB support is still lacking.

1 Like

Hi,

thanks to all for your replies. Booting the mainline from SD Card works as expected. I try some of your hints to boot from eMMC. But now i’m lost or better my VIM2 is lost :frowning: . I wrote u-boot.bin to eMMC and now VIM2 hangs here:

GXM:BL1:dc8b51:76f1a5;FEAT:ADFC318C:0;POC:3;RCY:0;EMMC:0;READ:0;0.0;CHK:0;
TE: 73616

BL2 Built : 14:59:36, Aug  9 2017. 
gxl ge8c6a83 - xiaobo.gu@droid12

set vcck to 1120 mv
set vddee to 1000 mv
Board ID = 6
CPU clk: 1200MHz
DQS-corr enabled
DDR scramble enabled
DDR3 chl: Rank0+1 @ 768MHz - FAIL
DDR3 chl: Rank0 @ 768MHz - FAIL
DDR3 chl: Rank0 16bit @ 768MHz - FAIL
DDR4 chl: Rank0+1 @ 1008MHz - PASS
Rank0: 2048MB(auto)-2T-18
Rank1: 1024MB(auto)-2T-18
DataBus test pass!
AddrBus test pass!
-s
Load fip header from eMMC, src: 0x0000c200, des: 0x01400000, size: 0x00004000
Load bl30 from eMMC, src: 0x00010200, des: 0x01100000, size: 0x0000d600
Load bl33 from eMMC, src: 0x00020200, des: 0x01000000, size: 0x00066800

How can i force VIM2 to load u-boot from SD card?
Or how can i erase the eMMC at this point? So the ROM will go further to the SD card and load u-boot from there.

Kind regards
Andreas

Which file u-boot.bin you used when writing to eMMC ? What commands did you record u-boot ? To lock u-boot on the eMMC, you must use m-register closure.

Hi Balbes150,

thanks for the hint. I don’t know what that u-boot.bin it was. Maybe i should take more care of it :wink: .

I’ve got it working with the Maskrom Mode. This will force loading u-boot from SD card and running straight into burn mode (loading aml_sdc_burn.ini and update.img). No external software is needed. Documentation on Khadas pages should be a little bit better.
I needed some tries to get into Maskrom Mode. It seems these contacts are bouncing a little bit.

Kind regards
Andreas