How to download u-boot.imx to eMMC by using u-boot?

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

How to download u-boot.imx to eMMC by using u-boot?

Jump to solution
16,980 Views
yenhsu
Contributor III

Hello,

I for now have a MCIMX6DL-SDP board and it can be booted from eMMC. So, I would like know how to download u-boot.imx image from a TFTP server into RAM and to write from RAM to the eMMC.

Of course, I have already read the "i.MX_Linux_User's_Guide.pdf" document to understand the steps of program the kernel image, but it seems to me that it does not mention how to program u-boot image by using u-boot, or say it doesn't descript "mmc write" to where address for the u-boot. 

Could somebody do me a favor?? And it would be better if you can provide a instruction that is step by step. 

Thank you.

Regards,

Chris

0 Kudos
1 Solution
10,275 Views
yenhsu
Contributor III

Hi Fabio,

I can flash a new U-boot by "mmc write" after using "mmc dev 2 1" to switch to partitions #1 of the cMMC. 

Thanks for your great help.

Regards,

Chris.

View solution in original post

0 Kudos
15 Replies
10,276 Views
udayakumar
Contributor I

Hi Fabio,

          how can we write u-boot.imx file in boot1 partition of eMMC in u-boot itself ?

          We could able to change the boot part through mmc partconf commands, but to access boot partition like boot0 and boot1, through commands or code can you suggest any idea.

thanks,

uday

0 Kudos
10,276 Views
fabio_estevam
NXP Employee
NXP Employee

Udaya,

u-boot.imx must be flashed into a raw partition.

Please start a new thread if needed.

Regards,

Fabio Estevam

0 Kudos
10,276 Views
udayakumar
Contributor I

Hi Fabio,

   I have the new u-boot.imx file in my fat partition of the emmc, i need to update the u-boot.imx file in boot1 partition of the emmc while my current u-boo.imx file run in boot0 partition.

thanks,

uday

0 Kudos
10,275 Views
fabio_estevam
NXP Employee
NXP Employee

Also , the "MMC: no card present" is suspicious. Please double check the eMMC IOMUX in your board file.

Looks like you are using the mx6dlsabresd as reference and maybe you missed to update the eMMC IOMUX as per your board schematics. Also, keep in mind that the sabresd boards have two SD card slots and one eMMC.

If your board has only eMMC than make sure to register only the eMMC interface in U-Boot.

=> mmcinfo

Should give you the information about your eMMC.

Something like this:

=> mmcinfo
Device: FSL_SDHC
Manufacturer ID: 70
OEM: 100
Name: V1000
Tran Speed: 52000000
Rd Block Len: 512
MMC version 5.0
High Capacity: Yes
Capacity: 7 GiB
Bus Width: 8-bit DDR
Erase Group Size: 512 KiB
HC WP Group Size: 8 MiB
User Capacity: 7 GiB
Boot Capacity: 4 MiB ENH
RPMB Capacity: 4 MiB ENH
=>

0 Kudos
10,276 Views
yenhsu
Contributor III

Hi Fabio,

After changing the number of "mmcdev" from 1 to 2, the "MMC: no card present" would not appear again, and I can flash the U-boot into eMMC by DFU. Another,the 'ums' command is workable. Thanks.

However, I really want to know how to use "mmc write" command to flash the U-boot into eMMC partition 1. Do you have any ideas about this?

Thank you.

Regards,

Chris

0 Kudos
10,276 Views
fabio_estevam
NXP Employee
NXP Employee

Hi Chris,

The mx6 ROM code expects U-Boot to be at offset 0x400 when booting from eMMC in a 'raw' partition, so you cannot put U-Boot to partition 1.

Regards,

Fabio Estevam

0 Kudos
10,276 Views
yenhsu
Contributor III

Hi Fabio,

Sorry, I think I didn't describe the question clearly. The partition 1 that I said is the eMMC boot partition 1. (eMMC has boot1, boot2, RPMB.. right?)

I am assuming that you mentioned mx6 code expects U-boot to be at offset 0x400 is meaning at eMMC block #2. Then, I am curiously why can't I use "mmc write 0x12000000 0x2 0x400" to flash it?? (Here I have used "tftp" command to load a new U-boot at 0x12000000)

Thanks.

Regards,

Chris

0 Kudos
10,276 Views
yenhsu
Contributor III

Hi Fabio,

I can flash a new U-boot by "mmc write" after using "mmc dev 2 1" to switch to partitions #1 of the cMMC. 

Thanks for your great help.

Regards,

Chris.

0 Kudos
10,275 Views
fabio_estevam
NXP Employee
NXP Employee

One alternative is to use the following steps to flash U-Boot into eMMC:

http://git.denx.de/?p=u-boot/u-boot-video.git;a=blob;f=board/warp7/README;h=60339da543732829d4ac09f0... 

0 Kudos
10,275 Views
yenhsu
Contributor III

Hi Fabio,

I followed the reference that you provided, I for now could load u-boot.imx from host PC via USB. 

However, the console appears some error messages when I carried out the "Run the DFU command" as below, 

====================================================================

U-Boot 2016.03-imx_v2016.03_4.1.15_2.0.0_ga+ga57b13b (Sep 12 2017 - 14:32:58 +0800)

CPU: Freescale i.MX6DL rev1.1 at 792MHz
CPU: Commercial temperature grade (0C to 95C) at 49C
Reset cause: POR
Board: MX6-SabreSD
I2C: ready
DRAM: 1 GiB
PMIC: PFUZE100 ID=0x10
MMC: FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2
MMC: no card present
*** Warning - MMC init failed, using default environment

No panel detected: default to Hannstar-XGA
Display: Hannstar-XGA (1024x768)
In: serial
Out: serial
Err: serial
MMC: no card present
Net: FEC [PRIME]
Boot from USB for mfgtools
Use default environment for mfgtools
Run bootcmd_mfg: run mfgtool_args;bootz ${loadaddr} ${initrd_addr} ${fdt_addr};
Hit any key to stop autoboot: 0
Bad Linux ARM zImage magic!
=>
=> dfu 0 mmc 0
ERROR: Invalid number of arguments.

at ../drivers/dfu/dfu_mmc.c:311/dfu_fill_entity_mmc()
ERROR: DFU entities configuration failed!

at ../drivers/dfu/dfu.c:70/dfu_init_env_entities()
dfu - Device Firmware Upgrade

Usage:
dfu <USB_controller> <interface> <dev> [list]
- device firmware upgrade via <USB_controller>
on device <dev>, attached to interface
<interface>
[list] - list available alt settings

=>

====================================================================

Could you please help to take a look and provide some advices about how to fix it?

Thanks.

Regards,

Chris.

0 Kudos
10,275 Views
fabio_estevam
NXP Employee
NXP Employee

Does the 'ums' command work?

=> ums 0 mmc 0

0 Kudos
10,275 Views
Yuri
NXP Employee
NXP Employee

Hello,

   Please look at ucl2.xml file of MFG, where eMMC section (  <LIST name="eMMC"

desc="Choose eMMC as media">) provides Linux commands, used to deploy image(s) to eMMC.

Looking over it You can, at least, to understand the needed sequence.

http://www.nxp.com/webapp/Download?colCode=IMX_L4.1.15_2.1.0_MFG_TOOL&appType=license&location=null&... 

Summary page :

i.MX 6 / i.MX 7 Series Software and Development Tool|NXP 

Have a great day,
Yuri

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
10,275 Views
yenhsu
Contributor III

Hi Yuri,

Thanks for your prompt response.

Unfortunately, it still can't work after I used same offset address that in the "ucl2.xml" file to program the "u-boot.imx".

************

<CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mmcblk%mmc%boot0 bs=512 seek=2">write U-Boot to sd card</CMD>

************

I pasted steps that I carried out as below, you can see the date of the u-boot is still same. 

Could you please help to check it?? Thanks.

====================================================

U-Boot 2016.03-imx_v2016.03_4.1.15_2.0.0_ga+ga57b13b (May 10 2017 - 05:47:44 -0500)

CPU: Freescale i.MX6DL rev1.1 at 792MHz
CPU: Commercial temperature grade (0C to 95C) at 47C
Reset cause: POR
Board: MX6-SabreSD
I2C: ready
DRAM: 1 GiB
PMIC: PFUZE100 ID=0x10
MMC: FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2
No panel detected: default to Hannstar-XGA
Display: Hannstar-XGA (1024x768)
In: serial
Out: serial
Err: serial
switch to partitions #0, OK
mmc2(part 0) is current device
Net: FEC [PRIME]
Warning: FEC MAC addresses don't match:
Address in SROM is 00:04:9f:02:68:a8
Address in environment is 00:01:02:03:04:05

Normal Boot
Hit any key to stop autoboot: 0
=> dhcp
BOOTP broadcast 1
*** Unhandled DHCP Option in OFFER/ACK: 43
*** Unhandled DHCP Option in OFFER/ACK: 43
DHCP client bound to address 172.26.130.149 (11 ms)
*** Warning: no boot file name; using 'AC1A8295.img'
Using FEC device
TFTP from server 172.26.130.105; our IP address is 172.26.130.149
Filename 'AC1A8295.img'.
Load address: 0x12000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
=> <INTERRUPT>
=>
=> tftpboot ${loadaddr} u-boot.imx
Using FEC device
TFTP from server 172.26.130.105; our IP address is 172.26.130.149
Filename 'u-boot.imx'.
Load address: 0x12000000
Loading: #################################################################
#############################
961.9 KiB/s
done
Bytes transferred = 478208 (74c00 hex)
=> <INTERRUPT>
=>
=> mmc list
FSL_SDHC: 0
FSL_SDHC: 1
FSL_SDHC: 2 (eMMC)
=> <INTERRUPT>
=>
=> mmc dev 2:0
switch to partitions #0, OK
mmc2(part 0) is current device
=> <INTERRUPT>
=>
=> mmc write ${loadaddr} 0x2 0x3A6

MMC write: dev # 2, block # 2, count 934 ... 934 blocks written: OK
=> <INTERRUPT>
=>
=>
=>
=>
=>
=>
=>
=>
=> reset
resetting ...


U-Boot 2016.03-imx_v2016.03_4.1.15_2.0.0_ga+ga57b13b (May 10 2017 - 05:47:44 -0500)

CPU: Freescale i.MX6DL rev1.1 at 792MHz
CPU: Commercial temperature grade (0C to 95C) at 48C
Reset cause: POR
Board: MX6-SabreSD
I2C: ready
DRAM: 1 GiB
PMIC: PFUZE100 ID=0x10
MMC: FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2
No panel detected: default to Hannstar-XGA
Display: Hannstar-XGA (1024x768)
In: serial
Out: serial
Err: serial
switch to partitions #0, OK
mmc2(part 0) is current device
Net: FEC [PRIME]
Warning: FEC MAC addresses don't match:
Address in SROM is 00:04:9f:02:68:a8
Address in environment is 00:01:02:03:04:05

Normal Boot
Hit any key to stop autoboot: 0
=> <INTERRUPT>
=> <INTERRUPT>
=> <INTERRUPT>
=>

====================================================

 

Regards,

Chris.

0 Kudos
10,275 Views
Yuri
NXP Employee
NXP Employee

Hello,

  it is needed to use special boot partition; and select the used boot partition,

since two partitions are located on eMMC.

 of=/dev/mmcblk%mmc%boot0 

Regards,

Yuri.

0 Kudos
10,276 Views
yenhsu
Contributor III

Hi Yuri,

Excuse me, I don't understand what's you meaning. Could you provide more details, please?

I would like to flash the U-boot by itself because I hope to short development time.

Thanks.

Regards,

Chris.

0 Kudos