Skip to content

Commit

Permalink
net: ethernet: motorcomm: Add yt6801 driver
Browse files Browse the repository at this point in the history
  • Loading branch information
baiywt authored and igorpecovnik committed May 9, 2024
1 parent 08eb04c commit d601b05
Show file tree
Hide file tree
Showing 22 changed files with 19,349 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/ethernet/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ source "drivers/net/ethernet/chelsio/Kconfig"
source "drivers/net/ethernet/cirrus/Kconfig"
source "drivers/net/ethernet/cisco/Kconfig"
source "drivers/net/ethernet/cortina/Kconfig"
source "drivers/net/ethernet/motorcomm/Kconfig"

config CX_ECAT
tristate "Beckhoff CX5020 EtherCAT master support"
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,4 @@ obj-$(CONFIG_NET_VENDOR_XILINX) += xilinx/
obj-$(CONFIG_NET_VENDOR_XIRCOM) += xircom/
obj-$(CONFIG_NET_VENDOR_SYNOPSYS) += synopsys/
obj-$(CONFIG_NET_VENDOR_PENSANDO) += pensando/
obj-$(CONFIG_NET_VENDOR_MOTORCOMM) += motorcomm/
18 changes: 18 additions & 0 deletions drivers/net/ethernet/motorcomm/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# SPDX-License-Identifier: GPL-2.0-only
config NET_VENDOR_MOTORCOMM
bool "Motorcomm devices"
default y
help
If you have a network (Ethernet) device 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 devices. If you say Y, you will be asked
for your specific device in the following questions.

if NET_VENDOR_MOTORCOMM

config FUXI
tristate "motorcomm fuxi Ethernet support"

endif #NET_VENDOR_MOTORCOMM
40 changes: 40 additions & 0 deletions drivers/net/ethernet/motorcomm/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# SUBARCH tells the usermode build what the underlying arch is. That is set
# first, and if a usermode build is happening, the "ARCH=um" on the command
# line overrides the setting of ARCH below. If a native build is happening,
# then ARCH is assigned, getting whatever value it gets normally, and
# SUBARCH is subsequently ignored.
# eg:
# x86(make modules or make)
# arm(make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modules)
SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/ -e s/s390x/s390/ -e s/parisc64/parisc/ -e s/ppc.*/powerpc/ -e s/mips.*/mips/ -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ -e s/riscv.*/riscv/)
CURARCH ?= $(SUBARCH)
ARCH ?= $(SUBARCH)
CROSS_COMPILE ?=
CONFIG_MODULE_SIG=n
EXTRA_CFLAGS = -Wall -g -I$(CURDIR) -I$(subst fuxi-linux-release-package/module_fuxi/src,common,$(PWD)) -I$(PWD)
EXTRA_CFLAGS += -DFXGMAC_DEBUG
KSRC = /lib/modules/`uname -r`/build
KDST = /lib/modules/`uname -r`/kernel/drivers/net/ethernet/motorcomm/
KFILE = yt6801.ko
ifneq ($(filter arm arm64, $(ARCH)),)
ifeq ($(CURARCH), x86)
# if you want to compile driver with linux kernel source code,you should specify the source path(KSRC), such as:
# KSRC = /home/mxl/ti-processor-sdk-linux-am57xx-evm-06.03.00.106/board-support/linux-4.19.94+gitAUTOINC+be5389fd85-gbe5389fd85
endif
endif
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-dbg.o fuxi-gmac-debugfs.o
obj-m += yt6801.o
modules:
make -C $(KSRC) M=$(PWD) modules
install:
sudo install -d $(KDST)
sudo install $(KFILE) $(KDST)
sudo depmod -a
@file $(KDST)$(KFILE)
@echo install done.
uninstall:
sudo rm $(KDST)$(KFILE)
sudo ls -l $(KDST)
clean:
make -C $(KSRC) M=$(PWD) clean
.PHONY:modules install uninstall clean
4 changes: 4 additions & 0 deletions drivers/net/ethernet/motorcomm/Makefile_into_kernel
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
obj-$(CONFIG_FUXI) += fuxi.o
fuxi-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-dbg.o \
fuxi-gmac-debugfs.o
30 changes: 30 additions & 0 deletions drivers/net/ethernet/motorcomm/Notice.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
=============================================================================

This file contains certain notices of software components included with
the software that Motorcomm, Inc. ("Motorcomm") is required to
provide you. Except where prohibited by the open source license, the
content of this file is provided solely to satisfy Motorcomm's attribution
and notice requirement; your use of these software components
together with the Motorcomm software ("Software") is subject to the terms
of your license from Motorcomm. Compliance with all copyright laws and
software license agreements included in the notice section of this
file are the responsibility of the user. Except as may be granted by
separate express written agreement, this file provides no license to
any patents, trademarks, copyrights, or other intellectual property
of Motorcomm or any of its subsidiaries.

Software provided with this notice is NOT A CONTRIBUTION to any open
source project. If alternative licensing is available for any of the
components with licenses or attributions provided below, a license
choice is made for receiving such code by Motorcomm.

Copyright (c) 2021 Motorcomm, Inc. All rights reserved.

Motorcomm is a trademark of Motorcomm Incorporated, registered in China
and other countries. All Motorcomm Incorporated trademarks
are used with permission. Other products and brand names may be
trademarks or registered trademarks of their respective owners.

=============================================================================


7 changes: 7 additions & 0 deletions drivers/net/ethernet/motorcomm/dkms.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
PACKAGE_NAME="yt6801"
PACKAGE_VERSION="1.0.21"
CLEAN="make clean"
MAKE[0]="make"
BUILT_MODULE_NAME[0]="yt6801"
DEST_MODULE_LOCATION[0]="/kernel/drivers/motorcomm"
AUTOINSTALL="yes"
Loading

0 comments on commit d601b05

Please sign in to comment.