Skip to content

Commit 2df8e64

Browse files
ivecerakuba-moo
authored andcommitted
dpll: Add basic Microchip ZL3073x support
Microchip Azurite ZL3073x represents chip family providing DPLL and optionally PHC (PTP) functionality. The chips can be connected be connected over I2C or SPI bus. They have the following characteristics: * up to 5 separate DPLL units (channels) * 5 synthesizers * 10 input pins (references) * 10 outputs * 20 output pins (output pin pair shares one output) * Each reference and output can operate in either differential or single-ended mode (differential mode uses 2 pins) * Each output is connected to one of the synthesizers * Each synthesizer is driven by one of the DPLL unit The device uses 7-bit addresses and 8-bits values. It exposes 8-, 16-, 32- and 48-bits registers in address range <0x000,0x77F>. Due to 7bit addressing, the range is organized into pages of 128 bytes, with each page containing a page selector register at address 0x7F. For reading/writing multi-byte registers, the device supports bulk transfers. Add basic functionality to access device registers, probe functionality both I2C and SPI cases and add devlink support to provide info and to set clock ID parameter. Signed-off-by: Ivan Vecera <[email protected]> Reviewed-by: Jiri Pirko <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent de9ccf2 commit 2df8e64

File tree

15 files changed

+1121
-2
lines changed

15 files changed

+1121
-2
lines changed

Documentation/networking/devlink/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,4 @@ parameters, info versions, and other features it supports.
9898
iosm
9999
octeontx2
100100
sfc
101+
zl3073x
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
=======================
4+
zl3073x devlink support
5+
=======================
6+
7+
This document describes the devlink features implemented by the ``zl3073x``
8+
device driver.
9+
10+
Parameters
11+
==========
12+
13+
.. list-table:: Generic parameters implemented
14+
:widths: 5 5 90
15+
16+
* - Name
17+
- Mode
18+
- Notes
19+
* - ``clock_id``
20+
- driverinit
21+
- Set the clock ID that is used by the driver for registering DPLL devices
22+
and pins.
23+
24+
Info versions
25+
=============
26+
27+
The ``zl3073x`` driver reports the following versions
28+
29+
.. list-table:: devlink info versions implemented
30+
:widths: 5 5 5 90
31+
32+
* - Name
33+
- Type
34+
- Example
35+
- Description
36+
* - ``asic.id``
37+
- fixed
38+
- 1E94
39+
- Chip identification number
40+
* - ``asic.rev``
41+
- fixed
42+
- 300
43+
- Chip revision number
44+
* - ``fw``
45+
- running
46+
- 7006
47+
- Firmware version number
48+
* - ``custom_cfg``
49+
- running
50+
- 1.3.0.1
51+
- Device configuration version customized by OEM

MAINTAINERS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16514,6 +16514,14 @@ L: [email protected]
1651416514
S: Supported
1651516515
F: drivers/net/wireless/microchip/
1651616516

16517+
MICROCHIP ZL3073X DRIVER
16518+
M: Ivan Vecera <[email protected]>
16519+
M: Prathosh Satish <[email protected]>
16520+
16521+
S: Supported
16522+
F: Documentation/devicetree/bindings/dpll/microchip,zl30731.yaml
16523+
F: drivers/dpll/zl3073x/
16524+
1651716525
MICROSEMI MIPS SOCS
1651816526
M: Alexandre Belloni <[email protected]>
1651916527

drivers/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ source "drivers/pps/Kconfig"
7777

7878
source "drivers/ptp/Kconfig"
7979

80+
source "drivers/dpll/Kconfig"
81+
8082
source "drivers/pinctrl/Kconfig"
8183

8284
source "drivers/gpio/Kconfig"
@@ -245,6 +247,4 @@ source "drivers/hte/Kconfig"
245247

246248
source "drivers/cdx/Kconfig"
247249

248-
source "drivers/dpll/Kconfig"
249-
250250
endmenu

drivers/dpll/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,11 @@
33
# Generic DPLL drivers configuration
44
#
55

6+
menu "DPLL device support"
7+
68
config DPLL
79
bool
10+
11+
source "drivers/dpll/zl3073x/Kconfig"
12+
13+
endmenu

drivers/dpll/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ obj-$(CONFIG_DPLL) += dpll.o
77
dpll-y += dpll_core.o
88
dpll-y += dpll_netlink.o
99
dpll-y += dpll_nl.o
10+
11+
obj-$(CONFIG_ZL3073X) += zl3073x/

drivers/dpll/zl3073x/Kconfig

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
3+
config ZL3073X
4+
tristate "Microchip Azurite DPLL/PTP/SyncE devices"
5+
depends on NET
6+
select DPLL
7+
select NET_DEVLINK
8+
help
9+
This driver supports Microchip Azurite family DPLL/PTP/SyncE
10+
devices that support up to 5 independent DPLL channels,
11+
10 input pins and up to 20 output pins.
12+
13+
To compile this driver as a module, choose M here. The module
14+
will be called zl3073x.
15+
16+
config ZL3073X_I2C
17+
tristate "I2C bus implementation for Microchip Azurite devices"
18+
depends on I2C && ZL3073X
19+
select REGMAP_I2C
20+
default m
21+
help
22+
This is I2C bus implementation for Microchip Azurite DPLL/PTP/SyncE
23+
devices.
24+
25+
To compile this driver as a module, choose M here: the module will
26+
be called zl3073x_i2c.
27+
28+
config ZL3073X_SPI
29+
tristate "SPI bus implementation for Microchip Azurite devices"
30+
depends on SPI && ZL3073X
31+
select REGMAP_SPI
32+
default m
33+
help
34+
This is SPI bus implementation for Microchip Azurite DPLL/PTP/SyncE
35+
devices.
36+
37+
To compile this driver as a module, choose M here: the module will
38+
be called zl3073x_spi.

drivers/dpll/zl3073x/Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
3+
obj-$(CONFIG_ZL3073X) += zl3073x.o
4+
zl3073x-objs := core.o devlink.o
5+
6+
obj-$(CONFIG_ZL3073X_I2C) += zl3073x_i2c.o
7+
zl3073x_i2c-objs := i2c.o
8+
9+
obj-$(CONFIG_ZL3073X_SPI) += zl3073x_spi.o
10+
zl3073x_spi-objs := spi.o

0 commit comments

Comments
 (0)