From: Min Li <lnimi@hotmail.com>
To: richardcochran@gmail.com, lee@kernel.org
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
Min Li <min.li.xe@renesas.com>
Subject: [PATCH net-next v7 2/5] ptp: clockmatrix: set write phase timer to 0 when not in PCW mode
Date: Thu, 4 Jan 2024 11:36:38 -0500 [thread overview]
Message-ID: <PH7PR03MB7064B38BDED195B1E6239AACA0672@PH7PR03MB7064.namprd03.prod.outlook.com> (raw)
In-Reply-To: <20240104163641.15893-1-lnimi@hotmail.com>
From: Min Li <min.li.xe@renesas.com>
In order for phase pull-in to work, write phase timer shall be 0
when not in write phase mode. Also Fix u8 -> u16, DPLL_WF_TIMER
and DPLL_WP_TIMER are 2-byte registers
Signed-off-by: Min Li <min.li.xe@renesas.com>
---
drivers/ptp/ptp_clockmatrix.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/ptp/ptp_clockmatrix.c b/drivers/ptp/ptp_clockmatrix.c
index f8556627befa..d069b6e451ef 100644
--- a/drivers/ptp/ptp_clockmatrix.c
+++ b/drivers/ptp/ptp_clockmatrix.c
@@ -1396,6 +1396,20 @@ static int idtcm_set_pll_mode(struct idtcm_channel *channel,
struct idtcm *idtcm = channel->idtcm;
int err;
u8 dpll_mode;
+ u8 buf[2] = {0};
+
+ /* Setup WF/WP timer for phase pull-in to work correctly */
+ err = idtcm_write(idtcm, channel->dpll_n, DPLL_WF_TIMER,
+ buf, sizeof(buf));
+ if (err)
+ return err;
+
+ if (mode == PLL_MODE_WRITE_PHASE)
+ buf[0] = 160;
+ err = idtcm_write(idtcm, channel->dpll_n, DPLL_WP_TIMER,
+ buf, sizeof(buf));
+ if (err)
+ return err;
err = idtcm_read(idtcm, channel->dpll_n,
IDTCM_FW_REG(idtcm->fw_ver, V520, DPLL_MODE),
--
2.39.2
next parent reply other threads:[~2024-01-04 16:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20240104163641.15893-1-lnimi@hotmail.com>
2024-01-04 16:36 ` Min Li [this message]
2024-01-04 16:36 ` [PATCH net-next v7 3/5] ptp: clockmatrix: dco input-to-output delay is 20 FOD cycles + 8ns Min Li
2024-01-04 16:36 ` [PATCH net-next v7 4/5] ptp: clockmatrix: Fix caps.max_adj to reflect DPLL_MAX_FREQ_OFFSET[MAX_FFO] Min Li
2024-01-11 10:47 ` Lee Jones
2024-01-04 16:36 ` [PATCH net-next v7 5/5] ptp: clockmatrix: move register and firmware related definition to idt8a340_reg.h Min Li
2024-01-11 10:48 ` Lee Jones
[not found] <20240501160324.27514-1-lnimi@hotmail.com>
2024-05-01 16:03 ` [PATCH net-next v7 2/5] ptp: clockmatrix: set write phase timer to 0 when not in PCW mode Min Li
[not found] <20240318173213.28475-1-lnimi@hotmail.com>
2024-03-18 17:32 ` Min Li
[not found] <20240314153707.31551-1-lnimi@hotmail.com>
2024-03-14 15:37 ` Min Li
[not found] <20231214152415.14785-1-lnimi@hotmail.com>
2023-12-14 15:24 ` Min Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=PH7PR03MB7064B38BDED195B1E6239AACA0672@PH7PR03MB7064.namprd03.prod.outlook.com \
--to=lnimi@hotmail.com \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=min.li.xe@renesas.com \
--cc=netdev@vger.kernel.org \
--cc=richardcochran@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).