内容发布更新时间 : 2024/11/5 12:54:40星期一 下面是文章的全部内容请认真阅读。
T
Freescale Semiconductor, Inc
I.MX Linux BSP Uboot Customization
ABSTRACT:
1) This document is a readme for uboot customization
KEYWORDS: IMX UBOOT APPROVED:
AUTHOR COMMENTS John li(r64710)
John li(r64710)
V0.1
Create the document 2009/07/14 V0.2
Change to i.MX6Q/D 2012/06/12
T
Freescale Semiconductor, Inc
1 Introduction
This document is an instruction on how to custom the Uboot in the i.MX linux BSP. The uboot version we used is u-boot-2009.08(You can get the uboot version from uboot-imx\\Makefile), we take i.MX6Q sabresd board as sample.
2 Go though the uboot
2.1 uboot folder structure
Uboot-imx
|->board: the supported board folder | |->freescale | | |->common | | |->mx6q_arm2 | | |->mx6q_sabreauto | | |->mx6q_sabrelite
| | |->mx6q_sabresd(All the board related codes in this folder, So it will be you “work folder”)
| | |->mx6sl_arm2
|->common:the uboot common command, such as cmd_*.c is every uboot command source codes, cmd_boot.c/cmd_bootm.c is what we concern because it is kernel boot related.
|->cpu: the supported cpu folder, | |->arm926ejs | | |->mx25 | |->arm1136 | | |->mx31 | | |->mx35
| |->arm_cortexa8 | | |->mx51
| | |->mx6(which have iomux macro source code) |->disk |->doc
|->driver: the folder to store the device driver source codes. |->fs: the supported filesystem. | |->cramfs | |->ext2 | |->fat | |->fdos | |->jffs2 | |->reiserfs | |->ubifs
T
Freescale Semiconductor, Inc
| |->yaffs2
|->include : head file public folder, | |->asm-arm
| | |->arch-mx25 | | |->arch-mx31 | | |->arch- mx51
| | |->arch-mx6: i.Mx6 iomux, pins definite.
| |->configs: mx6q_sabresd.h define the i.Mx6Q/D related resource parameters, modify the file to configure the board parameters, such as baud rate, boot, and memory map. | |->configs: mx6q_sabresd_android.h, beside the mx6q_sabresd.h, Android need more compiling macro
| |->configs: mx6q_sabresd_mfg.h, the configuration to compile the MFG firmware |->lib_arm |->lib_generic |->net |->post |->tools | |->bddb | |->easylogo | |->env | |->gdb | |->logos | |->scripts | |->updater
2.2 flash header
i.Mx6Q/D TO1.1 just can boot from internal rom code, which will copy the first flash sector in first block(if fail, will try to copy the first flash sector in second block) into the iRAM, and then, rom code will check the datum segment to run some CPU initialization, code sign, and so on. So we use the DCD segment for the DDR3/LPDDR2 initialization, and we must add a flash header before the real codes, which have the DCD segment information in it, and it will be call by rom code.
The flash header source codes is: \\board\\freescale\\mx6q_sabresd\\flash_header.S, and it will be link firstly in the uboot image, the link file is \\board\\freescale\\ mx6q_sabresd \%u-boot.lds.
The flash_header.s is a assemble codes under the folder “\\board\\freescale\\
mx6q_sabresd”, and it will allocate the memory, and initial its content, which will be used for rom code to initial the DDR3.
//a micro to allocate the memory and initial it.
#define CPU_2_BE_32(l) \\
((((l) & 0x000000FF) << 24) | \\ (((l) & 0x0000FF00) << 8) | \\ (((l) & 0x00FF0000) >> 8) | \\