20171103_jeffrey - silenceuncrio/diary GitHub Wiki

0905

review

0915

今天繼續進行 eMMC 相關作業

後續還有

  • image generation for firmware upgrade
  • firmware upgrade process
  • others uboot env
    • sys led
    • bootdelay
  • default hw_mcsv

先來做 others uboot env

參考原本 NAND Flash 的 uboot_env.sh

點亮 system LED

# sys led - GPIO2-IO20
# +----------+--------+-----------+------+
# | Instance | Signal | Pad       | Mode |
# | GPIO2    | IO20   | SD1_DATA2 | ALT5 |
# +----------+--------+-----------+------+
#
# SW_MUX_CTL_PAD_SD1_DATA2 - select mux mode: ALT5 mux port
# - mw 0x020E01CC 0x00000005 1
# GPIO2_GDIR - define the direction of the GPIO2-IO20 as OUTPUT
# - mw 0x020A0004 00100000 1
# GPIO2_DR - define the value of the GPIO2-IO20 OUTPUT to 0 - pull low
# - mw 0x020A0000 00000000 1
fw_setenv turnon_sysled 'mw 0x020E01CC 0x00000005 1; mw 0x020A0004 00100000 1; mw 0x020A0000 00000000 1'

reset ethernet 1, ethernet 2 and mobile

# Ethernet 1 Reset PIN - GPIO1-IO30
# +----------+--------+---------------+------+
# | Instance | Signal | Pad           | Mode |
# | GPIO1    | IO30   | UART5_TX_DATA | ALT5 |
# +----------+--------+---------------+------+
#
# IOMUXC_SW_MUX_CTL_PAD_UART5_TX_DATA - select mux mode: ALT5 mux port
# mw 0x020E00BC 00000005 1
# GPIO1_GDIR - define the direction of the GPIO1-IO30 as OUTPUT
# mw 0x0209C004 40000000 1
# GPIO1_DR - define the value of the GPIO1-IO30 OUTPUT to 0 - pull low
# mw 0x0209C000 00000000 1
# GPIO1_DR - define the value of the GPIO1-IO30 OUTPUT to 1 - pull high
# mw 0x0209C000 40000000 1

# Ethernet 2 Reset PIN - GPIO1-IO30
# +----------+--------+---------------+------+
# | Instance | Signal | Pad           | Mode |
# | GPIO1    | IO31   | UART5_RX_DATA | ALT5 |
# +----------+--------+---------------+------+
#
# IOMUXC_SW_MUX_CTL_PAD_UART5_RX_DATA - select mux mode: ALT5 mux port
# mw 0x020E00C0 00000005 1
# GPIO1_GDIR - define the direction of the GPIO1-IO31 as OUTPUT
# mw 0x0209C004 80000000 1
# GPIO1_DR - define the value of the GPIO1-IO31 OUTPUT to 0 - pull low
# mw 0x0209C000 00000000 1
# GPIO1_DR - define the value of the GPIO1-IO31 OUTPUT to 1 - pull high
# mw 0x0209C000 80000000 1

# Mobile Reset PIN - GPIO5-IO7
# +----------+--------+--------------+-----------------+
# | Instance | Signal | Pad          | Mode            |
# | GPIO5    | IO7    | SNVS_TAMPER7 | No Muxing(ALT5) |
# +----------+--------+--------------+-----------------+
#
# GPIO5_GDIR - define the direction of the GPIO5-IO7 as OUTPUT
# mw 0x020AC004 00000080 1
# GPIO5_DR - define the value of the GPIO5-IO7 OUTPUT to 0 - pull low
# mw 0x020AC000 00000000 1
# GPIO5_DR - define the value of the GPIO5-IO7 OUTPUT to 1 - pull high
# mw 0x020AC000 00000080 1

fw_setenv reset_ethernet_and_mobile 'mw 0x020E00BC 00000005 1; mw 0x020E00C0 00000005 1; \
mw 0x0209C004 C0000000 1; mw 0x020AC004 00000080 1; \
mw 0x0209C000 00000000 1; mw 0x020AC000 00000000 1; \
sleep 1; \
mw 0x0209C000 C0000000 1; mw 0x020AC000 00000080 1'

set bootdelay 0 - 不讓使用者有機會去修改 uboot env

fw_setenv bootdelay 0

總共有三件事

  • 點亮 system LED
  • reset ethernet 1, ethernet 2 and mobile
  • set bootdelay 0 - 不讓使用者有機會去修改 uboot env

直接 patch 到 uboot 吧

目前的 eMMC 的 uboot 相關的 default env 設定如下

#define CONFIG_EXTRA_ENV_SETTINGS \
	CONFIG_MFG_ENV_SETTINGS \
	"console=ttymxc0\0" \
	"fdt_high=0xffffffff\0" \
	"initrd_high=0xffffffff\0" \
	"fdt_addr=0x83000000\0" \
	"mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
	"mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
	"mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
	"mmcautodetect=yes\0" \
	\
	/* only keep in uboot default */ \
	"app_1=a\0" \
	"app_2=b\0" \
	\
	/* dual image uboot env version */ \
	"uboot_env_ver=emmc_v1.0\0" \
	\
	/* dual image no good counter */ \
	"no_good=.\0" \
	\
	/* dual image bootargs */ \
	"bootargs_a=echo bootargs dual image a;" \
		"setenv bootargs console=${console},${baudrate} root=/dev/mmcblk1p2 rootwait rw\0" \
	"bootargs_b=echo bootargs dual image b;" \
		"setenv bootargs console=${console},${baudrate} root=/dev/mmcblk1p3 rootwait rw\0" \
	\
	/* dual image fatload */ \
	"fatload_a=echo fatload dual image a;" \
		"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} zImage_a;" \
		"fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} imx6ul-14x14-evk_a.dtb;\0" \
	"fatload_b=echo fatload dual image b;" \
		"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} zImage_b;" \
		"fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} imx6ul-14x14-evk_b.dtb;\0" \
	\
	/* dual image app replace */ \
	"app_replace=echo App Replace;" \
		"if test ${app_1} = a;" \
		"then echo App 1 from dual image a to b; setenv app_1 b; setenv app_2 a;" \
		"else echo App 1 from dual image b to a; setenv app_1 a; setenv app_2 b;" \
		"fi\0" \
	\
	/* dual image app choose */ \
	"app_choose=echo App Choose;" \
		"if test ${no_good} = \".xx\";" \
		"then echo Replace App 1; run app_replace; setenv no_good .;" \
		"else echo Run App 1;" \
		"fi\0" \
	\
	/* dual image bootcmd emmc v1.0 */ \
	"bootcmd_emmc_v1.0=echo bootcmd_emmc_v1.0;" \
		"mmc dev ${mmcdev};" \
		"mmc rescan;" \
		"run app_choose;" \
		"run bootargs_${app_1};" \
		"run fatload_${app_1};" \
		"setenv no_good ${no_good}x;" \
		"saveenv;" \
		"bootz ${loadaddr} - ${fdt_addr}\0" \



#define CONFIG_BOOTCOMMAND \
	"run bootcmd_emmc_v1.0"

1000

今天的 M300 週會 borchen 也一起加入

  • 下禮拜開始做 vlan web ui
  • 還有 ariel 的 data usage - 要畫圖
  • emmc 暫緩
  • ospf 也暫緩

1300

修改後的 eMMC 的 uboot 相關的 default env 設定如下

#define CONFIG_EXTRA_ENV_SETTINGS \
	CONFIG_MFG_ENV_SETTINGS \
	"console=ttymxc0\0" \
	"fdt_high=0xffffffff\0" \
	"initrd_high=0xffffffff\0" \
	"fdt_addr=0x83000000\0" \
	"mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
	"mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
	"mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
	"mmcautodetect=yes\0" \
	\
	/* only keep in uboot default */ \
	"app_1=a\0" \
	"app_2=b\0" \
	\
	/* dual image uboot env version */ \
	"uboot_env_ver=emmc_v1.0\0" \
	\
	/* dual image no good counter */ \
	"no_good=.\0" \
	\
	/* dual image bootargs */ \
	"bootargs_a=echo bootargs dual image a;" \
		"setenv bootargs console=${console},${baudrate} root=/dev/mmcblk1p2 rootwait rw\0" \
	"bootargs_b=echo bootargs dual image b;" \
		"setenv bootargs console=${console},${baudrate} root=/dev/mmcblk1p3 rootwait rw\0" \
	\
	/* dual image fatload */ \
	"fatload_a=echo fatload dual image a;" \
		"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} zImage_a;" \
		"fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} imx6ul-14x14-evk_a.dtb;\0" \
	"fatload_b=echo fatload dual image b;" \
		"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} zImage_b;" \
		"fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} imx6ul-14x14-evk_b.dtb;\0" \
	\
	/* dual image app replace */ \
	"app_replace=echo App Replace;" \
		"if test ${app_1} = a;" \
		"then echo App 1 from dual image a to b; setenv app_1 b; setenv app_2 a;" \
		"else echo App 1 from dual image b to a; setenv app_1 a; setenv app_2 b;" \
		"fi\0" \
	\
	/* dual image app choose */ \
	"app_choose=echo App Choose;" \
		"if test ${no_good} = \".xx\";" \
		"then echo Replace App 1; run app_replace; setenv no_good .;" \
		"else echo Run App 1;" \
		"fi\0" \
	\
	/*
	** sys led - GPIO2-IO20
	** +----------+--------+-----------+------+
	** | Instance | Signal | Pad       | Mode |
	** | GPIO2    | IO20   | SD1_DATA2 | ALT5 |
	** +----------+--------+-----------+------+
	** 
	** SW_MUX_CTL_PAD_SD1_DATA2 - select mux mode: ALT5 mux port
	** - mw 0x020E01CC 0x00000005 1
	** GPIO2_GDIR - define the direction of the GPIO2-IO20 as OUTPUT
	** - mw 0x020A0004 00100000 1
	** GPIO2_DR - define the value of the GPIO2-IO20 OUTPUT to 0 - pull low
	** - mw 0x020A0000 00000000 1
	** _setenv turnon_sysled 'mw 0x020E01CC 0x00000005 1; mw 0x020A0004 00100000 1; mw 0x020A0000 00000000 1'
	*/ \
	"turnon_sysled=echo Turn On System LED;" \
		"mw 0x020E01CC 0x00000005 1;" \
		"mw 0x020A0004 0x00100000 1;" \
		"mw 0x020A0000 0x00000000 1\0" \
	\
	/*
	**
	** Ethernet 1 Reset PIN - GPIO1-IO30
	** +----------+--------+---------------+------+
	** | Instance | Signal | Pad           | Mode |
	** | GPIO1    | IO30   | UART5_TX_DATA | ALT5 |
	** +----------+--------+---------------+------+
	**
	** IOMUXC_SW_MUX_CTL_PAD_UART5_TX_DATA - select mux mode: ALT5 mux port
	** mw 0x020E00BC 00000005 1
	** GPIO1_GDIR - define the direction of the GPIO1-IO30 as OUTPUT
	** mw 0x0209C004 40000000 1
	** GPIO1_DR - define the value of the GPIO1-IO30 OUTPUT to 0 - pull low
	** mw 0x0209C000 00000000 1
	** GPIO1_DR - define the value of the GPIO1-IO30 OUTPUT to 1 - pull high
	** mw 0x0209C000 40000000 1
	**
	** 
	** Ethernet 2 Reset PIN - GPIO1-IO30
	** +----------+--------+---------------+------+
	** | Instance | Signal | Pad           | Mode |
	** | GPIO1    | IO31   | UART5_RX_DATA | ALT5 |
	** +----------+--------+---------------+------+
	**
	** IOMUXC_SW_MUX_CTL_PAD_UART5_RX_DATA - select mux mode: ALT5 mux port
	** mw 0x020E00C0 00000005 1
	** GPIO1_GDIR - define the direction of the GPIO1-IO31 as OUTPUT
	** mw 0x0209C004 80000000 1
	** GPIO1_DR - define the value of the GPIO1-IO31 OUTPUT to 0 - pull low
	** mw 0x0209C000 00000000 1
	** GPIO1_DR - define the value of the GPIO1-IO31 OUTPUT to 1 - pull high
	** mw 0x0209C000 80000000 1
	**
	** 
	** Mobile Reset PIN - GPIO5-IO7
	** +----------+--------+--------------+-----------------+
	** | Instance | Signal | Pad          | Mode            |
	** | GPIO5    | IO7    | SNVS_TAMPER7 | No Muxing(ALT5) |
	** +----------+--------+--------------+-----------------+
	**
	** GPIO5_GDIR - define the direction of the GPIO5-IO7 as OUTPUT
	** mw 0x020AC004 00000080 1
	** GPIO5_DR - define the value of the GPIO5-IO7 OUTPUT to 0 - pull low
	** mw 0x020AC000 00000000 1
	** GPIO5_DR - define the value of the GPIO5-IO7 OUTPUT to 1 - pull high
	** mw 0x020AC000 00000080 1
	**
	*/ \
	"reset_ethernet_and_mobile=echo Reset Ethernet and Mobile;" \
		"mw 0x020E00BC 00000005 1; mw 0x020E00C0 00000005 1;" \
		"mw 0x0209C004 C0000000 1; mw 0x020AC004 00000080 1;" \
		"mw 0x0209C000 00000000 1; mw 0x020AC000 00000000 1;" \
		"sleep 1;" \
		"mw 0x0209C000 C0000000 1; mw 0x020AC000 00000080 1\0" \
	\
	/* do not allow user stop autoboot - no chance to change the uboot env */ \
	"bootdelay=0\0" \
	/* 
	** dual image bootcmd
	** use eMMC as storage memory
	** verstion - v1.0 
	*/ \
	"bootcmd_emmc_v1.0=echo bootcmd_emmc_v1.0;" \
		"mmc dev ${mmcdev};" \
		"mmc rescan;" \
		"run turnon_sysled;" \
		"run reset_ethernet_and_mobile;" \
		"run app_choose;" \
		"run bootargs_${app_1};" \
		"run fatload_${app_1};" \
		"setenv no_good ${no_good}x;" \
		"saveenv;" \
		"bootz ${loadaddr} - ${fdt_addr}\0" \



#define CONFIG_BOOTCOMMAND \
	"run bootcmd_emmc_v1.0"

重上 patch 吧

  • bitbake u-boot-imx -c devshell
  • quilt new uboot_env_emmc_v1.0.patch
  • quilt add include/configs/mx6ul_14x14_evk.h

修改 include/configs/mx6ul_14x14_evk.h

收尾 - quilt refresh

得到 patches/uboot_env_emmc_v1.0.patch

Index: git/include/configs/mx6ul_14x14_evk.h
===================================================================
--- git.orig/include/configs/mx6ul_14x14_evk.h
+++ git/include/configs/mx6ul_14x14_evk.h
@@ -205,84 +205,159 @@
 		"bootz ${loadaddr} - ${fdt_addr}\0"
 
 #else
+
+
+
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	CONFIG_MFG_ENV_SETTINGS \
-	CONFIG_VIDEO_MODE \
-	"script=boot.scr\0" \
-	"image=zImage\0" \
 	"console=ttymxc0\0" \
 	"fdt_high=0xffffffff\0" \
 	"initrd_high=0xffffffff\0" \
-	"fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
 	"fdt_addr=0x83000000\0" \
-	"boot_fdt=try\0" \
-	"ip_dyn=yes\0" \
 	"mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
 	"mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
 	"mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
 	"mmcautodetect=yes\0" \
-	"mmcargs=setenv bootargs console=${console},${baudrate} " \
-	    CONFIG_BOOTARGS_CMA_SIZE \
-		"root=${mmcroot}\0" \
-	"loadbootscript=" \
-		"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
-	"bootscript=echo Running bootscript from mmc ...; " \
-		"source\0" \
-	"loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
-	"loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
-	"mmcboot=echo Booting from mmc ...; " \
-		"run mmcargs; " \
-		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
-			"if run loadfdt; then " \
-				"bootz ${loadaddr} - ${fdt_addr}; " \
-			"else " \
-				"if test ${boot_fdt} = try; then " \
-					"bootz; " \
-				"else " \
-					"echo WARN: Cannot load the DT; " \
-				"fi; " \
-			"fi; " \
-		"else " \
-			"bootz; " \
-		"fi;\0" \
-	"netargs=setenv bootargs console=${console},${baudrate} " \
-	    CONFIG_BOOTARGS_CMA_SIZE \
-		"root=/dev/nfs " \
-	"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
-		"netboot=echo Booting from net ...; " \
-		"run netargs; " \
-		"if test ${ip_dyn} = yes; then " \
-			"setenv get_cmd dhcp; " \
-		"else " \
-			"setenv get_cmd tftp; " \
-		"fi; " \
-		"${get_cmd} ${image}; " \
-		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
-			"if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
-				"bootz ${loadaddr} - ${fdt_addr}; " \
-			"else " \
-				"if test ${boot_fdt} = try; then " \
-					"bootz; " \
-				"else " \
-					"echo WARN: Cannot load the DT; " \
-				"fi; " \
-			"fi; " \
-		"else " \
-			"bootz; " \
-		"fi;\0"
+	\
+	/* only keep in uboot default */ \
+	"app_1=a\0" \
+	"app_2=b\0" \
+	\
+	/* dual image uboot env version */ \
+	"uboot_env_ver=emmc_v1.0\0" \
+	\
+	/* dual image no good counter */ \
+	"no_good=.\0" \
+	\
+	/* dual image bootargs */ \
+	"bootargs_a=echo bootargs dual image a;" \
+		"setenv bootargs console=${console},${baudrate} root=/dev/mmcblk1p2 rootwait rw\0" \
+	"bootargs_b=echo bootargs dual image b;" \
+		"setenv bootargs console=${console},${baudrate} root=/dev/mmcblk1p3 rootwait rw\0" \
+	\
+	/* dual image fatload */ \
+	"fatload_a=echo fatload dual image a;" \
+		"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} zImage_a;" \
+		"fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} imx6ul-14x14-evk_a.dtb;\0" \
+	"fatload_b=echo fatload dual image b;" \
+		"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} zImage_b;" \
+		"fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} imx6ul-14x14-evk_b.dtb;\0" \
+	\
+	/* dual image app replace */ \
+	"app_replace=echo App Replace;" \
+		"if test ${app_1} = a;" \
+		"then echo App 1 from dual image a to b; setenv app_1 b; setenv app_2 a;" \
+		"else echo App 1 from dual image b to a; setenv app_1 a; setenv app_2 b;" \
+		"fi\0" \
+	\
+	/* dual image app choose */ \
+	"app_choose=echo App Choose;" \
+		"if test ${no_good} = \".xx\";" \
+		"then echo Replace App 1; run app_replace; setenv no_good .;" \
+		"else echo Run App 1;" \
+		"fi\0" \
+	\
+	/*
+	** sys led - GPIO2-IO20
+	** +----------+--------+-----------+------+
+	** | Instance | Signal | Pad       | Mode |
+	** | GPIO2    | IO20   | SD1_DATA2 | ALT5 |
+	** +----------+--------+-----------+------+
+	** 
+	** SW_MUX_CTL_PAD_SD1_DATA2 - select mux mode: ALT5 mux port
+	** - mw 0x020E01CC 0x00000005 1
+	** GPIO2_GDIR - define the direction of the GPIO2-IO20 as OUTPUT
+	** - mw 0x020A0004 00100000 1
+	** GPIO2_DR - define the value of the GPIO2-IO20 OUTPUT to 0 - pull low
+	** - mw 0x020A0000 00000000 1
+	** _setenv turnon_sysled 'mw 0x020E01CC 0x00000005 1; mw 0x020A0004 00100000 1; mw 0x020A0000 00000000 1'
+	*/ \
+	"turnon_sysled=echo Turn On System LED;" \
+		"mw 0x020E01CC 0x00000005 1;" \
+		"mw 0x020A0004 0x00100000 1;" \
+		"mw 0x020A0000 0x00000000 1\0" \
+	\
+	/*
+	**
+	** Ethernet 1 Reset PIN - GPIO1-IO30
+	** +----------+--------+---------------+------+
+	** | Instance | Signal | Pad           | Mode |
+	** | GPIO1    | IO30   | UART5_TX_DATA | ALT5 |
+	** +----------+--------+---------------+------+
+	**
+	** IOMUXC_SW_MUX_CTL_PAD_UART5_TX_DATA - select mux mode: ALT5 mux port
+	** mw 0x020E00BC 00000005 1
+	** GPIO1_GDIR - define the direction of the GPIO1-IO30 as OUTPUT
+	** mw 0x0209C004 40000000 1
+	** GPIO1_DR - define the value of the GPIO1-IO30 OUTPUT to 0 - pull low
+	** mw 0x0209C000 00000000 1
+	** GPIO1_DR - define the value of the GPIO1-IO30 OUTPUT to 1 - pull high
+	** mw 0x0209C000 40000000 1
+	**
+	** 
+	** Ethernet 2 Reset PIN - GPIO1-IO30
+	** +----------+--------+---------------+------+
+	** | Instance | Signal | Pad           | Mode |
+	** | GPIO1    | IO31   | UART5_RX_DATA | ALT5 |
+	** +----------+--------+---------------+------+
+	**
+	** IOMUXC_SW_MUX_CTL_PAD_UART5_RX_DATA - select mux mode: ALT5 mux port
+	** mw 0x020E00C0 00000005 1
+	** GPIO1_GDIR - define the direction of the GPIO1-IO31 as OUTPUT
+	** mw 0x0209C004 80000000 1
+	** GPIO1_DR - define the value of the GPIO1-IO31 OUTPUT to 0 - pull low
+	** mw 0x0209C000 00000000 1
+	** GPIO1_DR - define the value of the GPIO1-IO31 OUTPUT to 1 - pull high
+	** mw 0x0209C000 80000000 1
+	**
+	** 
+	** Mobile Reset PIN - GPIO5-IO7
+	** +----------+--------+--------------+-----------------+
+	** | Instance | Signal | Pad          | Mode            |
+	** | GPIO5    | IO7    | SNVS_TAMPER7 | No Muxing(ALT5) |
+	** +----------+--------+--------------+-----------------+
+	**
+	** GPIO5_GDIR - define the direction of the GPIO5-IO7 as OUTPUT
+	** mw 0x020AC004 00000080 1
+	** GPIO5_DR - define the value of the GPIO5-IO7 OUTPUT to 0 - pull low
+	** mw 0x020AC000 00000000 1
+	** GPIO5_DR - define the value of the GPIO5-IO7 OUTPUT to 1 - pull high
+	** mw 0x020AC000 00000080 1
+	**
+	*/ \
+	"reset_ethernet_and_mobile=echo Reset Ethernet and Mobile;" \
+		"mw 0x020E00BC 00000005 1; mw 0x020E00C0 00000005 1;" \
+		"mw 0x0209C004 C0000000 1; mw 0x020AC004 00000080 1;" \
+		"mw 0x0209C000 00000000 1; mw 0x020AC000 00000000 1;" \
+		"sleep 1;" \
+		"mw 0x0209C000 C0000000 1; mw 0x020AC000 00000080 1\0" \
+	\
+	/* do not allow user stop autoboot - no chance to change the uboot env */ \
+	"bootdelay=0\0" \
+	/* 
+	** dual image bootcmd
+	** use eMMC as storage memory
+	** verstion - v1.0 
+	*/ \
+	"bootcmd_emmc_v1.0=echo bootcmd_emmc_v1.0;" \
+		"mmc dev ${mmcdev};" \
+		"mmc rescan;" \
+		"run turnon_sysled;" \
+		"run reset_ethernet_and_mobile;" \
+		"run app_choose;" \
+		"run bootargs_${app_1};" \
+		"run fatload_${app_1};" \
+		"setenv no_good ${no_good}x;" \
+		"saveenv;" \
+		"bootz ${loadaddr} - ${fdt_addr}\0" \
+
+
 
 #define CONFIG_BOOTCOMMAND \
-	   "mmc dev ${mmcdev};" \
-	   "mmc dev ${mmcdev}; if mmc rescan; then " \
-		   "if run loadbootscript; then " \
-			   "run bootscript; " \
-		   "else " \
-			   "if run loadimage; then " \
-				   "run mmcboot; " \
-			   "else run netboot; " \
-			   "fi; " \
-		   "fi; " \
-	   "else run netboot; fi"
+	"run bootcmd_emmc_v1.0"
+
+
+
 #endif
 
 /* Miscellaneous configurable options */

patches/uboot_env_emmc_v1.0.patch 複製到 meta-proscend/recipes-bsp/u-boot/files/

重新再 build 一個 uboot- bitbake u-boot-imx -c compile

1355

目前看來 eMMC 的 rc.local 並沒有需要再額外呼叫像 uboot_env.sh 這樣的 script 去額外設定一些 uboot env

後續有需要再說吧

1755

eMMC 的進度暫時告一段落

commit f79daa92bb676df4328e8ee604ca801fc5755ee4
Author: jeffrey <[email protected]>
Date:   Fri Nov 3 17:52:36 2017 +0800

    modify the uboot env for eMMC

 .../u-boot/files/uboot_env_emmc_v1.0.patch         | 95 +++++++++++++++++++++-
 1 file changed, 93 insertions(+), 2 deletions(-)

後續還有

  • image generation for firmware upgrade
  • firmware upgrade process
  • default hw_mcsv