Difference between revisions of "Internal Used/By-pass advloader"

From ESS-WIKI
Jump to: navigation, search
 
Line 1: Line 1:
 
= Modify and Build U-boot =
 
= Modify and Build U-boot =
 
== Yocto 1.5 ==
 
 
You can download patch file as below:
 
 
[[:File:bypass_advloader_Yocto_1.5.patch]]
 
 
u-boot-imx/arch/arm/lib/board.c
 
 
Index: arch/arm/lib/board.c
 
===================================================================
 
--- arch/arm/lib/board.c        (revision 2241)
 
+++ arch/arm/lib/board.c        (working copy)
 
@@ -411,7 +411,6 @@
 
        switch(dev)
 
        {
 
                case 1:
 
-              default:
 
                        /* booting from SD*/
 
                        printf("booting from SD\n");
 
                        setenv("mmcdev", "0");
 
@@ -448,6 +447,11 @@
 
                        if(emmc_exist)  setenv("mmcdev", "1");
 
                        break;
 
  #endif
 
+              default:
 
+                      printf("Default boot device\n");
 
+                      printf("booting from SD\n");
 
+                      setenv("mmcdev", "1");
 
+                      break;
 
        }
 
 
        /*record ddr bit, 32 or 64 bit*/
 
 
 
 
build u-boot (we take DDR 1G for example)
 
 
make mx6qrom5420_1G_config
 
make u-boot.imx -j4
 
 
Then you can put this file to mfgtool folder
 
  
 
== Yocto 2.1 ==
 
== Yocto 2.1 ==
Line 47: Line 5:
 
You can download patch file as below:
 
You can download patch file as below:
  
[[:File:bypass_advloader_Yocto_2.1.patch]]
+
[[:File:Bypass_advloader_Yocto_2.1.patch]]
 
 
--- a/common/board_r.c
 
+++ b/common/board_r.c
 
@@ -927,7 +927,6 @@ int board_set_boot_device(void)
 
  #else
 
        /* Linux */
 
                case 1:
 
-              default:
 
                        /* booting from SD*/
 
                        printf("booting from SD\n");
 
                        setenv("mmcdev", "0");
 
@@ -976,6 +975,11 @@ int board_set_boot_device(void)
 
                        setenv("mmcroot",buf);
 
                          break;
 
  #endif
 
+              default:
 
+                        printf("Default boot device\n");
 
+                        printf("booting from SD\n");
 
+                        setenv("mmcdev", "1");
 
+                        break;
 
  #endif /*CONFIG_ANDROID_SUPPORT*/
 
        }
 
 
 
  
 
build u-boot (we take DDR 1G for example)
 
build u-boot (we take DDR 1G for example)

Latest revision as of 09:01, 31 August 2017

Modify and Build U-boot

Yocto 2.1

You can download patch file as below:

File:Bypass_advloader_Yocto_2.1.patch

build u-boot (we take DDR 1G for example)

make mx6qrom5420b1_1G_defconfig
make u-boot.imx -j4

Then you can put this file to mfgtool folder

Modify mfgtool

  • ucl2.xml

We add a new task for burning u-boot.imx to spi

  <LIST name="ADV bypass adv-loader" desc="update u-boot.imx to spi">
	<CMD state="BootStrap" type="boot" body="BootStrap" file ="firmware/u-boot.imx" ifdev="MX6Q">Loading U-boot</CMD>
	<CMD state="BootStrap" type="load" file="firmware/uImage" address="0x12000000"
          loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6Q">Loading Kernel.</CMD>
	<CMD state="BootStrap" type="load" file="firmware/initramfs.cpio.gz.uboot" address="0x12C00000"
          loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6Q">Loading Initramfs.</CMD>
	<CMD state="BootStrap" type="load" file="firmware/imx6q-%board%.dtb" address="0x18000000"
          loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6Q">Loading device tree.</CMD>
	<CMD state="BootStrap" type="jump" > Jumping to OS image. </CMD>
	<CMD state="Updater" type="push" body="$ flash_erase /dev/mtd0 0 192">Erasing SPI</CMD>
	<CMD state="Updater" type="push" body="send" file="files/u-boot.imx" ifdev="MX6Q">Sending u-boot.imx</CMD>
	<CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mtd0 bs=512 seek=2">write u-boot.imx</CMD>
	<CMD state="Updater" type="push" body="$ echo Update Complete!">Done</CMD>
  </LIST>

  • cfg.ini
 [LIST]
  name = ADV bypass adv-loader

At last , we can refer to Mfgtool to update spi.