V3S-Zero 网络篇章 Linux5.2
板子上的網(wǎng)口可不能白占著空間
進(jìn)入主題
開啟網(wǎng)口需要 修改Uboot Kernel 文件系統(tǒng) 缺一不可
5.2的內(nèi)核對(duì)NET網(wǎng)絡(luò)已經(jīng)支持 所以修改較少
以下是基于TF卡試驗(yàn)的(同等也可以修改在Flash版本中)
Uboot
下載主線的Uboot源碼
v3s-current https://github.com/Lichee-Pi/u-boot.git修改如下
修改include/configs/sun8i.h
修改Dts文件
sun8i-v3s.dtsi 修改如下
soc {compatible = "simple-bus";#address-cells = <1>;#size-cells = <1>;ranges; /*添加syscon*/syscon: syscon@01c00000 {compatible = "allwinner,sun8i-h3-syscon","syscon";reg = <0x01c00000 0x34>;};mmc0: mmc@01c0f000 {compatible = "allwinner,sun7i-a20-mmc";reg = <0x01c0f000 0x1000>;clocks = <&ccu CLK_BUS_MMC0>,<&ccu CLK_MMC0>,<&ccu CLK_MMC0_OUTPUT>,<&ccu CLK_MMC0_SAMPLE>;clock-names = "ahb","mmc","output","sample";resets = <&ccu RST_BUS_MMC0>;reset-names = "ahb";interrupts = <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;status = "disabled";#address-cells = <1>;#size-cells = <0>;}; pio: pinctrl@01c20800 {compatible = "allwinner,sun8i-v3s-pinctrl";reg = <0x01c20800 0x400>;interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,<GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;clocks = <&ccu CLK_BUS_PIO>, <&osc24M>, <&osc32k>;clock-names = "apb", "hosc", "losc";gpio-controller;#gpio-cells = <3>;interrupt-controller;#interrupt-cells = <3>; /*Pin添加RMII的描述*/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>;};uart0_pins_a: uart0@0 {pins = "PB8", "PB9";function = "uart0";bias-pull-up;}; gic: interrupt-controller@01c81000 {compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic";reg = <0x01c81000 0x1000>,<0x01c82000 0x1000>,<0x01c84000 0x2000>,<0x01c86000 0x2000>;interrupt-controller;#interrupt-cells = <3>;interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;};/*添加EMAC描述*/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";};};sun8i-v3s-licheepi-zero.dts 修改如下
model = "Lichee Pi Zero";compatible = "licheepi,licheepi-zero", "allwinner,sun8i-v3s";aliases {serial0 = &uart0;ethernet0 = &emac;spi0 = &spi0;};chosen {stdout-path = "serial0:115200n8";};添加emac
&emac {phy = <&phy0>;phy-mode = "mii";allwinner,use-internal-phy;allwinner,leds-active-low;status = "okay";phy0: ethernet-phy@0 {reg = <1>;}; };Uboot設(shè)備樹修改如上即可
進(jìn)入U(xiǎn)boot的menuconfig
修改
Kernel
修改 設(shè)備樹文件
sun8i-v3s-licheepi-zero.dts
menuconfig 修改
文件系統(tǒng)
文件系統(tǒng)制作(Buildroot) 可以參考
https://blog.csdn.net/weixin_44205779/article/details/107330375
制作好的文件系統(tǒng) 需要修改Net相關(guān)描述
/etc/network/interfaces 下
添加
對(duì)應(yīng)的PC主機(jī)
我用的Windows
需要關(guān)閉防火墻 或者改出入站規(guī)則
不然ping 不上
改完之后的效果如下:
后面就可以愉快的使用網(wǎng)絡(luò)了
總結(jié)
以上是生活随笔為你收集整理的V3S-Zero 网络篇章 Linux5.2的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 忆往昔
- 下一篇: 淘宝小程序(商家应用)开发提前需要了解的