I.MX6Q (TQIMX6Q/TQE9) study notes--the u-boot transplant of the new BSP

Source: Internet
Author: User

Some time ago began to learn i.mx6q, but recently work is really busy, interrupted some time. To improve migration efficiency, consider porting the 3.10 version of the kernel that Freescale maintains.

Source Access

Freescale maintained 3.10 of the kernel is managed using GIT, but the direct use of git to download the code will be slower, the following is my download good uboot and kernel:

I.mx6q BSP Source code (Freescale official maintenance)

After the code is downloaded, unzip the u-boot to the working directory and then switch to the Uboot root directory under the terminal. Since this version of BSP is managed using GIT, it is necessary to switch to the specified branch. Execution Instructions:

Git branch-a
You can view the various branches of the Uboot maintained by Freescale, and our checkout branch is "Remotes/origin/imx_v2013.04_3.10.17_1.0.0_ga", executing the instructions:

git checkout-b tqimx6q imx_v2013.04_3.10.17_1.0.0_ga
In this way, the branch tqimx6q is created locally and the Code on the remote branch Imx_v2013.04_3.10.17_1.0.0_ga checkout to the local branch. Our subsequent changes can be made in the Tqimx6q branch.

U-boot Transplant

The new u-boot transplant is not troublesome, mainly Freescale gives a detailed official manual "I. mx 6 BSP Porting Guide", the specific porting steps are as follows:

Step1. Create the Board directory. Since many of Imx6q's code is common, as in the previous porting, you can refer to the MX6QSABRESD and execute the instructions:

CP Board/freescale/mx6qsabresd/board/freescale/mx6q_tqimx6q-r

Step2. To modify the name of the board related file:

CP BOARD/FREESCALE/MX6Q_TQIMX6Q/MX6QSABRESD.C BOARD/FREESCALE/MX6Q_TQIMX6Q/MX6Q_TQIMX6Q.C
Step3. Modify the file name in the makefile. Open Board/freescale/makefile, and replace mx6qsabresd with MX6Q_TQIMX6Q.C.

Step4. Create a board configuration file. Also refer to MX6QSABRESD, execute the following command:
CP Include/configs/mx6qsabresd.h Include/configs/mx6q_tqimx6q.h
Step5. Add compilation options. Open the file boards.cfg, locate the configuration item "MX6QSABRESD" (if not changed, on line 277), copy the line configuration and add it below, and then modify it to the following:

MX6Q_TQIMX6Q arm armv7 mx6q_tqimx6q Freescale mx6 Mx6qsabresd:imx_co Nfig=board/freescale/mx6q_tqimx6q/mx6q_tqimx6q_ddr.cfg,mx6q,default_fdt_file= "Imx6q-tqimx6q.dtb", DDR_MB=1024, Sys_use_spinor

Step6. Custom DDR configuration. In fact, DDR-related parameters are already available in previous porting articles.

CP Board/freescale/imx/ddr/mx6q_4x_mt41j128.cfg Board/freescale/mx6q_tqimx6q/mx6q_tqimx6q_ddr.cfg

Then modify the file Mx6q_tqimx6q_ddr.cfg, the modified file content is as follows:

DATA 4, 0x020e0798, 0x000c0000data 4, 0x020e0758, 0x00000000data 4, 0x020e0588, 0x00000030data 4, 0x020e0594, 0x00000030DA  TA 4, 0x020e056c, 0x00000030data 4, 0x020e0578, 0x00000030data 4, 0x020e074c, 0x00000030data 4, 0x020e057c, 0x00000030DATA 4, 0x020e058c, 0x00000000data 4, 0x020e059c, 0x00000030data 4, 0x020e05a0, 0x00000030data 4, 0x020e078c, 0x00000030DATA 4 , 0x020e0750, 0x00020000data 4, 0x020e05a8, 0x00000018data 4, 0x020e05b0, 0x00000018data 4, 0x020e0524, 0x00000018DATA 4, 0X020E051C, 0x00000018data 4, 0x020e0518, 0x00000018data 4, 0x020e050c, 0x00000018data 4, 0x020e05b8, 0x00000018DATA 4, 0x 020E05C0, 0x00000018data 4, 0x020e0774, 0x00020000data 4, 0x020e0784, 0x00000018data 4, 0x020e0788, 0x00000018DATA 4, 0x02 0e0794, 0x00000018data 4, 0x020e079c, 0x00000018data 4, 0X020E07A0, 0x00000018data 4, 0X020E07A4, 0x00000018data 4, 0x020e 07a8, 0x00000018data 4, 0x020e0748, 0x00000018data 4, 0X020E05AC, 0x00000018data 4, 0X020E05B4, 0x00000018DATA 4, 0x020e05 0x00000018data, 4, 0x020e0520, 0x00000018data 4, 0x020e0514, 0x00000018data 4, 0x020e0510, 0x00000018data 4, 0X020E05BC, 0x00000018data 4, 0x02 0E05C4, 0x00000018data 4, 0x021b0800, 0xa1390003data 4, 0x021b080c, 0x001f001fdata 4, 0x021b0810, 0x001F001FDATA 4, 0x021b 480C, 0x001f001fdata 4, 0x021b4810, 0x001f001fdata 4, 0x021b083c, 0x43270338data 4, 0x021b0840, 0x03200314data 4, 0X021B48 3c, 0x431a032fdata 4, 0x021b4840, 0x03200263data 4, 0x021b0848, 0x4b434748data 4, 0x021b4848, 0x4445404cdata 4, 0x021b0850 , 0x38444542data 4, 0x021b4850, 0x4935493adata 4, 0x021b081c, 0x33333333data 4, 0x021b0820, 0x33333333data 4, 0x021b0824, 0x33333333data 4, 0x021b0828, 0x33333333data 4, 0x021b481c, 0x33333333data 4, 0x021b4820, 0x33333333data 4, 0x021b4824, 0x 33333333DATA 4, 0x021b4828, 0x33333333data 4, 0x021b08b8, 0x00000800data 4, 0x021b48b8, 0x00000800data 4, 0x021b0004, 0x00 020036DATA 4, 0x021b0008, 0x09444040data 4, 0x021b000c, 0x8a8f7955data 4, 0x021b0010, 0xff328f64data 4, 0x021b0014, 0x01FF 00DBDATA 4, 0x021b0018,0x00001740data 4, 0x021b001c, 0x00008000data 4, 0x021b002c, 0x000026d2data 4, 0x021b0030, 0x008f1023data 4, 0x021b0040, 0x 00000047DATA 4, 0x021b0000, 0x841a0000data 4, 0x021b001c, 0x04088032data 4, 0x021b001c, 0x00008033data 4, 0x021b001c, 0x00 048031DATA 4, 0x021b001c, 0x09408030data 4, 0x021b001c, 0x04008040data 4, 0x021b0020, 0x00005800data 4, 0x021b0818, 0x0001 1117DATA 4, 0x021b4818, 0x00011117data 4, 0x021b0004, 0x00025576data 4, 0x021b0404, 0x00011006data 4, 0x021b001c, 0x000000 00/* set the default clock gate to save power */data 4, 0x020c4068, 0x00c03f3fdata 4, 0x020c406c, 0x0030fc03data 4, 0x020c 4070, 0x0fffc000data 4, 0x020c4074, 0x3ff00000data 4, 0x020c4078, 0x00fff300data 4, 0x020c407c, 0x0F0000F3DATA 4, 0X020C40 0x000003ff/* enable AXI cache for Vdoa/vpu/ipu */data 4, 0x020e0010, 0xf00000cf/* set IPU axi-id0 qos=0xf (bypass) axi- ID1 qos=0x7 */data 4, 0x020e0018, 0x007f007fdata 4, 0x020e001c, 0x007f007f

Step7. Custom board terminals. In fact, the impact of the terminal in the old version of the uboot has been known, so it is relatively easy to modify.

(1) Modify the serial terminal. Details of the changes are as follows:

iomux_v3_cfg_t Const uart1_pads[] = {        //Mx6_pad_csi0_dat10__uart1_txd | Mux_pad_ctrl (Uart_pad_ctrl),        mx6_pad_sd3_dat7__uart1_txd | Mux_pad_ctrl (Uart_pad_ctrl),        //Mx6_pad_csi0_dat11__uart1_rxd | Mux_pad_ctrl (Uart_pad_ctrl),        mx6_pad_sd3_dat6__uart1_rxd | Mux_pad_ctrl (Uart_pad_ctrl),};
(2) Modify the SD card terminal. The specific changes are as follows:
iomux_v3_cfg_t Const usdhc2_pads[] = {MX6_PAD_SD2_CLK__USDHC2_CLK | Mux_pad_ctrl (Usdhc_pad_ctrl), Mx6_pad_sd2_cmd__usdhc2_cmd | Mux_pad_ctrl (Usdhc_pad_ctrl), Mx6_pad_sd2_dat0__usdhc2_dat0 | Mux_pad_ctrl (Usdhc_pad_ctrl), MX6_PAD_SD2_DAT1__USDHC2_DAT1 | Mux_pad_ctrl (Usdhc_pad_ctrl), MX6_PAD_SD2_DAT2__USDHC2_DAT2 | Mux_pad_ctrl (Usdhc_pad_ctrl), MX6_PAD_SD2_DAT3__USDHC2_DAT3 | Mux_pad_ctrl (Usdhc_pad_ctrl),//MX6_PAD_NANDF_D4__USDHC2_DAT4 | Mux_pad_ctrl (Usdhc_pad_ctrl),//MX6_PAD_NANDF_D5__USDHC2_DAT5 | Mux_pad_ctrl (Usdhc_pad_ctrl),//Mx6_pad_nandf_d6__usdhc2_dat6 | Mux_pad_ctrl (Usdhc_pad_ctrl),//MX6_PAD_NANDF_D7__USDHC2_DAT7 | Mux_pad_ctrl (Usdhc_pad_ctrl),//Mx6_pad_nandf_d2__gpio_2_2 | Mux_pad_ctrl (No_pad_ctrl),/* CD */};iomux_v3_cfg_t const usdhc3_pads[] = {MX6_PAD_SD3_CLK__USDHC3_CLK | Mux_pad_ctrl (Usdhc_pad_ctrl), mx6_pad_sd3_cmd__usdhc3_cmD | Mux_pad_ctrl (Usdhc_pad_ctrl), Mx6_pad_sd3_dat0__usdhc3_dat0 | Mux_pad_ctrl (Usdhc_pad_ctrl), MX6_PAD_SD3_DAT1__USDHC3_DAT1 | Mux_pad_ctrl (Usdhc_pad_ctrl), MX6_PAD_SD3_DAT2__USDHC3_DAT2 | Mux_pad_ctrl (Usdhc_pad_ctrl), MX6_PAD_SD3_DAT3__USDHC3_DAT3 | Mux_pad_ctrl (Usdhc_pad_ctrl), MX6_PAD_SD3_DAT4__USDHC3_DAT4 | Mux_pad_ctrl (Usdhc_pad_ctrl), MX6_PAD_SD3_DAT5__USDHC3_DAT5 | Mux_pad_ctrl (Usdhc_pad_ctrl),//Mx6_pad_sd3_dat6__usdhc3_dat6 | Mux_pad_ctrl (Usdhc_pad_ctrl),//MX6_PAD_SD3_DAT7__USDHC3_DAT7 | Mux_pad_ctrl (Usdhc_pad_ctrl), MX6_PAD_NANDF_D0__GPIO_2_0 | Mux_pad_ctrl (No_pad_ctrl),/* CD */};

Step8. Compile the uboot. Execute the following command:

Export Arch=armexport Cross_compile=arm-linux-gnueabi-make mx6q_tqimx6q

Among them, Cross_compile is the prefix of the cross-compiling tool chain, which is modified according to its own situation. If the previous steps are correct, the Uboot can be successfully compiled.

Burn Write Start

After the previous porting work, the Uboot has been able to run properly on the Tqimx6q Development Board. This version of the Uboot is different from the previous version of the Uboot compiled by the target file, the specific burn-write instructions are as follows:

sudo dd if=u-boot.imx of=/dev/sdb bs=512 seek=2
Start log as follows:
U-boot 2013.04-04987-g98fdbdc-dirty (May 2015-23:15:34) CPUs:   Freescale i.mx6q rev1.2 at 792 mhzcpu:   Temperatu Re-C, calibration data:0x54e4bb69reset cause:porboard:mx6q/sdl-sabresdi2c:   readydram:  1 gibmmc:   FSL_  sdhc:0, Fsl_sdhc:1, Fsl_sdhc:2mmc:no card presentmmc init failedusing default Environmentno panel Detected:default to HANNSTAR-XGADISPLAY:HANNSTAR-XGA (1024x768) in:    serialout:   serialerr:   serialmmc:no card presentmmc0 ( Part 0) was current DeviceNet:   Phy not foundphy reset timed outfec [prime]warning:failed to set MAC addressnormal Boot Hit any key to stop autoboot:  
Summary
After the migration described above, the U-boot is ready to start. In fact, this version of the Uboot transplant with the previous version of the uboot transplant is not much different, the idea is similar. Have any questions to leave a message.





This article link: http://blog.csdn.net/girlkoo/article/details/45420977

This article Girlkoo

I.MX6Q (TQIMX6Q/TQE9) study notes--the u-boot transplant of the new BSP

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.