全网最详细,保证能用的Licheepi Zero Ethernet适配指南

内核5.10版本只需要改这个一个文件,这里是参考,因为有些新的内核下,这些配置已经被提交了,所以酌情参考着修改

  • 修改sun8i-v3s-licheepi-zero.dts:
  • index 387fc2a..904e60e 100644
    --- a/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts
    +++ b/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts
    @@ -50,6 +50,7 @@
     
            aliases {
                    serial0 = &uart0;
    +               ethernet0 = &emac;
            };
     
            chosen {
    @@ -101,3 +102,10 @@
            usb0_id_det-gpio = <&pio 5 6 GPIO_ACTIVE_HIGH>;
            status = "okay";
     };
    +
    +&emac {
    +       phy-handle = <&int_mii_phy>;
    +       phy-mode = "mii";
    +       allwinner,leds-active-low;
    +       status = "okay";
    +};
    
    

  • 另一个文件sun8i-v3s.dtsi:

    diff --git a/arch/arm/boot/dts/sun8i-v3s.dtsi b/arch/arm/boot/dts/sun8i-v3s.dtsi
    index 7107596..65be2ab 100644
    --- a/arch/arm/boot/dts/sun8i-v3s.dtsi
    +++ b/arch/arm/boot/dts/sun8i-v3s.dtsi
    @@ -40,7 +40,10 @@
      *     OTHER DEALINGS IN THE SOFTWARE.
      */
     
    +#include <dt-bindings/clock/sun8i-v3s-ccu.h>
    +#include <dt-bindings/reset/sun8i-v3s-ccu.h>
     #include <dt-bindings/interrupt-controller/arm-gic.h>
    +#include <dt-bindings/pinctrl/sun4i-a10.h>
     
     / {
            #address-cells = <1>;
    @@ -93,6 +96,12 @@
                    #size-cells = <1>;
                    ranges;
     
    +               syscon: syscon@1c00000 {
    +                       compatible = "allwinner,sun8i-h3-system-controller",
    +                               "syscon";
    +                       reg = <0x01c00000 0x1000>;
    +               };
    +
                    mmc0: mmc@01c0f000 {
                            compatible = "allwinner,sun7i-a20-mmc";
                            reg = <0x01c0f000 0x1000>;
    @@ -205,6 +214,17 @@
                            interrupt-controller;
                            #interrupt-cells = <3>;
     
    +                       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>;
    +                       };
    +
                            i2c0_pins: i2c0 {
                                    pins = "PB6", "PB7";
                                    function = "i2c0";
    @@ -295,6 +315,31 @@
                            #size-cells = <0>;
                    };
     
    +               emac: ethernet@1c30000 {
    +                       compatible = "allwinner,sun8i-h3-emac";
    +                       syscon = <&syscon>;
    +                       reg = <0x01c30000 0x104>;
    +                       interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>;
    +                       interrupt-names = "macirq";
    +                       resets = <&ccu RST_BUS_EMAC>;
    +                       reset-names = "stmmaceth";
    +                       clocks = <&ccu CLK_BUS_EMAC>;
    +                       clock-names = "stmmaceth";
    +                       #address-cells = <1>;
    +                       #size-cells = <0>;
    +                       status = "disabled";
    +
    +                       mdio: mdio {
    +                               #address-cells = <1>;
    +                               #size-cells = <0>;
    +                               int_mii_phy: ethernet-phy@0 {
    +                                       compatible = "ethernet-phy-ieee802.3-c22";
    +                                       reg = <1>;
    +                                       clocks = <&ccu CLK_BUS_EPHY>;
    +                                       resets = <&ccu RST_BUS_EPHY>;
    +                               };
    +                       };
    +               };
                    gic: interrupt-controller@01c81000 {
                            compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic";
                            reg = <0x01c81000 0x1000>,
  • 进入内核目录,不同内核版本配置,这里可能不同,但是大致的选项是一致的,这里酌情修改
  • sudo make kernel-menuconfig
  • 选择 Device Drivers --->
  • 选择 Network device support --->
  • 选择 Ethernet driver support --->
  • 选中 Allwinner sun8i EMAC support 和 Use dwmac-sun8i bindings
  • 不同内核有不同选项

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值