日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

V3S-Zero 网络篇章 Linux5.2

發布時間:2023/12/8 linux 40 豆豆
生活随笔 收集整理的這篇文章主要介紹了 V3S-Zero 网络篇章 Linux5.2 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

板子上的網口可不能白占著空間

進入主題

開啟網口需要 修改Uboot Kernel 文件系統 缺一不可
5.2的內核對NET網絡已經支持 所以修改較少

以下是基于TF卡試驗的(同等也可以修改在Flash版本中)

Uboot

下載主線的Uboot源碼

v3s-current https://github.com/Lichee-Pi/u-boot.git

修改如下
修改include/configs/sun8i.h

/** Include common sunxi configuration where most the settings are*//*一定要放下面*/ #include <configs/sunxi-common.h>#define CONFIG_BOOTCOMMAND "setenv bootm_boot_mode sec; " \"load mmc 0:1 0x41000000 zImage; " \"load mmc 0:1 0x41800000 sun8i-v3s-licheepi-zero-dock.dtb; " \"bootz 0x41000000 - 0x41800000;"#define CONFIG_BOOTARGS "console=ttyS0,115200 panic=5 rootwait root=/dev/mmcblk0p2 earlyprintk rw vt.global_cursor_default=0"

修改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設備樹修改如上即可

進入Uboot的menuconfig
修改

Kernel

修改 設備樹文件
sun8i-v3s-licheepi-zero.dts

aliases {serial0 = &uart0;ethernet0 = &emac;}; &emac {phy-handle = <&int_mii_phy>;phy-mode = "mii";allwinner,leds-active-low;status = "okay"; };

menuconfig 修改

文件系統

文件系統制作(Buildroot) 可以參考
https://blog.csdn.net/weixin_44205779/article/details/107330375

制作好的文件系統 需要修改Net相關描述

/etc/network/interfaces 下
添加

auto eth0 iface eth0 inet static address 192.168.11.188 netmask 255.255.255.0 gateway 192.168.11.1

對應的PC主機
我用的Windows
需要關閉防火墻 或者改出入站規則
不然ping 不上

改完之后的效果如下:

后面就可以愉快的使用網絡了

總結

以上是生活随笔為你收集整理的V3S-Zero 网络篇章 Linux5.2的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。