Skip to content

Commit

Permalink
ethernet: bundle module for Motorcomm YT6801
Browse files Browse the repository at this point in the history
- The Asus XC-LS3A6M motherboard (Loongson 3A6000) comes with two Ethernet
  ports, which uses a yt6801 controller.
- This patch introduces an out of tree module to provide support for this
  NIC. [^1]
- Refactor module tree to make it work with Kconfig. [^2]
- Drop unneeded installation script (yt_nic_install.sh).
- Trim README to remove useless installation instructions.
- enable YT6801 for x86 arm64 and loongarch as module
- Refactor according to the kernel code style

[^1]: Ref: https://www.motor-comm.com/Public/Uploads/uploadfile/files/20240104/yt6801-linux-driver-1.0.27.zip
[^2]: CONFIG_NET_VENDOR_MOTORCOMM =(y)=> CONFIG_YT8601 (tristate).

Co-authored-by: Mingcong Bai <[email protected]>
Co-authored-by: Xiaotian Wu <[email protected]>
Signed-off-by: Yanteng Si <[email protected]>
  • Loading branch information
3 people committed Jul 17, 2024
1 parent a4eda44 commit f989cf6
Show file tree
Hide file tree
Showing 20 changed files with 17,313 additions and 0 deletions.
1 change: 1 addition & 0 deletions arch/loongarch/configs/loongson3_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,7 @@ CONFIG_8139TOO=m
# CONFIG_8139TOO_PIO is not set
CONFIG_8139TOO_8129=y
CONFIG_R8169=m
CONFIG_YT6801=m
# CONFIG_NET_VENDOR_RENESAS is not set
# CONFIG_NET_VENDOR_ROCKER is not set
# CONFIG_NET_VENDOR_SAMSUNG is not set
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ source "drivers/net/ethernet/mediatek/Kconfig"
source "drivers/net/ethernet/mellanox/Kconfig"
source "drivers/net/ethernet/micrel/Kconfig"
source "drivers/net/ethernet/microchip/Kconfig"
source "drivers/net/ethernet/motorcomm/Kconfig"
source "drivers/net/ethernet/mscc/Kconfig"
source "drivers/net/ethernet/microsoft/Kconfig"
source "drivers/net/ethernet/moxa/Kconfig"
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ obj-$(CONFIG_NET_VENDOR_MEDIATEK) += mediatek/
obj-$(CONFIG_NET_VENDOR_MELLANOX) += mellanox/
obj-$(CONFIG_NET_VENDOR_MICREL) += micrel/
obj-$(CONFIG_NET_VENDOR_MICROCHIP) += microchip/
obj-$(CONFIG_NET_VENDOR_MOTORCOMM) += motorcomm/
obj-$(CONFIG_NET_VENDOR_MICROSEMI) += mscc/
obj-$(CONFIG_NET_VENDOR_MOXART) += moxa/
obj-$(CONFIG_NET_VENDOR_MYRI) += myricom/
Expand Down
27 changes: 27 additions & 0 deletions drivers/net/ethernet/motorcomm/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# SPDX-License-Identifier: GPL-2.0-only
# Copyright (c) 2023 Motorcomm, Inc.

config NET_VENDOR_MOTORCOMM
bool "Motorcomm devices"
default y
depends on PCI
help
If you have a network (Ethernet) card belonging to this class, say Y.

Note that the answer to this question doesn't directly affect the
kernel: saying N will just cause the configurator to skip all
the questions about Motorcomm cards. If you say Y, you will be asked
for your specific card in the following questions.

if NET_VENDOR_MOTORCOMM

config YT6801
tristate "Motorcomm YT6801 Ethernet support"
depends on PCI
help
If you have a network (Ethernet) controller of this type, say Y here.

To compile this driver as a module, choose M here. The module
will be called forcedeth.

endif # NET_VENDOR_MOTORCOMM
4 changes: 4 additions & 0 deletions drivers/net/ethernet/motorcomm/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# SPDX-License-Identifier: GPL-2.0-only
# Copyright (c) 2023 Motorcomm, Inc.

obj-$(CONFIG_YT6801) += yt6801/
15 changes: 15 additions & 0 deletions drivers/net/ethernet/motorcomm/yt6801/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# SPDX-License-Identifier: GPL-2.0-only
# Copyright (c) 2023 Motorcomm, Inc.


obj-$(CONFIG_YT6801) += yt6801.o

yt6801-objs := fuxi-gmac-common.o \
fuxi-gmac-desc.o \
fuxi-gmac-ethtool.o \
fuxi-gmac-hw.o \
fuxi-gmac-net.o \
fuxi-gmac-pci.o \
fuxi-gmac-phy.o \
fuxi-efuse.o \
fuxi-gmac-debugfs.o
15 changes: 15 additions & 0 deletions drivers/net/ethernet/motorcomm/yt6801/fuxi-dbg.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (c) 2021 Motorcomm Corporation. */

#ifndef _MP_DBG_H
#define _MP_DBG_H

/* Message verbosity: lower values indicate higher urgency */
#define MP_OFF 0
#define MP_ERROR 1
#define MP_WARN 2
#define MP_TRACE 3
#define MP_INFO 4
#define MP_LOUD 5

#endif /* _MP_DBG_H */
Loading

0 comments on commit f989cf6

Please sign in to comment.