* [PATCH v2] phy: qcom: qmp: Add debug prints for register writes
@ 2024-07-31 11:56 Manivannan Sadhasivam
2024-08-01 2:26 ` Bjorn Andersson
0 siblings, 1 reply; 3+ messages in thread
From: Manivannan Sadhasivam @ 2024-07-31 11:56 UTC (permalink / raw)
To: vkoul; +Cc: kishon, linux-arm-msm, linux-phy, linux-kernel,
Manivannan Sadhasivam
These register prints are useful to validate the init sequence against the
Qcom internal documentation and also to share with the Qcom hw engineers to
debug issues related to PHY.
Sample debug prints:
QMP PHY: Writing Reg: QSERDES_V5_COM_SYSCLK_EN_SEL Offset: 0x0094 Val: 0xd9
QMP PHY: Writing Reg: QSERDES_V5_COM_HSCLK_SEL Offset: 0x0158 Val: 0x11
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
Changes in v2:
* Modifed the debug print to include reg offset
drivers/phy/qualcomm/phy-qcom-qmp-common.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-common.h b/drivers/phy/qualcomm/phy-qcom-qmp-common.h
index 799384210509..40beb413328f 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-common.h
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-common.h
@@ -9,6 +9,7 @@
struct qmp_phy_init_tbl {
unsigned int offset;
unsigned int val;
+ char *name;
/*
* mask of lanes for which this register is written
* for cases when second lane needs different values
@@ -20,6 +21,7 @@ struct qmp_phy_init_tbl {
{ \
.offset = o, \
.val = v, \
+ .name = #o, \
.lane_mask = 0xff, \
}
@@ -27,6 +29,7 @@ struct qmp_phy_init_tbl {
{ \
.offset = o, \
.val = v, \
+ .name = #o, \
.lane_mask = l, \
}
@@ -45,6 +48,8 @@ static inline void qmp_configure_lane(void __iomem *base,
if (!(t->lane_mask & lane_mask))
continue;
+ pr_debug("QMP PHY: Writing Reg: %s Offset: 0x%04x Val: 0x%02x\n",
+ t->name, t->offset, t->val);
writel(t->val, base + t->offset);
}
}
--
2.25.1
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v2] phy: qcom: qmp: Add debug prints for register writes
2024-07-31 11:56 [PATCH v2] phy: qcom: qmp: Add debug prints for register writes Manivannan Sadhasivam
@ 2024-08-01 2:26 ` Bjorn Andersson
2024-08-01 6:58 ` Manivannan Sadhasivam
0 siblings, 1 reply; 3+ messages in thread
From: Bjorn Andersson @ 2024-08-01 2:26 UTC (permalink / raw)
To: Manivannan Sadhasivam
Cc: vkoul, kishon, linux-arm-msm, linux-phy, linux-kernel
On Wed, Jul 31, 2024 at 05:26:37PM GMT, Manivannan Sadhasivam wrote:
> These register prints are useful to validate the init sequence against the
> Qcom internal documentation and also to share with the Qcom hw engineers to
> debug issues related to PHY.
>
I've written this patch every time I've touched one of these PHYs, so I
certainly like this.
> Sample debug prints:
>
> QMP PHY: Writing Reg: QSERDES_V5_COM_SYSCLK_EN_SEL Offset: 0x0094 Val: 0xd9
> QMP PHY: Writing Reg: QSERDES_V5_COM_HSCLK_SEL Offset: 0x0158 Val: 0x11
That said, with multiple instances of PHYs being configured at about the
same time it seems this would benefit greatly from something identifying
which PHY instance the write relates to?
dev_dbg() would certainly be nice...
>
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> ---
>
> Changes in v2:
>
> * Modifed the debug print to include reg offset
>
> drivers/phy/qualcomm/phy-qcom-qmp-common.h | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-common.h b/drivers/phy/qualcomm/phy-qcom-qmp-common.h
> index 799384210509..40beb413328f 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qmp-common.h
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-common.h
> @@ -9,6 +9,7 @@
> struct qmp_phy_init_tbl {
> unsigned int offset;
> unsigned int val;
> + char *name;
const?
Regards,
Bjorn
> /*
> * mask of lanes for which this register is written
> * for cases when second lane needs different values
> @@ -20,6 +21,7 @@ struct qmp_phy_init_tbl {
> { \
> .offset = o, \
> .val = v, \
> + .name = #o, \
> .lane_mask = 0xff, \
> }
>
> @@ -27,6 +29,7 @@ struct qmp_phy_init_tbl {
> { \
> .offset = o, \
> .val = v, \
> + .name = #o, \
> .lane_mask = l, \
> }
>
> @@ -45,6 +48,8 @@ static inline void qmp_configure_lane(void __iomem *base,
> if (!(t->lane_mask & lane_mask))
> continue;
>
> + pr_debug("QMP PHY: Writing Reg: %s Offset: 0x%04x Val: 0x%02x\n",
> + t->name, t->offset, t->val);
> writel(t->val, base + t->offset);
> }
> }
> --
> 2.25.1
>
>
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v2] phy: qcom: qmp: Add debug prints for register writes
2024-08-01 2:26 ` Bjorn Andersson
@ 2024-08-01 6:58 ` Manivannan Sadhasivam
0 siblings, 0 replies; 3+ messages in thread
From: Manivannan Sadhasivam @ 2024-08-01 6:58 UTC (permalink / raw)
To: Bjorn Andersson; +Cc: vkoul, kishon, linux-arm-msm, linux-phy, linux-kernel
On Wed, Jul 31, 2024 at 09:26:27PM -0500, Bjorn Andersson wrote:
> On Wed, Jul 31, 2024 at 05:26:37PM GMT, Manivannan Sadhasivam wrote:
> > These register prints are useful to validate the init sequence against the
> > Qcom internal documentation and also to share with the Qcom hw engineers to
> > debug issues related to PHY.
> >
>
> I've written this patch every time I've touched one of these PHYs, so I
> certainly like this.
>
Me too :) I've been carrying this as an out-of-tree patch ever since I started
bringing up Qcom chipsets.
> > Sample debug prints:
> >
> > QMP PHY: Writing Reg: QSERDES_V5_COM_SYSCLK_EN_SEL Offset: 0x0094 Val: 0xd9
> > QMP PHY: Writing Reg: QSERDES_V5_COM_HSCLK_SEL Offset: 0x0158 Val: 0x11
>
> That said, with multiple instances of PHYs being configured at about the
> same time it seems this would benefit greatly from something identifying
> which PHY instance the write relates to?
>
> dev_dbg() would certainly be nice...
>
I understood that after comments from Dmitry. So v4 has this:
qcom-qmp-pcie-phy 1c0e000.phy: Writing Reg: QSERDES_V5_COM_SYSCLK_EN_SEL Offset: 0x0094 Val: 0xd9
- Mani
> >
> > Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> > ---
> >
> > Changes in v2:
> >
> > * Modifed the debug print to include reg offset
> >
> > drivers/phy/qualcomm/phy-qcom-qmp-common.h | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-common.h b/drivers/phy/qualcomm/phy-qcom-qmp-common.h
> > index 799384210509..40beb413328f 100644
> > --- a/drivers/phy/qualcomm/phy-qcom-qmp-common.h
> > +++ b/drivers/phy/qualcomm/phy-qcom-qmp-common.h
> > @@ -9,6 +9,7 @@
> > struct qmp_phy_init_tbl {
> > unsigned int offset;
> > unsigned int val;
> > + char *name;
>
> const?
>
> Regards,
> Bjorn
>
> > /*
> > * mask of lanes for which this register is written
> > * for cases when second lane needs different values
> > @@ -20,6 +21,7 @@ struct qmp_phy_init_tbl {
> > { \
> > .offset = o, \
> > .val = v, \
> > + .name = #o, \
> > .lane_mask = 0xff, \
> > }
> >
> > @@ -27,6 +29,7 @@ struct qmp_phy_init_tbl {
> > { \
> > .offset = o, \
> > .val = v, \
> > + .name = #o, \
> > .lane_mask = l, \
> > }
> >
> > @@ -45,6 +48,8 @@ static inline void qmp_configure_lane(void __iomem *base,
> > if (!(t->lane_mask & lane_mask))
> > continue;
> >
> > + pr_debug("QMP PHY: Writing Reg: %s Offset: 0x%04x Val: 0x%02x\n",
> > + t->name, t->offset, t->val);
> > writel(t->val, base + t->offset);
> > }
> > }
> > --
> > 2.25.1
> >
> >
--
மணிவண்ணன் சதாசிவம்
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-08-01 6:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-31 11:56 [PATCH v2] phy: qcom: qmp: Add debug prints for register writes Manivannan Sadhasivam
2024-08-01 2:26 ` Bjorn Andersson
2024-08-01 6:58 ` Manivannan Sadhasivam
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).