Skip to content
Permalink
Browse files
net: Add dm9051 driver
v1-v4

Add davicom dm9051 spi ethernet driver. The driver work for the
device platform with spi master

Test ok with raspberry pi 2 and pi 4, the spi configure used in
my raspberry pi 4 is spi0.1, spi speed 31200000, and INT by pin 26.

v5

Work to eliminate the wrappers to be clear for read, swapped to
phylib for phy connection tasks.

Tested with raspberry pi 4. Test for netwroking function, CAT5
cable unplug/plug and also ethtool detect for link state, and
all are ok.

v6

remove the redundant code that phylib has support,
adjust to be the reasonable sequence,
fine tune comments, add comments for pause function support

Tested with raspberry pi 4. Test for netwroking function, CAT5
cable unplug/plug and also ethtool detect for link state, and
all are ok.

v7

read/write registers must return error code to the callet,
add to enable pause processing

v8

not parmanently set MAC by .ndo_set_mac_address

correct rx function such as clear ISR,
inblk avoid stack buffer,
simple skb buffer process and
easy use netif_rx_ni.

simplely queue init and wake the queues,
limit the start_xmit function use netif_stop_queue.

descript that schedule delay is essential
for tx_work and rxctrl_work

eliminate ____cacheline_aligned and
add static int msg_enable.

v9

use phylib, no need 'select MII' in Kconfig,
make it clear in dm9051_xfer when using spi_sync,
improve the registers read/write so that error code
return as far as possible up the call stack.

v10

use regmap APIs for SPI and MDIO,
modify to correcting such as include header files
and program check styles

v11

eliminate the redundant code for struct regmap_config data
use regmap_read_poll_timeout
use corresponding regmap APIs, i.e. MDIO, SPI
all read/write registers by regmap
all read/write registers with mutex lock by regmap
problem: regmap MDIO and SPI has no .reg_update_bits, I write it
in the driver
problem: this chip can support bulk read/write to rx/tx data, but
can not support bulk read/write to continue registers, so need
read/write register one by one

v12

correctly use regmap bulk read/write/update_bits APIs
use mdiobus to work to phylib and to this driver
fine tune to arrange the source code to better usage
  • Loading branch information
josright123 authored and intel-lab-lkp committed Jan 21, 2022
1 parent fb5684a commit a6eb8dd02aed17af37a0b38fbcc250fd9ed9492d
Show file tree
Hide file tree
Showing 4 changed files with 1,371 additions and 0 deletions.
@@ -3,6 +3,19 @@
# Davicom device configuration
#

config NET_VENDOR_DAVICOM
bool "Davicom devices"
default y
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 Davicom devices. If you say Y, you will be asked
for your specific card in the following selections.

if NET_VENDOR_DAVICOM

config DM9000
tristate "DM9000 support"
depends on ARM || MIPS || COLDFIRE || NIOS2 || COMPILE_TEST
@@ -22,3 +35,21 @@ config DM9000_FORCE_SIMPLE_PHY_POLL
bit to determine if the link is up or down instead of the more
costly MII PHY reads. Note, this will not work if the chip is
operating with an external PHY.

config DM9051
tristate "DM9051 SPI support"
depends on SPI
select CRC32
select MDIO
select PHYLIB
select REGMAP_SPI
help
Support for DM9051 SPI chipset.

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

The SPI mode for the host's SPI master to access DM9051 is mode
0 on the SPI bus.

endif # NET_VENDOR_DAVICOM
@@ -4,3 +4,4 @@
#

obj-$(CONFIG_DM9000) += dm9000.o
obj-$(CONFIG_DM9051) += dm9051.o

0 comments on commit a6eb8dd

Please sign in to comment.