Community
cancel
Showing results for 
Search instead for 
Did you mean: 
FerryT
Valued Contributor I
6,637 Views

Update U-Boot

Jump to solution

Does anybody know how to update U-Boot (from here https://github.com/01org/edison-u-boot https://github.com/01org/edison-u-boot?

Would it be possible to do that while leaving kernel/system intact?

1 Solution
JJona4
Novice
555 Views

Yocto already uses that repo to build u-boot. If you want a newer version, there's a 2015.10 branch that I've been using. I basically just copied the .bb files to my own layer, changed the version/branch, and set `PREFERRED_VERSION_u-boot = "2015.10%"` in local.conf. I needed make a few changes to get everything working; they're in a PR on the repo.

View solution in original post

23 Replies
idata
Community Manager
518 Views

Hi FerryT,

 

 

Thank you for contacting us. Even though customization or changes to the Edison's u-boot are not supported, we'll do our best to help find information to guide you. I found a thread you might find useful. Take a look at /thread/100798 https://communities.intel.com/thread/100798 . This user shared steps on how to recompile and flash u-boot in the Edison. You might find this helpful.

 

 

Additionally, you should also direct your request to the u-boot developers here: https://github.com/01org/edison-u-boot/issues https://github.com/01org/edison-u-boot/issues . They'll be able to provide a more accurate response.

 

 

If you're able to update u-boot, please share your results with the community so other users can benefit from your findings.

 

 

Please let us know if you found this useful.

 

 

-Sergio

 

JJona4
Novice
556 Views

Yocto already uses that repo to build u-boot. If you want a newer version, there's a 2015.10 branch that I've been using. I basically just copied the .bb files to my own layer, changed the version/branch, and set `PREFERRED_VERSION_u-boot = "2015.10%"` in local.conf. I needed make a few changes to get everything working; they're in a PR on the repo.

View solution in original post

FerryT
Valued Contributor I
518 Views

Yeah, I did get that.

However, I don't really want to rebuild all right now (or I should I don't really want to reflash all and loose configuration that I have now).

Is there a way to just rebuild and replace uboot manually?

JJona4
Novice
518 Views

You can rebuild u-boot by sourcing the bitbake environment (`poky/oe-init-build-env /path/to/build`, where `build` is the yocto build dir), and running `bitbake -c cleansstate u-boot && bitbake u-boot` (this actually applies to any bitbake recipe). In the case of u-boot, it ends up in the `build/tmp/deploy/images/edison` directory, where both `u-boot.bin` and `u-boot.img` appear. `u-boot.img` is used by the recovery tool `xfstk-dldr-solo`, and contains the environment as well. `u-boot.bin` is used by the normal flashing utility `dfu-util`, and can be `dd`ed to the u-boot partition from linux, though it doesn't contain the environment (the two copies of which are on the two environment partitions).

Andriy_S_Intel
Employee
518 Views

FerryT kirjoitti:

Does anybody know how to update U-Boot (from here https://github.com/01org/edison-u-boot https://github.com/01org/edison-u-boot?

Would it be possible to do that while leaving kernel/system intact?

I see this is an answered question, nevertheless...

I would like to announce I'm able to build and flash latest U-Boot (v2016.11) on Edison which allows me to boot x86_64 kernel directly! So, the links:

I have established tagging in repository. All working cases are tagged with edison prefix. As of today (May 10) U-Boot version bumped to v2017.05 (stable).

Development version is based on v2017.05.

The goal is to get Intel Edison supported by U-Boot out-of-the-box.

To build just run couple of simple commands:

make edison_defconfig

make -j16

Don't pay attention on non-standard configuration option error. You will have u-boot.bin compiled anyway. Solved (Jan 21).

First you need to prepare an image to be suitable for DFU. There are few options available. You have to choose one suitable for your case.

Option 1:

Installed edison-v2017.03 (or later) or development version v2017.03-rc1 (or later).

Installing edison-v2017.03 (or later) or development version v2017.03-rc1 (or later).

# nothing special is required, there are patches that fixes alignment issue.

Option 2:

Installed v2014.04 or edison-v2016.11, or edison-v2017.01.

Installing edison-v2017.03 (or later) or development version v2017.03-rc1 (or later).

truncate -s %4096 u-boot.bin

Option 3:

Installed v2014.04 or edison-v2016.11, or edison-v2017.01.

Installing edison-v2016.11, or edison-v2017.01.

dd if=u-boot.bin of=u-boot-4k.bin bs=4k seek=1 && truncate -s %4096 u-boot-4k.bin && mv u-boot-4k.bin u-boot.bin

 

 

When you get a u-boot.bin run the following command to get the image you flash with DFU:dfu-util -v -d 8087:0a99 --alt u-boot0 -D u-boot.bin

There https://gist.github.com/andy-shev/2c388310f2773ead647d9c1a3f1c813f https://gist.github.com/andy-shev/2c388310f2773ead647d9c1a3f1c813f is a script which allows to create a suitable U-Boot image for xFSTK and DFU including preset environment.

Known bugs:

FerryT
Valued Contributor I
518 Views

0andriy I built edison-v2017.01 succesfully, then used the script from gist. The script looks for edison-environment.txt which is not in the build dir. I created that using (from the comment in the script):

strings edison-blankcdc.bin > edison-environment.txt

I got edison-blankcdc.bin from the image I built long ago from http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel-edison/ meta-intel-edison - Layer for the Intel Edison Development Platform.

So that all seems fine.

Question: If I flash this uboot, will the old 3.10.14 kernel still boot, or will it expect your new kernel?

Andriy_S_Intel
Employee
518 Views

edison-blankcdc.bin is the default environment. You may get yours current by using:

dfu-util -v -d 8087:0a99 --alt u-boot0 -U u-boot-environment.orig.bin

(instead of download choose upload). And convert it to text:

strings u-boot-environment.orig.bin > edison-environment.txt

Note: first 4 bytes are CRC32 sum and thus in some cases the strings utility might interpret them, so, check a very beginning of the resulting text file to ensure there are no artifacts.

Yes, it will boot any kernel older or newer.

JMetz2
Beginner
518 Views

hi guys,

can someone give me a hint how to compile that?

I've setup an ubuntu 14.04 machine but when compiling i get en error to switch to C99 or C11 mode (and when doing os i get other errors).

Thanks

Jan

Andriy_S_Intel
Employee
518 Views

iotjam kirjoitti:

can someone give me a hint how to compile that?

I've setup an ubuntu 14.04 machine but when compiling i get en error to switch to C99 or C11 mode (and when doing os i get other errors).

I'm not quite sure what you are doing and what kind of errors you got. Everything important is listed in my comment above. Otherwise it's just same process as you compile other projects.

FerryT
Valued Contributor I
518 Views

Maybe the problem is 14.04 which gives you an older version of gcc? I built on 16.10 amd64 . Probably using gcc 6.2.

FerryT
Valued Contributor I
518 Views

0andriy Here is my edison-environment.txt (for completeness) attached. That expands mostly to:

boot_target_cmd=run do_flash_os;run do_probe_dfu;run do_compute_target;run mmc-bootargs;run load_kernel;zboot ${loadaddr}

mmc-bootargs=run do_bootargs_rootfs; run do_audio_support; \

setenv bootargs ${bootargs_rootfs} ${bootargs_console} ${bootargs_debug} g_multi.ethernet_config=${bootargs_ethconfig} \

systemd.unit=${bootargs_target}.target hardware_id=${hardware_id} g_multi.iSerialNumber=${serial# } \

g_multi.dev_addr=${usb0addr} ${audio_support}

do_bootargs_rootfs=setenv bootargs_rootfs rootwait root=PARTUUID=${uuid_rootfs} rootfstype=ext4

bootargs_console=console=ttyMFD2 earlyprintk=ttyMFD2,keep

bootargs_debug=loglevel=4

bootargs_ethconfig=cdc

bootargs_target=multi-user

load_kernel=fatload mmc 0:7 ${loadaddr} vmlinuz

loadaddr=0x100000

To boot your kernel I mount (on the edison with 2.1 image):

mount /dev/mmcblk0p9 /mnt

scp vmlinuz.efi to /mnt

Then reboot, press ESC and run (which I added to the environment before):

load_edsboot=load mmc 0:9 0x100000 vmlinuz.efi

boot_edsboot=zboot 0x100000

FerryT
Valued Contributor I
518 Views

Yeah, I was in a bit of hurry. I was mostly trying to be complete.

The question is: will the original kernel (on 0:7) still boot with console=ttyMFD2? I need that to mount and scp your kernel.

Andriy_S_Intel
Employee
518 Views

FerryT kirjoitti:

The question is: will the original kernel (on 0:7) still boot with console=ttyMFD2? I need that to mount and scp your kernel.

Yes. U-Boot doesn't alter any kernel configuration implicitly. (Otherwise how do I manage copying and checking? :-) )

FerryT
Valued Contributor I
518 Views

I would like to know that :-) I guess you are using netboot in some way I don't understand.

Andriy_S_Intel
Employee
518 Views

FerryT kirjoitti:

I would like to know that :-) I guess you are using netboot in some way I don't understand.

I have three boards right now, one of them is connected in our Lab and being accessed remotely (netboot), another one on my table where I'm experimenting with direct kernel loading and U-Boot, The last one is spare one.

So, the board on my table is using official BSP for a purpose(s) to a) copy newer kernels to its eMMC, and b) check how official BSP behaves in certain cases.

FerryT
Valued Contributor I
518 Views

0andriy I followed your instructions above.

If I use your script https://gist.github.com/andy-shev/2c388310f2773ead647d9c1a3f1c813f https://gist.github.com/andy-shev/2c388310f2773ead647d9c1a3f1c813f to generate edison-environment.bin and flash those with the lines at the bottom of the script (preceded with sudo):

dfu-util -v -d 8087:0a99 --alt u-boot0 -D u-boot.bin

dfu-util -v -d 8087:0a99 --alt u-boot-env0 -D edison-environment.bin

dfu-util -v -d 8087:0a99 --alt u-boot-env1 -D edison-environment.bin

The environment was of course generated from the file attached to # 11 above. Except that I replaced all ' mmc ' by ' raw '.

The boot hangs at:

  1. DRAM: 980.6 MiB
  2. MMC: mmc@ff3fc000: 0, mmc@ff3fa000: 1

<== hangs here ==>

  1. In: serial@ff010180
  2. Out: serial@ff010180
  3. Err: serial@ff010180

Before that, the terminal output is char-for-char identical to yours.

So exactly before I can press 'any key'.

Then if I use recovery, then flashall, then follow exactly your instructions, i.e. only flash u-boot.bin, and the (old, recovered) kernel boots just fine. That is with all the references to mmc not replaced by raw.

1) What am I doing wrong here so bad that I choke u-boot?

And the old environment has still mmc everywhere. Still the kernel boots.

2) What is the problem with leaving mmc and not changing to raw? (I guess I don't completely understand the function of the dfu command in u-boot)

Andriy_S_Intel
Employee
518 Views

You have almost identical two messages...

I dunno what you did wrong, I can't see from above.

Only what I would recommend is to follow "step by step instructions" in comment # 5.

DFU stands for Device Firmware Update, the mechanism which allows you to update (flash) images and partitions in standard way without using any [device] specific tools.

It's recommended way to update images.

In new U-Boot developers changed keyword which is used for mmc partitions to be mmc instead of raw as explained in issue I referred to in my comment above.

FerryT
Valued Contributor I
518 Views

Sorry about the dup message, the web site refused when I pressed the send button, so I copied to clipboard, logged in again and sent again. Now it seems it posted twice.

So what I get from your reply, not replacing mmc with raw has no effect on booting eds, but will prevent flashall because commands with 'dfu 0 mmc 0' won't work.

But 'load_kernel=fatload mmc 0:7 ${loadaddr} vmlinuz' works normally? Strange.

I'm just trying to figure out how this u-boot stuff works, since the last step (I hope) in porting meta-intel-edison to morty is the scripts that do the post-build (prepare the images for flashall). The learning curve is a little steep in this area.

I'm really happy up to now though, as I broke u-boot, built xfstk as a deb package, got it to install on ubuntu 17.04, recovered u-boot and the rest of the image, upgraded it correctly to eds-17.04.

So, next steps, only, get your kernel on the device, get rootfs to work, then automate all building in morty. Then switch to amd64 kernel. Just a few more evenings ... :-)

FerryT
Valued Contributor I
518 Views

Ok, I get it, I think. The only lines where mmc needs to be replaced are:

setenv dfu_alt_info "ifwi${hardware_id} raw 0 8192 mmcpart 1;ifwib${hardware_id} raw 0 8192 mmcpart 2;u-boot0 part 0 1;u-boot-env0 part 0 2;u-boot1 part 0 3;u-boot-env1 part 0 4;boot part 0 7;rootfs part 0 8;update part 0 9;home part 0 10;vmlinuz fat 0 7;initrd fat 0 7" 

setenv do_dfu_alt_info_ifwi 'setenv dfu_alt_info "ifwi${hardware_id} raw 0 8192 mmcpart 1;ifwib${hardware_id} raw 0 8192 mmcpart 2"'

 

setenv do_dfu_alt_info_mmc 'setenv dfu_alt_info "ifwi${hardware_id} raw 0 8192 mmcpart 1;ifwib${hardware_id} raw 0 8192 mmcpart 2;u-boot0 part 0 1;u-boot-env0 part 0 2;u-boot1 part 0 3;u-boot-env1 part 0 4;boot part 0 7;rootfs part 0 8;update part 0 9;home part 0 10;vmlinuz fat 0 7;initrd fat 0 7"'

and

dfu 0 mmc 0

(as well as a few other lines with mmc) should not be changed.

Reply