IMX6ULL - 移植linux-imx_5.4.70_2.3.0

发布者:Huixin8888最新更新时间:2025-02-28 来源: cnblogs关键字:移植 手机看文章 扫描二维码
随时随地手机看文章

一、说明

主机系统:Ubuntu 20.04.3 LTS


开发板:TOPEET-IMX6ULL


Linux版本:linux-imx_5.4.70_2.3.0


交叉编译器:gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf


有了前面IMX6ULL-移植uboot-imx_v2020.04_5.4.70_2.3.0的基础再进行Linux移植就会方便很多。因为Linux的移植更多的是对设备树的修改,而在Uboot移植时已经修改过设备树,所以接下来会省不少事。


二、环境搭建

2.1、Linux源码

获取NXP维护的Linux内核源码:


git clone https://source.codeaurora.org/external/imx/linux-imx

使用命令git tag -a查看版本然后git checkout -b 切换到目标版本:


git checkout -b rel_imx_5.4.70_2.3.0

接下来就基于版本源码进行linux内核移植


2.2、交叉编译器

参考IMX6ULL-移植uboot-imx_v2020.04_5.4.70_2.3.0的2.2小节


三、编译源码

linux源码根目录下创建编译脚本make.sh内容如下:


#!/bin/bash


# 若之前已经导入到环境变量则不需要

export PATH=$PATH:/usr/local/arm/gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf/bin

# 若已经在顶层Makefile文件中指定则不需要

export ARCH=arm

# 若已经在顶层Makefile文件中指定则不需要

export CROSS_COMPILE=arm-none-linux-gnueabihf-


make distclean

# make mrproper


# For I.MX6 --> imx_v7_defconfig

# For I.MX7 --> imx_v7_defconfig

# For I.MX8 --> imx_v8_defconfig

make imx_v7_defconfig


# make menuconfig

 make -j $(nproc) all


执行编译./make.sh并等待编译完成,如果没有错误出现说明搭建环境OK。


补充说明:


make命令


/imx6ull/kernel/linux-imx_5.4.70_2.3.0$ make help

Cleaning targets:

  clean   - Remove most generated files but keep the config and

                    enough build support to build external modules

  mrproper   - Remove all generated files + config + various backup files

  distclean   - mrproper + remove editor backup and patch files


Configuration targets:

  config   - Update current config utilising a line-oriented program

  nconfig         - Update current config utilising a ncurses menu based program

  menuconfig   - Update current config utilising a menu based program

  xconfig   - Update current config utilising a Qt based front-end

  gconfig   - Update current config utilising a GTK+ based front-end

  oldconfig   - Update current config utilising a provided .config as base

  localmodconfig  - Update current config disabling modules not loaded

  localyesconfig  - Update current config converting local mods to core

  defconfig   - New config with default from ARCH supplied defconfig

  savedefconfig   - Save current config as ./defconfig (minimal config)

  allnoconfig   - New config where all options are answered with no

  allyesconfig   - New config where all options are accepted with yes

  allmodconfig   - New config selecting modules when possible

  alldefconfig    - New config with all symbols set to default

  randconfig   - New config with random answer to all options

  listnewconfig   - List new options

  olddefconfig   - Same as oldconfig but sets new symbols to their

                    default value without prompting

  kvmconfig   - Enable additional options for kvm guest kernel support

  xenconfig       - Enable additional options for xen dom0 and guest kernel support

  tinyconfig   - Configure the tiniest possible kernel

  testconfig   - Run Kconfig unit tests (requires python3 and pytest)


Other generic targets:

  all   - Build all targets marked with [*]

* vmlinux   - Build the bare kernel

* modules   - Build all modules

  modules_install - Install all modules to INSTALL_MOD_PATH (default: /)

  dir/            - Build all files in dir and below

  dir/file.[ois]  - Build specified target only

  dir/file.ll     - Build the LLVM assembly file

                    (requires compiler support for LLVM assembly generation)

  dir/file.lst    - Build specified mixed source/assembly target only

                    (requires a recent binutils and recent build (System.map))

  dir/file.ko     - Build module including final link

  modules_prepare - Set up for building external modules

  tags/TAGS   - Generate tags file for editors

  cscope   - Generate cscope index

  gtags           - Generate GNU GLOBAL index

  kernelrelease   - Output the release version string (use with make -s)

  kernelversion   - Output the version stored in Makefile (use with make -s)

  image_name   - Output the image name (use with make -s)

  headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH

                    (default: ./usr)


Static analysers:

  checkstack      - Generate a list of stack hogs

  namespacecheck  - Name space analysis on compiled kernel

  versioncheck    - Sanity check on version.h usage

  includecheck    - Check for duplicate included header files

  export_report   - List the usages of all exported symbols

  headerdep       - Detect inclusion cycles in headers

  coccicheck      - Check with Coccinelle


Tools:

  nsdeps          - Generate missing symbol namespace dependencies


Kernel selftest:

  kselftest       - Build and run kernel selftest (run as root)

                    Build, install, and boot kernel before

                    running kselftest on it

  kselftest-clean - Remove all generated kselftest files

  kselftest-merge - Merge all the config dependencies of kselftest to existing

                    .config.


Userspace tools targets:

  use 'make tools/help'

  or  'cd tools; make help'


Kernel packaging:

  rpm-pkg             - Build both source and binary RPM kernel packages

  binrpm-pkg          - Build only the binary kernel RPM package

  deb-pkg             - Build both source and binary deb kernel packages

  bindeb-pkg          - Build only the binary kernel deb package

  snap-pkg            - Build only the binary kernel snap package (will connect to external hosts)

  tar-pkg             - Build the kernel as an uncompressed tarball

  targz-pkg           - Build the kernel as a gzip compressed tarball

  tarbz2-pkg          - Build the kernel as a bzip2 compressed tarball

  tarxz-pkg           - Build the kernel as a xz compressed tarball

  perf-tar-src-pkg    - Build perf-5.4.70.tar source tarball

  perf-targz-src-pkg  - Build perf-5.4.70.tar.gz source tarball

  perf-tarbz2-src-pkg - Build perf-5.4.70.tar.bz2 source tarball

  perf-tarxz-src-pkg  - Build perf-5.4.70.tar.xz source tarball


Documentation targets:

 Linux kernel internal documentation in different formats from ReST:

  htmldocs        - HTML

  latexdocs       - LaTeX

  pdfdocs         - PDF

  epubdocs        - EPUB

  xmldocs         - XML

  linkcheckdocs   - check for broken external links (will connect to external hosts)

  refcheckdocs    - check for references to non-existing files under Documentation

  cleandocs       - clean all generated files


  make SPHINXDIRS='s1 s2' [target] Generate only docs of folder s1, s2

  valid values for SPHINXDIRS are: 


  make SPHINX_CONF={conf-file} [target] use *additional* sphinx-build

  configuration. This is e.g. useful to build with nit-picking config.


  Default location for the generated documents is Documentation/output


Architecture specific targets (x86):

* bzImage      - Compressed kernel image (arch/x86/boot/bzImage)

  install      - Install kernel using

                  (your) ~/bin/installkernel or

                  (distribution) /sbin/installkernel or

                  install to $(INSTALL_PATH) and run lilo

  fdimage      - Create 1.4MB boot floppy image (arch/x86/boot/fdimage)

  fdimage144   - Create 1.4MB boot floppy image (arch/x86/boot/fdimage)

  fdimage288   - Create 2.8MB boot floppy image (arch/x86/boot/fdimage)

  isoimage     - Create a boot CD-ROM image (arch/x86/boot/image.iso)

                  bzdisk/fdimage*/isoimage also accept:

                  FDARGS='...'  arguments for the booted kernel

                  FDINITRD=file initrd for the booted kernel


  i386_defconfig           - Build for i386

  x86_64_defconfig         - Build for x86_64


  make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build

  make V=2   [targets] 2 => give reason for rebuild of target

  make O=dir [targets] Locate all output files in 'dir', including .config

  make C=1   [targets] Check re-compiled c source with $CHECK (sparse by default)

  make C=2   [targets] Force check of all c source with $CHECK

  make RECORDMCOUNT_WARN=1 [targets] Warn about ignored mcount sections

  make W=n   [targets] Enable extra build checks, n=1,2,3 where

[1] [2] [3]
关键字:移植 引用地址:IMX6ULL - 移植linux-imx_5.4.70_2.3.0

上一篇:IMX6ULL-移植uboot-imx_v2020.04_5.4.70_2.3.0
下一篇:IMX6ULL - Linux根文件系统(rootfs)构建

推荐阅读最新更新时间:2026-02-11 09:50

迅为imx6ull开发板移植Debian文件系统
本教程将带领大家移植 Debian 文件系统到 i.MX6ULL 终结者开发板上。 1 安装 Qemu 和 Debootstrap 由于我们是在 Ubuntu 上构建的 debian 的文件系统,所以安装这俩个工具我们直接使用 apt-get 命令即可。命令如下: apt-get install binfmt-support qemu qemu-user-static debootstrap如下图所示: 2 抽取 Debain 文件系统 抽取文件系统我们使用的是 debootstrap 命令,我们执行以下命令即可从 debian 下载源中获取到文件系统: debootstrap --arch=armhf --foreign bu
[单片机]
迅为<font color='red'>imx6ull</font>开发板<font color='red'>移植</font>Debian文件系统
迅为-iMX6ULL开发板-移植mjpg-streamer实现远程监控
本章节使用的资料已经放到了开发板网盘资料中,路径为:11_Linux 系统开发进阶97_章节使用资料。 本章节介绍移植 MJPG 库和 mjpg-streamer 服务器到迅为 i.MX6ULL 终结者开发板上,并将采集到的图像通过网络在 PC 机上显示出来,交叉编译工具为 arm-linux-gnueabihf,摄像头为 USB 免驱摄像头。 97.1 移植 MJPG 库 因为使用 mjpg-streamer 要用到 MJPG 库,所以我们要先把 MJPG 库移植到开发板上。 MJPG 是 MJPEG 的缩写,MJPEG 是一种视频编码格式,但是 MJPEG 还可以表示文件格式扩展名,常用于闭合电路的电视摄像机的模拟视频信号
[单片机]
迅为-<font color='red'>iMX6ULL</font>开发板-<font color='red'>移植</font>mjpg-streamer实现远程监控
IMX6ULL学习笔记】五、U-BOOT移植与解析
一、移植自定义开发板流程 1、添加 mx6ull_kodo_emmc_defconfig 配置文件(.config) 在 /config s目录下,复制 mx6ull_14x14_evk_emmc_defconfig 文件,重命名为 mx6ull_kodo_emmc_defconfig 并修改其中内容,如下: CONFIG_SYS_EXTRA_OPTIONS= IMX_CONFIG=board/freescale/mx6ull_kodoboard/imximage.cfg,MX6ULL_EVK_EMMC_REWORK CONFIG_ARM=y CONFIG_ARCH_MX6=y CONFIG_TARGET_MX6ULL_K
[单片机]
【<font color='red'>IMX6ULL</font>学习笔记】五、U-BOOT<font color='red'>移植</font>与解析
imx6ull之Qt移植
开发板:飞凌 OKMX6ULL-S + 7寸电阻屏 交叉编译工具链:gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf Qt:qt-everywhere-opensource-src-5.9.0.tar 一、移植   1、上传并解压:tar -xvf qt-everywhere-opensource-src-5.9.0.tar   2、将之前编译好的tslib库复制到/opt下     sudo cp TSLIB_INSTALL/ /opt/ -rf   3、修改与配置     cd qt-everywhere-opensource-src-5.9.0/     vi qtb
[单片机]
<font color='red'>imx6ull</font>之Qt<font color='red'>移植</font>
Linux4.1.15内核移植-imx6ull
一、Linux内核编译 1、修改顶层Makefile 第252行修改: ARCH ?= arm CROSS_COMPLIE ?= arm-linux-gnueabihf- 2、配置并编译Linux内核 make clean make imx_v7_mfg_defconfig 3、Linux内核启动测试   1、确保以下变量配置     console=ttymxc0,115200 root=/dev/mmcblk1p2 rootwait rw   2、将zImage和设备树文件拷贝到tftp服务器目录下   3、下载内核与设备树文件到开发板中,并启动内核 tftp 80800000 zImage tftp
[单片机]
使用迅为IMX6ULL开发板第一个汇编实验(二)
94 .4 GPIO 时钟 时钟 如果使用 GPIO,我们必须要使能 GPIO 的时钟。i.MX6 ULL 的每个外设的时钟可以独立的使能,我们可以关闭不使用的外设时钟,可以达到节能的目的。如果使用某个外设,我们必须要打开对应的时钟。《I.MX6ULL 参考手册》的第 18 章“Clock Controller Module (CCM)”是关于 i.MX6ULL 时钟的讲解,我们可以看下该章节里面外设时钟的使能寄存器。跟外设时钟使能相关的寄存器有: CCM_CCGR0 CCM_CCGR1 CCM_CCGR2 CCM_CCGR3 CCM_CCGR4 CCM_CCGR5 CCM_CCGR6 一共 7 个。我们来看下 CCM_CCGR0
[单片机]
使用迅为<font color='red'>IMX6ULL</font>开发板第一个汇编实验(二)
迅为imx6ull开发板Linux I2C驱动实验-应用程序与I2C通信
本章内容对应视频讲解链接(在线观看): 程序源码在网盘资料“imx6ull 驱动程序配套资料21-Linux I2C 驱动实验”路径下。 我们可以先来体验一下,在 Linux 上操作 I2C 是多么的容易,我们可以先来看一下系统里面都有哪些 I2C的节点,这里以终结者 imx6ull 开发板为例。如下图所示: Linux 有一个非常重要的概念叫一切皆文件,那么我们能不能在应用层通过 open 这些节点来操作 I2C 来跟外设 I2C 通信的芯片进行一个数据交流呢?当然是可以的,我们来一起看一下,这里我们以 7 寸 RGB 屏幕上的触摸芯片 FT5X06 为例,迅为所有开发板都是支持迅为 7 寸 RGB 屏幕屏的,所有都是可以进
[单片机]
迅为<font color='red'>imx6ull</font>开发板Linux I2C驱动实验-应用程序与I2C通信
迅为IMX6ULL开发板Linux驱动初探-最简单的设备驱动-helloworld
经过前面的学习,我们了解了驱动开发的框架,本章节将带领大家实验操作,写最简单的驱动-helloworld。 Linux 设备驱动会以内核模块的形式出现,因为 linux 内核的整体架构就非常庞大,包含的组件也非常多,如果把所有的功能都编译到 linux 内核中会使得内核非常臃肿,为了解决这个问题,更方便地新增和删除功能,linux 提供了这样的机制,这种机制被称为模块。为了大家对模块有一个感性的认识,我们先来看一个最简单的驱动-helloworld。 驱动分为四个部分:  头文件  驱动模块的入口函数和出口函数  声明信息  功能实现 我们在 windows 上面新建一个 helloworld.c 文件,这里使用 sour
[单片机]
迅为<font color='red'>IMX6ULL</font>开发板Linux驱动初探-最简单的设备驱动-helloworld
小广播
最新单片机文章
何立民专栏 单片机及嵌入式宝典

北京航空航天大学教授,20余年来致力于单片机与嵌入式系统推广工作。

厂商技术中心

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

 
机器人开发圈

电子工程世界版权所有 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2026 EEWORLD.com.cn, Inc. All rights reserved