
This commit back ports the DPLL related commits from the upstream kernel that are identified by Intel to provide the expected SyncE/GNSS functionality. There are totally 46 back ported commits included the four commits I added are used to resolve the conflicts during back porting. The 0046 patch is cherry picked from kernel-6.9. The 0031-0045 patches are cherry picked from kernel-6.8. The 0001-0030 patches are cherry picked from kernel-6.7. We also change the in-tree ice driver version to 6.6.40-stx.2 from 6.6.40-stx.1. * To fix the conflict of 91e43ca0090b ("ice: fix linking when CONFIG_PTP_1588_CLOCK=n"), we cherry pick 12a5a28b565b ("ice: remove ICE_F_PTP_EXTTS feature flag") and 89776a6a702e ("ice: check netlist before enabling ICE_F_GNSS"). Adjust 12a5a28b565b because 0d1b22367ec2 ("ice: fix pin assignment for E810-T without SMA control") already included the part code of 12a5a28b565b. https://git.yoctoproject.org/linux-yocto/commit/?id=0d1b22367ec2 * Cherry pick 7049fd5df7 ("netlink: specs: remove redundant type keys from attributes in subsets") to fix the the conflict of c3c6ab95c397 ("dpll: spec: add support for pin-dpll signal phase offset/adjust.") * Cherry pick be16574609f1 ("ice: introduce hw->phy_model for handling PTP PHY differences") to fix the confilict of 6db5f2cd9ebb ("ice: dpll:fix output pin capabilities"). Verification: - Build kernel and out of tree modules success for rt and std. - Install success onto a All-in-One lab with rt kernel. - Boot up successfully in the lab. - interfaces are up and pass packets for rt and std. - Check dmesg to see DDP package is loaded successfully and the version is 1.3.36.0 for rt and std, that is same with the OOT ice-1.14.9 driver. - The SyncE/GNSS functionality tests were done by the network team. Story: 2011056 Task: 50797 Change-Id: I715480681c7c43d53b0a0126b34135562e9d02a0 Signed-off-by: Jiping Ma <jiping.ma2@windriver.com>
175 lines
5.9 KiB
Diff
175 lines
5.9 KiB
Diff
From 304d5b650378394e20c1f65af6a4898c49f95e12 Mon Sep 17 00:00:00 2001
|
|
From: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
|
|
Date: Wed, 11 Oct 2023 12:12:33 +0200
|
|
Subject: [PATCH 22/46] dpll: spec: add support for pin-dpll signal phase
|
|
offset/adjust
|
|
|
|
Add attributes for providing the user with:
|
|
- measurement of signals phase offset between pin and dpll
|
|
- ability to adjust the phase of pin signal
|
|
|
|
Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
|
|
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
(cherry picked from commit c3c6ab95c397134bf5948f18743b3ba8008e7c47)
|
|
Signed-off-by: Jiping Ma <jiping.ma2@windriver.com>
|
|
---
|
|
Documentation/netlink/specs/dpll.yaml | 30 +++++++++++++++++++++++++++
|
|
drivers/dpll/dpll_nl.c | 8 ++++---
|
|
drivers/dpll/dpll_nl.h | 2 +-
|
|
include/uapi/linux/dpll.h | 6 ++++++
|
|
4 files changed, 42 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/Documentation/netlink/specs/dpll.yaml b/Documentation/netlink/specs/dpll.yaml
|
|
index 1c1b53136c7b..cf8abe1c0550 100644
|
|
--- a/Documentation/netlink/specs/dpll.yaml
|
|
+++ b/Documentation/netlink/specs/dpll.yaml
|
|
@@ -164,6 +164,18 @@ definitions:
|
|
-
|
|
name: state-can-change
|
|
doc: pin state can be changed
|
|
+ -
|
|
+ type: const
|
|
+ name: phase-offset-divider
|
|
+ value: 1000
|
|
+ doc: |
|
|
+ phase offset divider allows userspace to calculate a value of
|
|
+ measured signal phase difference between a pin and dpll device
|
|
+ as a fractional value with three digit decimal precision.
|
|
+ Value of (DPLL_A_PHASE_OFFSET / DPLL_PHASE_OFFSET_DIVIDER) is an
|
|
+ integer part of a measured phase offset value.
|
|
+ Value of (DPLL_A_PHASE_OFFSET % DPLL_PHASE_OFFSET_DIVIDER) is a
|
|
+ fractional part of a measured phase offset value.
|
|
|
|
attribute-sets:
|
|
-
|
|
@@ -272,6 +284,18 @@ attribute-sets:
|
|
type: nest
|
|
multi-attr: true
|
|
nested-attributes: pin-parent-pin
|
|
+ -
|
|
+ name: phase-adjust-min
|
|
+ type: s32
|
|
+ -
|
|
+ name: phase-adjust-max
|
|
+ type: s32
|
|
+ -
|
|
+ name: phase-adjust
|
|
+ type: s32
|
|
+ -
|
|
+ name: phase-offset
|
|
+ type: s64
|
|
-
|
|
name: pin-parent-device
|
|
subset-of: pin
|
|
@@ -284,6 +308,8 @@ attribute-sets:
|
|
name: prio
|
|
-
|
|
name: state
|
|
+ -
|
|
+ name: phase-offset
|
|
-
|
|
name: pin-parent-pin
|
|
subset-of: pin
|
|
@@ -431,6 +457,9 @@ operations:
|
|
- capabilities
|
|
- parent-device
|
|
- parent-pin
|
|
+ - phase-adjust-min
|
|
+ - phase-adjust-max
|
|
+ - phase-adjust
|
|
|
|
dump:
|
|
pre: dpll-lock-dumpit
|
|
@@ -458,6 +487,7 @@ operations:
|
|
- state
|
|
- parent-device
|
|
- parent-pin
|
|
+ - phase-adjust
|
|
-
|
|
name: pin-create-ntf
|
|
doc: Notification about pin appearing
|
|
diff --git a/drivers/dpll/dpll_nl.c b/drivers/dpll/dpll_nl.c
|
|
index 14064c8c783b..eaee5be7aa64 100644
|
|
--- a/drivers/dpll/dpll_nl.c
|
|
+++ b/drivers/dpll/dpll_nl.c
|
|
@@ -11,11 +11,12 @@
|
|
#include <uapi/linux/dpll.h>
|
|
|
|
/* Common nested types */
|
|
-const struct nla_policy dpll_pin_parent_device_nl_policy[DPLL_A_PIN_STATE + 1] = {
|
|
+const struct nla_policy dpll_pin_parent_device_nl_policy[DPLL_A_PIN_PHASE_OFFSET + 1] = {
|
|
[DPLL_A_PIN_PARENT_ID] = { .type = NLA_U32, },
|
|
[DPLL_A_PIN_DIRECTION] = NLA_POLICY_RANGE(NLA_U32, 1, 2),
|
|
[DPLL_A_PIN_PRIO] = { .type = NLA_U32, },
|
|
[DPLL_A_PIN_STATE] = NLA_POLICY_RANGE(NLA_U32, 1, 3),
|
|
+ [DPLL_A_PIN_PHASE_OFFSET] = { .type = NLA_S64, },
|
|
};
|
|
|
|
const struct nla_policy dpll_pin_parent_pin_nl_policy[DPLL_A_PIN_STATE + 1] = {
|
|
@@ -61,7 +62,7 @@ static const struct nla_policy dpll_pin_get_dump_nl_policy[DPLL_A_PIN_ID + 1] =
|
|
};
|
|
|
|
/* DPLL_CMD_PIN_SET - do */
|
|
-static const struct nla_policy dpll_pin_set_nl_policy[DPLL_A_PIN_PARENT_PIN + 1] = {
|
|
+static const struct nla_policy dpll_pin_set_nl_policy[DPLL_A_PIN_PHASE_ADJUST + 1] = {
|
|
[DPLL_A_PIN_ID] = { .type = NLA_U32, },
|
|
[DPLL_A_PIN_FREQUENCY] = { .type = NLA_U64, },
|
|
[DPLL_A_PIN_DIRECTION] = NLA_POLICY_RANGE(NLA_U32, 1, 2),
|
|
@@ -69,6 +70,7 @@ static const struct nla_policy dpll_pin_set_nl_policy[DPLL_A_PIN_PARENT_PIN + 1]
|
|
[DPLL_A_PIN_STATE] = NLA_POLICY_RANGE(NLA_U32, 1, 3),
|
|
[DPLL_A_PIN_PARENT_DEVICE] = NLA_POLICY_NESTED(dpll_pin_parent_device_nl_policy),
|
|
[DPLL_A_PIN_PARENT_PIN] = NLA_POLICY_NESTED(dpll_pin_parent_pin_nl_policy),
|
|
+ [DPLL_A_PIN_PHASE_ADJUST] = { .type = NLA_S32, },
|
|
};
|
|
|
|
/* Ops table for dpll */
|
|
@@ -140,7 +142,7 @@ static const struct genl_split_ops dpll_nl_ops[] = {
|
|
.doit = dpll_nl_pin_set_doit,
|
|
.post_doit = dpll_pin_post_doit,
|
|
.policy = dpll_pin_set_nl_policy,
|
|
- .maxattr = DPLL_A_PIN_PARENT_PIN,
|
|
+ .maxattr = DPLL_A_PIN_PHASE_ADJUST,
|
|
.flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO,
|
|
},
|
|
};
|
|
diff --git a/drivers/dpll/dpll_nl.h b/drivers/dpll/dpll_nl.h
|
|
index 1f67aaed4742..92d4c9c4f788 100644
|
|
--- a/drivers/dpll/dpll_nl.h
|
|
+++ b/drivers/dpll/dpll_nl.h
|
|
@@ -12,7 +12,7 @@
|
|
#include <uapi/linux/dpll.h>
|
|
|
|
/* Common nested types */
|
|
-extern const struct nla_policy dpll_pin_parent_device_nl_policy[DPLL_A_PIN_STATE + 1];
|
|
+extern const struct nla_policy dpll_pin_parent_device_nl_policy[DPLL_A_PIN_PHASE_OFFSET + 1];
|
|
extern const struct nla_policy dpll_pin_parent_pin_nl_policy[DPLL_A_PIN_STATE + 1];
|
|
|
|
int dpll_lock_doit(const struct genl_split_ops *ops, struct sk_buff *skb,
|
|
diff --git a/include/uapi/linux/dpll.h b/include/uapi/linux/dpll.h
|
|
index 20ef0718f8dc..715a491d2727 100644
|
|
--- a/include/uapi/linux/dpll.h
|
|
+++ b/include/uapi/linux/dpll.h
|
|
@@ -138,6 +138,8 @@ enum dpll_pin_capabilities {
|
|
DPLL_PIN_CAPABILITIES_STATE_CAN_CHANGE = 4,
|
|
};
|
|
|
|
+#define DPLL_PHASE_OFFSET_DIVIDER 1000
|
|
+
|
|
enum dpll_a {
|
|
DPLL_A_ID = 1,
|
|
DPLL_A_MODULE_NAME,
|
|
@@ -173,6 +175,10 @@ enum dpll_a_pin {
|
|
DPLL_A_PIN_CAPABILITIES,
|
|
DPLL_A_PIN_PARENT_DEVICE,
|
|
DPLL_A_PIN_PARENT_PIN,
|
|
+ DPLL_A_PIN_PHASE_ADJUST_MIN,
|
|
+ DPLL_A_PIN_PHASE_ADJUST_MAX,
|
|
+ DPLL_A_PIN_PHASE_ADJUST,
|
|
+ DPLL_A_PIN_PHASE_OFFSET,
|
|
|
|
__DPLL_A_PIN_MAX,
|
|
DPLL_A_PIN_MAX = (__DPLL_A_PIN_MAX - 1)
|
|
--
|
|
2.43.0
|
|
|