U-boot transplantation based on tiny4412 (I.)

Source: Internet
Author: User
Tags spl

Author information

Pengdonglin

Email:[email protected]

qq:405728433

Platform Introduction

Development environment: Win7 64-bit + VMWARE11 + Ubuntu14.04 64-bit

Development Board: TINY4412ADK + S700 + 4GB EMMC + 1G DDR3

Toolchain: arm-linux-provided by friendly arm (GCC version 4.5.1)

Version of U-boot to migrate: u-boot-2015-10

Reference U-boot version: The u-boot-2010-12 of the friendly arm

Summary

This blog post briefly analyzes the porting u-boot-2015-12 to tiny4412, using the method of starting SPL, which can now be done by entering the U-boot command terminal, such as:

And only support from the SD card boot, will gradually improve.

Transplantation

To transplant U-boot to tiny4412, first we need to have a clear understanding of the way the board is started and the allocation of address space . In addition, since the beginning only need to enter the U-boot command line (such as), which involves at least the system clock initialization , memory initialization and serial port initialization , to achieve these three points, for the future of the various work paved the way.

Here are some references:

    1. Technical Tribe (this site provides a detailed explanation of the startup, clock, serial, and memory initialization of tiny4412)
    2. Embedded Linux System Development Complete manual _ based on 4412_. PDF (This document is written by Vedon and speaks very well)
    3. Android_exynos4412_irom_secure_booting_guide_ver.1.00.00.pdf (This document is in Samsung and details the start-up of this SOC)
    4. Sec_exynos4412_users Manual_ver.1.00.00.pdf (This document is also Samsung's, is the exynos4412 user's manual, has more than 2,800 pages, including exynos4412 details)

I'll explain briefly below.

    • EXYNOS4412 's address space

What we need to focus on is the top three.

Irom: This address space corresponds to exynos4412 internal curing a program, exynos4412 start the first instruction is stored here.

IRAM: This address space corresponds to a memory inside the exynos4412, this memory is characterized by power-on can be used without initialization.

DMC0: This address space is the DDR3 corresponding storage space on the core board (my tiny4412 has a 1GB DDR3, so the address space is 0x40000000-0x80000000), after power on the need to initialize the DRAM controller to use.

    • exynos4412 Start-up

There are several pictures:

Figure A

In Figure one, Irom runs first, then determines from which storage device the BL1 to Iram based on the value of the OM, and BL1 then determines from which storage device the OS is loaded into DRAM from the value of the OM. Note: As an example of tiny4412 starting from SDcard, Irom is cured inside the SOC and BL1 is a mirrored file provided by Samsung E4412_ N.bl1.bin,os here can be thought of as BL2, which is part of U-boot code in which the generated spl,bl2 is run by BL1 loaded into Iram. Finally, BL2 copies the U-boot code from SDcard to DRAM, based on the OM value.

Figure II

In figure II, the operating address space for the Irom, BL1, and BL2 is shown, and the Iram address space is 0x02020000-0x02060000. Since Irom is a read-only memory, the 5KB address space of the Iram 0x02020000-0x02021400 is allocated to the Irom, which is used to store the Irom global variables (ZI/RW, which hold the global uninitialized variable, the global initialized variable), Local variables (stacks), and so on. The 8KB address space from 0x02021400-0x02023400 belongs to BL1, and it can be assumed that the first instruction of BL1 is stored in the 0X02021400 address unit. Immediately after the 0x02023400-0x02027400 16KB address space belongs to BL2, namely: BL2 the first instruction to store the address is 0x02023400, this value is very important, if we have "non-position independent code" in SPL, Then you have to load SPL to its run address, otherwise there will be errors when executing those non-positional extraneous codes, we know that the SPL program is run by BL1 loading to the 0x02023400 address of Iram, but BL1 is provided by Samsung and has no source code, There is only a binary image, so when SPL has "non-positional independent code", the link address of SPL must be set to 0x02023400.

Might

Figure III is the layout of the program in SDcard when it is started from SDcard. Where the sdcard sector size is 512B. The No. 0 sector is the reserved sector and the 1th to the 16th sector has a total of 8KB of space to store BL1 (i.e.: e4412_ N.bl1.bin), the 16KB space from the 17th to the 48th sector is used to store BL2 (that is, U-boot-spl-dtb.bin), after which the sectors can be arranged according to the actual requirements.

For the initialization of clocks, DRAM, and serial ports, refer to the resources listed above.

With the basics above, start porting below.

U-boot transplantation based on tiny4412 (I.)

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.