* [PATCH 2/2] phy: bcm-ns-usb2: drop support for old binding variant
2024-09-13 4:45 [PATCH 1/2] dt-bindings: phy: bcm-ns-usb2-phy: drop deprecated variant Rafał Miłecki
@ 2024-09-13 4:45 ` Rafał Miłecki
2024-09-13 18:24 ` [PATCH 1/2] dt-bindings: phy: bcm-ns-usb2-phy: drop deprecated variant Conor Dooley
2024-10-22 5:32 ` Vinod Koul
2 siblings, 0 replies; 4+ messages in thread
From: Rafał Miłecki @ 2024-09-13 4:45 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
Kishon Vijay Abraham I
Cc: Jeff Johnson, linux-phy, devicetree, linux-kernel,
Rafał Miłecki
From: Rafał Miłecki <rafal@milecki.pl>
The old binding was incorrectly designed and ended up being deprecated 3
years ago. Finally it has been dropped so relevant code it not needed
anymore.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
drivers/phy/broadcom/phy-bcm-ns-usb2.c | 54 +++++++-------------------
1 file changed, 15 insertions(+), 39 deletions(-)
diff --git a/drivers/phy/broadcom/phy-bcm-ns-usb2.c b/drivers/phy/broadcom/phy-bcm-ns-usb2.c
index 5213c75b6da6..c5d35031b398 100644
--- a/drivers/phy/broadcom/phy-bcm-ns-usb2.c
+++ b/drivers/phy/broadcom/phy-bcm-ns-usb2.c
@@ -24,9 +24,6 @@ struct bcm_ns_usb2 {
struct phy *phy;
struct regmap *clkset;
void __iomem *base;
-
- /* Deprecated binding */
- void __iomem *dmu;
};
static int bcm_ns_usb2_phy_init(struct phy *phy)
@@ -49,10 +46,7 @@ static int bcm_ns_usb2_phy_init(struct phy *phy)
goto err_clk_off;
}
- if (usb2->base)
- usb2ctl = readl(usb2->base);
- else
- usb2ctl = readl(usb2->dmu + BCMA_DMU_CRU_USB2_CONTROL);
+ usb2ctl = readl(usb2->base);
if (usb2ctl & BCMA_DMU_CRU_USB2_CONTROL_USB_PLL_PDIV_MASK) {
usb_pll_pdiv = usb2ctl;
@@ -66,24 +60,16 @@ static int bcm_ns_usb2_phy_init(struct phy *phy)
usb_pll_ndiv = (1920000000 * usb_pll_pdiv) / ref_clk_rate;
/* Unlock DMU PLL settings with some magic value */
- if (usb2->clkset)
- regmap_write(usb2->clkset, 0, 0x0000ea68);
- else
- writel(0x0000ea68, usb2->dmu + BCMA_DMU_CRU_CLKSET_KEY);
+ regmap_write(usb2->clkset, 0, 0x0000ea68);
/* Write USB 2.0 PLL control setting */
usb2ctl &= ~BCMA_DMU_CRU_USB2_CONTROL_USB_PLL_NDIV_MASK;
usb2ctl |= usb_pll_ndiv << BCMA_DMU_CRU_USB2_CONTROL_USB_PLL_NDIV_SHIFT;
- if (usb2->base)
- writel(usb2ctl, usb2->base);
- else
- writel(usb2ctl, usb2->dmu + BCMA_DMU_CRU_USB2_CONTROL);
+
+ writel(usb2ctl, usb2->base);
/* Lock DMU PLL settings */
- if (usb2->clkset)
- regmap_write(usb2->clkset, 0, 0x00000000);
- else
- writel(0x00000000, usb2->dmu + BCMA_DMU_CRU_CLKSET_KEY);
+ regmap_write(usb2->clkset, 0, 0x00000000);
err_clk_off:
clk_disable_unprepare(usb2->ref_clk);
@@ -107,27 +93,17 @@ static int bcm_ns_usb2_probe(struct platform_device *pdev)
return -ENOMEM;
usb2->dev = dev;
- if (of_property_present(dev->of_node, "brcm,syscon-clkset")) {
- usb2->base = devm_platform_ioremap_resource(pdev, 0);
- if (IS_ERR(usb2->base)) {
- dev_err(dev, "Failed to map control reg\n");
- return PTR_ERR(usb2->base);
- }
-
- usb2->clkset = syscon_regmap_lookup_by_phandle(dev->of_node,
- "brcm,syscon-clkset");
- if (IS_ERR(usb2->clkset)) {
- dev_err(dev, "Failed to lookup clkset regmap\n");
- return PTR_ERR(usb2->clkset);
- }
- } else {
- usb2->dmu = devm_platform_ioremap_resource_byname(pdev, "dmu");
- if (IS_ERR(usb2->dmu)) {
- dev_err(dev, "Failed to map DMU regs\n");
- return PTR_ERR(usb2->dmu);
- }
+ usb2->base = devm_platform_ioremap_resource(pdev, 0);
+ if (IS_ERR(usb2->base)) {
+ dev_err(dev, "Failed to map control reg\n");
+ return PTR_ERR(usb2->base);
+ }
- dev_warn(dev, "using deprecated DT binding\n");
+ usb2->clkset = syscon_regmap_lookup_by_phandle(dev->of_node,
+ "brcm,syscon-clkset");
+ if (IS_ERR(usb2->clkset)) {
+ dev_err(dev, "Failed to lookup clkset regmap\n");
+ return PTR_ERR(usb2->clkset);
}
usb2->ref_clk = devm_clk_get(dev, "phy-ref-clk");
--
2.35.3
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH 1/2] dt-bindings: phy: bcm-ns-usb2-phy: drop deprecated variant
2024-09-13 4:45 [PATCH 1/2] dt-bindings: phy: bcm-ns-usb2-phy: drop deprecated variant Rafał Miłecki
2024-09-13 4:45 ` [PATCH 2/2] phy: bcm-ns-usb2: drop support for old binding variant Rafał Miłecki
@ 2024-09-13 18:24 ` Conor Dooley
2024-10-22 5:32 ` Vinod Koul
2 siblings, 0 replies; 4+ messages in thread
From: Conor Dooley @ 2024-09-13 18:24 UTC (permalink / raw)
To: Rafał Miłecki
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
Kishon Vijay Abraham I, Jeff Johnson, linux-phy, devicetree,
linux-kernel, Rafał Miłecki
[-- Attachment #1: Type: text/plain, Size: 795 bytes --]
On Fri, Sep 13, 2024 at 06:45:56AM +0200, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
>
> The old binding variant (the one covering whole DMU block) was
> deprecated 3 years ago. Linux kernel was warning when using it for
> similar amount of time.
>
> There aren't any known Northstar devices with bootloader providing DT to
> operating system. Actually OpenWrt seems to be the only project using
> this binding and it always appends DTB to kernel. It has switched to the
> non-deprecated binding years ago.
>
> Given there is close to zero chance this breaks anyone's setup it should
> more than safe to drop this binding variant after 3 years.
I love a commit message like this.
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Thanks,
Conor.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] dt-bindings: phy: bcm-ns-usb2-phy: drop deprecated variant
2024-09-13 4:45 [PATCH 1/2] dt-bindings: phy: bcm-ns-usb2-phy: drop deprecated variant Rafał Miłecki
2024-09-13 4:45 ` [PATCH 2/2] phy: bcm-ns-usb2: drop support for old binding variant Rafał Miłecki
2024-09-13 18:24 ` [PATCH 1/2] dt-bindings: phy: bcm-ns-usb2-phy: drop deprecated variant Conor Dooley
@ 2024-10-22 5:32 ` Vinod Koul
2 siblings, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2024-10-22 5:32 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Kishon Vijay Abraham I, Rafał Miłecki
Cc: Jeff Johnson, linux-phy, devicetree, linux-kernel,
Rafał Miłecki
On Fri, 13 Sep 2024 06:45:56 +0200, Rafał Miłecki wrote:
> The old binding variant (the one covering whole DMU block) was
> deprecated 3 years ago. Linux kernel was warning when using it for
> similar amount of time.
>
> There aren't any known Northstar devices with bootloader providing DT to
> operating system. Actually OpenWrt seems to be the only project using
> this binding and it always appends DTB to kernel. It has switched to the
> non-deprecated binding years ago.
>
> [...]
Applied, thanks!
[1/2] dt-bindings: phy: bcm-ns-usb2-phy: drop deprecated variant
commit: c3639d423d76c935b58827296a124e8f13d79b4b
[2/2] phy: bcm-ns-usb2: drop support for old binding variant
commit: 0175a673e478eed99a86fc094e7d91ed2f3d5a34
Best regards,
--
~Vinod
^ permalink raw reply [flat|nested] 4+ messages in thread