* [PATCH net v7 0/7] ptp: fix OCP routes and SJA1105 pin direction
@ 2026-11-27 19:22 Ahmad Byagowi
2026-11-27 19:22 ` [PATCH net v7 1/7] net: dsa: sja1105: keep pin function on EXTTS disable Ahmad Byagowi
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: Ahmad Byagowi @ 2026-11-27 19:22 UTC (permalink / raw)
To: netdev
Cc: andrew+netdev, arkadiusz.kubalewski, davem, edumazet, jiri,
jonathan.lemon, kuba, linux-kernel, milena.olech, olteanv, pabeni,
richardcochran, vadim.fedorenko
These driver fixes apply without the PTP-core series. The OCP detach
path and the shared-PPS shortcut are unchanged.
Changes since v6:
- Drop patch 8. Removing OCP's early timestamp disable needs the core
cleanup change and separate validation before it can be proposed.
- Serialize OCP route changes across sysfs, PTP pin configuration
and DPLL. Reject unrepresentable 10 MHz plus auxiliary routes
without writing the mux. Document the selector encoding and the
nominal-frequency readback rules, including ART.
- Decode both input and output enable bits when binding configurable
FB and ADVA pins. Leave fixed-direction boards unchanged.
- Put SJA1105 PEROUT pin selection inside the existing enable block.
Existing SJA1105 enable and timer lifecycle concerns are not part
of these enable-only mux fixes.
- Correct the disabled-selector explanation, align the author name,
use contiguous trailers, and retain the DCF Reviewed-by on the
unchanged code.
Validation (local fixtures): strict PTP and SJA1105 PTP builds on x86_64
and i386, allmodconfig and allyesconfig. Source-derived tests exercise
serialized selector changes, nominal-frequency readback, rejected and
accepted 10 MHz requests, 768 rebind states and SJA1105 pin behavior.
No physical card or switch test was performed.
Coding-assistant support was used to review the reports, refine the
SMA changes and tests, and prepare changelogs.
v6: https://lore.kernel.org/r/20261126-timecard-driver-v6-0-ahmadexp@gmail.com/
Ahmad Byagowi (7):
net: dsa: sja1105: keep pin function on EXTTS disable
net: dsa: sja1105: keep pin function on PEROUT disable
ptp: ocp: preserve timestamp routes on DPLL frequency changes
ptp: ocp: recover SMA direction from both enable bits on bind
ptp: ocp: report disabled SMA inputs as zero Hz
ptp: ocp: correct the DCF output frequency
ptp: ocp: match ART DPLL frequencies to selectors
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH net v7 1/7] net: dsa: sja1105: keep pin function on EXTTS disable
2026-11-27 19:22 [PATCH net v7 0/7] ptp: fix OCP routes and SJA1105 pin direction Ahmad Byagowi
@ 2026-11-27 19:22 ` Ahmad Byagowi
2026-11-27 19:22 ` [PATCH net v7 2/7] net: dsa: sja1105: keep pin function on PEROUT disable Ahmad Byagowi
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Ahmad Byagowi @ 2026-11-27 19:22 UTC (permalink / raw)
To: netdev
Cc: andrew, davem, edumazet, kuba, linux-kernel, olteanv, pabeni,
richardcochran
An EXTTS disable request programs the shared PTP_CLK pin as an input
even if the pin is driving periodic output. Select input mode only
when enabling EXTTS. Keep the existing disable and timer drain.
Developed with coding-assistant support during review and validation.
Fixes: 747e5eb31d59 ("net: dsa: sja1105: configure the PTP_CLK pin as EXT_TS or PER_OUT")
Signed-off-by: Ahmad Byagowi <ahmadexp@gmail.com>
---
drivers/net/dsa/sja1105/sja1105_ptp.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/net/dsa/sja1105/sja1105_ptp.c b/drivers/net/dsa/sja1105/sja1105_ptp.c
index 350f958dcb2a..da35805152e0 100644
--- a/drivers/net/dsa/sja1105/sja1105_ptp.c
+++ b/drivers/net/dsa/sja1105/sja1105_ptp.c
@@ -816,9 +816,11 @@ static int sja1105_extts_enable(struct sja1105_private *priv,
(extts->flags & PTP_EXTTS_EDGES) != PTP_EXTTS_EDGES)
return -EOPNOTSUPP;
- rc = sja1105_change_ptp_clk_pin_func(priv, PTP_PF_EXTTS);
- if (rc)
- return rc;
+ if (on) {
+ rc = sja1105_change_ptp_clk_pin_func(priv, PTP_PF_EXTTS);
+ if (rc)
+ return rc;
+ }
priv->ptp_data.extts_enabled = on;
base-commit: 4392bb809812ac79449cd0cf1f5e00469ee102d1
--
2.54.0 (Apple Git-157)
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net v7 2/7] net: dsa: sja1105: keep pin function on PEROUT disable
2026-11-27 19:22 [PATCH net v7 0/7] ptp: fix OCP routes and SJA1105 pin direction Ahmad Byagowi
2026-11-27 19:22 ` [PATCH net v7 1/7] net: dsa: sja1105: keep pin function on EXTTS disable Ahmad Byagowi
@ 2026-11-27 19:22 ` Ahmad Byagowi
2026-11-27 19:22 ` [PATCH net v7 3/7] ptp: ocp: preserve timestamp routes on DPLL frequency changes Ahmad Byagowi
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Ahmad Byagowi @ 2026-11-27 19:22 UTC (permalink / raw)
To: netdev
Cc: andrew, davem, edumazet, kuba, linux-kernel, olteanv, pabeni,
richardcochran
Stopping periodic output currently switches the shared PTP_CLK pin
to output even if it is configured for EXTTS. Only select output
mode when starting the generator. Keep the existing stop command.
Developed with coding-assistant support during review and validation.
Fixes: 747e5eb31d59 ("net: dsa: sja1105: configure the PTP_CLK pin as EXT_TS or PER_OUT")
Signed-off-by: Ahmad Byagowi <ahmadexp@gmail.com>
---
drivers/net/dsa/sja1105/sja1105_ptp.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/dsa/sja1105/sja1105_ptp.c b/drivers/net/dsa/sja1105/sja1105_ptp.c
index da35805152e0..5d69d083f5ec 100644
--- a/drivers/net/dsa/sja1105/sja1105_ptp.c
+++ b/drivers/net/dsa/sja1105/sja1105_ptp.c
@@ -733,10 +733,6 @@ static int sja1105_per_out_enable(struct sja1105_private *priv,
mutex_lock(&ptp_data->lock);
- rc = sja1105_change_ptp_clk_pin_func(priv, PTP_PF_PEROUT);
- if (rc)
- goto out;
-
if (on) {
struct timespec64 pin_duration_ts = {
.tv_sec = perout->period.sec,
@@ -751,6 +747,10 @@ static int sja1105_per_out_enable(struct sja1105_private *priv,
u32 pin_duration32;
u64 now;
+ rc = sja1105_change_ptp_clk_pin_func(priv, PTP_PF_PEROUT);
+ if (rc)
+ goto out;
+
/* ptppindur: 32 bit register which holds the interval between
* 2 edges on PTP_CLK. So check for truncation which happens
* at periods larger than around 68.7 seconds.
--
2.54.0 (Apple Git-157)
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net v7 3/7] ptp: ocp: preserve timestamp routes on DPLL frequency changes
2026-11-27 19:22 [PATCH net v7 0/7] ptp: fix OCP routes and SJA1105 pin direction Ahmad Byagowi
2026-11-27 19:22 ` [PATCH net v7 1/7] net: dsa: sja1105: keep pin function on EXTTS disable Ahmad Byagowi
2026-11-27 19:22 ` [PATCH net v7 2/7] net: dsa: sja1105: keep pin function on PEROUT disable Ahmad Byagowi
@ 2026-11-27 19:22 ` Ahmad Byagowi
2026-11-27 19:22 ` [PATCH net v7 4/7] ptp: ocp: recover SMA direction from both enable bits on bind Ahmad Byagowi
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Ahmad Byagowi @ 2026-11-27 19:22 UTC (permalink / raw)
To: netdev
Cc: andrew+netdev, arkadiusz.kubalewski, davem, edumazet, jiri, kuba,
milena.olech, pabeni, richardcochran, vadim.fedorenko
DPLL frequency set uses a table index as a hardware selector and can
replace timestamp or counter destinations selected through sysfs.
Use the encoded selector on inputs and outputs, including ART. Keep
auxiliary input routes while replacing the frequency-bearing source.
Reject a zero-encoded 10 MHz selection when auxiliary routes make it
unrepresentable, without changing the register or connector state.
Serialize the read and write against sysfs, PTP pin assignments and
DPLL direction changes. Keep the existing MMIO spinlock inside the
register accessors.
For readback, mask out the enable bit and report the configured nominal
frequency when combined input routes agree. Report zero when there is
no unambiguous frequency. This does not measure the input signal.
Developed with coding-assistant support using v6 review feedback.
Fixes: 09eeb3aecc6c ("ptp_ocp: implement DPLL ops")
Link: https://lore.kernel.org/r/179579808134.3135.14342336954222031404@kernel.org
Signed-off-by: Ahmad Byagowi <ahmadexp@gmail.com>
---
drivers/ptp/ptp_ocp.c | 64 +++++++++++++++++++++++++++++++++++++++----
1 file changed, 59 insertions(+), 5 deletions(-)
diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
index 625a85b2dc7e..3781f6582b7b 100644
--- a/drivers/ptp/ptp_ocp.c
+++ b/drivers/ptp/ptp_ocp.c
@@ -417,6 +417,7 @@ struct ptp_ocp {
u32 ts_window_adjust;
u64 fw_cap;
struct ptp_ocp_signal signal[OCP_SIGNAL_NUM];
+ struct mutex sma_lock; /* serializes routing and connector state */
struct ptp_ocp_sma_connector sma[OCP_SMA_NUM];
const struct ocp_sma_op *sma_op;
struct dpll_device *dpll;
@@ -3384,6 +3385,7 @@ ptp_ocp_sma_show(struct ptp_ocp *bp, int sma_nr, char *buf,
const struct ocp_selector * const *tbl;
u32 val;
+ guard(mutex)(&bp->sma_lock);
tbl = bp->sma_op->tbl;
val = ptp_ocp_sma_get(bp, sma_nr) & SMA_SELECT_MASK;
@@ -3433,6 +3435,7 @@ ptp_ocp_sma_store_val(struct ptp_ocp *bp, int val, enum ptp_ocp_sma_mode mode, i
{
struct ptp_ocp_sma_connector *sma = &bp->sma[sma_nr - 1];
+ lockdep_assert_held(&bp->sma_lock);
if (sma->fixed_dir && (mode != sma->mode || val & SMA_DISABLE))
return -EOPNOTSUPP;
@@ -3473,6 +3476,7 @@ ptp_ocp_sma_store(struct ptp_ocp *bp, const char *buf, int sma_nr)
enum ptp_ocp_sma_mode mode;
int val;
+ guard(mutex)(&bp->sma_lock);
mode = sma->mode;
val = sma_parse_inputs(bp->sma_op->tbl, buf, &mode);
if (val < 0)
@@ -5838,7 +5842,9 @@ static int ptp_ocp_dpll_direction_get(const struct dpll_pin *pin,
struct netlink_ext_ack *extack)
{
struct ptp_ocp_sma_connector *sma = pin_priv;
+ struct ptp_ocp *bp = priv;
+ guard(mutex)(&bp->sma_lock);
*direction = sma->mode == SMA_MODE_IN ?
DPLL_PIN_DIRECTION_INPUT :
DPLL_PIN_DIRECTION_OUTPUT;
@@ -5857,6 +5863,7 @@ static int ptp_ocp_dpll_direction_set(const struct dpll_pin *pin,
enum ptp_ocp_sma_mode mode;
int sma_nr = (sma - bp->sma);
+ guard(mutex)(&bp->sma_lock);
if (sma->fixed_dir)
return -EOPNOTSUPP;
mode = direction == DPLL_PIN_DIRECTION_INPUT ?
@@ -5873,16 +5880,39 @@ static int ptp_ocp_dpll_frequency_set(const struct dpll_pin *pin,
struct ptp_ocp_sma_connector *sma = pin_priv;
struct ptp_ocp *bp = dpll_priv;
const struct ocp_selector *tbl;
+ u32 val, aux = 0;
int sma_nr = (sma - bp->sma);
- int i;
+ int i, j;
+ guard(mutex)(&bp->sma_lock);
if (sma->fixed_fcn)
return -EOPNOTSUPP;
tbl = bp->sma_op->tbl[sma->mode];
- for (i = 0; tbl[i].name; i++)
- if (tbl[i].frequency == frequency)
- return ptp_ocp_sma_store_val(bp, i, sma->mode, sma_nr + 1);
+ for (i = 0; tbl[i].name; i++) {
+ if (tbl[i].frequency != frequency)
+ continue;
+
+ if (sma->mode == SMA_MODE_IN) {
+ val = bp->sma_op->get(bp, sma_nr + 1) & SMA_SELECT_MASK;
+ if (sma->disabled)
+ val = 0;
+
+ for (j = 0; tbl[j].name; j++) {
+ if (!tbl[j].frequency && (val & tbl[j].value))
+ aux |= tbl[j].value;
+ }
+
+ /* Some boards encode 10 MHz as an empty selector. */
+ if (!tbl[i].value && aux) {
+ NL_SET_ERR_MSG(extack,
+ "10 MHz cannot coexist with the current SMA routes");
+ return -EBUSY;
+ }
+ }
+ return ptp_ocp_sma_store_val(bp, tbl[i].value | aux,
+ sma->mode, sma_nr + 1);
+ }
return -EINVAL;
}
@@ -5899,7 +5929,9 @@ static int ptp_ocp_dpll_frequency_get(const struct dpll_pin *pin,
u32 val;
int i;
+ guard(mutex)(&bp->sma_lock);
val = bp->sma_op->get(bp, sma_nr + 1);
+ val &= SMA_SELECT_MASK;
tbl = bp->sma_op->tbl[sma->mode];
for (i = 0; tbl[i].name; i++)
if (val == tbl[i].value) {
@@ -5907,7 +5939,28 @@ static int ptp_ocp_dpll_frequency_get(const struct dpll_pin *pin,
return 0;
}
- return -EINVAL;
+ if (sma->mode == SMA_MODE_OUT)
+ return -EINVAL;
+
+ /* Inputs can feed several destinations, including timestampers. */
+ *frequency = 0;
+ for (i = 0; tbl[i].name; i++) {
+ if (!(val & tbl[i].value))
+ continue;
+ val &= ~tbl[i].value;
+ if (!tbl[i].frequency)
+ continue;
+ if (*frequency && *frequency != tbl[i].frequency) {
+ *frequency = 0;
+ return 0;
+ }
+ *frequency = tbl[i].frequency;
+ }
+ /* Unknown destinations do not establish a frequency either. */
+ if (val)
+ *frequency = 0;
+
+ return 0;
}
static const struct dpll_device_ops dpll_ops = {
@@ -5981,6 +6034,7 @@ ptp_ocp_probe(struct pci_dev *pdev, const struct pci_device_id *id)
* ptp_ocp_register_resources(), so this sentinel cannot overwrite an
* adapter number the i2c notifier stores during registration.
*/
+ mutex_init(&bp->sma_lock);
mutex_init(&bp->cpld_lock);
spin_lock_init(&bp->cpld_adap_lock);
bp->cpld_i2c_adap_nr = -1;
--
2.54.0 (Apple Git-157)
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net v7 4/7] ptp: ocp: recover SMA direction from both enable bits on bind
2026-11-27 19:22 [PATCH net v7 0/7] ptp: fix OCP routes and SJA1105 pin direction Ahmad Byagowi
` (2 preceding siblings ...)
2026-11-27 19:22 ` [PATCH net v7 3/7] ptp: ocp: preserve timestamp routes on DPLL frequency changes Ahmad Byagowi
@ 2026-11-27 19:22 ` Ahmad Byagowi
2026-11-27 19:23 ` [PATCH net v7 5/7] ptp: ocp: report disabled SMA inputs as zero Hz Ahmad Byagowi
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Ahmad Byagowi @ 2026-11-27 19:22 UTC (permalink / raw)
To: netdev
Cc: andrew+netdev, davem, edumazet, jonathan.lemon, kuba, pabeni,
richardcochran, vadim.fedorenko
An IN: None request clears the input register. On bind, interpreting
a clear input enable bit as an enabled output (SMA1/SMA2) loses the
disabled state that is already represented by the register pair.
For configurable FB and ADVA connectors, use both enable bits. An
enabled input or output selects the corresponding direction. If
both are clear, report the disabled connector as IN: None. Keep
the existing per-connector default if both bits are set, and leave
fixed-direction hardware unchanged. Probe does not rewrite the mux.
Developed with coding-assistant support using v6 review feedback.
Fixes: b2c4f0ac53f3 ("ptp: ocp: Add ability to disable input selectors.")
Link: https://lore.kernel.org/r/179579808276.3135.5382400825629748441@kernel.org
Signed-off-by: Ahmad Byagowi <ahmadexp@gmail.com>
---
drivers/ptp/ptp_ocp.c | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
index 3781f6582b7b..6cf060d3b1a1 100644
--- a/drivers/ptp/ptp_ocp.c
+++ b/drivers/ptp/ptp_ocp.c
@@ -2926,13 +2926,22 @@ ptp_ocp_sma_fb_init(struct ptp_ocp *bp)
for (i = 0; i < OCP_SMA_NUM; i++)
bp->sma[i].fixed_dir = true;
} else {
- reg = ioread32(&bp->sma_map1->gpio1);
- bp->sma[0].mode = reg & BIT(15) ? SMA_MODE_IN : SMA_MODE_OUT;
- bp->sma[1].mode = reg & BIT(31) ? SMA_MODE_IN : SMA_MODE_OUT;
+ u32 inputs[] = { ioread32(&bp->sma_map1->gpio1),
+ ioread32(&bp->sma_map2->gpio1) };
+ u32 outputs[] = { reg, ioread32(&bp->sma_map1->gpio2) };
- reg = ioread32(&bp->sma_map1->gpio2);
- bp->sma[2].mode = reg & BIT(15) ? SMA_MODE_OUT : SMA_MODE_IN;
- bp->sma[3].mode = reg & BIT(31) ? SMA_MODE_OUT : SMA_MODE_IN;
+ for (i = 0; i < OCP_SMA_NUM; i++) {
+ u32 mask = SMA_ENABLE << (16 * (i & 1));
+ bool input = inputs[i / 2] & mask;
+ bool output = outputs[i / 2] & mask;
+
+ bp->sma[i].disabled = !input && !output;
+ /* If both are active, retain this connector's default. */
+ if (!output)
+ bp->sma[i].mode = SMA_MODE_IN;
+ else if (!input)
+ bp->sma[i].mode = SMA_MODE_OUT;
+ }
}
}
--
2.54.0 (Apple Git-157)
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net v7 5/7] ptp: ocp: report disabled SMA inputs as zero Hz
2026-11-27 19:22 [PATCH net v7 0/7] ptp: fix OCP routes and SJA1105 pin direction Ahmad Byagowi
` (3 preceding siblings ...)
2026-11-27 19:22 ` [PATCH net v7 4/7] ptp: ocp: recover SMA direction from both enable bits on bind Ahmad Byagowi
@ 2026-11-27 19:23 ` Ahmad Byagowi
2026-11-27 19:23 ` [PATCH net v7 6/7] ptp: ocp: correct the DCF output frequency Ahmad Byagowi
2026-11-27 19:23 ` [PATCH net v7 7/7] ptp: ocp: match ART DPLL frequencies to selectors Ahmad Byagowi
6 siblings, 0 replies; 8+ messages in thread
From: Ahmad Byagowi @ 2026-11-27 19:23 UTC (permalink / raw)
To: netdev
Cc: andrew+netdev, arkadiusz.kubalewski, davem, edumazet, jiri, kuba,
pabeni, richardcochran, vadim.fedorenko
A disabled SMA input has a cleared hardware selector. On FB and ADVA
the cleared selector also encodes enabled 10 MHz when accompanied by
the enable bit. Once that bit is masked in DPLL readback, the disabled
input can be reported as already configured for 10 MHz. DPLL can then
skip the set callback, leaving the input disabled.
Use the connector's disabled state to report a nominal frequency of
zero. Keep enabled input and output reporting unchanged.
Developed with coding-assistant support during review and validation.
Fixes: 09eeb3aecc6c ("ptp_ocp: implement DPLL ops")
Signed-off-by: Ahmad Byagowi <ahmadexp@gmail.com>
---
drivers/ptp/ptp_ocp.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
index 6cf060d3b1a1..9500fb2635a9 100644
--- a/drivers/ptp/ptp_ocp.c
+++ b/drivers/ptp/ptp_ocp.c
@@ -5941,6 +5941,8 @@ static int ptp_ocp_dpll_frequency_get(const struct dpll_pin *pin,
guard(mutex)(&bp->sma_lock);
val = bp->sma_op->get(bp, sma_nr + 1);
val &= SMA_SELECT_MASK;
+ if (sma->mode == SMA_MODE_IN && sma->disabled)
+ val = SMA_DISABLE;
tbl = bp->sma_op->tbl[sma->mode];
for (i = 0; tbl[i].name; i++)
if (val == tbl[i].value) {
--
2.54.0 (Apple Git-157)
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net v7 6/7] ptp: ocp: correct the DCF output frequency
2026-11-27 19:22 [PATCH net v7 0/7] ptp: fix OCP routes and SJA1105 pin direction Ahmad Byagowi
` (4 preceding siblings ...)
2026-11-27 19:23 ` [PATCH net v7 5/7] ptp: ocp: report disabled SMA inputs as zero Hz Ahmad Byagowi
@ 2026-11-27 19:23 ` Ahmad Byagowi
2026-11-27 19:23 ` [PATCH net v7 7/7] ptp: ocp: match ART DPLL frequencies to selectors Ahmad Byagowi
6 siblings, 0 replies; 8+ messages in thread
From: Ahmad Byagowi @ 2026-11-27 19:23 UTC (permalink / raw)
To: netdev
Cc: andrew+netdev, arkadiusz.kubalewski, davem, edumazet, jiri, kuba,
pabeni, richardcochran, vadim.fedorenko
The output table uses 77000 Hz for DCF, while the input table and DPLL
capability list use 77500 Hz. An output request for the advertised
frequency fails and reads report an unsupported nominal frequency.
Use 77500 Hz for the DCF output selector.
Developed with coding-assistant support during review and validation.
Fixes: 09eeb3aecc6c ("ptp_ocp: implement DPLL ops")
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Signed-off-by: Ahmad Byagowi <ahmadexp@gmail.com>
---
drivers/ptp/ptp_ocp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
index 9500fb2635a9..8e898d929105 100644
--- a/drivers/ptp/ptp_ocp.c
+++ b/drivers/ptp/ptp_ocp.c
@@ -1374,7 +1374,7 @@ static const struct ocp_selector ptp_ocp_sma_out[] = {
{ .name = "GNSS1", .value = 0x0004, .frequency = 1 },
{ .name = "GNSS2", .value = 0x0008, .frequency = 1 },
{ .name = "IRIG", .value = 0x0010, .frequency = 10000 },
- { .name = "DCF", .value = 0x0020, .frequency = 77000 },
+ { .name = "DCF", .value = 0x0020, .frequency = 77500 },
{ .name = "GEN1", .value = 0x0040 },
{ .name = "GEN2", .value = 0x0080 },
{ .name = "GEN3", .value = 0x0100 },
--
2.54.0 (Apple Git-157)
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net v7 7/7] ptp: ocp: match ART DPLL frequencies to selectors
2026-11-27 19:22 [PATCH net v7 0/7] ptp: fix OCP routes and SJA1105 pin direction Ahmad Byagowi
` (5 preceding siblings ...)
2026-11-27 19:23 ` [PATCH net v7 6/7] ptp: ocp: correct the DCF output frequency Ahmad Byagowi
@ 2026-11-27 19:23 ` Ahmad Byagowi
6 siblings, 0 replies; 8+ messages in thread
From: Ahmad Byagowi @ 2026-11-27 19:23 UTC (permalink / raw)
To: netdev
Cc: andrew+netdev, arkadiusz.kubalewski, davem, edumazet, jiri, kuba,
milena.olech, pabeni, richardcochran, vadim.fedorenko
The ART input selector named 10Mhz is recorded as 1 MHz although the
pin advertises 10 MHz. ART also advertises IRIG-B and DCF77 through
the generic capability list, but has no selectors for them.
Use 10 MHz in the ART input table. Advertise only 1 PPS and 10 MHz on
ART connectors so DPLL validation matches the available selectors.
Developed with coding-assistant support during review and validation.
Fixes: 09eeb3aecc6c ("ptp_ocp: implement DPLL ops")
Signed-off-by: Ahmad Byagowi <ahmadexp@gmail.com>
---
drivers/ptp/ptp_ocp.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
index 8e898d929105..3bdd6e8959fd 100644
--- a/drivers/ptp/ptp_ocp.c
+++ b/drivers/ptp/ptp_ocp.c
@@ -299,6 +299,11 @@ static struct dpll_pin_frequency ptp_ocp_sma_freq[] = {
DPLL_PIN_FREQUENCY_DCF77,
};
+static struct dpll_pin_frequency ptp_ocp_art_sma_freq[] = {
+ DPLL_PIN_FREQUENCY_1PPS,
+ DPLL_PIN_FREQUENCY_10MHZ,
+};
+
struct ptp_ocp_sma_connector {
enum ptp_ocp_sma_mode mode;
bool fixed_fcn;
@@ -1386,7 +1391,7 @@ static const struct ocp_selector ptp_ocp_sma_out[] = {
static const struct ocp_selector ptp_ocp_art_sma_in[] = {
{ .name = "PPS1", .value = 0x0001, .frequency = 1 },
- { .name = "10Mhz", .value = 0x0008, .frequency = 1000000 },
+ { .name = "10Mhz", .value = 0x0008, .frequency = 10000000 },
{ }
};
@@ -3140,8 +3145,8 @@ ptp_ocp_art_sma_init(struct ptp_ocp *bp)
.board_label = NULL,
.type = DPLL_PIN_TYPE_EXT,
.capabilities = 0,
- .freq_supported_num = ARRAY_SIZE(ptp_ocp_sma_freq),
- .freq_supported = ptp_ocp_sma_freq,
+ .freq_supported_num = ARRAY_SIZE(ptp_ocp_art_sma_freq),
+ .freq_supported = ptp_ocp_art_sma_freq,
};
u32 reg;
--
2.54.0 (Apple Git-157)
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-11-27 19:23 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-27 19:22 [PATCH net v7 0/7] ptp: fix OCP routes and SJA1105 pin direction Ahmad Byagowi
2026-11-27 19:22 ` [PATCH net v7 1/7] net: dsa: sja1105: keep pin function on EXTTS disable Ahmad Byagowi
2026-11-27 19:22 ` [PATCH net v7 2/7] net: dsa: sja1105: keep pin function on PEROUT disable Ahmad Byagowi
2026-11-27 19:22 ` [PATCH net v7 3/7] ptp: ocp: preserve timestamp routes on DPLL frequency changes Ahmad Byagowi
2026-11-27 19:22 ` [PATCH net v7 4/7] ptp: ocp: recover SMA direction from both enable bits on bind Ahmad Byagowi
2026-11-27 19:23 ` [PATCH net v7 5/7] ptp: ocp: report disabled SMA inputs as zero Hz Ahmad Byagowi
2026-11-27 19:23 ` [PATCH net v7 6/7] ptp: ocp: correct the DCF output frequency Ahmad Byagowi
2026-11-27 19:23 ` [PATCH net v7 7/7] ptp: ocp: match ART DPLL frequencies to selectors Ahmad Byagowi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox