* [PATCH] phy: phy-snps-eusb2: fix FSEL_48_MHZ_VAL definition
@ 2026-09-08 8:59 Xu Yang
2026-09-08 9:04 ` sashiko-bot
2026-09-08 12:17 ` ivaylo
0 siblings, 2 replies; 4+ messages in thread
From: Xu Yang @ 2026-09-08 8:59 UTC (permalink / raw)
To: vkoul, neil.armstrong, mani, dmitry.baryshkov, ivo.ivanov.ivanov1
Cc: linux-phy, linux-kernel, imx
From: Xu Yang <xu.yang_2@nxp.com>
According to Synopsys eUSB2 PHY Databook, FSEL_48_MHZ_VAL should be 0x6
for supported 48 MHz reference clock.
Fixes: c4098f3e6134 ("phy: phy-snps-eusb2: add support for exynos2200")
Cc: stable@vger.kernel.org
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
---
drivers/phy/phy-snps-eusb2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/phy/phy-snps-eusb2.c b/drivers/phy/phy-snps-eusb2.c
index af4fa17ac6cb..3cb18d6ebc1d 100644
--- a/drivers/phy/phy-snps-eusb2.c
+++ b/drivers/phy/phy-snps-eusb2.c
@@ -21,7 +21,7 @@
#define FSEL_20_MHZ_VAL (0x1)
#define FSEL_24_MHZ_VAL (0x2)
#define FSEL_26_MHZ_VAL (0x3)
-#define FSEL_48_MHZ_VAL (0x2)
+#define FSEL_48_MHZ_VAL (0x6)
#define EXYNOS_USB_PHY_CFG_PLLCFG0 (0x8)
#define PHY_CFG_PLL_FB_DIV_19_8_MASK GENMASK(19, 8)
--
2.34.1
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] phy: phy-snps-eusb2: fix FSEL_48_MHZ_VAL definition 2026-09-08 8:59 [PATCH] phy: phy-snps-eusb2: fix FSEL_48_MHZ_VAL definition Xu Yang @ 2026-09-08 9:04 ` sashiko-bot 2026-09-08 12:17 ` ivaylo 1 sibling, 0 replies; 4+ messages in thread From: sashiko-bot @ 2026-09-08 9:04 UTC (permalink / raw) To: Xu Yang; +Cc: neil.armstrong, linux-phy, Frank.Li, olteanv, vkoul, imx Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: Pre-existing issues: - [High] Missing FIELD_PREP() for EXYNOS_PHY_CFG_PLL_FB_DIV_11_8_MASK causes bits 11:8 to always evaluate to 0, breaking the 48MHz PLL configuration. -- commit 8f10cea005e7c30e78e3855b1b3db039eba68023 Author: Xu Yang <xu.yang_2@nxp.com> phy: phy-snps-eusb2: fix FSEL_48_MHZ_VAL definition According to Synopsys eUSB2 PHY Databook, FSEL_48_MHZ_VAL should be 0x6 for supported 48 MHz reference clock. > diff --git a/drivers/phy/phy-snps-eusb2.c b/drivers/phy/phy-snps-eusb2.c > index af4fa17ac6cbc..3cb18d6ebc1d2 100644 > --- a/drivers/phy/phy-snps-eusb2.c > +++ b/drivers/phy/phy-snps-eusb2.c > @@ -21,7 +21,7 @@ > #define FSEL_20_MHZ_VAL (0x1) > #define FSEL_24_MHZ_VAL (0x2) > #define FSEL_26_MHZ_VAL (0x3) > -#define FSEL_48_MHZ_VAL (0x2) > +#define FSEL_48_MHZ_VAL (0x6) [Severity: High] This is a pre-existing issue, but does the missing FIELD_PREP() prevent the 48MHz configuration from working on Exynos devices? When using the 48MHz reference clock, EXYNOS_DIV_11_8_48_MHZ_VAL is 0x1. However, in exynos_eusb2_ref_clk_init(), the PLL config is written without shifting: drivers/phy/phy-snps-eusb2.c:exynos_eusb2_ref_clk_init() { snps_eusb2_hsphy_write_mask(phy->base, EXYNOS_USB_PHY_CFG_PLLCFG1, EXYNOS_PHY_CFG_PLL_FB_DIV_11_8_MASK, config->div_11_8_val); } Because snps_eusb2_hsphy_write_mask() applies the mask bitwise: drivers/phy/phy-snps-eusb2.c:snps_eusb2_hsphy_write_mask() { reg &= ~mask; reg |= val & mask; } Since val is 0x1 and mask is EXYNOS_PHY_CFG_PLL_FB_DIV_11_8_MASK (0x0F00), the bitwise AND evaluates to 0, leaving bits 11:8 zeroed. Should FIELD_PREP() be used here to ensure the 48MHz configuration applies properly? > > #define EXYNOS_USB_PHY_CFG_PLLCFG0 (0x8) > #define PHY_CFG_PLL_FB_DIV_19_8_MASK GENMASK(19, 8) -- Sashiko AI review · https://sashiko.dev/#/patchset/20260908085953.3315953-1-xu.yang_2@oss.nxp.com?part=1 -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] phy: phy-snps-eusb2: fix FSEL_48_MHZ_VAL definition 2026-09-08 8:59 [PATCH] phy: phy-snps-eusb2: fix FSEL_48_MHZ_VAL definition Xu Yang 2026-09-08 9:04 ` sashiko-bot @ 2026-09-08 12:17 ` ivaylo 2026-09-09 2:49 ` Xu Yang 1 sibling, 1 reply; 4+ messages in thread From: ivaylo @ 2026-09-08 12:17 UTC (permalink / raw) To: Xu Yang, vkoul, neil.armstrong, mani, dmitry.baryshkov Cc: linux-phy, linux-kernel, imx On 8.09.26 12:59, Xu Yang wrote: > From: Xu Yang <xu.yang_2@nxp.com> > > According to Synopsys eUSB2 PHY Databook, FSEL_48_MHZ_VAL should be 0x6 > for supported 48 MHz reference clock. I don't see this as a justified change. Samsung's implementation of eUSB2 differs from the generic Synopsys interface, as is visible from the differences between QCOM's implementation and Samsung's. From what I see for exynos2200, the FSEL value is 0x2 for both 24 MHz and 48 MHz. The differentiating part is that the upper PLL divider is 0x0 for 24 MHz and 0x1 for 48 MHz. The current programming was taken from the samsung vendor kernel driver, which is a reliable-ish reference for the differences in register interface implementation when we have no other public resource like a manual. ..now that I look into it though, the 11_8 value should probably be field_prep'd instead of just directly passed as an argument of snps_eusb2_hsphy_write_mask(), because right now it's essentially 0x1 & 0xf00 = 0? I haven't tested this path on my hardware, so it might prove to be a regression in the future? So: snps_eusb2_hsphy_write_mask(phy->base, EXYNOS_USB_PHY_CFG_PLLCFG1, EXYNOS_PHY_CFG_PLL_FB_DIV_11_8_MASK, FIELD_PREP(EXYNOS_PHY_CFG_PLL_FB_DIV_11_8_MASK, config->div_11_8_val)); For this patch though, unless this change is tested on real hardware and backed up by a technical reference manual for this particular implementation, CC-ing the change to stable is unreasonable. Best regards, Ivaylo Ivanov > > Fixes: c4098f3e6134 ("phy: phy-snps-eusb2: add support for exynos2200") > Cc: stable@vger.kernel.org > Signed-off-by: Xu Yang <xu.yang_2@nxp.com> > --- > drivers/phy/phy-snps-eusb2.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/phy/phy-snps-eusb2.c b/drivers/phy/phy-snps-eusb2.c > index af4fa17ac6cb..3cb18d6ebc1d 100644 > --- a/drivers/phy/phy-snps-eusb2.c > +++ b/drivers/phy/phy-snps-eusb2.c > @@ -21,7 +21,7 @@ > #define FSEL_20_MHZ_VAL (0x1) > #define FSEL_24_MHZ_VAL (0x2) > #define FSEL_26_MHZ_VAL (0x3) > -#define FSEL_48_MHZ_VAL (0x2) > +#define FSEL_48_MHZ_VAL (0x6) > > #define EXYNOS_USB_PHY_CFG_PLLCFG0 (0x8) > #define PHY_CFG_PLL_FB_DIV_19_8_MASK GENMASK(19, 8) -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] phy: phy-snps-eusb2: fix FSEL_48_MHZ_VAL definition 2026-09-08 12:17 ` ivaylo @ 2026-09-09 2:49 ` Xu Yang 0 siblings, 0 replies; 4+ messages in thread From: Xu Yang @ 2026-09-09 2:49 UTC (permalink / raw) To: ivaylo Cc: vkoul, neil.armstrong, mani, dmitry.baryshkov, linux-phy, linux-kernel, imx On Tue, Sep 08, 2026 at 04:17:57PM +0400, ivaylo wrote: > On 8.09.26 12:59, Xu Yang wrote: > > From: Xu Yang <xu.yang_2@nxp.com> > > > > According to Synopsys eUSB2 PHY Databook, FSEL_48_MHZ_VAL should be 0x6 > > for supported 48 MHz reference clock. > > I don't see this as a justified change. Samsung's implementation of eUSB2 > differs from the generic Synopsys interface, as is visible from the > differences > between QCOM's implementation and Samsung's. > > From what I see for exynos2200, the FSEL value is 0x2 for both 24 MHz and > 48 MHz. The differentiating part is that the upper PLL divider is 0x0 for 24 > MHz > and 0x1 for 48 MHz. The current programming was taken from the samsung\ For Product Code H483-0, it's 0x2 for 24 MHz and 0x6 for 48 MHz. The PLL divider is 0x0 for 24 MHz and 0x1 for 48 MHz too. So it does seem like something mismatch in your side. Because the FSEL_*_MHZ_VAL is common definition in the driver, this means FSEL_48_MHZ_VAL is not common anymore. But if you have confirmed it's simply like that, it's fine. Others need to add their specific definition in the future. > vendor kernel driver, which is a reliable-ish reference for the differences > in register > interface implementation when we have no other public resource like a > manual. > > ..now that I look into it though, the 11_8 value should probably be > field_prep'd > instead of just directly passed as an argument of > snps_eusb2_hsphy_write_mask(), > because right now it's essentially 0x1 & 0xf00 = 0? I haven't tested this > path on > my hardware, so it might prove to be a regression in the future? > So: > snps_eusb2_hsphy_write_mask(phy->base, EXYNOS_USB_PHY_CFG_PLLCFG1, > EXYNOS_PHY_CFG_PLL_FB_DIV_11_8_MASK, > FIELD_PREP(EXYNOS_PHY_CFG_PLL_FB_DIV_11_8_MASK, config->div_11_8_val)); Yeah, sashiko had reported it: https://sashiko.dev/#/patchset/20260908085953.3315953-1-xu.yang_2@oss.nxp.com?part=1 Thanks, Xu Yang > > For this patch though, unless this change is tested on real hardware and > backed up > by a technical reference manual for this particular implementation, CC-ing > the > change to stable is unreasonable. > > Best regards, > Ivaylo Ivanov > > > > > Fixes: c4098f3e6134 ("phy: phy-snps-eusb2: add support for exynos2200") > > Cc: stable@vger.kernel.org > > Signed-off-by: Xu Yang <xu.yang_2@nxp.com> > > --- > > drivers/phy/phy-snps-eusb2.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/phy/phy-snps-eusb2.c b/drivers/phy/phy-snps-eusb2.c > > index af4fa17ac6cb..3cb18d6ebc1d 100644 > > --- a/drivers/phy/phy-snps-eusb2.c > > +++ b/drivers/phy/phy-snps-eusb2.c > > @@ -21,7 +21,7 @@ > > #define FSEL_20_MHZ_VAL (0x1) > > #define FSEL_24_MHZ_VAL (0x2) > > #define FSEL_26_MHZ_VAL (0x3) > > -#define FSEL_48_MHZ_VAL (0x2) > > +#define FSEL_48_MHZ_VAL (0x6) > > #define EXYNOS_USB_PHY_CFG_PLLCFG0 (0x8) > > #define PHY_CFG_PLL_FB_DIV_19_8_MASK GENMASK(19, 8) > -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-09-09 2:52 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-09-08 8:59 [PATCH] phy: phy-snps-eusb2: fix FSEL_48_MHZ_VAL definition Xu Yang 2026-09-08 9:04 ` sashiko-bot 2026-09-08 12:17 ` ivaylo 2026-09-09 2:49 ` Xu Yang
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox