Skip to content

Commit 46e73aa

Browse files
committed
Merge: zl3073x: backport the driver into RHEL9
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/7159 JIRA: https://issues.redhat.com/browse/RHEL-105063 Depends: !7157 Depends: !7158 This backports zl3073x DPLL driver. Signed-off-by: Ivan Vecera <ivecera@redhat.com> Approved-by: Michal Schmidt <mschmidt@redhat.com> Approved-by: Petr Oros <poros@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Patrick Talbert <ptalbert@redhat.com>
2 parents 9d825f6 + 1a9af34 commit 46e73aa

File tree

31 files changed

+5235
-2
lines changed

31 files changed

+5235
-2
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/dpll/dpll-device.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Digital Phase-Locked Loop (DPLL) Device
8+
9+
maintainers:
10+
- Ivan Vecera <ivecera@redhat.com>
11+
12+
description:
13+
Digital Phase-Locked Loop (DPLL) device is used for precise clock
14+
synchronization in networking and telecom hardware. The device can
15+
have one or more channels (DPLLs) and one or more physical input and
16+
output pins. Each DPLL channel can either produce pulse-per-clock signal
17+
or drive ethernet equipment clock. The type of each channel can be
18+
indicated by dpll-types property.
19+
20+
properties:
21+
$nodename:
22+
pattern: "^dpll(@.*)?$"
23+
24+
"#address-cells":
25+
const: 0
26+
27+
"#size-cells":
28+
const: 0
29+
30+
dpll-types:
31+
description: List of DPLL channel types, one per DPLL instance.
32+
$ref: /schemas/types.yaml#/definitions/non-unique-string-array
33+
items:
34+
enum: [pps, eec]
35+
36+
input-pins:
37+
type: object
38+
description: DPLL input pins
39+
unevaluatedProperties: false
40+
41+
properties:
42+
"#address-cells":
43+
const: 1
44+
"#size-cells":
45+
const: 0
46+
47+
patternProperties:
48+
"^pin@[0-9a-f]+$":
49+
$ref: /schemas/dpll/dpll-pin.yaml
50+
unevaluatedProperties: false
51+
52+
required:
53+
- "#address-cells"
54+
- "#size-cells"
55+
56+
output-pins:
57+
type: object
58+
description: DPLL output pins
59+
unevaluatedProperties: false
60+
61+
properties:
62+
"#address-cells":
63+
const: 1
64+
"#size-cells":
65+
const: 0
66+
67+
patternProperties:
68+
"^pin@[0-9]+$":
69+
$ref: /schemas/dpll/dpll-pin.yaml
70+
unevaluatedProperties: false
71+
72+
required:
73+
- "#address-cells"
74+
- "#size-cells"
75+
76+
additionalProperties: true
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/dpll/dpll-pin.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: DPLL Pin
8+
9+
maintainers:
10+
- Ivan Vecera <ivecera@redhat.com>
11+
12+
description: |
13+
The DPLL pin is either a physical input or output pin that is provided
14+
by a DPLL( Digital Phase-Locked Loop) device. The pin is identified by
15+
its physical order number that is stored in reg property and can have
16+
an additional set of properties like supported (allowed) frequencies,
17+
label, type and may support embedded sync.
18+
19+
Note that the pin in this context has nothing to do with pinctrl.
20+
21+
properties:
22+
reg:
23+
description: Hardware index of the DPLL pin.
24+
maxItems: 1
25+
26+
connection-type:
27+
description: Connection type of the pin
28+
$ref: /schemas/types.yaml#/definitions/string
29+
enum: [ext, gnss, int, mux, synce]
30+
31+
esync-control:
32+
description: Indicates whether the pin supports embedded sync functionality.
33+
type: boolean
34+
35+
label:
36+
description: String exposed as the pin board label
37+
$ref: /schemas/types.yaml#/definitions/string
38+
39+
supported-frequencies-hz:
40+
description: List of supported frequencies for this pin, expressed in Hz.
41+
42+
required:
43+
- reg
44+
45+
additionalProperties: false
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/dpll/microchip,zl30731.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Microchip Azurite DPLL device
8+
9+
maintainers:
10+
- Ivan Vecera <ivecera@redhat.com>
11+
12+
description:
13+
Microchip Azurite DPLL (ZL3073x) is a family of DPLL devices that
14+
provides up to 5 independent DPLL channels, up to 10 differential or
15+
single-ended inputs and 10 differential or 20 single-ended outputs.
16+
These devices support both I2C and SPI interfaces.
17+
18+
properties:
19+
compatible:
20+
enum:
21+
- microchip,zl30731
22+
- microchip,zl30732
23+
- microchip,zl30733
24+
- microchip,zl30734
25+
- microchip,zl30735
26+
27+
reg:
28+
maxItems: 1
29+
30+
required:
31+
- compatible
32+
- reg
33+
34+
allOf:
35+
- $ref: /schemas/dpll/dpll-device.yaml#
36+
- $ref: /schemas/spi/spi-peripheral-props.yaml#
37+
38+
unevaluatedProperties: false
39+
40+
examples:
41+
- |
42+
i2c {
43+
#address-cells = <1>;
44+
#size-cells = <0>;
45+
46+
dpll@70 {
47+
compatible = "microchip,zl30732";
48+
reg = <0x70>;
49+
dpll-types = "pps", "eec";
50+
51+
input-pins {
52+
#address-cells = <1>;
53+
#size-cells = <0>;
54+
55+
pin@0 { /* REF0P */
56+
reg = <0>;
57+
connection-type = "ext";
58+
label = "Input 0";
59+
supported-frequencies-hz = /bits/ 64 <1 1000>;
60+
};
61+
};
62+
63+
output-pins {
64+
#address-cells = <1>;
65+
#size-cells = <0>;
66+
67+
pin@3 { /* OUT1N */
68+
reg = <3>;
69+
connection-type = "gnss";
70+
esync-control;
71+
label = "Output 1";
72+
supported-frequencies-hz = /bits/ 64 <1 10000>;
73+
};
74+
};
75+
};
76+
};
77+
- |
78+
spi {
79+
#address-cells = <1>;
80+
#size-cells = <0>;
81+
82+
dpll@70 {
83+
compatible = "microchip,zl30731";
84+
reg = <0x70>;
85+
spi-max-frequency = <12500000>;
86+
87+
dpll-types = "pps";
88+
89+
input-pins {
90+
#address-cells = <1>;
91+
#size-cells = <0>;
92+
93+
pin@0 { /* REF0P */
94+
reg = <0>;
95+
connection-type = "ext";
96+
label = "Input 0";
97+
supported-frequencies-hz = /bits/ 64 <1 1000>;
98+
};
99+
};
100+
101+
output-pins {
102+
#address-cells = <1>;
103+
#size-cells = <0>;
104+
105+
pin@3 { /* OUT1N */
106+
reg = <3>;
107+
connection-type = "gnss";
108+
esync-control;
109+
label = "Output 1";
110+
supported-frequencies-hz = /bits/ 64 <1 10000>;
111+
};
112+
};
113+
};
114+
};
115+
...

Documentation/networking/devlink/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,4 @@ parameters, info versions, and other features it supports.
9696
prestera
9797
iosm
9898
sfc
99+
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: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5946,6 +5946,8 @@ M: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
59465946
M: Jiri Pirko <jiri@resnulli.us>
59475947
L: netdev@vger.kernel.org
59485948
S: Supported
5949+
F: Documentation/devicetree/bindings/dpll/dpll-device.yaml
5950+
F: Documentation/devicetree/bindings/dpll/dpll-pin.yaml
59495951
F: Documentation/driver-api/dpll.rst
59505952
F: drivers/dpll/*
59515953
F: include/linux/dpll.h
@@ -12924,6 +12926,14 @@ L: linux-wireless@vger.kernel.org
1292412926
S: Supported
1292512927
F: drivers/net/wireless/microchip/wilc1000/
1292612928

12929+
MICROCHIP ZL3073X DRIVER
12930+
M: Ivan Vecera <ivecera@redhat.com>
12931+
M: Prathosh Satish <Prathosh.Satish@microchip.com>
12932+
L: netdev@vger.kernel.org
12933+
S: Supported
12934+
F: Documentation/devicetree/bindings/dpll/microchip,zl30731.yaml
12935+
F: drivers/dpll/zl3073x/
12936+
1292712937
MICROSEMI MIPS SOCS
1292812938
M: Alexandre Belloni <alexandre.belloni@bootlin.com>
1292912939
M: UNGLinuxDriver@microchip.com

drivers/Kconfig

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

7676
source "drivers/ptp/Kconfig"
7777

78+
source "drivers/dpll/Kconfig"
79+
7880
source "drivers/pinctrl/Kconfig"
7981

8082
source "drivers/gpio/Kconfig"
@@ -245,6 +247,4 @@ source "drivers/most/Kconfig"
245247

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

0 commit comments

Comments
 (0)