头图

一、关于 kernel

1、下载

tiansong@tiansong:~$ pwd
/home/tiansong

# 下载
tiansong@tiansong:~/100ask_imx6ull_pro$ git clone http://source.codeaurora.cn/external/imx/linux-imx

# 切换分支
tiansong@tiansong:~/100ask_imx6ull_pro$ cd linux-imx/
## 查看所有分支
tiansong@tiansong:~/100ask_imx6ull_pro/linux-imx$ git branch -a
## 切换到 imx 最新分支
tiansong@tiansong:~/100ask_imx6ull_pro/linux-imx$ git checkout remotes/origin/imx_5.4.70_2.3.0
## 确认是否切换成功
tiansong@tiansong:~/100ask_imx6ull_pro/linux-imx$ git log -1

2、 开发板文件适配

默认的配置文件

复制公版提供的默认配置文件
tiansong@tiansong:~/100ask_imx6ull_pro/linux-imx/arch/arm/configs$ pwd
/home/tiansong/100ask_imx6ull_pro/linux-imx/arch/arm/configs
tiansong@tiansong:~/100ask_imx6ull_pro/linux-imx/arch/arm/configs$ cp imx_v7_defconfig 100ask_imx6ull_pro_emmc_defconfig
复制公版提供设备树
tiansong@tiansong:~/100ask_imx6ull_pro/linux-imx/arch/arm/boot/dts$ pwd
/home/tiansong/100ask_imx6ull_pro/linux-imx/arch/arm/boot/dts

tiansong@tiansong:~/100ask_imx6ull_pro/linux-imx/arch/arm/boot/dts$ cp imx6ull-14x14-evk-emmc.dts 100ask_imx6ull_pro_emmc.dts
tiansong@tiansong:~/100ask_imx6ull_pro/linux-imx/arch/arm/boot/dts$ cp imx6ull-14x14-evk.dts 100ask_imx6ull_pro.dts
tiansong@tiansong:~/100ask_imx6ull_pro/linux-imx/arch/arm/boot/dts$ cp imx6ul-14x14-evk.dtsi 100ask_imx6ull_pro.dtsi
修改 100ask_imx6ull_pro_emmc.dts
#include "imx6ull-14x14-evk.dts"
👉
#include "100ask_imx6ull_pro.dts
修改 100ask_imx6ull_pro.dts
#include "imx6ull.dtsi"
#include "imx6ul-14x14-evk.dtsi"

model = "Freescale i.MX6 ULL 14x14 EVK Board";
👉
#include "100ask_imx6ull_pro.dtsi"

model = "100ASK IMX6ULL PRO EMMC Board";
修改 100ask_imx6ull_pro.dtsi
# 1.修改 backlight_display 节点
backlight_display: backlight-display {
        compatible = "pwm-backlight";
        pwms = <&pwm1 0 1000>;  // 默认设备树中频率过高,背光控制芯片 滋滋滋 ~
        brightness-levels = <0 4 8 16 32 64 128 255>;
        default-brightness-level = <6>;
        status = "okay";
};

# 2.修改网口节点
&fec1 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_enet1>;
        phy-mode = "rmii";
        phy-handle = <&ethphy0>;
        status = "disabled";  // 修改
};

&fec2 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_enet2>;
        phy-mode = "rmii";
        phy-handle = <&ethphy1>;
        phy-reset-gpios = <&gpio5 6 GPIO_ACTIVE_LOW>;  // 新增
        phy-reset-duration = <50>;                     // 新增
        status = "okay";

        mdio {
                #address-cells = <1>;
                #size-cells = <0>;

                ethphy0: ethernet-phy@2 {
                        reg = <0>;  
                        smsc,led-mode = <1>;
                        clocks = <&clks IMX6UL_CLK_ENET_REF>;
                        clock-names = "rmii-ref";
                };

                ethphy1: ethernet-phy@1 {
                        reg = <1>;
                        smsc,led-mode = <1>;
                        clocks = <&clks IMX6UL_CLK_ENET2_REF>;
                        clock-names = "rmii-ref";
                };
        };
};

pinctrl_enet2: enet2grp {
        fsl,pins = <
                MX6UL_PAD_GPIO1_IO07__ENET2_MDC         0x1b0b0
                MX6UL_PAD_GPIO1_IO06__ENET2_MDIO        0x1b0b0
                MX6UL_PAD_ENET2_RX_EN__ENET2_RX_EN      0x1b0b0
                MX6UL_PAD_ENET2_RX_ER__ENET2_RX_ER      0x1b0b0
                MX6UL_PAD_ENET2_RX_DATA0__ENET2_RDATA00 0x1b0b0
                MX6UL_PAD_ENET2_RX_DATA1__ENET2_RDATA01 0x1b0b0
                MX6UL_PAD_ENET2_TX_EN__ENET2_TX_EN      0x1b0b0
                MX6UL_PAD_ENET2_TX_DATA0__ENET2_TDATA00 0x1b0b0
                MX6UL_PAD_ENET2_TX_DATA1__ENET2_TDATA01 0x1b0b0
                MX6UL_PAD_ENET2_TX_CLK__ENET2_REF_CLK2  0x4001b031
                /* used for phy reset */
                MX6ULL_PAD_SNVS_TAMPER6__GPIO5_IO06     0x1b0b0  // 增加复位引脚
        >;
};

# 3.修改 lcd 节点
&lcdif {
        assigned-clocks = <&clks IMX6UL_CLK_LCDIF_PRE_SEL>;
        assigned-clock-parents = <&clks IMX6UL_CLK_PLL5_VIDEO_DIV>;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_lcdif_dat
                     &pinctrl_lcdif_ctrl>;
        display = <&display0>;
        status = "okay";
        reset-gpios = <&gpio3 4 GPIO_ACTIVE_LOW>;

        display0: display@0 {
                bits-per-pixel = <24>;
                bus-width = <24>;

                display-timings {
                        native-mode = <&timing0>;

                        timing0: timing0 {
                                clock-frequency = <50000000>;
                                hactive = <1024>;
                                vactive = <600>;
                                hfront-porch = <160>;
                                hback-porch = <140>;
                                hsync-len = <20>;
                                vback-porch = <20>;
                                vfront-porch = <12>;
                                vsync-len = <3>;

                                hsync-active = <0>;
                                vsync-active = <0>;
                                de-active = <1>;
                                pixelclk-active = <0>;
                        };
                };
        };
};

 pinctrl_lcdif_ctrl: lcdifctrlgrp {
                fsl,pins = <
                        MX6UL_PAD_LCD_CLK__LCDIF_CLK        0x79
                        MX6UL_PAD_LCD_ENABLE__LCDIF_ENABLE  0x79
                        MX6UL_PAD_LCD_HSYNC__LCDIF_HSYNC    0x79
                        MX6UL_PAD_LCD_VSYNC__LCDIF_VSYNC    0x79
                        /* used for lcd reset */
                        MX6UL_PAD_LCD_RESET__GPIO3_IO04     0x1b0b0  // 增加复位引脚
                >;
        };
修改 /home/tiansong/100ask_imx6ull_pro/linux-imx/arch/arm/boot/dts/Makefile
dtb-$(CONFIG_SOC_IMX6UL) += \
...
imx6ull-14x14-evk.dtb \
100ask_imx6ull_pro.dtb \         # 新增
imx6ull-14x14-evk-emmc.dtb \
100ask_imx6ull_pro_emmc.dtb \    # 新增
...

3、配置及编译

安装环境依赖

sudo apt-get install libssl-dev

生成 .config 文件

tiansong@tiansong:~/100ask_imx6ull_pro/linux-imx$ pwd
/home/tiansong/100ask_imx6ull_pro/linux-imx

tiansong@tiansong:~/100ask_imx6ull_pro/linux-imx$ make distclean

tiansong@tiansong:~/100ask_imx6ull_pro/linux-imx$ make 100ask_imx6ull_pro_emmc_defconfig

图形化配置

使能 SMSC PHY 支持, 目录项:Device Drivers --> Network device support --> PHY Device support and infrasttructure

image.png

编译

tiansong@tiansong:~/100ask_imx6ull_pro/linux-imx$ make -j12

tiansong@tiansong:~/100ask_imx6ull_pro/linux-imx$ ls arch/arm/boot/zImage -l
-rwxrwxr-x 1 tiansong tiansong 8998576  8月 30 19:16 arch/arm/boot/zImage

tiansong@tiansong:~/100ask_imx6ull_pro/linux-imx$ ls arch/arm/boot/dts/100ask_imx6ull_pro_emmc.dtb -l
-rw-rw-r-- 1 tiansong tiansong 35808  8月 30 19:54 arch/arm/boot/dts/100ask_imx6ull_pro_emmc.dtb

4、安装 tftp 服务

目的:kernel 在 调试过程中,会不断的修改、编译,之后再将 zImagedtb 传输到开发板执行。为了方便这一过程,开发板的 uboot 使用 tftp 下载 ubuntu 中的 zImagedtb 启动。

安装 tftp 服务
sudo apt-get install tftp-hpa tftpd-hpa
创建 tftp 工作目录
mkdir -p /home/tiansong/tftpboot
sudo chmod 777 /home/tiansong/tftpboot/
添加配置信息
sudo vim /etc/default/tftpd-hpa

# 文件末尾添加
TFTP_DIRECTORY="/home/tiansong/tftpboot"
TFTP_OPTIONS="-l -c -s"
重启 tftp 服务
 sudo service tftpd-hpa restart

5、开发板 tftp 启动 & kernel 验证

uboot 命令行依次输入 【172.16.10.228 为 ubuntu 地址】
=> setenv fdt_file 100ask_imx6ull_pro_emmc.dtb
=> setenv serverip 172.16.10.228
=> run netboot
tftp 下载 zImage

image.png

tftp 下载 dtb

image.png

内核启动

image.png

网卡工作正常

image.png

lcd 观察 (🐧)

image.png

注意:下图提示未能正确挂载根文件系统(是正常现象,根文件系统在 buildroot 部分制作)

image.png

6、文件及代码管理

默认配置文件更新
tiansong@tiansong:~/100ask_imx6ull_pro/linux-imx$ make savedefconfig
scripts/kconfig/conf  --savedefconfig=defconfig Kconfig

tiansong@tiansong:~/100ask_imx6ull_pro/linux-imx$ ls defconfig -l
-rw-rw-r-- 1 tiansong tiansong 13756  8月 30 20:42 defconfig

tiansong@tiansong:~/100ask_imx6ull_pro/linux-imx$ cp defconfig ./arch/arm/configs/100ask_imx6ull_pro_emmc_defconfig

二、关于 buildroot

1、下载

最新长期支持版 : https://buildroot.org/downloa...

image.png

tiansong@tiansong:~/100ask_imx6ull_pro$ tar -xvf buildroot-2022.02.4.tar.xz

tiansong@tiansong:~/100ask_imx6ull_pro/buildroot-2022.02.4$ ls
arch   boot     Config.in         configs  DEVELOPERS  fs     Makefile         package  support  toolchain
board  CHANGES  Config.in.legacy  COPYING  docs        linux  Makefile.legacy  README   system   utils

2、安装依赖

安装必要依赖

参考buildroot官方手册 Chapter 2 : https://buildroot.org/downloa...

image.png

tiansong@tiansong:~/100ask_imx6ull_pro/buildroot-2022.02.4$ sudo apt install -y sed make binutils build-essential gcc g++ patch gzip bzip2 perl tar cpio \
unzip rsync file bc wget

安装可选依赖

tiansong@tiansong:~/100ask_imx6ull_pro/buildroot-2022.02.4$ sudo apt install -y wget python3 libncurses5 bzr cvs git mercurial rsync subversion

3、开发板文件适配

复制公版提供的默认配置文件
tiansong@tiansong:~/100ask_imx6ull_pro/buildroot-2022.02.4$ ls configs/*6ull* -l
-rw-rw-r-- 1 tiansong tiansong  974  7月 29 17:39 configs/freescale_imx6ullevk_defconfig
-rw-rw-r-- 1 tiansong tiansong 1013  7月 29 17:39 configs/imx6ullevk_defconfig
生成 .config 文件
tiansong@tiansong:~/100ask_imx6ull_pro/buildroot-2022.02.4$ cd configs/
tiansong@tiansong:~/100ask_imx6ull_pro/buildroot-2022.02.4$ cp imx6ullevk_defconfig 100ask_imx6ull_pro_emmc_defconfig
tiansong@tiansong:~/100ask_imx6ull_pro/buildroot-2022.02.4/configs$ cd ..
tiansong@tiansong:~/100ask_imx6ull_pro/buildroot-2022.02.4$ make 100ask_imx6ull_pro_emmc_defconfig

4、图形化配置工具链

tiansong@tiansong:~/100ask_imx6ull_pro/buildroot-2022.02.4$ make menuconfig

image.png

注意红框标记的内容

image.png

关于 Toolchain/Tool path
tiansong@tiansong:~/100ask_imx6ull_pro/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf$ whereis arm-none-linux-gnueabihf-gcc
arm-none-linux-gnueabihf-gcc: /home/tiansong/100ask_imx6ull_pro/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-gcc
关于 Toolchain/prefix

image.png

关于 Toolchain/External toolchain gcc version
tiansong@tiansong:~/100ask_imx6ull_pro/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf$ arm-none-linux-gnueabihf-gcc -v
Using built-in specs.
COLLECT_GCC=arm-none-linux-gnueabihf-gcc
COLLECT_LTO_WRAPPER=/home/tiansong/100ask_imx6ull_pro/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/../libexec/gcc/arm-none-linux-gnueabihf/11.3.1/lto-wrapper
Target: arm-none-linux-gnueabihf
Configured with: /data/jenkins/workspace/GNU-toolchain/arm-11/src/gcc/configure --target=arm-none-linux-gnueabihf --prefix= --with-sysroot=/arm-none-linux-gnueabihf/libc --with-build-sysroot=/data/jenkins/workspace/GNU-toolchain/arm-11/build-arm-none-linux-gnueabihf/install//arm-none-linux-gnueabihf/libc --with-bugurl=https://bugs.linaro.org/ --enable-gnu-indirect-function --enable-shared --disable-libssp --disable-libmudflap --enable-checking=release --enable-languages=c,c++,fortran --with-gmp=/data/jenkins/workspace/GNU-toolchain/arm-11/build-arm-none-linux-gnueabihf/host-tools --with-mpfr=/data/jenkins/workspace/GNU-toolchain/arm-11/build-arm-none-linux-gnueabihf/host-tools --with-mpc=/data/jenkins/workspace/GNU-toolchain/arm-11/build-arm-none-linux-gnueabihf/host-tools --with-isl=/data/jenkins/workspace/GNU-toolchain/arm-11/build-arm-none-linux-gnueabihf/host-tools --with-arch=armv7-a --with-fpu=neon --with-float=hard --with-mode=thumb --with-arch=armv7-a --with-pkgversion='Arm GNU Toolchain 11.3.Rel1'
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.3.1 20220712 (Arm GNU Toolchain 11.3.Rel1)
关于 Toolchain/External toolchain kernel header series
暂时选定 4.20 如果不匹配,编译时会报错提示版本信息,再依据提示进行修改

5、编译根文件系统

确认 buildroot 中未选中 Linux kernel

image.png

确认 buildroot 中未选中 Bootloader/uboot

image.png

编译
tiansong@tiansong:~/100ask_imx6ull_pro/buildroot-2022.02.4$ pwd
/home/tiansong/100ask_imx6ull_pro/buildroot-2022.02.4
tiansong@tiansong:~/100ask_imx6ull_pro/buildroot-2022.02.4$ make
注意,在编译过程中buildroot会在网络下载依赖包,下载失败\慢时可中终止编译【CTRL+C】,使用 迅雷 下载上传到 /home/tiansong/100ask_imx6ull_pro/buildroot-2022.02.4/dl,之后再重新开始编译
编译结束,错误提示不能生成 zImage 是正常的,因为还未设置 kernel

image.png

可以看到根文件系统已经生成 /home/tiansong/100ask_imx6ull_pro/buildroot-2022.02.4/output/target

image.png

6、 安装 nfs 服务

目的在于开发板使用 nfs 挂载网络文件系统,检查 kernel 是否还存在问题
sudo apt-get install nfs-kernel-server
添加配置信息
sudo vim /etc/exports

# 文件末尾添加
/home/tiansong *(rw,nohide,insecure,no_subtree_check,async,no_root_squash)
重启 nfs 服务
sudo /etc/init.d/nfs-kernel-server restart

7、开发板 nfs 挂载根文件系统

uboot 命令行依次输入
=> setenv nfsroot /home/tiansong/100ask_imx6ull_pro/buildroot-2022.02.4/output/target
=> setenv fdt_file 100ask_imx6ull_pro_emmc.dtb
=> setenv serverip 172.16.10.228
=> run netboot
查看串口终端输出, 网络文件系统正常挂载

image.png

image.png

8、移植触摸驱动

此处借助buildroot构建好的 rootfs 可以完整的测试 kernel,当 kernel 全部符合预期后,使用 buildroot 制作最后镜像文件

修改设备树

检索所有设备树文件是否有使用 gt911
tiansong@tiansong:~/100ask_imx6ull_pro/linux-imx/arch/arm/boot/dts$ pwd
/home/tiansong/100ask_imx6ull_pro/linux-imx/arch/arm/boot/dts

tiansong@tiansong:~/100ask_imx6ull_pro/linux-imx/arch/arm/boot/dts$ grep -nwr "goodix,gt911"

imx6ul-ccimx6ulsbcpro.dts:122:          compatible = "goodix,gt911";
查看 imx6ul-ccimx6ulsbcpro.dts,可借鉴使用
&i2c1 {
        touchscreen@14 {
                compatible = "goodix,gt911";
                reg = <0x14>;
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_goodix_touch>;
                interrupt-parent = <&gpio5>;
                interrupts = <2 IRQ_TYPE_EDGE_RISING>;
                irq-gpios = <&gpio5 2 GPIO_ACTIVE_HIGH>;
                status = "okay";
        };
};
复制到 100ask_imx6ull_pro.dtsi 并修改
&i2c2 {
        clock-frequency = <100000>;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_i2c2>;
        status = "okay";

        touchscreen@5d {  // 新增节点
                compatible = "goodix,gt911";
                reg = <0x5d>;
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_tsc>;
                interrupt-parent = <&gpio1>;
                interrupts = <5 IRQ_TYPE_EDGE_FALLING>;
                irq-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>;
                reset-gpios = <&gpio5 2 GPIO_ACTIVE_HIGH>;
                status = "okay";
        };

        codec: wm8960@1a {
                #sound-dai-cells = <0>;
                compatible = "wlf,wm8960";
                reg = <0x1a>;
                wlf,shared-lrclk;
                clocks = <&clks IMX6UL_CLK_SAI2>;
                clock-names = "mclk";
        };

        ov5640: ov5640@3c {
                compatible = "ovti,ov5640";
                reg = <0x3c>;
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_csi1>;
                clocks = <&clks IMX6UL_CLK_CSI>;
                clock-names = "csi_mclk";
                pwn-gpios = <&gpio_spi 6 1>;
                rst-gpios = <&gpio_spi 5 0>;
                csi_id = <0>;
                mclk = <24000000>;
                mclk_source = <0>;
                status = "disabled";
                port {
                        ov5640_ep: endpoint {
                                remote-endpoint = <&csi1_ep>;
                        };
                };
        };
};

// ...

&tsc {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_tsc>;
        xnur-gpio = <&gpio1 3 GPIO_ACTIVE_LOW>;
        measure-delay-time = <0xffff>;
        pre-charge-time = <0xfff>;
        status = "disabled";  // 修改节点
};

// ...

pinctrl_tsc: tscgrp {   // 修改节点
        fsl,pins = <
                MX6ULL_PAD_SNVS_TAMPER2__GPIO5_IO02   0x000110A0
                MX6UL_PAD_GPIO1_IO05__GPIO1_IO05      0x000010B0
        >;
};

编译测试

编译设备树
tiansong@tiansong:~/100ask_imx6ull_pro/linux-imx$ pwd

/home/tiansong/100ask_imx6ull_pro/linux-imx
tiansong@tiansong:~/100ask_imx6ull_pro/linux-imx$ make dtbs
  DTC     arch/arm/boot/dts/100ask_imx6ull_pro.dtb
  DTC     arch/arm/boot/dts/100ask_imx6ull_pro_emmc.dtb

tiansong@tiansong:~/100ask_imx6ull_pro/linux-imx$ cp arch/arm/boot/dts/100ask_imx6ull_pro_emmc.dtb ~/tftpboot/
uboot 命令行依次输入
=> setenv nfsroot /home/tiansong/100ask_imx6ull_pro/buildroot-2022.02.4/output/target
=> setenv fdt_file 100ask_imx6ull_pro_emmc.dtb
=> setenv serverip 172.16.10.228
=> run netboot
开发板网络启动,观察输出日志

image.png

hexdump 测试 (运行后触摸屏幕观察输出)

image.png

9、文件及代码管理

默认配置文件更新
tiansong@tiansong:~/100ask_imx6ull_pro/linux-imx$ make savedefconfig
scripts/kconfig/conf  --savedefconfig=defconfig Kconfig

tiansong@tiansong:~/100ask_imx6ull_pro/linux-imx$ ls defconfig -l
-rw-rw-r-- 1 tiansong tiansong 13756  8月 30 20:42 defconfig

tiansong@tiansong:~/100ask_imx6ull_pro/linux-imx$ cp defconfig ./arch/arm/configs/100ask_imx6ull_pro_emmc_defconfig
本地 git 仓库提交
tiansong@tiansong:~/100ask_imx6ull_pro/linux-imx$ git status
HEAD detached at origin/imx_5.4.70_2.3.0
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   arch/arm/boot/dts/Makefile

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        arch/arm/boot/dts/100ask_imx6ull_pro.dts
        arch/arm/boot/dts/100ask_imx6ull_pro.dtsi
        arch/arm/boot/dts/100ask_imx6ull_pro_emmc.dts
        arch/arm/configs/100ask_imx6ull_pro_emmc_defconfig
        defconfig

no changes added to commit (use "git add" and/or "git commit -a")
tiansong@tiansong:~/100ask_imx6ull_pro/linux-imx$ git add -A
tiansong@tiansong:~/100ask_imx6ull_pro/linux-imx$ git commit -m "适配 100ask_imx6ull_pro 开发板"
tiansong@tiansong:~/100ask_imx6ull_pro/linux-imx$ git log -1
commit 1e602d9f519c00c85461ac74a966c4f850074569 (HEAD)
Author: TianSong <1508539502@qq.com>
Date:   Sun Sep 4 18:10:57 2022 +0800

    适配 100ask_imx6ull_pro 开发板

10、buidroot 管理 uboot

图形化配置

tiansong@tiansong:~/100ask_imx6ull_pro/buildroot-2022.02.4$ pwd
/home/tiansong/100ask_imx6ull_pro/buildroot-2022.02.4

tiansong@tiansong:~/100ask_imx6ull_pro/buildroot-2022.02.4$ make menuconfig
开启 uboot 支持,目录项 bootloaders/U-Boot

image.png

注意红框标记的内容

image.png

关于 URL of custom repository
tiansong@tiansong:~/100ask_imx6ull_pro/uboot-imx$ pwd
/home/tiansong/100ask_imx6ull_pro/uboot-imx
关于 Custom repository version
commit 9f96361312aeeba348bf8b563a22479d6d2f6c23 (HEAD)
Author: TianSong <1508539502@qq.com>
Date:   Fri Aug 26 21:38:36 2022 +0800

    适配 100ask_imx6ull_pro 开发板
关于 Board defconfig
tiansong@tiansong:~/100ask_imx6ull_pro/uboot-imx/configs$ ls 100ask_imx6ull_pro_emmc_defconfig
100ask_imx6ull_pro_emmc_defconfig
关于 U-Boot binary format -->

image.png

编译

tiansong@tiansong:~/100ask_imx6ull_pro/buildroot-2022.02.4$ make clean

tiansong@tiansong:~/100ask_imx6ull_pro/buildroot-2022.02.4$ pwd
/home/tiansong/100ask_imx6ull_pro/buildroot-2022.02.4

tiansong@tiansong:~/100ask_imx6ull_pro/buildroot-2022.02.4$ make uboot-rebuild
查看编译结果
tiansong@tiansong:~/100ask_imx6ull_pro/buildroot-2022.02.4/output/images$ pwd
/home/tiansong/100ask_imx6ull_pro/buildroot-2022.02.4/output/images
tiansong@tiansong:~/100ask_imx6ull_pro/buildroot-2022.02.4/output/images$ ls
u-boot-dtb.imx

烧写运行

lcd 正常显示,kernel 正常启动 (此时根文件系统未正常挂载,是正常现象)

11、buildroot 管理 kernel

图形化配置

tiansong@tiansong:~/100ask_imx6ull_pro/buildroot-2022.02.4$ pwd
/home/tiansong/100ask_imx6ull_pro/buildroot-2022.02.4

tiansong@tiansong:~/100ask_imx6ull_pro/buildroot-2022.02.4$ make menuconfig
开启 kernel 支持,目录项 Kernel/Linux Kernel

image.png

注意红框标记的内容

image.png

关于 URL of custom repository
tiansong@tiansong:~/100ask_imx6ull_pro/linux-imx$ pwd
/home/tiansong/100ask_imx6ull_pro/linux-imx
关于 Custom repository version
tiansong@tiansong:~/100ask_imx6ull_pro/linux-imx$ git log -1
commit 1e602d9f519c00c85461ac74a966c4f850074569 (HEAD)
Author: TianSong <1508539502@qq.com>
Date:   Sun Sep 4 18:10:57 2022 +0800

    适配 100ask_imx6ull_pro 开发板
关于 Defconfig name
tiansong@tiansong:~/100ask_imx6ull_pro/linux-imx/arch/arm/configs$ ls 100ask_imx6ull_pro_emmc_defconfig
100ask_imx6ull_pro_emmc_defconfig
关于 In-tree Device Tree Source file names
tiansong@tiansong:~/100ask_imx6ull_pro/linux-imx/arch/arm/boot/dts$ ls 100ask_imx6ull_pro_emmc.dts
100ask_imx6ull_pro_emmc.dts

编译

tiansong@tiansong:~/100ask_imx6ull_pro/buildroot-2022.02.4$ make clean

tiansong@tiansong:~/100ask_imx6ull_pro/buildroot-2022.02.4$ pwd
/home/tiansong/100ask_imx6ull_pro/buildroot-2022.02.4

tiansong@tiansong:~/100ask_imx6ull_pro/buildroot-2022.02.4$ make all
查看编译结果
tiansong@tiansong:~/100ask_imx6ull_pro/buildroot-2022.02.4/output/images$ ls zImage 100ask_imx6ull_pro_emmc.dtb
100ask_imx6ull_pro_emmc.dtb  zImage

烧写运行

lcd 正常显示,根文件系统正常挂载

文件及代码管理

tiansong@tiansong:~/100ask_imx6ull_pro/buildroot-2022.02.4$ make savedefconfig

参考资料


TianSong
737 声望139 粉丝

阿里山神木的种子在3000年前已经埋下,今天不过是看到当年注定的结果,为了未来的自己,今天就埋下一颗好种子吧