Skip to content

Commit f6bb3e9

Browse files
fancerdavem330
authored andcommitted
net: pcs: xpcs: Add Synopsys DW xPCS platform device driver
Synopsys DesignWare XPCS IP-core can be synthesized with the device CSRs being accessible over the MCI or APB3 interface instead of the MDIO bus (see the CSR_INTERFACE HDL parameter). Thus all the PCS registers can be just memory mapped and be a subject of the standard MMIO operations of course taking into account the peculiarities of the Clause C45 CSRs mapping. From that perspective the DW XPCS devices would look as just normal platform devices for the kernel. On the other hand in order to have the DW XPCS devices handled by the pcs-xpcs.c driver they need to be registered in the framework of the MDIO-subsystem. So the suggested change is about providing a DW XPCS platform device driver registering a virtual MDIO-bus with a single MDIO-device representing the DW XPCS device. DW XPCS platform device is supposed to be described by the respective compatible string "snps,dw-xpcs" (or with the PMA-specific compatible string), CSRs memory space and optional peripheral bus and reference clock sources. Depending on the INDIRECT_ACCESS IP-core synthesize parameter the memory-mapped reg-space can be represented as either directly or indirectly mapped Clause 45 space. In the former case the particular address is determined based on the MMD device and the registers offset (5 + 16 bits all together) within the device reg-space. In the later case there is only 8 lower address bits are utilized for the registers mapping (255 CSRs). The upper bits are supposed to be written into the respective viewport CSR in order to select the respective MMD sub-page. Note, only the peripheral bus clock source is requested in the platform device probe procedure. The core and pad clocks handling has been implemented in the framework of the xpcs_create() method intentionally since the clocks-related setups are supposed to be performed later, during the DW XPCS main configuration procedures. (For instance they will be required for the DW Gen5 10G PMA configuration.) Signed-off-by: Serge Semin <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 664690e commit f6bb3e9

File tree

6 files changed

+547
-9
lines changed

6 files changed

+547
-9
lines changed

drivers/net/pcs/Kconfig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
menu "PCS device drivers"
77

88
config PCS_XPCS
9-
tristate
9+
tristate "Synopsys DesignWare Ethernet XPCS"
1010
select PHYLINK
1111
help
12-
This module provides helper functions for Synopsys DesignWare XPCS
13-
controllers.
12+
This module provides a driver and helper functions for Synopsys
13+
DesignWare XPCS controllers.
1414

1515
config PCS_LYNX
1616
tristate

drivers/net/pcs/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# SPDX-License-Identifier: GPL-2.0
22
# Makefile for Linux PCS drivers
33

4-
pcs_xpcs-$(CONFIG_PCS_XPCS) := pcs-xpcs.o pcs-xpcs-nxp.o pcs-xpcs-wx.o
4+
pcs_xpcs-$(CONFIG_PCS_XPCS) := pcs-xpcs.o pcs-xpcs-plat.o \
5+
pcs-xpcs-nxp.o pcs-xpcs-wx.o
56

67
obj-$(CONFIG_PCS_XPCS) += pcs_xpcs.o
78
obj-$(CONFIG_PCS_LYNX) += pcs-lynx.o

0 commit comments

Comments
 (0)