1 2 Previous Next 23 Replies Latest reply on Jul 14, 2017 8:04 AM by FerryT

    Update U-Boot

    FerryT

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

       

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

        • 1. Re: Update U-Boot
          Intel Corporation
          This message was posted on behalf of Intel Corporation

          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 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 . 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
           

          • 2. Re: Update U-Boot
            jpkotta

            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.

            • 3. Re: Update U-Boot
              FerryT

              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?

              • 4. Re: Update U-Boot
                jpkotta

                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).

                • 5. Re: Update U-Boot
                  0andriy

                  FerryT kirjoitti:

                   

                  Does anybody know how to update U-Boot (from here 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 is a script which allows to create a suitable U-Boot image for xFSTK and DFU including preset environment.

                   

                  Known bugs:

                  • To enable DFU don't forget to change mmc to raw in the corresponding U-Boot environment variables. See https://github.com/01org/edison-u-boot/issues/3 as well.
                  • GPT table when written by gpt command will make device unresponsive (recovery via xfstk), see https://github.com/andy-shev/u-boot/issues/1 as well. Solved (Jan 31).
                  • DFU timeout patch is absent, so if you use default bootcmd setting you have to press Ctrl+C manually each time it boots.
                  • Unclean build (last stage failed due to custom configuration options). Got clean build for U-Boot today (Jan 21). Removed few patches from that BSP hell.
                  • Upstreaming patches. 11 patches has been sent upstream, 4 of them had already been applied (Feb 14). It's only 10 patches left in the queue, where couple of them rather will be squashed (Mar 1). 5 (five) patches left in a queue (May 10)!

                   

                  Feel free to use my GitHub page for pull requests (with bug fixes), bug-reports, improvements, etc.

                   

                  U-Boot 2017.03-rc2-00019-gb986ef9a09 (Feb 17 2017 - 17:59:07 +0300) 
                   
                  CPU: x86_64, vendor Intel, device 406a8h 
                  DRAM:  980.6 MiB 
                  MMC:   mmc@ff3fc000: 0, mmc@ff3fa000: 1 
                  In:    serial@ff010180 
                  Out:   serial@ff010180 
                  Err:   serial@ff010180 
                  Net:   Net Initialization Skipped 
                  No ethernet found. 
                  Hit any key to stop autoboot:  0 
                  => 
                  => pci enum 
                  => dm tree 
                   Class       Probed   Name 
                  ---------------------------------------- 
                   root        [ + ]    root_driver 
                   timer       [ + ]    |-- tsc-timer 
                   pci         [ + ]    |-- pci 
                   pci_generic [   ]    |   |-- pci_0:0.0 
                   pci_generic [   ]    |   `-- pci_0:2.0 
                   serial      [ + ]    |-- serial@ff010180 
                   mmc         [ + ]    |-- mmc@ff3fc000 
                   blk         [ + ]    |   `-- mmc@ff3fc000.blk 
                   mmc         [ + ]    |-- mmc@ff3fa000 
                   blk         [   ]    |   `-- mmc@ff3fa000.blk 
                   misc        [ + ]    |-- power@ff00b000 
                   simple_bus  [ + ]    `-- cpus 
                   cpu         [ + ]        |-- cpu@0 
                   cpu         [ + ]        `-- cpu@1 
                  => cpu list 
                    0: cpu@0              Intel(R) Atom(TM) CPU  U1000  @  500MHz 
                    1: cpu@1              Intel(R) Atom(TM) CPU  U1000  @  500MHz 
                  =>
                  

                   

                   

                  Step-by-step example of updating stock version

                   

                  After boot I have checked the version of U-Boot:

                   

                  U-Boot 2014.04 (Jun 06 2016 - 14:40:07)

                   

                  Interrupted to get U-Boot shell and run:

                  boot > run do_force_flash_os
                  Saving Environment to MMC...
                  Writing to redundant MMC(0)... done
                  GADGET DRIVER: usb_dnl_dfu
                  
                  


                  On the host:

                  $ make clean && make edison_defconfig && make -j16
                  $ truncate -s %4096 u-boot.bin 
                  $ dfu-util -v -d 8087:0a99 --alt u-boot0 -D u-boot.bin
                  
                  


                  Again in U-Boot shell:

                  #
                  DFU complete CRC32: 0xf340088e
                  DOWNLOAD ... OK
                  Ctrl+C to exit ...
                   boot > reset
                  resetting ...
                  
                  ******************************
                  PSH KERNEL VERSION: b0182b2b
                                  WR: 20104000
                  ******************************
                  
                  SCU IPC: 0x800000d0  0xfffce92c
                  
                  PSH miaHOB version: TNG.B0.VVBD.0000000c
                  
                  microkernel built 11:24:08 Feb  5 2015
                  
                  ******* PSH loader *******
                  PCM page cache size = 192 KB
                  Cache Constraint = 0 Pages
                  Arming IPC driver ..
                  Adding page store pool ..
                  PagestoreAddr(IMR Start Address) = 0x04899000
                  pageStoreSize(IMR Size)          = 0x00080000
                  
                  *** Ready to receive application ***
                  
                  U-Boot 2017.03-rc3-00012-ge6566cddc9 (Mar 01 2017 - 21:01:06 +0200)
                  
                  CPU: x86_64, vendor Intel, device 406a8h
                  DRAM:  980.6 MiB
                  MMC:   mmc@ff3fc000: 0, mmc@ff3fa000: 1
                  In:    serial@ff010180
                  Out:   serial@ff010180
                  Err:   serial@ff010180
                  Net:   Net Initialization Skipped
                  No ethernet found.
                  Hit any key to stop autoboot:  0
                  =>
                  
                  • 6. Re: Update U-Boot
                    FerryT

                    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 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?

                     

                    1 of 1 people found this helpful
                    • 7. Re: Update U-Boot
                      0andriy

                      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.

                      • 8. Re: Update U-Boot
                        iotjam

                        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

                        • 9. Re: Update U-Boot
                          0andriy

                          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.

                          • 10. Re: Update U-Boot
                            FerryT

                            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.

                            • 11. Re: Update U-Boot
                              FerryT

                              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

                              • 12. Re: Update U-Boot
                                FerryT

                                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.

                                • 13. Re: Update U-Boot
                                  0andriy

                                  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? :-) )

                                  • 14. Re: Update U-Boot
                                    FerryT

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

                                    1 2 Previous Next