Share Tiny4412,emmc burn u-boot, support fastboot mode burn write eMMC

Source: Internet
Author: User

Reprint: http://www.arm9home.net/read.php?tid-83474.html

I am the first time in this post, I hope you have a lot of support, posting purpose is to share, the purpose of sharing is to pass the spirit of open source.
Tiny4412 Development Board just got hand is, read the next introduction, found that superboot is a good thing, but not open source, this serious and open source thinking does not meet.

Preface:
according to the CD-ROM introduction compilation burning Write U-boot also cannot start the board, only superboot use after the board can be started. This is a lot to think of as I thought, how to use open source U-boot to launch the Development Board.

To get to the point , our goal is to use U-boot to run tiny4412.

Text:
The first thing to note is that the original kernel configuration to open the Config_arm_trustzone, this and Superboot.bin is supporting the use of, but u-boot by the study found that the TZ mode is not supported, so the kernel configuration to remove this option. Otherwise, follow the tutorial will appear in the panic. Forum also has a lot of netizens found this phenomenon, no longer repeat. (later I will study the trustzone mechanism)

after the TZ option is removed, through the SD card burning U-boot can bring up the board, this is not the focus we want to tell, we want to talk about how to burn u-boot to eMMC, this friendly did not provide a method, in fact, not difficult.

eMMC in fact, and SD card is similar, are SD device, EMMC is 8-bit mode, SD is 4-bit mode. TINY4412 is eMMC4.4. Since the SD card can burn, then the EMMC must be burnt.

SD card Burning, in fact, through a friendly tutorial, in the U-boot source directory has sd_fusing.sh, open to see to know the burning principle. This does not speak, interested friends can see, very see. is to burn each bin file to the system partition of the SD card in the specified location.

so eMMC how to write it, this is the point we want to talk about. Here you have to talk about the DNW tool, which can be USB to the computer-side files burned to the target board memory. Attachment is DNW Linux complete source package, solution to a folder, inside there are dnw.c, Makefile, Precompiled DNW (x86_64). You can directly use or compile yourself, compiled DNW can be copied to/usr/bin, and chmod 777/usr/bin/dnw.

U-boot interrupts also support DNW instructions, so eMMC burning is possible, because the U-boot.bin firmware on the computer can be burned to the Development Board memory by DNW ....

compile Uboot Process friendly documentation has been written very well, we refer to and compile U-boot. After the compilation is complete, the U-boot directory is:
U-boot.bin
enter u-boot/sd_fuse/to execute make, you can generate the Mkbl2 tool,
Enter the u-boot/sd_fuse/tiny4412 directory to see the Bl2.bin E4412_N.bl1.bin e4412_tzsw.bin three bin, where Bl2.bin will be generated when the SD boot card is produced, we also need this file.

here is how to use DNW to download firmware to the Board memory, note that I am debugging in the Ubuntu environment, using Windows Friends Self-control process.

1 Download Attachment DNW compiled, above already spoken,
2 Follow the friendly document, make SD boot card, develop board SW2 switch Select SD boot.
3 The serial port connects the PC with the Development Board first.
4 Insert the SD card into the Development Board, and give the Development Board power SW1.
5 Keyboard Press any keyboard to enter Uboot terminal, at this time input help can see a lot of instructions.

6 Now we have entered the SD card mode to start the u-boot. Now let's look at the MMC device information:
input in U-boot mode:
>mmcinfo 0
omit ...
>mmcinfo 1
DEVICE:S5P_MSHC4
manufacturer Id:15
oem:100
name:m4g1y
Tran speed:0
Rd Block len:512
MMC version 4.0
High Capacity:yes
SIZE:3728MB (block:7634944)
Bus width:8-bit
Boot Partition size:2048 KB

The above two instructions are executed separately, you can find MMC 0 is our SD card, MMC 1 device is we want to burn device emmc,uboot return prompt is 8-bit, memory capacity is 4G eMMC card.

7 Continue typing:
>fdisk-p 0
>fdisk-p 1
partion # Size (MB) block Start # block Count partition_id
1 695 6070812 1424478 0x0C
2 134244 656304 0x83
3 2057 790548 4213770 0x83
4 520 5004318 1066494 0x83

These two instructions are to view the partition table information for the MMC 0/1 device separately. Device MMC1 partition information, that is, EMMC analysis, note that this is the Superboot partition information, we use this partition.

Partition 1 is the FAE partition, partition 2 is for system, Partition 3 is User-data, Partition 4 is cache.

8 Format eMMC, enter the following instruction in U-boot mode to format the EMMC device.
>fdisk-c 1 2057 520
the partition information is returned after execution, and the format session partition is resumed 1,2,3,4
>fatformat MMC 1:1
This means that the first partition format for MMC 1 devices is formatted as FAT.
>ext3format MMC 1:2
>ext3format MMC 1:3
>ext3format MMC 1:4
The above three instructions are EMMC partition 2,3,4 for the ext3 format respectively.

Here we have completed the formatting of the EMMC device.

next we have to think of ways to burn Bl1.bin, Bl2.bin, U-boot.bin, Tzsw.bin burned to eMMC.

9 Download the firmware from the PC to the Development Board memory.
just now we focused on DNW, and then we'll use this tool to download the firmware into the board memory. Note that it is downloaded into memory and the firmware data is cached and burned to eMMC.
first, we need to open the EMMC device .
u-boot input below:
>EMMC Open 1
EMMC OPEN success.!!
                        !!! Notice!!!
! You must close EMMC boot Partition after all image writing!
!EMMC boot partition have continuity at image writing time.!
! So, does not close boot partition, before, all images is written.!
The above hint eMMC open success, note that, eMMC once open, need to burn continuously, burn can close emmc after completion.

10 Next we're going to run DNW
U-boot Enter below:
>DNW
OTG Cable connected!
Now , waiting-DNW to transmit data
Prompt for data input, here is waiting for us to transfer data from the PC side via DNW.

at this point in the PC Terminal serial port, CD to U-boot directory where the path
[email protected]~/u-boot/:
input: Dwn sd_fuse/tiny4412/e4412_n.bl1.bin

at this time the U-boot interrupt will prompt the delivery of the verification completed, at this time, the Bl1.bin via USB to the Memeory 0xc0000000 start address, size 8KB.
Next we burn bl1.bin to eMMC, U-boot continue to enter:
>MMC Write 1 0xc0000000 0 0x10
will be prompted to write a message stating that the write was successful. This is to download the Bl1.bin firmware downloaded from the PC side via DNW to eMMC, starting with 0, 16 blocks, a block is 512B, 16*512=8*1024=8kb. This is the storage location of the Bl1.bin.

and so on, burn Bl2.bin. U-boot.bin, Tzsw.bin
----------------------------------------------------------------------------------------------------------- ------------------------------------------
U-boot Terminal continues to enter:
>DNW
PC-Side input: (Note the input is beginning with DNW, the current path is the front, easy to understand)
[email protected]~/u-boot/: dwn sd_fuse/tiny4412/bl2.bin
continue typing under u-boot:
>mmc Write 1 0xc0000000 0x10 0x1C
the actual size of the Bl2.bin is about 14K, and the allocated space is 16K. Actually, the 16th block starts, writes 28 blocks, 28*512b=14*1024=14k
Note that this area pre-allocation is 32 blocks, so the next start is 32+16=48
----------------------------------------------------------------------------------------------------------- -------------------------------------------
U-boot Terminal continues to enter:
>DNW
PC-Side input: (Note the input is beginning with DNW, the current path is the front, easy to understand)
[email protected]~/u-boot/: dwn u-boot.bin
continue typing under u-boot:
>mmc Write 1 0xc0000000 0x30 0x21d
u-boot.bin Actual size is about 270K, the allocated space is 328K. It's actually the 48th block. Start, write 541 blocks, 541*512b=270.5*1024 approx. 270K
----------------------------------------------------------------------------------------------------------- -------------------------------------------
U-boot Terminal continues to enter:
>DNW
PC-Side input: (Note the input is beginning with DNW, the current path is the front, easy to understand)
[email protected]~/u-boot/: dwn sd_fuse/tiny4412/e4412_tzsw.bin
continue typing under u-boot:
>mmc Write 1 0xc0000000 0x2c0 0xb8
the actual size of the Tzsw.bin is about 92K, and the allocated space is 160K. Actually, the NO. 704 block starts, writes 184 blocks, 184*512=92*1024=92k
----------------------------------------------------------------------------------------------------------- -------------------------------------------
boot partition to this all write completion, note Be sure to turn off eMMC,
continue typing under u-boot:
>EMMC Close 1
EMMC CLOSE success.!!
turn off the EMMC device and prompt to close successfully. At this point we have all the boot files burned into the eMMC.
----------------------------------------------------------------------------------------------------------- --------------------------------------------

Next we can toggle the SW2 of the Development Board to NAND start, while u-boot interrupt input reset and press any key on the computer keyboard, we can see:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
u-boot 2010.12-00000-g3e284d5-dirty (Jul 2014-17:40:58) for TINY4412


cpu:s5pc220 [Samsung SOC on SMP Platform Base on ARM CortexA9]
APLL = 1400MHz, MPLL = 800MHz

board:tiny4412
dram:1023 MiB

vdd_arm:1.2
vdd_int:1.0
vdd_mif:1.1

BL1 version:n/a (TrustZone Enabled BSP)


Checking Boot Mode ... EMMC4.41
revision:1.1
MMC Device 0:3728 MB
MMC Device 1:1876 MB
MMC Device 2:n/a
Read ... Bootmode Reg 0x00000000
Get bootmode reg 0XF3CA4C36
modekey Check ... run normal_boot
Net:no Ethernet found.
Hit any key to stop autoboot:0
TINY4412 #
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Yes, our u-boot has been successfully written to the eMMC and can be started successfully.

Another very important thing we have to do is to start the parameter write, we bootargs write to the Env partition, notice that the Env partition is behind the TZSW partition, before the kernel partition. That is TZSW | ENV | KERNEL
after starting u-boot from eMMC, enter in the U-boot terminal:
>setenv Bootargs console=ttysac0,115200n8 androidboot.console=ttysac0 uhost0=n ctp=2 skipcali=y vmalloc=512m LCD=S70
>saveenv
set and save the startup parameters, then restart the board, enter the U-boot.
u-boot input below:
>printenv
See if the startup parameters you just burned are successful.

11 Burn Write kernel, system, RAMDisk
below burn kernel, system,ramdisk and SD card burn the same.
u-boot Continue typing
>fastboot
Enter FastBoot mode

PC-side use FastBoot flash kernel zimag, FastBoot flash system system.img, FastBoot Flash ramdisk ramdisk-u.img to burn all the remaining img Into the eMMC. Restart the Development Board to launch the Development Board.

Although there is no open source of superboot, but still can not stop us an open-source heart.

and I have succeeded in u-boot to join the key to start the U-boot fastboot function, this paste together issued ...

using the K1 button on the board backplane, press and hold K1 to enter the FastBoot mode of the system. The FastBoot reboot bootloader Restart mode is also supported after FastBoot download is complete.

functionality has been fully validated.

to this position, the process of u-boot burning eMMC has been explained, hope to bring help to everyone, to the friendly open source U-boot building blocks.

Thanks
Harry

Http://pan.baidu.com/s/1o6wUHNc

Share Tiny4412,emmc burn u-boot, support fastboot mode burn write eMMC

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.