i.MX8MQ u-boot和mgftool烧写emmc失败

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX8MQ u-boot和mgftool烧写emmc失败

5,595 Views
晓锋潘
Contributor I

我使用的芯片是i.mx8mq,手里也有一块你们的开发板,使用的android版本是8.1.0_1.3.0,问题如下:

 

Git下载源码后,根据文档提示操作进行编译,完成后使用mfgtool进行emmc烧写,单板对象为官方开发板:

 

1  将编译得到的android_build/out/target/product/evk_8mq目录下的如下6个文件拷贝到mgfttoolandroid_O8.1.0_1.3.0_8M_tools\mfgtools\Profiles\Linux\OS Firmware\files\android\evk目录下:

将编译生成的android_build/out/target/product/evk_8mq/obj/KERNEL_OBJ/arch/arm64/boot/dts/freescale目录下的fsl-imx8mq-evk.dtb文件拷贝到mgftoolandroid_O8.1.0_1.3.0_8M_tools\mfgtools\Profiles\Linux\OS Firmware\firmware目录下进行烧写,结果,success

 

2  前边步骤同上,同时将编译生成的u-boot-imx8mq.imx拷贝到mgftool的android_O8.1.0_1.3.0_8M_tools\mfgtools\Profiles\Linux\OS Firmware\firmware目录下,并改名为imx-boot-imx8mqevk-sd.bin-flash_evk,再次对开发板进行烧写,结果,fail。

 

3  对比mfgtool自带的imx-boot-imx8mqevk-sd.bin-flash_evk文件和编译生成的imx-boot-imx8mqevk-sd.bin-flash_evk文件,串口打印信息如下:

mfgtool自带的imx-boot-imx8mqevk-sd.bin-flash_evk串口输出打印信息:

U-Boot SPL 2017.03-imx_v2017.03_4.9.51_imx8m_ga+g2537522 (Mar 12 2018 - 12:25:24)

PMIC:  PFUZE100 ID=0x10

start to config phy: p0=3200mts, p1=667mts with 1D2D training

check ddr4_pmu_train_imem code

check ddr4_pmu_train_imem code pass

check ddr4_pmu_train_dmem code

check ddr4_pmu_train_dmem code pass

config to do 3200 1d training.

Training PASS

check ddr4_pmu_train_imem code

check ddr4_pmu_train_imem code pass

check ddr4_pmu_train_dmem code

check ddr4_pmu_train_dmem code pass

config to do 3200 2d training.

Training PASS

check ddr4_pmu_train_imem code

check ddr4_pmu_train_imem code pass

check ddr4_pmu_train_dmem code

check ddr4_pmu_train_dmem code pass

pstate=1: set dfi clk done done

Training PASS

Load 201711 PIE

Back to ROM, SDP

 

 

U-Boot 2017.03-imx_v2017.03_4.9.51_imx8m_ga+g2537522 (Mar 12 2018 - 12:25:24 -0500)

 

CPU:   Freescale i.MX8MQ rev2.0 1500 MHz (running at 1000 MHz)

CPU:   Commercial temperature grade (0C to 95C) at 42C

Reset cause: POR

Model: Freescale i.MX8MQ EVK

DRAM:  3 GiB

TCPC:  Vendor ID [0x1fc9], Product ID [0x5110]

MMC:   FSL_SDHC: 0, FSL_SDHC: 1

MMC: no card present

mmc_init: -123, time 2

*** Warning - MMC init failed, using default environment

 

No panel detected: default to HDMI

Display: HDMI (1280x720)

HDMI enable failed!

In:    serial

Out:   serial

Err:   serial

 

BuildInfo:

  - ATF 6a83ae0

  - U-Boot 2017.03-imx_v2017.03_4.9.51_imx8m_ga+g2537522

 

MMC: no card present

mmc_init: -123, time 2

Net:  

Warning: ethernet@30be0000 using MAC address from ROM

eth0: ethernet@30be0000

Boot from USB for mfgtools

Use default environment for                              mfgtools

Run bootcmd_mfg: run mfgtool_args;booti ${loadaddr} ${initrd_addr} ${fdt_addr};

Hit any key to stop autoboot:  0

u-boot=> printenv

baudrate=115200

boot_fdt=try

bootcmd=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 booti ${loadaddr} - ${fdt_addr}; fi

bootcmd_mfg=run mfgtool_args;booti ${loadaddr} ${initrd_addr} ${fdt_addr};

bootdelay=2

bootscript=echo Running bootscript from mmc ...; source

console=ttymxc0,115200 earlycon=ec_imx6q,0x30860000,115200

ethprime=FEC

fdt_addr=0x43000000

fdt_file=fsl-imx8mq-evk.dtb

fdt_high=0xffffffffffffffff

image=Image

initrd_addr=0x43800000

initrd_high=0xffffffffffffffff

loadaddr=0x40480000

loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};

loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}

loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}

mfgtool_args=setenv bootargs console=${console},${baudrate} rdinit=/linuxrc g_mass_storage.stall=0 g_mass_storage.removable=1 g_mass_storage.idVendor=0x066F g_mass_storage.idProduct=0x37FF g_mass_storage.iSerialNumber="" clk_ignore_unused

mmcargs=setenv bootargs console=${console} root=${mmcroot}

mmcautodetect=yes

mmcboot=echo Booting from mmc ...; run mmcargs; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then booti ${loadaddr} - ${fdt_addr}; else echo WARN: Cannot load the DT; fi; else echo wait for boot; fi;

mmcdev=1

mmcpart=1

mmcroot=/dev/mmcblk1p2 rootwait rw

netargs=setenv bootargs console=${console} root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp

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} ${loadaddr} ${image}; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if ${get_cmd} ${fdt_addr} ${fdt_file}; then booti ${loadaddr} - ${fdt_addr}; else echo WARN: Cannot load the DT; fi; else booti; fi;

script=boot.scr

 

Environment size: 1935/4092 bytes

u-boot=>

 

我自己编译生成的imx-boot-imx8mqevk-sd.bin-flash_evk串口输出打印信息:

U-Boot SPL 2017.03 (Jul 10 2018 - 19:25:46)

PMIC:  PFUZE100 ID=0x10

start to config phy: p0=3200mts, p1=667mts with 1D2D training

check ddr4_pmu_train_imem code

check ddr4_pmu_train_imem code pass

check ddr4_pmu_train_dmem code

check ddr4_pmu_train_dmem code pass

config to do 3200 1d training.

Training PASS

check ddr4_pmu_train_imem code

check ddr4_pmu_train_imem code pass

check ddr4_pmu_train_dmem code

check ddr4_pmu_train_dmem code pass

config to do 3200 2d training.

Training PASS

check ddr4_pmu_train_imem code

check ddr4_pmu_train_imem code pass

check ddr4_pmu_train_dmem code

check ddr4_pmu_train_dmem code pass

pstate=1: set dfi clk done done

Training PASS

Load 201711 PIE

Back to ROM, SDP

 

 

U-Boot 2017.03 (Jul 10 2018 - 19:25:46 +0800)

 

CPU:   Freescale i.MX8MQ rev2.0 1500 MHz (running at 1000 MHz)

CPU:   Commercial temperature grade (0C to 95C) at 41C

Reset cause: POR

Model: Freescale i.MX8MQ EVK

DRAM:  3 GiB

MMC:   FSL_SDHC: 0, FSL_SDHC: 1

MMC: no card present

mmc_init: -123, time 2

*** Warning - MMC init failed, using default environment

 

In:    serial

Out:   serial

Err:   serial

 

BuildInfo:

  - ATF 6a83ae0

  - U-Boot 2017.03

 

unsupported boot devices

SATA isn't buildin

Net:  

Warning: ethernet@30be0000 using MAC address from ROM

eth0: ethernet@30be0000

MMC: no card present

mmc_init: -123, time 2

Block device mmc 1 not supported

bcb_rw_block, get_block_size return 0

read_bootctl, bcb_rw_block read failed

read command failed

Fastboot: Normal

u-boot=> printenv

baudrate=115200

bootdelay=1

ethaddr=00:04:9f:05:6a:83

ethprime=FEC

fdt_high=0xffffffffffffffff

fdtcontroladdr=f9efec48

initrd_high=0xffffffffffffffff

loadaddr=0x40480000

soc_type=imx8mq

splashpos=m,m

stderr=serial

stdin=serial

stdout=serial

 

Environment size: 268/4092 bytes

       u-boot=>

4  现象,使用mfgtool自带的imx-boot-imx8mqevk-sd.bin-flash_evk文件对开发板进行烧写,可以成功;使用编译生成的imx-boot-imx8mqevk-sd.bin-flash_evk对开发板进行烧写,不成功;

能看到的区别是两个uboot的版本不一样,且编译生成的uboot中似乎没有bootcmd等一系列环境变量。

 

请问我上述的操作步骤对吗?在我自己做的板子中,需要更改uboot,但是我现在找不到一个能使用的uboot版本。

我使用的mgftool工具的VBS文件为mfgtool2-android-mx8mq-evk-emmc.vbs。

Labels (1)
0 Kudos
Reply
3 Replies

3,704 Views
Rita_Wang
NXP TechSupport
NXP TechSupport

Hi,

If the DDR is the same as our refrence board, you can directly use the default mfgtool. You do not need to build the mfgtool firmware. If you change the DDR you need to rebuild the firmware for your board mfgtool, About the mfgtool uboot here you can use the same one uboot image with your board uboot image.

Have a nice day

Rita

0 Kudos
Reply

3,704 Views
晓锋潘
Contributor I

问题是我的板子修改了PMIC挂接的I2C和串口,特别是I2C,如果不修改mfgtool工具里的uboot的话,PMIC无法正常工作,emmc无法正常供电,所以我必须修改mfgtool里边的uboot。

0 Kudos
Reply

3,704 Views
jimmychan
NXP TechSupport
NXP TechSupport

The mfgtool is loading a small Linux kernel to DDR and then run the linux command to program the images to the storage devices. (for the details of what linux commands used, please read ucl2.xml script)

If you need to build your own firmware, you need to use Yocto BSP.

You can refer to this :

https://community.nxp.com/thread/391218 

0 Kudos
Reply