在正式修改uboot之前我们先创建vscode工程,方便修改。
uboot2020和以前的uboot不一样,uboot2020与linux的内核类似,使用设备树描述设备。这里就不分析源码。重点就是快速移植,所以根据uboot输出的调试信息,在源码中找到并修改。

从调试信息看,我第一个应该修改的是Model:的内容,我们复制这个内容“i.MX6 ULL 14x14 EVK Board”到源码中搜索,发现在设备树imx6ull-14x14-evk.dts中,我们肯定最好不要修改这个文件,不影响包含他的其他板子。这个文件的内容比较少,我们可以把他的内容复制到imx6ull-alpha-emmc.dts中,再修改,修改后:
/*
* Copyright 2019 NXP
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*/
/dts-v1/;
#include "imx6ull.dtsi"
#include "imx6ul-14x14-evk.dtsi"
#include "imx6ul-14x14-evk-u-boot.dtsi"
/ {
model = "i.MX6 ULL ALPHA EMMC Board";
compatible = "fsl,imx6ull-14x14-evk", "fsl,imx6ull";
};
&clks {
assigned-clocks = <&clks IMX6UL_CLK_PLL3_PFD2>;
assigned-clock-rates = <320000000>;
};
&usdhc2 {
pinctrl-names = "default", "state_100mhz", "state_200mhz";
pinctrl-0 = <&pinctrl_usdhc2_8bit>;
pinctrl-1 = <&pinctrl_usdhc2_8bit_100mhz>;
pinctrl-2 = <&pinctrl_usdhc2_8bit_200mhz>;
bus-width = <8>;
non-removable;
status = "okay";
};
编译下载运行看看结果:

发现已经改变了。
接下来看调试信息,返现显示设备不对,需要修改
这个能够输出显示设备的信息,说明设备的驱
U-Boot移植与配置实战:设备树与网络驱动修改

本文详细介绍了如何在U-Boot中进行移植和配置,包括创建VSCode工程,修改Model信息,更新设备树以匹配LCD显示屏,以及配置和修改网口驱动。通过修改源码和设备树,成功实现了对硬件平台的适配,最终实现网络通畅,内核引导正常。
最低0.47元/天 解锁文章
2371

被折叠的 条评论
为什么被折叠?



