8 Replies Latest reply on Jul 21, 2016 1:32 PM by Intel Corporation

    How to merge edison-v2015.10 patches to mainline u-boot

    Mosfet

      Sirs,

       

      Any idea on how to extract changes from

      github.com/01org/edison-u-boot/tree/edison-v2015.10

       

      And merge them into mainline u-boot?

      github.com/u-boot/u-boot

       

      I would want to boot the mainline u-boot on edison as it support bootz for x86.

       

      Thanking you

        • 1. Re: How to merge edison-v2015.10 patches to mainline u-boot
          Intel Corporation
          This message was posted on behalf of Intel Corporation

          Hello Mosfet,
           
          Could you please let us know why you would like to do this? Also, could you please provide us more details about your project? It would be of much help for us if we could understand this project.
           
          -Peter.

          • 2. Re: How to merge edison-v2015.10 patches to mainline u-boot
            Mosfet

            Hi Peter,

             

            Where is what we have done. We have generated a custom OSIP.bin file that will then boot to a u-boot as the following.

             

            The u-boot is from here

            GitHub - 01org/edison-u-boot at edison-v2015.10

             

            The kernel is from here

            GitHub - 01org/edison-linux at edison-3.10.98

             

            # Image layout

            # +------------------------+

            # | MBR/OSIP Header    |

            # +------------------------+

            # | u-boot.bin               |

            # +------------------------+

            # | U-Boot environment |

            # +------------------------+

            # | U-Boot environment |

            # +------------------------+

            # | Rootfs (FAT32)         |

            # +------------------------+

            # | Unused                   |

            # +------------------------+

            # | Unused                   |

            # +------------------------+

             

            UBOOT OFFSET, 2048

            UBOOT ENV MAIN OFFSET 6144

            UBOOT ENV REDUNDANT OFFSET, 12288

            FAT32 OFFSET, 14336

             

            We then create a single image using DD and burn it edison as follows

            xfstk-dldr-solo --gpflags 0x80000007 --osimage output/images/edison.img --fwdnx edison_dnx_fwr.bin --fwimage edison_ifwi-dbg-00.bin --osdnx edison_dnx_osr.bin

             

            And its does boot

             

            However the following are issues.

             

            ISSUE 1 - ZBOOT

            => setenv bootargs console=tty1 console=ttyS2,115200n8

            => load mmc 0 0x100000 bzimage-bit

            reading bzimage-bit

            6340528 bytes read in 161 ms (37.6 MiB/s)

            => load mmc 0 0x8800000 initramfs-vanilla

            reading initramfs-vanilla

            9327379 bytes read in 227 ms (39.2 MiB/s)

            => zboot 0x100000 0 0x8100000 0x8100000

            Error: Invalid Boot Flag (found 0x0000, expected 0xaa55)

            ## Kernel loading failed ...

             

            Now zboot is looking for a bootflag in mmc...but my edison-img.vfat is a simple DD written and mkfs.vfat formatted file.

             

            I dont think fdisk can set a boot flag in a virtual file system? I could use gpt from inside edison u-boot to write partition table but then that will destory my vfat that I write to emmc using xfstk.

             

            I did try bypassing by editing it to return 1...however not much help

             

            https://github.com/01org/edison-u-boot/blob/master/arch/x86/lib/zimage.c

            if (KERNEL_MAGIC != hdr->boot_flag) {

            printf("Error: Invalid Boot Flag "

             

            What does these mean??

            Magic signature not found

            Invalid Valid Boot Flag

             

            ISSUE 2 - BOOTM

            => setenv bootargs console=ttyMFD2,115200n8

             

            => load mmc 0 0x100000 uimage

            reading uimage

            5425120 bytes read in 138 ms (37.5 MiB/s)

            => load mmc 0 0x8100000 initramfs-edison-new

            reading initramfs-edison-new

            8284799 bytes read in 203 ms (38.9 MiB/s)

            => bootm 0x100000 0x8100000

            Wrong Image Format for bootm command

            ERROR: can't get kernel image!

             

            I have tried many different conversions using mkimage but bootm simply refuses to recognizes the uimage.

             

            ISSUE 3 - LEFT OVER OPTION IS BOOTZ

            However it says => bootz

            Your platform's zImage format isn't supported yet!

             

            I realized bootz for x86 is only available in the latest...so I am trying to migrate all the patches from their u-boot git to the latest bleeding u-boot but it doesnt compile as the lastest u-boot has completely changed directory structures etc

             

            ISSUE 3 is the reason I wanted to try Mainline u-boot.

            • 3. Re: How to merge edison-v2015.10 patches to mainline u-boot
              Mosfet

              The fat partition is a very simple partition containing the Linux kernel and an Initramfs file.

               

              Please help us, this will also pay way for more OSes supporting edison including u-buntu, fedora, arch-linux etc

               

              Please note for Bootz we did the following we edited include/configs/edison.h for raw initrd support

               

              #define CONFIG_CMD_BOOTZ /* bootz zImage support */

              #define CONFIG_SUPPORT_RAW_INITRD /* bootz raw initrd support */

               

              However the error is as above...

              • 4. Re: How to merge edison-v2015.10 patches to mainline u-boot
                Mosfet

                The problem stems from the fact as to how a mkfs.vfat is used....

                 

                GARBLED TEXT

                mkfs.vfat -n "edison" -F 32 -v rootfs.fat32

                 

                this does set the boot flag however notice how it garbles the text

                 

                => fatls mmc 0

                  8284735 initramfs-edison

                  8284799 initramfs-edison-new

                  5425056 bzimage

                  3407872 modloop-edison

                  apks/

                553873196 bzimage.backup

                  ▒▒▒▒w/

                  ▒▒7▒▒1▒.▒@6/

                  /

                2991622641 ▒▒i▒▒▒▒.▒▒r

                3728523478 ;▒58▒▒7;.▒q

                  ▒▒巛▒▒▒.▒dy/

                1900702730 9_ac'▒▒s.}▒▒

                  un▒▒w▒▒.t▒▒/

                 

                8 file(s), 6 dir(s)

                 

                NON-GARBLED TEXT BUT INVALID BOOT FLAG

                mkfs.vfat rootfs.fat32

                 

                Plain mkfs formating does NOT produce any such above artifacts however it does not set the boot flag hence resulting in

                Error: Invalid Boot Flag (found 0x0000, expected 0xaa55)

                 

                ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

                 

                This does not happen any other boards (even non-x86)....

                 

                 

                We are pretty giving up now on edison, we are so near but alas, this is height of ........

                • 5. Re: How to merge edison-v2015.10 patches to mainline u-boot
                  Intel Corporation
                  This message was posted on behalf of Intel Corporation

                  Hi Mosfet,
                   
                  Thank you for providing all these details, it helps us a lot. I have one more question, how were you building the image? Did you get the files from https://github.com/01org/edison-u-boot/tree/edison-v2015.10?
                   
                  Regarding your questions, please let us investigate, we will try to see how we can help you.
                  I will get back to you as soon as possible.
                   
                  Peter.

                  • 6. Re: How to merge edison-v2015.10 patches to mainline u-boot
                    Mosfet

                    git clone that particular branch

                    make edison_defconfig

                    make -j4

                     

                    There is no problem with u-boot. It compiles and boots with our OSIP.

                     

                    Also understand OSIP has all necessary changes required like correct OFFSETS etc.

                     

                    This is how we dd

                    dd if=osip.bin of=output.img 

                    dd if=u-boot.bin of=output.img seek=2056 

                    dd if=u-boot-env.bin of=output.img seek=6144 

                    dd if=u-boot-env.bin of=output.img seek=12288 

                    dd if=rootfs.fat32 of=output.img seek=14336

                     

                    # Intel's XFSTK tool reads the OSIP header to

                    # determine where to write the bytes immediately following

                    # the block, so they need to be removed for the XFSTK tool to work.

                    dd if=osip.bin of=output_xfstk.img

                    dd if=output.img of=output_xfstk.img skip=2048 seek=1

                     

                    This is how we BURN

                    xfstk-dldr-solo --gpflags 0x80000007 --osimage output_xfstk.img --fwdnx edison_dnx_fwr.bin --fwimage edison_ifwi-dbg-00.bin --osdnx edison_dnx_osr.bin

                     

                    It does boot (u-boot) however since I use this for preparing rootfs.fat32 I have garbled text

                    dd if=/dev/zero of=rootfs.fat32 bs=1M count=256

                    mkfs.vfat -n "alpine" -F 32 -v rootfs.fat32

                     

                    If i use this as below then it doesnt seem to write the 0xaa55 magic header hence I get the invalid partition flag error

                    dd if=/dev/zero of=rootfs.fat32 bs=1M count=256

                    mkfs.vfat rootfs.fat32

                    • 7. Re: How to merge edison-v2015.10 patches to mainline u-boot
                      Mosfet

                      Are there any changes to upgrade the current u-boot 2015 release to the latest?

                      • 8. Re: How to merge edison-v2015.10 patches to mainline u-boot
                        Intel Corporation
                        This message was posted on behalf of Intel Corporation

                        Hi Mosfet,
                         
                        I apologize for the delay in my response.
                         
                        We have made an extensive research in order to see if we could provide you with further help. Considering that you’re modifying the firmware for a very specific use, I’m afraid the assistance we can provide on the debugging is limited.
                         
                        Sorry we can’t be of much help.
                         
                        -Peter.