• Yanteng Si's avatar
    net: stmmac: dwmac-loongson: Add Loongson GNET support · 56dbe2c2
    Yanteng Si authored
    The new generation Loongson LS2K2000 SoC and LS7A2000 chipset are
    equipped with the network controllers called Loongson GNET. It's the
    single and multi DMA-channels Loongson GMAC but with a PHY attached.
    Here is the summary of the DW GMAC features the controller has:
    
       DW GMAC IP-core: v3.73a
       Speeds: 10/100/1000Mbps
       Duplex: Full (both versions), Half (LS2K2000 GNET only)
       DMA-descriptors type: enhanced
       L3/L4 filters availability: Y
       VLAN hash table filter: Y
       PHY-interface: GMII (PHY is integrated into the chips)
       Remote Wake-up support: Y
       Mac Management Counters (MMC): Y
       Number of additional MAC addresses: 5
       MAC Hash-based filter: Y
       Hash Table Size: 256
       AV feature: Y (LS2K2000 GNET only)
       DMA channels: 8 (LS2K2000 GNET), 1 (LS7A2000 GNET)
    
    Let's update the Loongson DWMAC driver to supporting the new Loongson
    GNET controller. The change is mainly trivial: the driver shall be
    bound to the PCIe device with DID 0x7a13, and the device-specific
    setup() method shall be called for it. The only peculiarity concerns
    the integrated PHY speed change procedure. The PHY has a weird problem
    with switching from the low speeds to 1000Mbps mode. The speedup
    procedure requires the PHY-link re-negotiation. So the suggested
    change provide the device-specific fix_mac_speed() method to overcome
    the problem.
    Signed-off-by: default avatarFeiyang Chen <chenfeiyang@loongson.cn>
    Signed-off-by: default avatarYinggang Gu <guyinggang@loongson.cn>
    Acked-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
    Reviewed-by: default avatarSerge Semin <fancer.lancer@gmail.com>
    Signed-off-by: default avatarYanteng Si <siyanteng@loongson.cn>
    Tested-by: default avatarSerge Semin <fancer.lancer@gmail.com>
    Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
    56dbe2c2
dwmac-loongson.c 18 KB