dt-bindings: usb: mtk-xhci: add support 'resets' property
Subsystems (5)
Chunfeng Yun
maintainerPATCH 1/4 dt-bindings: usb: mtk-xhci: add support 'resets' property
Add 'resets' property to support IP reset usually by top pericfg.
--- Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml | 3 +++ 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml +3 -0
@@ -113,6 +113,9 @@ properties: vbus-supply: description: Regulator of USB VBUS5v + resets: + maxItems: 1 + usb3-lpm-capable: true usb2-lpm-disable: true
Signature · 1 line
2.18.0
Chunfeng Yun
maintainerPATCH 2/4 dt-bindings: usb: mtu3: add support 'resets' property
Add 'resets' property to support IP reset usually by top pericfg.
--- Documentation/devicetree/bindings/usb/mediatek,mtu3.yaml | 3 +++ 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/usb/mediatek,mtu3.yaml +3 -0
@@ -106,6 +106,9 @@ properties: maximum-speed: enum: [super-speed-plus, super-speed, high-speed, full-speed] + resets: + maxItems: 1 + "#address-cells": enum: [1, 2]
Signature · 1 line
2.18.0
Re: [PATCH 2/4] dt-bindings: usb: mtu3: add support 'resets' property
Il 23/05/22 11:04, Chunfeng Yun ha scritto:
Quoted 3 lines
Add 'resets' property to support IP reset usually by top pericfg.
Signed-off-by Chunfeng Yun <[email protected]>
Re: [PATCH 2/4] dt-bindings: usb: mtu3: add support 'resets' property
In reply to Chunfeng YunQuoted 7 lines · Chunfeng Yun
Add 'resets' property to support IP reset usually by top pericfg.
Signed-off-by Chunfeng Yun <[email protected]>--- Documentation/devicetree/bindings/usb/mediatek,mtu3.yaml | 3 +++ 1 file changed, 3 insertions(+)
Chunfeng Yun
maintainerPATCH 3/4 usb: xhci-mtk: add support optional controller reset
In reply to Chunfeng YunAdd support controller reset via a reset-controller usually in infracfg, it's different with the software reset by IPPC which only used to reset MAC, and it will also reset IPPC meanwhile.
--- drivers/usb/host/xhci-mtk.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/usb/host/xhci-mtk.c +7 -0
@@ -18,6 +18,7 @@#include <linux/pm_wakeirq.h> #include <linux/regmap.h> #include <linux/regulator/consumer.h> +#include <linux/reset.h> #include "xhci.h" #include "xhci-mtk.h"
@@ -550,6 +551,12 @@ static int xhci_mtk_probe(struct platform_device *pdev)if (ret) goto disable_ldos; + ret =device_reset_optional (dev); +if (ret) { +dev_err_probe (dev, ret,"failed to reset controller\n" ); + goto disable_clk; + } + hcd =usb_create_hcd (driver, dev,dev_name (dev));if (!hcd) { ret = -ENOMEM ;
Signature · 1 line
2.18.0
Re: [PATCH 3/4] usb: xhci-mtk: add support optional controller reset
Il 23/05/22 11:04, Chunfeng Yun ha scritto:
Quoted 5 lines
Add support controller reset via a reset-controller usually in infracfg, it's different with the software reset by IPPC which only used to reset MAC, and it will also reset IPPC meanwhile.
Signed-off-by Chunfeng Yun <[email protected]>
Chunfeng Yun
maintainerPATCH 4/4 usb: mtu3: add support controller reset
In reply to Chunfeng YunAdd support controller reset via a reset-controller usually in infracfg, it's different with the software reset by IPPC which only used to reset MAC, and it will also reset IPPC meanwhile.
--- drivers/usb/mtu3/mtu3_plat.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/usb/mtu3/mtu3_plat.c +7 -0
@@ -13,6 +13,7 @@#include <linux/of_irq.h> #include <linux/platform_device.h> #include <linux/pm_wakeirq.h> +#include <linux/reset.h> #include "mtu3.h" #include "mtu3_dr.h"
@@ -345,6 +346,12 @@ static int mtu3_probe(struct platform_device *pdev)dev_info (dev,"wakeup irq %d\n" , ssusb->wakeup_irq); } + ret =device_reset_optional (dev); +if (ret) { +dev_err_probe (dev, ret,"failed to reset controller\n" ); + goto comm_exit; + } +ssusb_ip_sw_reset (ssusb);if (IS_ENABLED (CONFIG_USB_MTU3_HOST ))
Signature · 1 line
2.18.0
Re: [PATCH 4/4] usb: mtu3: add support controller reset
Il 23/05/22 11:04, Chunfeng Yun ha scritto:
Quoted 5 lines
Add support controller reset via a reset-controller usually in infracfg, it's different with the software reset by IPPC which only used to reset MAC, and it will also reset IPPC meanwhile.
Signed-off-by Chunfeng Yun <[email protected]>
Quoted 14 lines · Chunfeng Yun
Add 'resets' property to support IP reset usually by top pericfg.
Signed-off-by Chunfeng Yun <[email protected]>--- Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml | 3 +++ 1 file changed, 3 insertions(+)(quoted diff) +0
-0
xhci.yamlb/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
index084d7135b2d9..892718459d25100644
Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml properties: · line 121
Quoted 9 lines
Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml +3
-0@@ -113,6 +113,9 @@ properties: vbus-supply: description: Regulator of USB VBUS5v + resets: + maxItems: 1 + usb3-lpm-capable: true usb2-lpm-disable: true
Hello Chunfeng,
Which soc we will use this reset?
I am upstreaming another series for system clock reset. I think you should add how to use for this series base on [1].
[1]:
https://lore.kernel.org/linux-clk/[email protected]/T/#m5b6abb9bd2109e4ed9a1a3eeee6e7976892cb8c2
BRs,
Rex
Chunfeng Yun
maintainerHi Rex-BC,
Quoted 24 lines · Rex-BC Chen
Quoted 23 lines · Chunfeng Yun
Add 'resets' property to support IP reset usually by top pericfg.
Signed-off-by Chunfeng Yun <[email protected]>--- Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml | 3 +++ 1 file changed, 3 insertions(+)(quoted diff) +0
-0
xhci.yamlb/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
index084d7135b2d9..892718459d25100644Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml +3
-0@@ -113,6 +113,9 @@ properties: vbus-supply: description: Regulator of USB VBUS5v + resets: + maxItems: 1 + usb3-lpm-capable: true
Quoted 5 lines
Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml properties: · line 121
Quoted 1 line
Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml +0
-0usb2-lpm-disable: trueHello Chunfeng,
Which soc we will use this reset?
This is common for all SoCs, can use it if there is a reset controller driver supported.
Quoted 1 line
I am upstreaming another series for system clock reset.
That's good
Quoted 1 line
I think you should add how to use for this series base on [1].
Currently I test it on mt8195 based on ti-syscon reset driver, luckly this is transparent for our usb controller drivers;
I could add patches to use this 'resets' property on mt8195/8186 if the below series are applied.
Thanks
Quoted 3 lines
[1]:
https://lore.kernel.org/linux-clk/[email protected]/T/#m5b6abb9bd2109e4ed9a1a3eeee6e7976892cb8c2
Quoted 4 lines
BRs,
Rex
Il 23/05/22 11:04, Chunfeng Yun ha scritto:
Quoted 3 lines
Add 'resets' property to support IP reset usually by top pericfg.
Signed-off-by Chunfeng Yun <[email protected]>
Quoted 7 lines · Chunfeng Yun
Add 'resets' property to support IP reset usually by top pericfg.
Signed-off-by Chunfeng Yun <[email protected]>--- Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml | 3 +++ 1 file changed, 3 insertions(+)