LicheePi Zero Notes -2 uboot compilation
cd u-boot
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
LicheePi_Zero_defconfig #载入模板配置文件
make menuconfig
,在图形配置中根据以下目录选择Allwinner Sun8i Ethernet MAC support
。Device Drivers —>
Network device support —>
Allwinner Sun8i Ethernet MAC support
u-boot/arch/dts
目录下找到sun8i-v3s-licheepi-zero.dts
,在aliases下添加ethernet0 = &emac;
aliases {
+ ethernet0 = &emac;
serial0 = &uart0;
};
在文件末尾添加:
&emac {
phy = <&phy0>;
phy-mode = "mii";
allwinner,use-internal-phy;
allwinner,leds-active-low;
status = "okay";
phy0: ethernet-phy@0 {
reg = <1>;
};
};
在目录u-boot/arch/dts
目录下找到sun8i-v3s.dtsi
首先在soc
子节点内添加以下内容
syscon: syscon@01c00000 {
compatible = "allwinner,sun8i-h3-syscon","syscon"
reg = <0x01c00000 0x34>;
};
在soc
子节点下的pio: pinctrl@01c20800
节点下添加
emac_rgmii_pins: emac0@0 {
allwinner,pins = "PD0", "PD1", "PD2", "PD3",
"PD4", "PD5", "PD7",
"PD8", "PD9", "PD10",
"PD12", "PD13", "PD15",
"PD16", "PD17";
allwinner,function = "emac";
allwinner,drive = <SUN4I_PINCTRL_40_MA>;
allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
};
最后在soc
子节点内添加以下内容
emac: ethernet@1c30000 {
compatible = "allwinner,sun8i-h3-emac";
reg = <0x01c30000 0x104>, <0x01c00030 0x4>;
reg-names = "emac", "syscon";
interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>;
resets = <&ccu RST_BUS_EMAC>, <&ccu RST_BUS_EPHY>;
reset-names = "ahb", "ephy";
clocks = <&ccu CLK_BUS_EMAC>, <&ccu CLK_BUS_EPHY>;
clock-names = "ahb", "ephy";
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
};
make ARCH=arm menuconfig #uboot配置命令
time make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- 2>&1 #编译
编译完成后,在当前目录下生成了u-boot-sunxi-with-spl.bin,可以烧录到8K偏移处启动
若编译报错./tools/binman/binman: not found
,说明编译环境缺少python工具链、
sudo apt get install python
本网站文章版权均为本人所有,未经同意不得私自搬运复制,欢迎注明引用出处的合理转载,图片转载请留言。文章内容仅用于技术研究和探索,不得用于违法目的。