imx6q BSP移植详细学习笔记
基于IMX6Q+TSI721的RapidIO硬件设计与实现
基于IMX6Q+TSI721的RapidIO硬件设计与实现作者:***来源:《计算机与网络》2021年第13期为了使ARM架构的CPU能通过PCIE总线连接到RapidIO系统中,利用NXP公司的IMX6Q处理器PCIE接口和RapidIO桥芯片Tsi721的硬件特性,在Linux操作系统下开发该芯片的驱动程序,实现了PCIE总线网络和RapidIO总线网络的无缝对接。
通过实际测试,验证了工作的正确性。
RapidIO总线是当前广泛应用的一种嵌入式系统内部互联架构,具有高带宽、低延迟,支持多处理器等特征,比千兆以太网提供更高的传输速率,比PCIE更适合组建平行通信网络。
本设计采用了FREESCALE公司的i.MX6Q芯片作为核心CPU,它是基于ARMCortex-A9架构,40nm工艺制程,最高运行频率可达1.2GHz,具备PCIE2.0接口,可以进行功能扩展,凭借IMX6Q的此功能,选择美国IDT公司生产的PCIE转RapidIO桥接芯片Tsi721与之无缝对接,来实现RapidIO总线功能。
为将SerialRapidIO总线更好地应用到ARM处理器系统中,本文提出了一种基于IMX6Q+TSI721的解决方案。
RapidIO协议架构RapidIO是一个开放的标准,宗旨是为嵌入式系统开发可靠的、高性能、基于包交换的互连技术。
主要用于系统内部互连,支持芯片到芯片、板到板间的通信。
为了满足灵活性和可扩展性的要求,RapidIO分为3个层次:逻辑层、传输层及物理层。
如图1所示。
CPU硬件设计ARM嵌入式Rapidio通信平台硬件由IMX6Q+TSI721芯片组成,IMX6Q集成1路PCIE 接口,外接TSI721桥接芯片,扩展Rapidio总线接口,外接DDR3存储器。
其中FLASH用于存储Bootloader、操作系统内核、文件系统,在IMX6Q内运行Linux操作系统,Linux操作系统集成协议栈,通过BSP与硬件进行通信,图2是硬件平台架构示意图。
IMX6开发板使用教程资料
D-CHIP i.MX6 开发板安装Android系统方法详细教程一、烧写系统●将i.MX6开发板通讯OTG与电脑的USB口连接;开发板OTG与电脑主机的USB口连接●将核心板上的2PIN拨码开关调为1:OFF,2:OFF。
核心板的2PIN拨码开关设置为全部关闭●在鼎芯科技下载的Android包对应的系统版本中运行相应的MfgTool2对系统进行系统烧写。
运行MfgTool2.exe程序未给i.MX6开发板通电时,软件为识别到设备的接入,显示为No Device Connected.给i.MX6开发板通电后,软件将会识别到设备的接入,并提示HID-compliant device.点击“Start”按钮,执行系统的烧写在软件对开发板烧写过程中,由于数据复制到eMMC存储芯片过程,系统将提示磁盘格式化提示,直接“取消”或者不予理会。
一直等到完成烧写并提示“Done”后,点击“Stop”退出软件,至此,系统已经烧写成功。
●完成烧写工作后,断开电源,并将核心板的2PIN拨码开关恢复原来状态1:ON,2:OFF将核心板的2PIN拨码开关设置为1:ON ;2:OFF状态●接入显示设备(LVDS显示屏)7寸LVDS屏幕(本屏幕作为产品选配件,需要额外购买)通过2x15排针将显示屏接入LVDS0接口接好的开发板显示屏(有木有一种帅帅的感觉?)●将i.MX6开发板的COM口与PC机电脑通讯COM口连接,用以和putty.exe进行数据交互。
开发板COM口连接PC机通讯COM口●运行putty.exe(通过网上百度搜索下载即可),实现通讯数据交互。
运行putty.exe程序在putty.exe主界面的“会话”窗口中设置如上图,“串行口”设置为您PC机COM口的端口号,“速度”处为152000,设置好以后直接按“打开”按钮进入数据侦听界面。
给i.MX6开发板接入电源,设备启动,PuTTY显示从COM口上传的数据信息,i.MX6开发板启动进入系统。
VxWorks_BSP移植笔记
Amine思创黄金开发板S3C44B0X VxWorks BSP 移植笔记版本 1.0修改历史目录1.介绍51.1目的51.2范围51.3定义和缩写51.4参考51.5声明52.开发环境描述52.1思创黄金开发板S3C44B0X 62.2Tornado 2.2 62.3ARM SDT v2.51 62.4Flash Programmer 63.设计目标74.关键主题74.1异常处理74.1.1问题分析74.1.2解决方法1(eking) 94.1.3解决方法2(d3000) 104.1.4解决方法3 114.1.5其他124.2CPU寄存器124.3仿真和写Flash程序的差别124.4时钟134.5串口驱动134.5.1修改134.5.2FIFO 144.5.3连接Console和target server 144.6缓存[Cache] 154.6.1修改154.6.2测试174.7网络驱动184.7.1修改184.7.2寄存器测试194.7.3网络初始化分离194.8TFFS驱动204.8.1Socket 204.8.2MTD 204.8.3格式化204.8.4加载214.9目标机FTP服务启动214.10boot Shell命令扩展224.11简单VxWorks应用235.详细开发过程245.1建立开发环境245.2选择近似BSP模板245.3让最简bootRom运行起来255.4丰富bootRom功能296.操作说明296.1bootRom启动296.2加载VxWorks 306.2.1TFFS自动加载316.2.2TFFS手动加载316.2.3网络自动加载316.2.4网络手动加载326.3VxWorks 启动337.TIPs 358.TODOs 359.?s 3510.附件3510.1代码目录3610.2映象目录3610.3其他36S3C44B0X VxWorks BSP 移植笔记1. 介绍1.1 目的主要从几个关键主题描述S3C44B0X VxWorks BSP定制工作,对整个过程作了详细描述。
6q营销文章
I.MX6Q(SAIL-IMX6Q)学习笔记——开发板的选择其实入手这块SAIL-IMX6Q的时候已经有一块别家的imx6Q开发板了在备选方案里了,但还是选择了电鱼电子这款SAIL-IMX6Q全能板,主要原因是个人感觉这款开发板上接口更加齐全,CAN、232、485、音频、PCIE等产品开发时需要的接口都有,比另一家板子的接口资源多不少,而且这两款开发板使用的是相同的芯片(Freescale的IMX6Q),因此,学习过程中会更方便一些。
本文的主要目的是简单的介绍下这款SAIL-IMX6Q,希望有更多的朋友一块研究。
开发板简介SAIL-IMX6Q全能板是电鱼电子推出的一款基于Freescale的i.MX6Q的四核开发板,1GB/2GB/4GB DDR3内存,值得一说的是,现在4GB内存的貌似就这一家吧,我入手的是1GB的,官方售卖的时候有标出4GB,不知道他们具体是什么情况。
他们家板子有个特点,同系列的不同平台的核心板都可以用在一款底板上,官方解释说是做了接口兼容,定义了sailfish接口,我感觉这个蛮实用的,起码选平台的时候可以考虑一下,都是同一款底板,开发产品时时间成本比较低。
废话不多说,上图,下图官方手册中截出的图片:背面还有个SATA接口,太占地方,我就不截图了,这接口密密麻麻的真实不少,我问了下他们的淘宝客服,6Q的还有双网方案可以提供,感觉这个对想用6Q平台双网的人来说的蛮实用的,但是这个方案具体的信息我没问,就随口聊了下。
我以前机缘巧合用过他们家的335,那个板子还是挺不错的,我当时用的板子的底板不是现在的底板,就说现在他们家的板子底板全换成同一款了,以后8X也是这款底板,这叫啥,一块底板走天下,哈哈!说了这么多,又歪楼了,接下来说说他们家给的资料,毕竟对做开发来说,厂家给的资料的多少和详细程度还是很重要的。
配套资料整体来说,资料还算齐全,但是怎么说呢,感觉他们的Linux资料比Android资料多,Android资料比较少。
i.MX_6Dual6Quad_BSP_Porting_Guide
i.MX 6Dual/6Quad BSP Porting GuideDocument Number: IMX6DQBSPPGRev L3.0.35_4.1.0, 09/2013ContentsSection number Title PageChapter 1Porting U-Boot from an i.MX 6Dual/6Quad Reference Board to an i.MX 6Dual/6Quad Custom Board1.1U-Boot Overview (7)1.2Obtaining the Source Code for the U-Boot (7)1.2.1Preparing the Code (7)1.3Customizing the i.MX 6 Custom Board Code (9)1.3.1Changing the DCD Table for i.MX 6 DDR3 Initialization (10)1.3.2Booting with the Modified U-Boot (10)1.3.3Add New Driver Initialize Code to Board Files (11)1.3.4Further Customization at System Boot (12)1.3.5Customizing the Printed Board Name (12)1.4How to Debug (13)1.4.1Use RealView ICE for Debugging (13)1.4.2Use printf for debugging (13)Chapter 2Configuring the IOMUX Controller2.1IOMUX Overview (15)2.2Information for Setting IOMUX Controller Registers (15)2.3Setting Up the IOMUX Controller and U-Boot (16)2.3.1Defining the Pads (16)2.3.2Configuring IOMUX Pins for Initialization Function (17)2.3.3Example-Setting a GPIO (17)2.4Setting Up the IOMUX Controller in Linux (18)2.4.1IOMUX Configuration Definition (18)2.4.2Machine Layer File (19)2.4.3Example -Setting a GPIO (20)Chapter 3Registering a New UART Driver3.1UART Overview (21)3.1.1Configuring UART Pads on IOMUX (21)3.1.2Enabling UART on Kernel Menuconfig (22)3.1.3Testing the UART (22)3.1.4File Names and Locations (22)Chapter 4Adding Support for SDHC4.1SDHC Overview (25)Chapter 5Configuring the SPI NOR Flash Memory Technology Device (MTD) Driver5.1SPI NOR Overview (27)5.2Source code structure (27)5.2.1Configuration options (27)5.2.2Selecting SPI NOR on the Linux image (28)5.3Changing the SPI interface configuration (29)5.3.1Changing the ECSPI Interface (29)5.3.2Changing the Chip Select (29)5.3.3Changing the external signals (29)5.4Hardware Operation (29)5.4.1Software Operation (30)Chapter 6Connecting an LVDS Panel to an i.MX 6 Reference Board6.1LVDS Overview (33)6.1.1Connecting an LVDS Panel to the i.MX 6 Reference Board (33)6.2Enabling a LVDS Channel (34)6.2.1Locating Menu Configuration Options (34)6.3LDB Ports (35)6.3.1Input Parallel Display Ports (36)6.3.2Output LVDS Ports (36)6.4Further Reading (36)Chapter 7Supporting the i.MX 6 Camera Sensor Interface CSI07.1CSI Overview (39)7.1.1Required Software (39)7.1.2i.MX 6 CSI Interfaces Layout (40)7.1.3Configuring the CSI Unit in Test Mode (40)7.2Adding Support for a New CMOS Camera Sensor (41)7.2.1Adding a Camera Sensor Entry on the ltib Catalog (Kconfig) (41)7.2.2Creating the Camera Sensor File (42)7.2.3Adding a Compilation Flag for the New Camera (44)7.3Using the I2C Interface (45)7.3.1Loading and Testing the Camera Module (47)7.4Additional Reference Information (48)7.4.1CMOS Interfaces Supported by the i.MX 6Solo/6DualLite (48)7.4.2i.MX 6 CSI Parallel Interface (50)7.4.3Timing Data Mode Protocols (51)Chapter 8Porting Audio Codecs to a Custom Board8.1Audio Overview (53)8.1.1Common Porting Task (53)8.1.2Porting the Reference BSP to a Custom Board (audio codec is the same as in the reference design) (54)8.1.3Porting the Reference BSP to a Custom Board (audio codec is different than the reference design) (54)Chapter 9Porting the Fast Ethernet Controller Driver9.1FEC Overview (57)9.1.1Pin Configuration (57)9.1.2Source Code (58)9.1.3Ethernet Configuration (59)Chapter 10Porting USB Host1 and USB OTG10.1USB Overview (61)Chapter 1Porting U-Boot from an i.MX 6Dual/6Quad Reference Board to an i.MX 6Dual/6Quad Custom Board1.1U-Boot OverviewThis chapter provides a step-by-step guide that explains how to add i.MX 6 custom board support for U-Boot.This developer's guide is based on U-Boot v2009.08 plus LTIB-based package for the i.MX patches. Please refer to the release notes.1.2Obtaining the Source Code for the U-BootThe following steps explain how to obtain the source code.1.Install LTIB as usual. Make sure you deselect U-Boot from compilation.2.Manually unpack U-Boot: ./ltib -m prep -p u-bootThe U-Boot code is now located at rpm/BUILD/u-boot-<version number>. The guide will now refer to the U-Boot main directory as <UBOOT_DIR> and assumes that your shell working directory is <UBOOT_DIR>.1.2.1Preparing the CodeThe following steps explain how to prepare the code.1.Make a copy of the board directory, as shown below:$cp -R board/freescale/mx6_<reference board name> board/freescale/mx6_<custom board name>2.Copy the existing mx6_<reference board name>.h board configuration file asmx6_<custom board name>.h, as shown below:$cp include/configs/mx6_<reference board name>.h include/configs/mx6_<custom board name>.hNOTEYou should pay attention to the following configurationswhen using a new board.•CONFIG_LOADADDR: Normally your uImage will beloaded to this address for boot.•CONFIG_SYS_MALLOC_LEN: Heap memory size.•CONFIG_STACKSIZE: Stack size.•CONFIG_NR_DRAM_BANKS: Number of ddr banks.•PHYS_SDRAM_x, PHYS_SDRAM_x_SIZE: DDR bankx start address and size (where x denotes an indexbetween 0 and CONFIG_NR_DRAM_BANKS-1,inclusive).•CONFIG_NR_DRAM_BANKS, PHYS_SDRAM_x andPHYS_SDRAM_x_SIZE will be passed to kernel. Ifthese configs are wrong, kernel might fail to boot.•Config file is important for U-Boot. Most times itdecides size, functionality, and performance of u-boot.bin.3.Create one entry in <UBOOT_DIR>/Makefile for the new i.MX 6Dual/6Quad-basedconfiguration. This file is in alphabetical order. The instruction for use is as follows:mx6_<custom board name>_config : unconfig@$(MKCONFIG) $(@:_config=) arm arm_cortexa8 mx6_<custom board name> freescale mx6NOTEU-Boot project developers recommend adding any newboard to the MAKEALL script and to run this script inorder to validate that the new code has not broken any otherplatform build. This is a requirement if you plan to submit apatch back to the U-Boot community. For furtherinformation, consult the U-Boot README file.4.Renameboard/freescale/mx6_<reference board name>/mx6_<reference board name>.casboard/freescale/mx6_<custom board name>/mx6_<custom board name>.c.5.Adapt any fixed paths. In this case, the linker script board/freescale/mx6_<customboard name>/u-boot.lds has at least two paths that must be changed•Changeboard/freescale/mx6_<reference board name>/flash_header.otoboard/freescale/mx6_<custom board name>/flash_header.o•Changeboard/freescale/mx6_<reference board name>/libmx6_<reference board name>.atoboard/freescale/mx6_<custom board name>/libmx6_<custom board name>.a6.Change the lineCOBJS := mx6_<reference board name>.o (inside board/freescale/mx6_<custom boardname>/Makefile)toCOBJS := mx6_<custom board name>.oNOTEThe remaining instructions build the U-Boot manually anddo not use LTIB.7.Create a shell script under <UBOOT_DIR> named build_u-boot.sh.The file contents are now:#!/bin/bashexport ARCH=armexport CROSS_COMPILE=<path to cross compiler prefix> (e.g.PATH:/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-)make distclean;make mx6_<custom board name>_configmakepile U-Boot using $./build_u-boot.sh9.If everything is correct, you should now have u-boot.bin as proof that your buildsetup is correct and ready to be customized.The new i.MX 6 custom board that you have created is an exact copy of the i.MX 6reference board, but the boards are two independent builds. This allows you to proceed tothe next step: customizing the code to suit the new hardware design.1.3Customizing the i.MX 6 Custom Board CodeThe new i.MX 6 custom board is part of the U-Boot source tree, but it is a duplicate of the i.MX 6 reference board code and needs to be customized.The DDR technology is a potential key difference between the two boards.If there is a difference in the DDR technology between the two boards, the DDRinitialization needs to be ported. DDR initialization is coded in the DCD table, inside the boot header of the U-Boot image. When porting bootloader, kernel or driver code, you must have the schematics easily accessible for reference.1.3.1Changing the DCD Table for i.MX 6 DDR3 InitializationInitializing the memory interface requires configuring the relevant I/O pins with the right mode and impedance and initializing the MMDC module.1.To port to the custom board, the appropriate DDR initialization needs to be used.This is the same initialization as would be used in a JTAG initialization script.2.Open the fileboard/freescale/mx6_<custom board name>/flash_header.S3.Modify all MXC_DCD_ITEM macros to match the memory specifications. These code blocks will be read by ROM code to initialize your DDR memory.4.Modify dcd_hdr and write_dcd_cmd value.NOTEIf you change the number of MXC_DCD_ITEM lines in theDCD table, you must update the value of the dcd_hdr andwrite_dcd_cmd labels according to the number of items.•dcd_hdr is comprised of tag(0xD2), len and version(0x40),where len = <dcd items> * 8 + 8.e.g.len = 128, dcd_hdr = 0x400804D2 (Tag=0xD2, Len=128*8 + 4 + 4, Ver=0x40)•write_dcd_cmd is comprised of tag(0xCC), len andparam(0x04), where len = <dcd items> * 8 + 4.e.g.len = 128, write_dcd_cmd = 0x040404CC (Tag=0xCC, Len=128*8 +4, Param=0x04)1.3.2Booting with the Modified U-BootThe content below explains how to compile and write u-boot.bin to SD card.If the DCD table (board/freescale/mx6_<custom board name>/flash_header.S) was modified successfully, you can compile and write u-boot.bin to an SD card. To test this, insert the SD card into the SD card socket of the CPU board and power cycle the board.A message like this should be printed in the console:U-Boot 2009.08-00410-ga32bc11 (Dec 15 2011 - 13:19:05)CPU: Freescale i.MX 6 family 0.0V at 792 MHzmx6 pll1: 792MHzmx6 pll2: 528MHzmx6 pll3: 480MHzmx6 pll8: 50MHzipg clock : 66000000Hzipg per clock : 66000000Hzuart clock : 80000000Hzcspi clock : 60000000Hzahb clock : 132000000Hzaxi clock : 264000000Hzemi_slow clock: 29333333Hzddr clock : 528000000Hzusdhc1 clock : 200000000Hzusdhc2 clock : 200000000Hzusdhc3 clock : 200000000Hzusdhc4 clock : 200000000Hznfc clock : 24000000HzBoard: MX6-<reference board name>:[ POR ]Boot Device: SDI2C: readyDRAM: 2 GBMMC: FSL_USDHC: 0,FSL_USDHC: 1,FSL_USDHC: 2,FSL_USDHC: 3In: serialOut: serialErr: serialNet: got MAC address from IIM: 00:00:00:00:00:00FEC0 [PRIME]Hit any key to stop autoboot: 0<reference board name>: U-Boot >1.3.3Add New Driver Initialize Code to Board FilesThe following steps explain how to add new driver initialize code.1.Find mx6_<customer_board>.c in board/freescale/mx6_<customer_board>/.2.Edit mx6_<customer_board>.c and add new module driver’s initialization code,including clock, iomux, and gpio.3.Put driver init function into board_init or board_late_init.NOTE•board_init() function will be called earlier beforeUART initialization. Please do not attempt to use printfin this function, otherwise U-Boot will crash. Most ofdriver init functions are put into board_init() function.•board_late_init() function will be called fairly later.For debugging initialization code, driver init functionsmay be put in it.1.3.4Further Customization at System BootTo further customize your U-Boot board project, use the first function that system boot calls on:start_armboot in "lib_arm/board.c".board_init()All board initialization is executed inside this function. It starts by running through the init_sequence[] array of function pointers.The first board dependent function inside init_sequence[] array is board_init(). board_init() is implemented inside board/freescale/mx6_<custom board name>.c.At this point the most important tip is the following line of code:...gd->bd->bi_arch_number = MACH_TYPE_MX6_<reference board name>; /* board id for Linux */ ...To customize your board ID, go to the registration process at http:///developer/machines/This tutorial will continue to use MACH_TYPE_MX6_<reference board name>.1.3.5Customizing the Printed Board NameTo customize the printed board name, use the checkboard() function.This function is called from the init_sequence[] array implemented inside board/ freescale/mx6_<custom board name>.c. There are two ways to use checkboard() to customize the printed board name. The brute force way or by using a more flexible identification method if implemented on the custom board.To customize the brute force way, delete the call to identify_board_id( ) insidecheckboard() and replace printf("Board: "); with printf("Board: i.MX 6 on <customboard>\n");If this replacement is not made, the custom board may use another identification method. The identification can be detected and printed by implementing the function__print_board_info() according to the identification method on the custom board.1.4How to DebugNormally we have two ways for debugging:•Use Realview ICE.•Use printf.1.4.1Use RealView ICE for DebuggingNormally we use RealView ICE to debug in very early stage, e.g. before uart initialization, or when it is hard to debug with printf.1.Make sure your RealView ICE can support cortex A9. If not, you need to upgradethe firmware and your RealView software.2.Load U-Boot (which is an elf file) in root directory of U-Boot fully, or just symbol(faster) to debug step by step.NOTEWe can make optimization level 0 in rules.mk which willbe easier for debugging in RealView ICE.1.4.2Use printf for debuggingThis is the most common method we use in debugging. You can print your value in driver for debugging.NOTEIf we want to use printf in early stages, e.g. in board_init, wecan put uart initialization code earlier, e.g. to start_armboot() inboard.c of lib_arm directory.Chapter 2Configuring the IOMUX Controller2.1IOMUX OverviewBefore using the i.MX 6Dual/6Quad pins (or pads), users must select the desired function and correct values for characteristics such as voltage level, drive strength, and hysteresis. They do this by configuring a set of registers from the IOMUX controller.For detailed information about each pin, see the "External Signals and Pin Multiplexing" chapter in the i.MX 6Dual/6Quad Multimedia Applications Processor Reference Manual. For additional information about the IOMUX controller block, see the "IOMUX Controller (IOMUXC)" chapter in the i.MX 6Dual/6Quad Multimedia Applications Processor Reference Manual.2.2Information for Setting IOMUX Controller RegistersThe IOMUX controller contains four sets of registers that affect the i.MX 6Dual/6Quad registers, as follows:•General-purpose registers (IOMUXC_GPR x)-consist of registers that control PLL frequency, voltage, and other general purpose sets.•"Daisy Chain" control registers (IOMUXC_<Instance_port>_SELECT_INPUT)-control the input path to a module when more than one pad may drive the module's input•MUX control registers (changing pad modes):•Select which of the pad's 8 different functions (also called ALT modes) is used.•Can set pad's functions individually or by group using one of the followingregisters:•IOMUXC_SW_MUX_CTL_PAD_<PAD NAME>•IOMUXC_SW_MUX_CTL_GRP_<GROUP NAME>•Pad control registers (changing pad characteristics):•Set pad characteristics individually or by group using one of the followingregisters:•IOMUXC_SW_PAD_CTL_PAD_<PAD_NAME>•IOMUXC_SW_PAD_CTL_GRP_<GROUP NAME>•Pad characteristics are:•SRE (1 bit slew rate control)-Slew rate control bit; selects between FAST/SLOW slew rate output. Fast slew rate is used for high frequency designs.•DSE (2 bits drive strength control)-Drive strength control bits; select thedrive strength (low, medium, high, or max).•ODE (1 bit open drain control)-Open drain enable bit; selects open drain orCMOS output.•HYS (1 bit hysteresis control)-Selects between CMOS or Schmitt Triggerwhen pad is an input.•PUS (2 bits pull up/down configuration value)-Selects between pull up ordown and its value.•PUE (1 bit pull/keep select)-Selects between pull up or keeper. A keepercircuit help assure that a pin stays in the last logic state when the pin is nolonger being driven.•PKE (1 bit enable/disable pull up, pull down or keeper capability)-Enable ordisable pull up, pull down, or keeper.•DDR_MODE_SEL (1 bit ddr_mode control)-Needed when interfacing DDRmemories.•DDR_INPUT (1 bit ddr_input control)-Needed when interfacing DDRmemories.2.3Setting Up the IOMUX Controller and U-BootThe IOMUX controller contains four sets of registers that affect the i.MX 6Dual/6Quad registers as follows:2.3.1Defining the PadsThe iomux-mx6x.h file contains each pad's IOMUX definitions where the x denotes the SOC type. Use the following code to see the default definitions:#define MX6x_PAD_<PIN NAME>__<FUNC NAME> (_MX6x_PAD_<PIN NAME>__<FUNC NAME> |MUX_PAD_CTRL(MX6x_<PAD CTRL>))To change the values for each pad according to your hardware configuration, use the following:_MX6x_PAD_<PIN NAME>__<FUNC NAME> = IOMUX_PAD(_pad_ctrl_ofs, _mux_ctrl_ofs, _mux_mode,_sel_input_ofs, _sel_input, _pad_ctrl)Where:•_pad_ctrl_ofs - PAD Control Offset•_mux_ctrl_ofs - MUX Control Offset•_mux_mode -MUX Mode•_sel_input_ofs - Select Input Offset•_sel_input - Select Input•_pad_ctrl - PAD ControlMX6x_<PAD CTRL> = (pull_keep_en | pull_keep_sel | pull_config | speed | drive_strength | slew_rate | hyst_en | open_drain_en )2.3.2Configuring IOMUX Pins for Initialization FunctionThe board-mx6x_<reference board name>.c file contains the initialization functions for all peripherals (such as UART, I2C, and Ethernet). Configure the relevant pins for each initializing function by using the following:mxc_iomux_v3_setup_pad(iomux_v3_cfg_t pad);mxc_iomux_v3_setup_multiple_pads(iomux_v3_cfg_t *pad_list, unsigned count)Where the following applies:<pad> < is a macro composed of mux mode, pad ctrl, and input select config. See IOMUX_PAD() definition in arch/arm/plat-mxc/include/mach/iomux-v3.h;<pad_list> is an array of <pad>;<count> is the size of the array of <pad>;2.3.3Example-Setting a GPIOFor example, configure and use pin SD2_DAT1 as a general GPIO and toggle its signal.Add the following code to the file board-mx6x_<reference board name>.h, in the array of mx6x_<reference board name>_pads where x denotes the SOC type:MX6x_PAD_SD2_DAT1__GPIO1_14;Make sure that no any other SD2_DAT1 configuration exists in the array. Then, if done correctly, the pin SD2_DAT1 on the i.MX 6Dual/6Quad toggles when booting.2.4Setting Up the IOMUX Controller in LinuxThe folder linux/arch/arm/mach-<platform name> contains the specific machine layer file for your custom board.For example, the machine layer file used on the i.MX 6Dual/6Quad <reference> boards are linux/arch/arm/mach-mx6/board-mx6x_<reference board name>.c. This platform is used in the examples in this section. The machine layer files include the IOMUX configuration information for peripherals used on a specific board.To set up the IOMUX controller and configure the pads, change the two files described in table below:2.4.1IOMUX Configuration DefinitionThe iomux-mx6x.h (x denotes SOC type) file contains definitions for all i.MX 6Dual/6Quad pins. Pin names are formed according to the formula <SoC>_PAD_<Pad Name>_GPIO_<Instance name>_<Port name>. Definitions are created with the following line code:IOMUX_PAD(PAD Control Offset, MUX Control Offset, MUX Mode, Select Input Offset, Select Input, Pad Control)The variables are defined as follows:PAD Control Offset Address offset to pad control register(IOMUXC_SW_PAD_CTL_PAD_<PAD_NAME>)MUX Control Offset Address offset to MUX control register(IOMUXC_SW_MUX_CTL_PAD_<PAD NAME>)MUX Mode MUX mode data, defined on MUX control registersSelect Input Offset Address offset to MUX control register(IOMUXC_<Instance_port>_SELECT_INPUT)Select Input Select Input data, defined on select input registersPad Control Pad Control data, defined on Pad control registersDefinitions can be added or changed as shown in the following example code:#define MX6x_PAD_SD2_DAT1__USDHC2_DAT1 IOMUX_PAD (0x0360, 0x004C, 0, 0x0000, 0, 0)The variables are as follows:0x0360 - PAD Control Offset0x004C - MUX Control Offset0 - MUX Mode0x0000 - Select Input Offset0 - Select Input0 - Pad ControlFor all addresses and register values, check the IOMUX chapter in the i.MX 6Dual/6Quad Applications Processor Reference Manual .2.4.2Machine Layer FileThe board-mx6x_<reference board name>.h file contains structures for configuring the pads(x denotes the SOC type).They are declared as follows:static iomux_v3_cfg_t mx6x_<reference board name>_pads[] = {………MX6x_PAD_SD2_CLK__USDHC2_CLK,MX6x_PAD_SD2_CMD__USDHC2_CMD,MX6x_PAD_SD2_DAT0__USDHC2_DAT0,MX6x_PAD_SD2_DAT1__USDHC2_DAT1,MX6x_PAD_SD2_DAT2__USDHC2_DAT1,MX6x_PAD_SD2_DAT3__USDHC2_DAT3,………};Add the pad's definitions from iomux-mx6x.h to the above code.On init function (in this example "mx6x_<reference board name>_init" function), set up the pads using the following function:mxc_iomux_v3_setup_multiple_pads(mx6x_<reference board name>_pads, ARRAY_SIZE(mx6x_<reference board name>_pads));2.4.3Example -Setting a GPIOFor example, configure the pin PATA_DA_1 (PIN L3) as a general GPIO and toggle its signal.On Kernel menuconfig, add sysfs interface support for GPIO with the following code:Device Drivers --->[*] GPIO Support --->[*] /sys/class/gpio/... (sysfs interface)Define the pad on iomux-mx6x.h (x denotes SOC type) file as follows:#define MX6x_PAD_SD2_DAT1__GPIO_1_14 IOMUX_PAD(0x0360, 0x004C, 5, 0x0000, 0, 0)Parameters:0x0360 - PAD Control Offset0x004C - MUX Control Offset5 - MUX Mode0x0000 - Select Input Offset0 - Select Input0 - Pad ControlTo register the pad, add the previously defined pin to the pad description structure in the board-mx6x_<reference board name>.h file as shown in the following code:static iomux_v3_cfg_t mx6x_<reference board name>_pads[] = {………MX6x_PAD_NANDF_CS0__GPIO_6_11,………};Chapter 3Registering a New UART Driver3.1UART OverviewThis chapter explains how to configure the UART pads, enable the UART driver, and test that the UART was set up correctly.3.1.1Configuring UART Pads on IOMUXThe IOMUX register must be set up correctly before the UART function can be used. This section provides example code to show how to set up the IOMUX register.Pads are configured using the file linux/arch/arm/mach-mx6/<platform>.c, with<platform> replaced by the appropriate platform file name.Take the i.MX 6 x, where x denotes the SOC type, (since i.MX 6DualLite and i.MX6Dual/6Quad are pin-pin compatible, they are using the same board file) reference board as an example. The machine layer file used on the i.MX 6 x reference boards is linux/ arch/arm/mach-mx6/board-mx6x_evk.c.The iomux-mx6x.h file contains the definitions for all i.MX 6Dual/6Quad pads. Configure the UART pads as follows:/* UART4 */#define MX6x_PAD_KEY_COL0_UART4_TXD\(_MX6x_PAD_KEY_COL0__UART4_TXD | MUX_PAD_CTRL(MX6x_UART_PAD_CTRL)#define MX6x_PAD_KEY_ROW0_UART4_TXD\(_MX6x_PAD_KEY_RAW0__UART4_TXD | MUX_PAD_CTRL(MX6x_UART_PAD_CTRL)The structures for configuring the pads are contained in the mx6x_<reference board name>.h file. Update them so that they match the configured pads' definition as shown above. The code below shows the non-updated structures:static iomux_v3_cfg_t mx6x_brd_pads[] = {………MX6x_PAD_KEY_COL0_UART4_TXD,MX6x_PAD_KEY_ROW0_UART4_TXD,………};Use the following function to set up the pads on the init function mx6_evk_init() (found in the board-mx6x_evk.c file).3.1.2Enabling UART on Kernel MenuconfigEnable the UART driver on Linux menuconfig. This option is located at:-> Device Drivers-> Character devices-> Serial drivers<*> IMX serial port support[*] Console on IMX serial portAfter enabling the UART driver, build the Linux kernel and boot the board.3.1.3Testing the UARTBy default, the UART is configured as follows:•Baud Rate: 9600•Data bits: 8•Parity: None•Stop bits: 1•Flow Control: NoneIf the user employed a different UART configuration for a device that needs to connect to the processor, connection and communication will fail. There is a simple way to test whether the UART is properly configured and enabled.In Linux command line, type the following:echo "test" > /dev/ttymxc13.1.4File Names and LocationsThere are three Linux source code directories that contain relevant UART files.Table below lists the UART files that are available on the directory <linux source code directory>/drivers/tty/serial/Table below lists the UART files that are available on the directory <linux source code directory>/arch/arm/plat-mxc/include/mach/Chapter 4Adding Support for SDHC4.1SDHC OverviewuSDHC has 14 associated I/O signals.The following list describes the associated I/O signals.Signal Overview•The SD_CLK is an internally generated clock used to drive the MMC, SD, and SDIO cards.•The CMD I/O is used to send commands and receive responses to/from the card.Eight data lines (DAT7~DAT0) are used to perform data transfers between theSDHC and the card.•The SD_CD# and SD_WP are card detection and write protection signals directly routed from the socket. These two signals are active low (0). A low on SD_CD#means that a card is inserted and a high on SD_WP means that the write protectswitch is active.•SD_LCTL is an output signal used to drive an external LED to indicate that the SD interface is busy.•SD_RST_N is an output signal used to reset MMC card. This should be supported by card.•SD_VSELECT is an output signal used to change the voltage of the external power supplier SD_CD#, SD_WP, SD_LCTL, SD_RST_N, and SD_VSELECT are alloptional for system implementation. If the uSDHC is desired to support a 4-bit data transfer, DAT7~DAT4 can also be optional and tied to high.Pin IOMUXMake modification to IOMUX according to your platform in the following file:•arch/arm/plat-mxc/include/mach/iomux-mx6q.hSupport of SD3.0。
SylixOS-EVB-iMX6Q使用手册-翼辉信息
目录目录 (1)第1章SylixOS-EVB-i.MX6Q 验证平台介绍 (1)1.1SylixOS-EVB-i.MX6Q 验证平台简介 (1)1.2SylixOS-EVB-i.MX6Q 验证平台实物图 (2)1.3SylixOS-EVB-i.MX6Q 验证平台硬件配置 (3)第2章SylixOS-EVB-i.MX6Q 验证平台快速体验 (4)2.1验证平台上电及启动项选择 (4)2.1.1验证平台系统IP地址修改 (6)2.1.2验证平台系统升级 (7)第3章SylixOS系统调试及uboot配置 (9)3.1基于u-boot的文件传输 (9)3.2u-boot下存储介质操作和系统固化 (12)3.3u-boot启动命令与Cache操作 (12)第1章SylixOS-EVB-i.MX6Q 验证平台介绍1.1 SylixOS-EVB-i.MX6Q 验证平台简介SylixOS-EVB-i.MX6Q验证平台是北京翼辉信息技术有限公司为方便SylixOS用户充分评估SylixOS功能和性能推出的高端ARM-SMP验证平台。
该验证平台基于使用i.MX6Q工业级CPU设计,可以直接进行多种软硬件的性能评估和测试。
SylixOS-EVB-i.MX6Q是北京翼辉信息技术有限公司推出的第一代ARM-SMP验证平台,采用i.MX6Q Cortex-A9处理器,可以测试常见的嵌入式通信接口如RS232、CAN、USB、PCIE、SATA、SDIO、以太网、I2C、LVDS、LCD、HDMI等。
SylixOS-EVB-i.MX6Q还包含3个扩展接口,可以测试自定义的I2C、SPI、UART模块或外扩设备。
i.MX6Q 是一款适用于消费电子、工业以及汽车车载娱乐系统等众多领域的新一代应用处理器。
基于ARM Cortex-A9架构,40nm工艺制程,最高运行频率可达1.2GHz,支持ARMv7TM、Neon、VFPV3和Trustzone 。
NXP SCM-i.MX 6 Series Yocto Linux 用户指南说明书
© 2017 NXP B.V.SCM-i.MX 6 Series Yocto Linux User'sGuide1. IntroductionThe NXP SCM Linux BSP (Board Support Package) leverages the existing i.MX 6 Linux BSP release L4.1.15-2.0.0. The i.MX Linux BSP is a collection of binary files, source code, and support files that can be used to create a U-Boot bootloader, a Linux kernel image, and a root file system. The Yocto Project is the framework of choice to build the images described in this document, although other methods can be also used.The purpose of this document is to explain how to build an image and install the Linux BSP using the Yocto Project build environment on the SCM-i.MX 6Dual/Quad Quick Start (QWKS) board and the SCM-i.MX 6SoloX Evaluation Board (EVB). This release supports these SCM-i.MX 6 Series boards:• Quick Start Board for SCM-i.MX 6Dual/6Quad (QWKS-SCMIMX6DQ)• Evaluation Board for SCM-i.MX 6SoloX (EVB-SCMIMX6SX)NXP Semiconductors Document Number: SCMIMX6LRNUGUser's GuideRev. L4.1.15-2.0.0-ga , 04/2017Contents1. Introduction........................................................................ 1 1.1. Supporting documents ............................................ 22. Enabling Linux OS for SCM-i.MX 6Dual/6Quad/SoloX .. 2 2.1. Host setup ............................................................... 2 2.2. Host packages ......................................................... 23.Building Linux OS for SCM i.MX platforms .................... 3 3.1. Setting up the Repo utility ...................................... 3 3.2. Installing Yocto Project layers ................................ 3 3.3. Building the Yocto image ....................................... 4 3.4. Choosing a graphical back end ............................... 4 4. Deploying the image .......................................................... 5 4.1. Flashing the SD card image .................................... 5 4.2. MFGTool (Manufacturing Tool) ............................ 6 5. Specifying displays ............................................................ 6 6. Reset and boot switch configuration .................................. 7 6.1. Boot switch settings for QWKS SCM-i.MX 6D/Q . 7 6.2. Boot switch settings for EVB SCM-i.MX 6SoloX . 8 7. SCM uboot and kernel repos .............................................. 8 8. References.......................................................................... 8 9.Revision history (9)Enabling Linux OS for SCM-i.MX 6Dual/6Quad/SoloX1.1. Supporting documentsThese documents provide additional information and can be found at the NXP webpage (L4.1.15-2.0.0_LINUX_DOCS):•i.MX Linux® Release Notes—Provides the release information.•i.MX Linux® User's Guide—Contains the information on installing the U-Boot and Linux OS and using the i.MX-specific features.•i.MX Yocto Project User's Guide—Contains the instructions for setting up and building the Linux OS in the Yocto Project.•i.MX Linux®Reference Manual—Contains the information about the Linux drivers for i.MX.•i.MX BSP Porting Guide—Contains the instructions to port the BSP to a new board.These quick start guides contain basic information about the board and its setup:•QWKS board for SCM-i.MX 6D/Q Quick Start Guide•Evaluation board for SCM-i.MX 6SoloX Quick Start Guide2. Enabling Linux OS for SCM-i.MX 6Dual/6Quad/SoloXThis section describes how to obtain the SCM-related build environment for Yocto. This assumes that you are familiar with the standard i.MX Yocto Linux OS BSP environment and build process. If you are not familiar with this process, see the NXP Yocto Project User’s Guide (available at L4.1.15-2.0.0_LINUX_DOCS).2.1. Host setupTo get the Yocto Project expected behavior on a Linux OS host machine, install the packages and utilities described below. The hard disk space required on the host machine is an important consideration. For example, when building on a machine running Ubuntu, the minimum hard disk space required is about 50 GB for the X11 backend. It is recommended that at least 120 GB is provided, which is enough to compile any backend.The minimum recommended Ubuntu version is 14.04, but the builds for dizzy work on 12.04 (or later). Earlier versions may cause the Yocto Project build setup to fail, because it requires python versions only available on Ubuntu 12.04 (or later). See the Yocto Project reference manual for more information.2.2. Host packagesThe Yocto Project build requires that the packages documented under the Yocto Project are installed for the build. Visit the Yocto Project Quick Start at /docs/current/yocto-project-qs/yocto-project-qs.html and check for the packages that must be installed on your build machine.The essential Yocto Project host packages are:$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat libsdl1.2-devThe i.MX layers’ host packages for the Ubuntu 12.04 (or 14.04) host setup are:$ sudo apt-get install libsdl1.2-dev xterm sed cvs subversion coreutils texi2html docbook-utils python-pysqlite2 help2man make gcc g++ desktop-file-utils libgl1-mesa-dev libglu1-mesa-dev mercurial autoconf automake groff curl lzop asciidocThe i.MX layers’ host packages for the Ubuntu 12.04 host setup are:$ sudo apt-get install uboot-mkimageThe i.MX layers’ host packages for the Ubuntu 14.04 host s etup are:$ sudo apt-get install u-boot-toolsThe configuration tool uses the default version of grep that is on your build machine. If there is a different version of grep in your path, it may cause the builds to fail. One workaround is to rename the special versi on to something not containing “grep”.3. Building Linux OS for SCM i.MX platforms3.1. Setting up the Repo utilityRepo is a tool built on top of GIT, which makes it easier to manage projects that contain multiple repositories that do not have to be on the same server. Repo complements the layered nature of the Yocto Project very well, making it easier for customers to add their own layers to the BSP.To install the Repo utility, perform these steps:1.Create a bin folder in the home directory.$ mkdir ~/bin (this step may not be needed if the bin folder already exists)$ curl /git-repo-downloads/repo > ~/bin/repo$ chmod a+x ~/bin/repo2.Add this line to the .bashrc file to ensure that the ~/bin folder is in your PATH variable:$ export PATH=~/bin:$PATH3.2. Installing Yocto Project layersAll the SCM-related changes are collected in the new meta-nxp-imx-scm layer, which is obtained through the Repo sync pointing to the corresponding scm-imx branch.Make sure that GIT is set up properly with these commands:$ git config --global "Your Name"$ git config --global user.email "Your Email"$ git config --listThe NXP Yocto Project BSP Release directory contains the sources directory, which contains the recipes used to build, one (or more) build directories, and a set of scripts used to set up the environment. The recipes used to build the project come from both the community and NXP. The Yocto Project layers are downloaded to the sources directory. This sets up the recipes that are used to build the project. The following code snippets show how to set up the SCM L4.1.15-2.0.0_ga Yocto environment for the SCM-i.MX 6 QWKS board and the evaluation board. In this example, a directory called fsl-arm-yocto-bsp is created for the project. Any name can be used instead of this.Building Linux OS for SCM i.MX platforms3.2.1. SCM-i.MX 6D/Q quick start board$ mkdir fsl-arm-yocto-bsp$ cd fsl-arm-yocto-bsp$ repo init -u git:///imx/fsl-arm-yocto-bsp.git -b imx-4.1-krogoth -m scm-imx-4.1.15-2.0.0.xml$ repo sync3.2.2. SCM-i.MX 6SoloX evaluation board$ mkdir my-evb_6sxscm-yocto-bsp$ cd my-evb_6sxscm-yocto-bsp$ repo init -u git:///imx/fsl-arm-yocto-bsp.git -b imx-4.1-krogoth -m scm-imx-4.1.15-2.0.0.xml$ repo sync3.3. Building the Yocto imageNote that the quick start board for SCM-i.MX 6D/Q and the evaluation board for SCM-i.MX 6SoloX are commercially available with a 1 GB LPDDR2 PoP memory configuration.This release supports the imx6dqscm-1gb-qwks, imx6dqscm-1gb-qwks-rev3, and imx6sxscm-1gb-evb. Set the machine configuration in MACHINE= in the following section.3.3.1. Choosing a machineChoose the machine configuration that matches your reference board.•imx6dqscm-1gb-qwks (QWKS board for SCM-i.MX 6DQ with 1 GB LPDDR2 PoP)•imx6dqscm-1gb-qwks-rev3 (QWKS board Rev C for SCM-i.MX 6DQ with 1GB LPDDR2 PoP) •imx6sxscm-1gb-evb (EVB for SCM-i.MX 6SX with 1 GB LPDDR2 PoP)3.4. Choosing a graphical back endBefore the setup, choose a graphical back end. The default is X11.Choose one of these graphical back ends:•X11•Wayland: using the Weston compositor•XWayland•FrameBufferSpecify the machine configuration for each graphical back end.The following are examples of building the Yocto image for each back end using the QWKS board for SCM-i.MX 6D/Q and the evaluation board for SCM-i.MX 6SoloX. Do not forget to replace the machine configuration with what matches your reference board.3.4.1. X11 image on QWKS board Rev C for SCM-i.MX 6D/Q$ DISTRO=fsl-imx-x11 imx6dqscm-1gb-qwks-rev3 source fsl-setup-release.sh -b build-x11$ bitbake fsl-image-gui3.4.2. FrameBuffer image on evaluation board for SCM-i.MX 6SX$ DISTRO=fsl-imx-fb MACHINE=imx6sxscm-1gb-evb source fsl-setup-release.sh –b build-fb-evb_6sxscm$ bitbake fsl-image-qt53.4.3. XWayland image on QWKS board for SCM-i.MX 6D/Q$ DISTRO=fsl-imx-xwayland MACHINE=imx6dqscm-1gb-qwks source fsl-setup-release.sh –b build-xwayland$ bitbake fsl-image-gui3.4.4. Wayland image on QWKS board for SCM-i.MX 6D/Q$ DISTRO=fsl-imx-wayland MACHINE=imx6dqscm-1gb-qwks source fsl-setup-release.sh -b build-wayland$ bitbake fsl-image-qt5The fsl-setup-release script installs the meta-fsl-bsp-release layer and configures theDISTRO_FEATURES required to choose the graphical back end. The –b parameter specifies the build directory target. In this build directory, the conf directory that contains the local.conf file is created from the setup where the MACHINE and DISTRO_FEATURES are set. The meta-fslbsp-release layer is added into the bblayer.conf file in the conf directory under the build directory specified by the –e parameter.4. Deploying the imageAfter the build is complete, the created image resides in the <build directory>/tmp/deploy/images directory. The image is (for the most part) specific to the machine set in the environment setup. Each image build creates the U-Boot, kernel, and image type based on the IMAGE_FSTYPES defined in the machine configuration file. Most machine configurations provide the SD card image (.sdcard), ext4, and tar.bz2. The ext4 is the root file system only. The .sdcard image contains the U-Boot, kernel, and rootfs, completely set up for use on an SD card.4.1. Flashing the SD card imageThe SD card image provides the full system to boot with the U-Boot and kernel. To flash the SD card image, run this command:$ sudo dd if=<image name>.sdcard of=/dev/sd<partition> bs=1M && syncFor more information about flashing, see “P reparing an SD/MMC Card to Boot” in the i.MX Linux User's Guide (document IMXLUG).Specifying displays4.2. MFGTool (Manufacturing Tool)MFGTool is one of the ways to place the image on a device. To download the manufacturing tool for the SCM-i.MX 6D/Q and for details on how to use it, download the SCM-i.MX 6 Manufacturing Toolkit for Linux 4.1.15-2.0.0 under the "Downloads" tab from /qwks-scm-imx6dq. Similarly, download the manufacturing tool for the SCM-i.MX 6SoloX evaluation board under the "Downloads" tab from /evb-scm-imx6sx.5. Specifying displaysSpecify the display information on the Linux OS boot command line. It is not dependent on the source of the Linux OS image. If nothing is specified for the display, the settings in the device tree are used. Find the specific parameters in the i.MX 6 Release Notes L4.1.15-2.0.0 (available at L4.1.15-2.0.0_LINUX_DOCS). The examples are shown in the following subsections. Interrupt the auto-boot and enter the following commands.5.1.1. Display options for QWKS board for SCM-i.MX 6D/QHDMI displayU-Boot > setenv mmcargs 'setenv bootargs console=${console},${baudrate} ${smp}root=${mmcroot} video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24'U-Boot > run bootcmd5.1.2. Display options for EVB for SCM-i.MX 6SXNote that the SCM-i.MX 6SX EVB supports HDMI with a HDMI accessory card (MCIMXHDMICARD) that plugs into the LCD connector on the EVB.Accessory boards:•The LVDS connector pairs with the NXP MCIMX-LVDS1 LCD display board.•The LCD expansion connector (parallel, 24-bit) pairs with the NXP MCIMXHDMICARD adapter board.LVDS displayU-Boot > setenv mmcargs 'setenv bootargs console=${console},${baudrate} ${smp}root=${mmcroot} ${dmfc} video=mxcfb0:dev=ldb,1024x768M@60,if=RGB666 ldb=sep0'U-Boot > run bootcmdHDMI display (dual display for the HDMI as primary and the LVDS as secondary)U-Boot > setenv mmcargs 'setenv bootargs console=${console},${baudrate} ${smp}root=${mmcroot} video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24video=mxcfb1:dev=ldb,LDBXGA,if=RGB666'U-Boot > run bootcmdLCD displayu-boot > setenv mmcargs 'setenv bootargs ${bootargs}root=${mmcroot} rootwait rw video=mxcfb0:dev=lcd,if=RGB565'u-boot> run bootcmd6. Reset and boot switch configuration6.1. Boot switch settings for QWKS SCM-i.MX 6D/QThere are two push-button switches on the QWKS-SCMIMX6DQ board. SW1 (SW3 for QWKS board Rev B) is the system reset that resets the PMIC. SW2 is the i.MX 6Dual/6Quad on/off button that is needed for Android.There are three boot options. The board can boot either from the internal SPI-NOR flash inside the SCM-i.MX6Dual/6Quad or from either of the two SD card slots. The following table shows the switch settings for the boot options.Table 1.Boot configuration switch settingsBoot from top SD slot (SD3)Boot from bottom SD slot (SD2)Boot from internal SPI NORDefault1.References6.2. Boot switch settings for EVB SCM-i.MX 6SoloXThis table shows the jumper configuration to boot the evaluation board from the SD card slot SD3.7. SCM uboot and kernel repositoriesThe kernel and uboot patches for both SCM-i.MX 6 QWKS board and evaluation board are integrated in specific git repositories. Below are the git repos for SCM-i.MX 6 uboot and kernel:uBoot repo: /git/cgit.cgi/imx/uboot-imx.gitSCM Branch: scm-imx_v2016.03_4.1.15_2.0.0_gakernel repo: /git/cgit.cgi/imx/linux-imx.gitSCM branch: scm-imx_4.1.15_2.0.0_ga8. References1.For details about setting up the Host and Yocto Project, see the NXP Yocto Project User’s Guide(document IMXLXYOCTOUG).2.For information about downloading images using U-Boot, see “Downloading images usingU-Boot” in the i.MX Linux User's Guide (document IMXLUG).3.For information about setting up the SD/MMC card, see “P reparing an SD/MMC card to boot” inthe i.MX Linux User's Guide (document IMXLUG).9. Revision historyDocument Number: SCMIMX6LRNUGRev. L4.1.15-2.0.0-ga04/2017How to Reach Us: Home Page: Web Support: /supportInformation in this document is provided solely to enable system and softwareimplementers to use NXP products. There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits based on the information in this document. NXP reserves the right to make changes without further notice to any products herein.NXP makes no warranty, representation, or guarantee regarding the suitability of its products for any particular purpose, nor does NXP assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequentia l or incidental damages. “Typical”parameters that may be provided in NXP data sheets and/or specifications can and do vary in different applications, and actual performance may vary over time. All operating parameters, including “typicals,” must be valida ted for each customer application by customer’s technical experts. NXP does not convey any license under its patent rights nor the rights of others. NXP sells products pursuant to standard terms and conditions of sale, which can be found at the following address: /SalesTermsandConditions .NXP, the NXP logo, NXP SECURE CONNECTIONS FOR A SMARTER WORLD, Freescale, and the Freescale logo are trademarks of NXP B.V. All other product or service names are the property of their respective owners.ARM, the ARM Powered logo, and Cortex are registered trademarks of ARM Limited (or its subsidiaries) in the EU and/or elsewhere. All rights reserved. © 2017 NXP B.V.。
连载-iMX6ULL软件定制应用笔记-9个知识点讲解
连载-iMX6ULL软件定制应用笔记-9个知识点讲解接上篇:连载-iMX6ULL 软件定制应用笔记 -3个常见问题解决思路点击了解本文以飞凌OKMX6ULL-S开发板为基础讲解,系统为Linux,一共总结了14个iMX6ULL小知识点,分三期完成,此为第二期i.MX6ULL应用笔记目录1.1 管脚复用的参数配置方法(PINMUX)1.2 Windows下转换开机LOGO图片格式1.3 8189es SDIO WIFI使用及测试1.4 USB转串口芯片的支持(PL2303)1.5 增加串口1.6 串口配置DMA1.7 LCD转LVDS模块1.8 LCD转VGA模块1.9 硬浮点运算1.10 OTG修改模式1.11 使用EC20模块实现4G-AP功能1.12 SPI转CAN接口1.13 ADC接口1.14 LCD的屏幕参数调整1.4 USB转串口芯片的支持(PL2303)内核自带了PL2303的驱动,需要将配置文imx6ull_defconfig中CONFIG_USB_SERIAL_PL2303 设置为y,如下:(默认已经配置)arch/arm/configs/imx6ull_defconfig# CONFIG_USB_SERIAL_NAVMAN is not setCONFIG_USB_SERIAL_PL2303=yCONFIG_USB_SERIAL_VIZZINI=y配置说明:1. 编译内核,烧写并替换内核。
(如果对imx6ull_defconfig配置进行修改需要执行此步骤)2.启动系统à插入USB转串口设备。
3.验证,输入以下指令查看,默认在dev下产生ttyUSB0节点:root@fl-imx6ull:~#ls -la /dev/ttyUSB0注意:1.有些USB设备需要将配置文件中CONFIG_USB_PRINTER=y;2. 测试方法同《用户手册》串口测试章节。
1.5 增加串口1.此处以uart4配置进行说明。
IMX6系列手册1
Target Applications• Automotive infotainment • Digital signage • E-Readers• Human-machine interface • Home energy management systems• In-flight entertainment • Intelligent industrial control systems • IP phones • IPTV• Portable medical• Smartbooks • Tablets• Point-of-sale devices • Digital cluster • Vehicle to vehicle connectivity• Home audio systems • Secure smartconnected devicesConsumer, Industrial and Automotive Marketsi.MX 6 Series ofApplications ProcessorsScalable multicore solutions breaking the boundaries of user experienceOverviewThe i.MX 6 series of applications processors unleashes a scalable multicore platform that includes single-, dual- and quad-core families based on the ARM ® Cortex ®-A9 architecture, in addition to the i.MX 6SoloX which offers heterogeneous multicoreprocessing with the Cortex ®-A9 and Cortex ®-M4 cores to deliver solutions with low power consumption, fast and deterministic response time and increased system integrity.Targeting consumer, industrial and automotive applications, the i.MX 6 seriescombines broad levels of integration and power-efficient processing capabilities all the way up to bleeding edge 3D and 2D graphics, as well as high-definition video, to provide a new level of multimedia performance for an unbounded next-generation user experience. The i.MX 6 series is supported by companion Freescale powermanagement ICs (PMICs).Available on certain product familiesSix Scalable FamiliesThe i.MX 6Quad family encompassesa quad-core platform running up to1.2 GHz with 1 MB of L2 cache, and 64-bit DDR3 or 2-channel, 32-bit LPDDR2 support. Integrated FlexCAN and MLB busses, PCI Express® and SATA-2 provide excellent connectivity while integration of dual, MIPI display port, MIPI camera port and HDMI v1.4 makes it an ideal platform for consumer, automotive and industrial multimedia applications.The i.MX 6Dual family provides dual cores running up to 1.2 GHz with1 MB of L2 cache, and 64-bit DDR3or 2-channel, 32-bit LPDDR2 support. Leveraging the same integrationof the i.MX 6Quad family, the i.MX6Dual provides a scalable solution for consumer, automotive and industrial applications.The i.MX 6DualLite family introduces dual cores running up to 1.0 GHzwith 512 KB of L2 cache, and 64-bit DDR3 or 2-channel, 32-bit LPDDR2 support. With integrated FlexCAN and MLB busses, PCI Express, LVDS, and support for MIPI cameras and displaysas well as HDMI v1.4, the device isa great fit for consumer, automotive and industrial multimedia centric applications.The i.MX 6Solo family provides a single core running up to 1.0 GHz with 512 KB of L2 cache and 32-bit DDR3/ LPDDR2 support. Integrated LVDS, MIPI display, MIPI camera port, HDMI v1.4, FlexCAN and MLB enables the i.MX 6Solo to be a flexible platform for consumer, automotive and industrial applications.The i.MX 6SoloX family introducessingle cores running up to 1.0 GHz(Cortex-A9) and 200 MHz (Cortex-M4)with 256 KB of L2 cache and 32-bitDDR3/LPDDR2 support. IntegratedLVDS, FlexCAN, and PCIe Expressenables the i.MX 6SoloX to be alow-power and flexible platform forconsumer, automotive and industrialapplications that require real-timeresponsiveness and a higher levelof system integrity.The i.MX 6SoloLite family provides asingle core running up to 1.0 GHz with256 KB of L2 cache and 32-bit DDR3/LPDDR2 support. Targeted integrationof an electronic paper display (EPD)controller makes it an ideal solution fornext generation e-readers and otheremerging consumer and embeddeddevices using EPD technology.i.MX 6 Series at a Glancei.MX6SoloLitei.MX6Soloi.MX6DualLitei.MX6Duali.MX6Quad• Single ARM®Cortex®-A9up to 1.0 GHz• 256 KB L2cache, Neon,VFPvd16Trustzone• 2D graphics• 32-bit DDR3and LPDDR2at 400 MHz• IntegratedEPDcontroller• 10/100Ethernet MAC• SingleCortex®-A9up to 1.0 GHz• 512 KB L2cache, Neon,VFPvd16Trustzone• 3D graphicswith oneshader• 2D graphics• 32-bit DDR3and LPDDR2at 400 MHz• IntegratedEPDcontroller• HDMIv1.4controllerplus PHY• LVDScontrollerplus PHY• PCIecontrollerplus PHY• GigabitEthernet MAC• MLB andFlexCANcontrollers• DualCortex®-A9up to 1.0 GHz• 512 KB L2cache, Neon,VFPvd16Trustzone• 3D graphicswith oneshader• 2D graphics• 64-bit DDR3and2-channel32-bitLPDDR2 at400 MHz• IntegratedEPDcontroller• HDMIv1.4controllerplus PHY• LVDScontrollerplus PHY• PCIecontrollerplus PHY• MLB andFlexCANcontrollers• GigabitEthernet MAC• DualCortex®-A9up to 1.2 GHz• 1 MB L2cache, Neon,VFPvd16Trustzone• 3D graphicswith fourshaders• Two 2Dgraphicsengines• 64-bit DDR3and2-channel32-bitLPDDR2at 533 MHz• IntegratedSATA-II• HDMIv1.4controller plusPHY• GigabitEthernet MAC• LVDScontroller plusPHY• PCIecontroller plusPHY• MLB andFlexCANcontrollers• QuadCortex®-A9up to 1.2 GHz• 1 MB L2cache, Neon,VFPvd16Trustzone• 3D graphicswith fourshaders• Two 2Dgraphicsengines• 64-bit DDR3and2-channel32-bitLPDDR2at 533 MHz• GigabitEthernet MAC• IntegratedSATA-II• HDMIv1.4controllerplus PHY• LVDScontrollerplus PHY• PCIecontrollerplus PHY• MLB andFlexCANcontrollers Red indicates change from column to the lefti.MX6SoloX• SingleCortex®-A9up to 1.0 GHz• SingleCortex®-M4up to 200 MHz• 256 KB L2cache, Neon,VFP,Trustzone• 3D and 2Dgraphics• 32-bit DDR3and LPDDR2at 400 MHz• Dual GigabitEthernet MACw/ hardwareAVB support• PCIecontrollerplus PHY• LVDScontrollerplus PHY• MLB andFlexCANcontrollers• Analogcamerainterface• 8-channel,12-bit ADCFor development tools and third-party resources,visit /iMX6seriesJoin fellow i.MX developers online at Freescale, the Freescale logo and the Energy Efficient Solutions logo are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. ARM is a registered trademark of ARM Limited. Cortex-A9, Cortex-M4 and ARMv7 are trademarks of ARM Limited. All other product or service names are the property of their respective owners. © 2012–2015 Freescale Semiconductor, Inc. Document Number: IMX6SRSFS REV 6。
IAC-IMX6UL-Kit LINUX 用户手册说明书
IAC-IMX6UL-Kit LINUX用户手册版本号:V1.0前言 (2)产品说明 (2)产品版本说明 (2)修订记录 (2)一、阅读前说明 (3)二、准备工作 (4)三、功能测试 (6)四、固件烧写 (7)五、安装交叉编译器 (8)5.1概述 (8)5.2安装步骤 (8)六、搭建NFS网络文件系统 (11)6.1概述 (11)6.2安装步骤 (11)七、源码编译 (14)7.1概述 (14)7.2 uboot 编译 (14)7.3内核的配置及编译 (18)八、应用程序的开发 (21)8.1编写应用程序及交叉编译 (21)8.2运行应用程序 (22)九、添加应用程序到文件系统 (26)9.1概述 (26)9.2添加到文件系统 (26)十、结束语 (29)产品说明欢迎使用浙江启扬智能科技有限公司产品IAC-IMX6UL-Kit,本产品Linux部分包含6份手册:《IAC-IMX6UL-Kit 用户手册.pdf》修订记录修订记录累积了每次文档更新的说明。
最新版本的文档包含以前所有文档版本的更新内容。
一、阅读前说明●装有Linux系统(ubuntu 或其它Linux发行版),本手册以ubuntu 12.04 操作为例,具体搭建请参照《虚拟机安装ubuntu指导手册.pdf》!●在ubuntu用户目录下创建一个工作目录:mkdir ~/work①②,并将要编译的文件拷贝到此目录下。
●关于linux下的常用命令以及vi的操作等在这里都不做详细说明,请用户自行查阅相关资料!●开发板标配光盘目录,文档说明中用到的所有工具软件以及代码文件全部在光盘的对应目录下,使用前请确保光盘资料齐全!●光盘中有移植好的源码,用户可直接编译使用,也可以根据实际情况进行配置、编译。
注:①这里的~/表示用户目录,整条命令表示在用户目录下创建work目录实际对应的绝对路径为/home/lvmh(此目录为登录账户工作目录,本手册以lvmh账户为例,操作过程中请以实际登录账户所在目录为准),~/work对应的路径是/home/lvmh/work。
移植内核必备知识
移植内核必备知识-6410的寄存器物理虚拟-地址映射方法嵌入式开发联盟Osbo y站长原创QQ:82475491@(一)6410设备的物理地址与虚拟地址的映射MACHINE_START(MCUOS6410, "MCUOS6410")/* Maintainer: Ben Dooks <ben-linux@> */ .boot_params = S3C64XX_PA_SDRAM + 0x100,.init_irq = s3c6410_init_irq,.map_io = mcuos6410_map_io,.init_machine = mcuos6410_machine_init,.timer = &s3c24xx_timer,MACHINE_END这里面的mao_io主要工作之一就是做6410的寄存器的物理地址与虚拟地址映射的工作。
mao_io的代码为:static void __init mcuos6410_map_io(void){s3c64xx_init_io(mcuos6410_iodesc, ARRAY_SIZE(mcuos6410_iodesc));s3c24xx_init_clocks(12000000);s3c24xx_init_uarts(mcuos6410_uartcfgs, ARRAY_SIZE(mcuos6410_uartcfgs));}s3c64xx_init_io最终会调用下面这个函数:iotable_init(s3c_iodesc, ARRAY_SIZE(s3c_iodesc));s3c_iodesc结构体定义在:static struct map_desc s3c_iodesc[] __initdata = {{.virtual = (unsigned long)S3C_VA_SYS,.pfn = __phys_to_pfn(S3C64XX_PA_SYSCON),.length = SZ_4K,.type = MT_DEVICE,}, {.virtual = (unsigned long)S3C_VA_MEM,.pfn = __phys_to_pfn(S3C64XX_PA_SROM),.length = SZ_4K,.type = MT_DEVICE,}, {.virtual = (unsigned long)(S3C_VA_UART + UART_OFFS),.pfn = __phys_to_pfn(S3C_PA_UART), .length = SZ_4K,.type = MT_DEVICE,}, {.virtual = (unsigned long)VA_VIC0,.pfn = __phys_to_pfn(S3C64XX_PA_VIC0),.length = SZ_16K,.type = MT_DEVICE,}, {.virtual = (unsigned long)VA_VIC1,.pfn = __phys_to_pfn(S3C64XX_PA_VIC1),.length = SZ_16K,.type = MT_DEVICE,}, {.virtual = (unsigned long)S3C_VA_TIMER, .pfn = __phys_to_pfn(S3C_PA_TIMER), .length = SZ_16K,.type = MT_DEVICE,}, {.virtual = (unsigned long)S3C64XX_VA_GPIO,.pfn = __phys_to_pfn(S3C64XX_PA_GPIO),.length = SZ_4K,.type = MT_DEVICE,}, {.virtual = (unsigned long)S3C64XX_VA_MODEM,.pfn = __phys_to_pfn(S3C64XX_PA_MODEM),.length = SZ_4K,.type = MT_DEVICE,}, {.virtual = (unsigned long)S3C_VA_WATCHDOG,.pfn = __phys_to_pfn(S3C64XX_PA_WATCHDOG),.length = SZ_4K,.type = MT_DEVICE,}, {.virtual = (unsigned long)S3C_VA_USB_HSPHY,.pfn = __phys_to_pfn(S3C64XX_PA_USB_HSPHY),.length = SZ_1K,.type = MT_DEVICE,},};linux/include/asm-arm/plat-s3c/map.h中有如下定义,我们在这边手动的定义了寄存器的虚拟地址空间:#define S3C_ADDR_BASE 0xF6000000#ifndef __ASSEMBLY__#define S3C_ADDR(x) ((void __iomem __force *)S3C_ADDR_BASE + (x))#else#define S3C_ADDR(x) (S3C_ADDR_BASE + (x))#endif#define S3C_VA_IRQ S3C_ADDR(0x00000000) /* irq controller(s) */#define S3C_VA_SYS S3C_ADDR(0x00100000) /* system control */#define S3C_VA_MEM S3C_ADDR(0x00200000) /* memory control */#define S3C_VA_TIMER S3C_ADDR(0x00300000) /* timer block */#define S3C_VA_WATCHDOG S3C_ADDR(0x00400000) /* watchdog */#define S3C_VA_UART S3C_ADDR(0x01000000) /* UART */ /* This is used for the CPU specific mappings that may be needed, so that* they do not need to directly used S3C_ADDR() and thus make it easier to* modify the space for mapping.*/#define S3C_ADDR_CPU(x) S3C_ADDR(0x00500000 + (x))iotable_init函数原型为:void __init iotable_init(struct map_desc *io_desc, int nr) {int i;for (i = 0; i < nr; i++)create_mapping(io_desc + i);}由此我们引出了最重要的映射函数:由前面的s3c_iodesc结构可以知道,6410的寄存器的映射结构体中.type = MT_DEVICE。
TQIMX6Q_BASEC产品介绍
、Neon、VFPV3和Trustzone支持。处理器内部为64/32位总线结构,32/32KB一级缓存,1M二级缓存
,可以实现12000DMIPS(每秒运算12亿条指令集)的高性能运算能力,并自带3D图形加速引擎,2D 图形加速,最大支持4096x4096 pixels分辨率,视频编码支持MPEG-4/H.263/H.264达到1080p@30fps ,解码MPEG2/VC1/Xvid 视频达到1080p@30fps,支持高清HDMI TV输出。
核心板层数
采用8层板沉金工艺设计、布局、布线充
分考虑EMC、EMI
核心板引脚数 MPU 主频
200 pin,采用2.0间距镀金双排BTB接口 Freescale i.MX6Q ARM Cortex-A9 最高1.2GHz
内存
eMMC 工作功耗
2GB DDR3 (8GB可选)
8GB eMMC Flash 5伏 300毫安 商业级(-20C 至 +105C)
arm-linux-gcc-4.6.2
支持SD卡脱机快速烧写 IMX6Q专用armv7指令集,支持硬浮点 运算, 独家提供 SD卡脱机刷机,专为企业级用户定制 ,非常适合批量生产 USB一键刷机,专为企业级用户定制, 非常适合批量生产
支持USB下载烧写
烧写 支持单个/多个文件一键烧写 支持EXT4格式系统文件烧写 烧写工具MFG Tools支持WindowsXP/ Vista/ Windows7 多启动方式选择(eMMC,SD卡) 内存(1G/2G) uboot
输入电压
底板功率 底板+核心板功耗 Usb OTG Usb Host Ethernet
12伏电源输入
0.6W (12V-50mA,均值) 3W(12V-250mA,均值) 1路USB_OTG 接口 3路USB_HOST 2.0输出 工业级千兆网卡芯片,数据传输更快更可靠,10/100/1000M自适应
imx6的MFGTools配置、流程、分析
1、MFG说明MFGTool工具是freescale专门针对i.MX处理器专门使用的烧写工具,用来将编译好的文件系统和镜像文件烧写到板子上。
2、文件结构以明远智睿MY-I.MX6-MFG-TOOL-V2.3 为例:文件结构cfg.ini 指定LIST,ucl2.xml根据此定义,找到对应的操作部分流程:MFG先把OS Firmware下面的uboot.bin uImage initramfs.cpio.gz.uboot下载到RAM中,运行,再执行具体的烧录过程。
Profiles/MX6Q Linux Update/OS Firmware/uImage打开MfgTool2.exe时,会读取uImage的内容。
如果没有uImage,打开MfgTool2.exe,提示:Profiles/MX6Q Linux Update/OS Firmware/ucl2.xmlMFG的工作流程由配置文件决定,配置文件即:ucl2.xml明远,LIST name=Android-MYZR-SPI_NOR-EMMC<CFG><STATE name="BootStrap" dev="MX6Q" vid="15A2" pid="0054"/><STATE name="Updater" dev="MSC" vid="066F" pid="37FF"/></CFG>//全局变量//ucl2.xml将烧录过程分成两个阶段:BootStrap和Updater//dev、vid和pid:分别对应两个阶段的设备名、设备对应连接的USB vid和pid号//针对imx6系列,在BootStrap阶段,有效的设备名只有MX6Q、MX6D、MX6SL。
imx6q BSP移植详细学习笔记
Imx6q 详细学习笔记开发环境:ubuntu 12.04.5 32位系统开发板:天嵌TQIMX6Q开发板需要的软件包:gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12.tar.bz2(由天嵌提供)uboot-imx.tar.bz2linux-2.6-imx.tar.bz2busybox-1.21.0.tar.bz2虚拟机 VMware 12这些工具的下载地址为百度网盘,连接如下:/s/1dETeap7一、安装必备的工具二、移植uboot先将u-boot解压到工作目录,然后在终端下切换到uboot根目录。
由于这个版本的bsp是使用令:"mx6qsabresd"(如果没有改动的话,在277行),复制该行配置并添加在下面,然后修改为如下是比较容易。
注意该部的所有操作均在mx6q_myimx6q.c中。
(1) 修改串口端子。
具体修改内容如下:其中,CROSS_COMPILE是交叉编译工具链的前缀,根据自己的实际情况修改。
如果前面的步骤操作正确,uboot就可以顺利编译通过了烧写启动经过前面的移植工作,uboot已经可以正常运行在myimx6q开发板上了。
这个版本的uboot与之前版本的uboot编译出的目标文件不同,将sd卡插入到电脑,回到uboot根目录,具体的烧写指令如下:三、移植内核系统。
准备工作每次移植kernel的时候都会做的工作就是找到与当前开发板接近的config,其实uboot移植的时候也是一样的。
由于myimx6q的芯片是imx6q的,所以,还是以mx6q_sabresd为例。
另外,自己动手移植BSP时应该充分使用官方文档,本人以为,以下文档是非常有用的:(1) i.MX 6 BSP Porting Guide:该文档详细的记载了BSP移植的流程。
(2) i.MX 6 SABRE-SD Linux User's Guide:该文档详细的记载了各种启动介质的制作方法。
imx6uart分析
imx6uart分析本⽂主要记录: 1、uart设备注册 2、uart驱动注册 3、上层应⽤调⽤有些地⽅理解的还不是很透彻,希望指正。
1、uart设备注册过程MACHINE_START(MX6Q_SABRESD, "Freescale i.MX 6Quad/DualLite/Solo Sabre-SD Board")/* Maintainer: Freescale Semiconductor, Inc. */.boot_params = MX6_PHYS_OFFSET + 0x100,.fixup = fixup_mxc_board,.map_io = mx6_map_io,.init_irq = mx6_init_irq,.init_machine = mx6_sabresd_board_init, ------------------------+.timer = &mx6_sabresd_timer, |.reserve = mx6q_sabresd_reserve, |MACHINE_END ||static void __init mx6_sabresd_board_init(void) <-----------------------+{int i;int ret;struct clk *clko, *clko2;struct clk *new_parent;int rate;if (cpu_is_mx6q())mxc_iomux_v3_setup_multiple_pads(mx6q_sabresd_pads, ----+ARRAY_SIZE(mx6q_sabresd_pads)); |else if (cpu_is_mx6dl()) { |mxc_iomux_v3_setup_multiple_pads(mx6dl_sabresd_pads, |ARRAY_SIZE(mx6dl_sabresd_pads)); |} |... ... |mx6q_sabresd_init_uart(); ------------------------|----+... ... | |} | |//设置IOMUX寄存器,将有功能复⽤的引脚设置为UART功能 | |static iomux_v3_cfg_t mx6q_sabresd_pads[] = { <---------------+ |... ... |/* UART1 for debug */ |MX6Q_PAD_CSI0_DAT10__UART1_TXD, |MX6Q_PAD_CSI0_DAT11__UART1_RXD, ||/* UART2*/ |MX6Q_PAD_EIM_D26__UART2_TXD, |MX6Q_PAD_EIM_D27__UART2_RXD, ||/* UART3 for gps */ |MX6Q_PAD_EIM_D24__UART3_TXD, |MX6Q_PAD_EIM_D25__UART3_RXD, ||/* UART4*/ |MX6Q_PAD_KEY_COL0__UART4_TXD, |MX6Q_PAD_KEY_ROW0__UART4_RXD, ||/* UART5*/ |MX6Q_PAD_KEY_COL1__UART5_TXD, |MX6Q_PAD_KEY_ROW1__UART5_RXD, |... ... |}; ||//uart初始化 |static inline void mx6q_sabresd_init_uart(void) <----------------+{imx6q_add_imx_uart(0, NULL);imx6q_add_imx_uart(1, NULL);imx6q_add_imx_uart(2, NULL);imx6q_add_imx_uart(3, NULL);imx6q_add_imx_uart(4, NULL);}#define imx6q_add_imx_uart(id, pdata) \imx_add_imx_uart_1irq(&imx6q_imx_uart_data[id], pdata)const struct imxuart_platform_data *pdata){struct resource res[] = {{.start = data->iobase,.end = data->iobase + data->iosize - 1,.flags = IORESOURCE_MEM,}, {.start = data->irq,.end = data->irq,.flags = IORESOURCE_IRQ,},};return imx_add_platform_device("imx-uart", data->id, res, ARRAY_SIZE(res), pdata, sizeof(*pdata)); |} ||Vstatic inline struct platform_device *imx_add_platform_device( const char *name, int id,const struct resource *res, unsigned int num_resources,const void *data, size_t size_data){return imx_add_platform_device_dmamask(name, id, res, num_resources, data, size_data, 0);}2、驱动注册kernel/drivers/tty/serial/imx.cstatic int __init imx_serial_init(void){int ret;printk(KERN_INFO "Serial: IMX driver\n");ret = uart_register_driver(&imx_reg); ----------------------------+if (ret) | |return ret; +----------------------------+ |//注册uart驱动 | |ret = platform_driver_register(&serial_imx_driver); | |if (ret != 0) | | |uart_unregister_driver(&imx_reg); | | |+--------------|-------|----+return0; | | |} | | || | |static struct uart_driver imx_reg = { <----------------------+ | |.owner = THIS_MODULE, | |.driver_name = DRIVER_NAME, // IMX-uart | |.dev_name = DEV_NAME, // ttymxc | |.major = SERIAL_IMX_MAJOR, // 207 | |.minor = MINOR_START, // 16 | |.nr = ARRAY_SIZE(imx_ports), | |.cons = IMX_CONSOLE, | |}; | || |// kernel/drivers/tty/serial/serial_core.c | |int uart_register_driver(struct uart_driver *drv) <----------+ |{ |struct tty_driver *normal; |int i, retval; ||BUG_ON(drv->state); |//分配uart_state空间,⼀个串⼝对应⼀个 |/* |* Maybe we should be using a slab cache for this, especially if |* we have a large number of ports to handle. |*/ |drv->state = kzalloc(sizeof(struct uart_state) * drv->nr, GFP_KERNEL); |if (!drv->state) |goto out; |//所有的串⼝只有⼀个tty_driver |normal = alloc_tty_driver(drv->nr); |if (!normal) |goto out_kfree; ||drv->tty_driver = normal; ||normal->owner = drv->owner; |normal->driver_name = drv->driver_name; |normal->type = TTY_DRIVER_TYPE_SERIAL; |normal->subtype = SERIAL_TYPE_NORMAL; |normal->init_termios = tty_std_termios; |normal->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL; |normal->init_termios.c_ispeed = normal->init_termios.c_ospeed = 9600; |normal->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV; | /* tty_driver和uart_driver结构体关联, |* 当驱动和设备匹配之后,调⽤probe函数, |* |*/ |normal->driver_state = drv; |tty_set_operations(normal, &uart_ops); ||/* |* Initialise the UART state(s). |*/ |for (i = 0; i < drv->nr; i++) { |struct uart_state *state = drv->state + i; |struct tty_port *port = &state->port; ||tty_port_init(port); |port->ops = &uart_port_ops; |port->close_delay = 500; /* .5 seconds */ |port->closing_wait = 30000; /* 30 seconds */ |tasklet_init(&state->tlet, uart_tasklet_action, |(unsigned long)state); |} ||retval = tty_register_driver(normal); ------------------------+ |if (retval >= 0) | |return retval; | || |put_tty_driver(normal); | |out_kfree: | |kfree(drv->state); | |out: | |return -ENOMEM; | |} | |// kernel/drivers/tty/tty_io.c | |int tty_register_driver(struct tty_driver *driver) <-------------------+ |{ |int error; |int i; |dev_t dev; |void **p = NULL; |struct device *d; ||if (!(driver->flags & TTY_DRIVER_DEVPTS_MEM) && driver->num) { |p = kzalloc(driver->num * 2 * sizeof(void *), GFP_KERNEL); | if (!p) |return -ENOMEM; |} ||if (!driver->major) { |error = alloc_chrdev_region(&dev, driver->minor_start, |driver->num, driver->name); |if (!error) { |driver->major = MAJOR(dev); |driver->minor_start = MINOR(dev); |} |} else { |dev = MKDEV(driver->major, driver->minor_start); |/* 为设备分配主设备号和次设备号 |* 主设备号207,次设备号从16开始 |* 所以注册的串⼝设备次设备号是16,17,18,19... |*/ |error = register_chrdev_region(dev, driver->num, driver->name); |} |if (error < 0) { |kfree(p); |return error; |} ||if (p) { |driver->ttys = (struct tty_struct **)p; |driver->termios = (struct ktermios **)(p + driver->num); |} else { |driver->ttys = NULL; |driver->termios = NULL; |} ||unregister_chrdev_region(dev, driver->num); |driver->ttys = NULL; |driver->termios = NULL; |kfree(p); |return error; |} ||mutex_lock(&tty_mutex); |list_add(&driver->tty_drivers, &tty_drivers); |mutex_unlock(&tty_mutex); ||if (!(driver->flags & TTY_DRIVER_DYNAMIC_DEV)) { |for (i = 0; i < driver->num; i++) { |d = tty_register_device(driver, i, NULL); |if (IS_ERR(d)) { |error = PTR_ERR(d); |goto err; |} |} |} |proc_tty_register_driver(driver); |driver->flags |= TTY_DRIVER_INSTALLED; |return0; ||err: |for (i--; i >= 0; i--) |tty_unregister_device(driver, i); ||mutex_lock(&tty_mutex); |list_del(&driver->tty_drivers); |mutex_unlock(&tty_mutex); ||unregister_chrdev_region(dev, driver->num); |driver->ttys = NULL; |driver->termios = NULL; |kfree(p); |return error; |} ||static struct platform_driver serial_imx_driver = { <----------------+.probe = serial_imx_probe,.remove = serial_imx_remove,.suspend = serial_imx_suspend,.resume = serial_imx_resume,.driver = {.name = "imx-uart",.owner = THIS_MODULE,},};//当设备和驱动匹配之后,会调⽤probe函数,其中就指定了读写函数static int serial_imx_probe(struct platform_device *pdev){... ...sport->port.ops = &imx_pops; -------+... ... |//将初始化⽤到的uart_driver和imx_port关联起来 |//最终就将操作imx_pops结构体定义的函数与上层应⽤关联起来 | //初始化的时候,就已经将uart_driver与tty_driver关联 |ret = uart_add_one_port(&imx_reg, &sport->port); -------+ |} | || |static struct uart_ops imx_pops = { <-----|----+.tx_empty = imx_tx_empty, |.set_mctrl = imx_set_mctrl, |.get_mctrl = imx_get_mctrl, |.stop_tx = imx_stop_tx, |.start_tx = imx_start_tx, |.stop_rx = imx_stop_rx, |.enable_ms = imx_enable_ms, |.break_ctl = imx_break_ctl, |.startup = imx_startup, |.shutdown = imx_shutdown, |.set_termios = imx_set_termios, |.type = imx_type, |.release_port = imx_release_port, |.request_port = imx_request_port, |.config_port = imx_config_port, |.verify_port = imx_verify_port, |#if defined(CONFIG_CONSOLE_POLL) |Vint uart_add_one_port(struct uart_driver *drv, struct uart_port *uport) {struct uart_state *state;struct tty_port *port;int ret = 0;struct device *tty_dev;BUG_ON(in_interrupt());if (uport->line >= drv->nr)return -EINVAL;state = drv->state + uport->line;port = &state->port;mutex_lock(&port_mutex);mutex_lock(&port->mutex);if (state->uart_port) {ret = -EINVAL;goto out;}state->uart_port = uport;state->pm_state = -1;uport->cons = drv->cons;uport->state = state;/** If this port is a console, then the spinlock is already* initialised.*/if (!(uart_console(uport) && (uport->cons->flags & CON_ENABLED))) { spin_lock_init(&uport->lock);lockdep_set_class(&uport->lock, &port_lock_key);}uart_configure_port(drv, state, uport);/** Register the port whether it's detected or not. This allows* setserial to be used to alter this ports parameters.*/tty_dev = tty_register_device(drv->tty_driver, uport->line, uport->dev);if (likely(!IS_ERR(tty_dev))) {device_set_wakeup_capable(tty_dev, 1);} else {printk(KERN_ERR "Cannot register tty device on line %d\n",uport->line);}/** Ensure UPF_DEAD is not set.*/uport->flags &= ~UPF_DEAD;out:mutex_unlock(&port->mutex);mutex_unlock(&port_mutex);return ret;}3、上层调⽤kernel/drivers/tty/tty_io.cstatic const struct file_operations tty_fops = {.llseek = no_llseek,.read = tty_read,.write = tty_write,.poll = tty_poll,.unlocked_ioctl = tty_ioctl,.compat_ioctl = tty_compat_ioctl,.open = tty_open,.release = tty_release,.fasync = tty_fasync,};// kernel/drivers/tty/tty_io.cstatic ssize_t tty_write(struct file *file, const char __user *buf,struct tty_struct *tty = file_tty(file);struct tty_ldisc *ld;ssize_t ret;if (tty_paranoia_check(tty, inode, "tty_write"))return -EIO;if (!tty || !tty->ops->write ||(test_bit(TTY_IO_ERROR, &tty->flags))) return -EIO;/* Short term debug to catch buggy drivers */if (tty->ops->write_room == NULL)printk(KERN_ERR "tty driver %s lacks a write_room method.\n", tty->driver->name);ld = tty_ldisc_ref_wait(tty);if (!ld->ops->write)ret = -EIO;elseret = do_tty_write(ld->ops->write, tty, file, buf, count);tty_ldisc_deref(ld); |return ret; |} |Vstatic inline ssize_t do_tty_write(ssize_t (*write)(struct tty_struct *, struct file *, const unsigned char *, size_t), struct tty_struct *tty,struct file *file,const char __user *buf,size_t count){ssize_t ret, written = 0;unsigned int chunk;ret = tty_write_lock(tty, file->f_flags & O_NDELAY);if (ret < 0)return ret;chunk = 2048;if (test_bit(TTY_NO_WRITE_SPLIT, &tty->flags))chunk = 65536;if (count < chunk)chunk = count;/* write_buf/write_cnt is protected by the atomic_write_lock mutex */if (tty->write_cnt < chunk) {unsigned char *buf_chunk;if (chunk < 1024)chunk = 1024;buf_chunk = kmalloc(chunk, GFP_KERNEL);if (!buf_chunk) {ret = -ENOMEM;goto out;}kfree(tty->write_buf);tty->write_cnt = chunk;tty->write_buf = buf_chunk;}/* Do the write .. */for (;;) {size_t size = count;if (size > chunk)size = chunk;ret = -EFAULT;if (copy_from_user(tty->write_buf, buf, size))break;ret = write(tty, file, tty->write_buf, size); -----------+if (ret <= 0) |break; |written += ret; |buf += ret; |count -= ret; |if (!count) |break; |ret = -ERESTARTSYS; |if (signal_pending(current)) |break; |cond_resched(); |} |if (written) { |} |out: |tty_write_unlock(tty); |return ret; |} |V//kernel/drivers/tty/n_tty.cstatic ssize_t n_tty_write(struct tty_struct *tty, struct file *file,const unsigned char *buf, size_t nr){const unsigned char *b = buf;DECLARE_WAITQUEUE(wait, current);int c;ssize_t retval = 0;/* Job control check -- must be done at start (POSIX.1 7.1.1.4). */if (L_TOSTOP(tty) && file->f_op->write != redirected_tty_write) {retval = tty_check_change(tty);if (retval)return retval;}/* Write out any echoed characters that are still pending */process_echoes(tty);add_wait_queue(&tty->write_wait, &wait);while (1) {set_current_state(TASK_INTERRUPTIBLE);if (signal_pending(current)) {retval = -ERESTARTSYS;break;}if (tty_hung_up_p(file) || (tty->link && !tty->link->count)) {retval = -EIO;break;}if (O_OPOST(tty) && !(test_bit(TTY_HW_COOK_OUT, &tty->flags))) {while (nr > 0) {ssize_t num = process_output_block(tty, b, nr);if (num < 0) {if (num == -EAGAIN)break;retval = num;goto break_out;}b += num;nr -= num;if (nr == 0)break;c = *b;if (process_output(c, tty) < 0)break;b++; nr--;}if (tty->ops->flush_chars)tty->ops->flush_chars(tty);} else {while (nr > 0) {c = tty->ops->write(tty, b, nr); -------------------+if (c < 0) { |retval = c; |goto break_out; |} |if (!c) |break; |b += c; |nr -= c; |} |} |if (!nr) |break; |if (file->f_flags & O_NONBLOCK) { |retval = -EAGAIN; |break; |} |schedule(); |} |break_out: |__set_current_state(TASK_RUNNING); |remove_wait_queue(&tty->write_wait, &wait); |if (b - buf != nr && tty->fasync) |// kernel/drivers/tty/serial/imx.c |static void |imx_console_write(struct console *co, const char *s, unsigned int count) <-+ {struct imx_port *sport = imx_ports[co->index];struct imx_port_ucrs old_ucr;unsigned int ucr1;unsigned long flags;int locked = 1;local_irq_save(flags);if (sport->port.sysrq)locked = 0;elsespin_lock(&sport->port.lock);/** First, save UCR1/2/3 and then disable interrupts*/imx_port_ucrs_save(&sport->port, &old_ucr);ucr1 = old_ucr.ucr1;if (cpu_is_mx1())ucr1 |= MX1_UCR1_UARTCLKEN;ucr1 |= UCR1_UARTEN;ucr1 &= ~(UCR1_TXMPTYEN | UCR1_RRDYEN | UCR1_RTSDEN);writel(ucr1, sport->port.membase + UCR1);writel(old_ucr.ucr2 | UCR2_TXEN, sport->port.membase + UCR2);uart_console_write(&sport->port, s, count, imx_console_putchar);/** Finally, wait for transmitter to become empty* and restore UCR1/2/3*/while (!(readl(sport->port.membase + USR2) & USR2_TXDC));imx_port_ucrs_restore(&sport->port, &old_ucr);if (locked)spin_unlock(&sport->port.lock);local_irq_restore(flags);}。
imx6android4.3bsp开发实录之一lvds、HDMMI输出显示
imx6android4.3bsp开发实录之一lvds、HDMMI输出显示手上有多块屏LVDS双通道,LVDS单通道,HDMI1980P,怎么说了,这个私活真的有点坑的,不过还好,做起来也容易案例一 LVDS单通道相信看过freescale驱动源码的都知道,显示这块支持好几种模式,下面贴一下代码mxc_ipuv3_fb.c freescale GPU驱动文件路径myandroid/kernel_imx/drivers/video/mxc/ldb.c里/** "ldb=spl0/1" -- split mode on DI0/1* "ldb=dul0/1" -- dual mode on DI0/1* "ldb=sin0/1" -- single mode on LVDS0/1* "ldb=sep0/1" -- separate mode begin from LVDS0/1** there are two LVDS channels(LVDS0 and LVDS1) which can transfer video* datas, there two channels can be used as split/dual/single/separate mode.** split mode means display data from DI0 or DI1 will send to both channels* LVDS0+LVDS1.* dual mode means display data from DI0 or DI1 will be duplicated on LVDS0* and LVDS1, it said, LVDS0 and LVDS1 has the same content.* single mode means only work for DI0/DI1->LVDS0 or DI0/DI1->LVDS1.* separate mode means you can make DI0/DI1->LVDS0 and DI0/DI1->LVDS1 work* at the same time.*/好了,看了上面的支持的模式,对照手里的两块单通道和双通道的屏,还是一头雾水啊,找到了这个,可是分辨率怎么调整呢,没事我们一步一步来接下来是要看一个结构体,相信大家都不陌生,在myandroid/kernel_imx/include/linux/fb.h里有定义struct fb_videomode {const char *name; /* optional */u32 refresh; /* optional */u32 xres;u32 yres;u32 pixclock;u32 left_margin;u32 right_margin;u32 upper_margin;u32 lower_margin;u32 hsync_len;u32 vsync_len;u32 sync;u32 vmode;u32 flag;};好了,我们根据具体的屏的参数将其对应的修改,我这里单通道的屏分辨率是1024*768分辨率M121GNX2 R1{"LDB-1024P768", 60, 1024, 768, 15384,100, 100,12, 12,120, 14,FB_VMODE_NONINTERLACED,FB_MODE_IS_DETAILED,},双通道的分辨率是1440*900 M190PW01 V8 {"LDB-WXGA", 60, 1440, 900, 18868, 160, 160,12, 10,168, 10,FB_SYNC_EXT,FB_VMODE_NONINTERLACED,0,},{"LDB-XGA", 60, 1440, 900, 18501,220, 40,21, 7,60, 10,FB_SYNC_EXT,FB_VMODE_NONINTERLACED,0,},{"LDB-1080P60", 60, 1440, 900, 18868, 160, 160,12, 10,168, 10,FB_SYNC_EXT,FB_VMODE_NONINTERLACED,0,},修改完以上的参数,剩下的就是要修改我们uboot启动时候传递的参数了,这个相信大家比我还熟悉,我就不用明说了单通道显示的参数U-Boot > setenv bootargs console=ttymxc0,115200 init=/init video=mxcfb0:dev=ldb,LDB-1024PP768,if=RGB18 ldb=sin0 video=mxcfb1:off video=mxcfb2:off fbmem=10M fb0base=0x27b00000 vmalloc=400M androidboot.console=ttymxc0 androidboot.hardware=freescale 双通道显示的参数U-Boot > setenv bootargs console=ttymxc0,115200 init=/init video=mxcfb0:dev=ldb,LDB-XGA,if=RGB24 ldb=spl0 video=mxcfb1:off video=mxcfb2:off fbmem=10M fb0base=0x27b00000 vmalloc=400M androidboot.console=ttymxc0 androidboot.hardware=freescale以上是LVDS的修改,接下来我们说一下HDMI的1080p的调试其实方法差不多/* #16: 1920x1080p@60Hz 16:9 */100 [16] = {101 NULL, 60, 1920, 1080, 6734, 148, 88, 36, 4, 44, 5,102 FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,103 FB_VMODE_NONINTERLACED | FB_VMODE_ASPECT_16_9, 0,104 },U-Boot > setenv bootargs console=ttymxc0,115200 init=/init rw video=mxcfb0:dev=hdmi,1920x1080@60,bpp=25video=mxcfb1:off video=mxcfb2:off fbmem=10M,28M vmalloc=512M androidboot.console=ttymxc0 androidboot.hardware=freescaleU-Boot > setenv bootargs console=ttymxc0,115200 init=/init rw video=mxcfb0:dev=hdmi,1920x1080@60,if=RGB32,bpp=32 video=mxcfb1:off video=mxcfb2:off fbmem=40M,68M vmalloc=512M androidboot.console=ttymxc0 androidboot.hardware=freescale。
iMX6设备树配置方法
can1: flexcan@02090000 { compatible = "fsl,flexcan"; reg = <0x02090000 0x4000>; interrupts = <142>; interrupt-parent = <&intc>; clocks = <&clk 33>, <&clk 34>; clock-names = "can1Ipg", "can1Serial"; pinmux-0 = <&flexcan1_3>; gpio-binds = <&gpio3 5 1 0 5>; };
-> vxbClkLibShow
clock domain: dumbClkDm
id clock name
parent name
frequency
--------------------------------------------------------------------------------------------------
定义使用了 gpio-binds 属性,&gpio3 定义使用 gpio bank3,对应的 GPIO 序号为 4。其余参数定义由 gpio 节点的'#gpio-cells'限定,格式为:
<localID> <direction> <vlue> <delay>
5 - bank 内部 gpio 序号,即对应 gpio4,io5; 1 - 输入/输出模式,1 为输出,0 为输入; 0 - 输出电平,0 为低,1 为高; 5 - 延时时长
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Imx6q 详细学习笔记
开发环境:ubuntu 12.04.5 32位系统
开发板:天嵌TQIMX6Q开发板
需要的软件包:
gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12.tar.bz2(由天嵌提供)uboot-imx.tar.bz2
linux-2.6-imx.tar.bz2
busybox-1.21.0.tar.bz2
虚拟机 VMware 12
这些工具的下载地址为百度网盘,连接如下:
/s/1dETeap7
一、安装必备的工具
二、移植uboot
先将u-boot解压到工作目录,然后在终端下切换到uboot根目录。
由于这个版本的bsp是使用
令:
"mx6qsabresd"(如果没有改动的话,在277行),复制该行配置并添加在下面,然后修改为如下
是比较容易。
注意该部的所有操作均在mx6q_myimx6q.c中。
(1) 修改串口端子。
具体修改内容如下:
其中,CROSS_COMPILE是交叉编译工具链的前缀,根据自己的实际情况修改。
如果前面的步骤操作正确,uboot就可以顺利编译通过了
烧写启动
经过前面的移植工作,uboot已经可以正常运行在myimx6q开发板上了。
这个版本的uboot与之前版本的uboot编译出的目标文件不同,将sd卡插入到电脑,回到uboot根目录,具体的烧写指令如下:
三、移植内核系统。
准备工作
每次移植kernel的时候都会做的工作就是找到与当前开发板接近的config,其实uboot移植
的时候也是一样的。
由于myimx6q的芯片是imx6q的,所以,还是以mx6q_sabresd为例。
另外,自己动手移植BSP时应该充分使用官方文档,本人以为,以下文档是非常有用的:
(1) i.MX 6 BSP Porting Guide:该文档详细的记载了BSP移植的流程。
(2) i.MX 6 SABRE-SD Linux User's Guide:该文档详细的记载了各种启动介质的制作方法。
在第二份文章中搜索defconfig,就可以找到imx6q使用的config文件是:imx_v7_defconfig,如果直接在arch/arm/configs目录下grep搜索MX6Q的话,可以搜到三个文件,其实也是可以确认使用哪个配置文件比较合适的。
确定好了配置文件,接下看就开始内核移植。
本文的目前不是移植好所有的驱动,而是先让内
核能够在myimx6q开发板上跑起来,接下来再去慢慢各个击破驱动。
Step1.定制DTS
使用了新的DTB方式传递内核参数。
为此,需要配置内核,关闭老式ATAGS方式内核参数传递
修改并保存内核配置项之后就可以尝试编译内核了:
烧写镜像
内核编译完成后可以得到内核镜像zImage和DTB文件myimx6q.dtb,接下来我们将这两个文件烧写到SD卡并尝试启动开发板。
(1) 烧写内核镜像
10M的位置上。
启动内核
将SD卡插到开发板后给开发板上电,按任意键打断uboot启动,并按如下内容配置uboot环境
出现上述东西后,说明文件系统没有,下面可以移植文件系统了。
四、构建文件系统
其实构建文件系统还是比较简单的,注意几个地方,然后按部就班的来就可以了。
(1)创建根文件系统目录结构,
首先切换到imx6q目录,建立如下mkrootfs.sh:
到Busybox下载最新版的Busybox源码,放在imx6q目录下,我是用的是1.21.0版本,下载完后解压并进入busybox目录,首先是配置busybox
Compiler prefix (NEW),设置为编译器的前缀,我的是arm-linux-。
另外选择Busybox Settings -> Build Options ->Build BusyBox as a static binary (no shared libs),这样
了,执行
在进入rootfs/etc目录下创建inittab文件,内容如下
在etc/sysconfig目录下创建HOSTNAME文件,在文件中写入主机名,我这里写的是MyImx6q。
到此根文件系统已经建立完成
五、制作启动SD卡
上面我们已经成功建立的根文件系统,下面我们需要把跟文件系统烧写到SD卡里面。
下面开始制作启动SD卡:
Step1.使用fdisk命令对SD卡进行分区
(1) 启动分区指令
其中sdb请根据自己的实际情况制定,执行之前一定要再三确认好,以免误操作导致文件丢失。
插入SD卡到电脑,执行指令。
按u然后回车,重复操作直至切换到sector模式。
按d然后回车,重复操作直至删除所有分区。
按n创建新分区。
按p选择为主分区。
(6) 输入起始偏移
输入"+20M",指定该分区的起始位置是20M的位置上。
(7) 输入结束偏移
本文仅使用了一个分区,故直接按回车,表示该分区的结束位置是磁盘的末尾。
(8) 保存分区信息
按w然后回车,即可保存分区信息。
使用mkfs命令格式化新创建的分区,对于移动设备,可以考虑使用ext3或者ext4文件系统,指令如下:
重新插拔SD卡,这个时候ubuntu系统应该可以识别到U盘了。