From: Stefan Agner <stefan@agner.ch> Date: 2014-07-18 17:01:51
This patchset adds USB support for Vybrid VF610 SoC. It extends the
clock framework to support the USB PHY cocks, extends the device
tree files and adds support for the non-core registers in the
usbmisc_imx driver.
This patchset needs the eSDHC length fix available in Shawn's
for-next branch.
The whole patchset proved to be working on a Colibri VF61. The
first USB controller runs in peripheral mode. I could successfully
use RNDIS, however with some stability issues: Suddenly the other
side was not reachable anymore and the interface needed to brought
down and back up again. I'm still investigating this.
The second USB controller, running in USB host mode, showed no
issues so far.
Stefan Agner (6):
ARM: dts: vf610: add USB PHY and controller
ARM: imx: clk-vf610: add USBPHY clocks
ARM: dts: vf610: Add usbmisc for non-core registers
chipidea: usbmisc_imx: Add USB support for VF610 SoCs
usb: phy: mxs: Add VF610 USB PHY support
ARM: dts: vf610-colibri: add USB support
arch/arm/boot/dts/vf610-colibri.dts | 10 +++++
arch/arm/boot/dts/vf610.dtsi | 55 ++++++++++++++++++++++--
arch/arm/mach-imx/clk-vf610.c | 12 +++++-
drivers/usb/chipidea/usbmisc_imx.c | 76 +++++++++++++++++++++++----------
drivers/usb/phy/phy-mxs-usb.c | 5 +++
include/dt-bindings/clock/vf610-clock.h | 5 ++-
6 files changed, 135 insertions(+), 28 deletions(-)
--
2.0.1
From: Stefan Agner <stefan@agner.ch> Date: 2014-07-18 17:01:56
This commit adds PLL7 which is required for USBPHY1. It also adds
the USB PHY and USB Controller clocks and the gates to enable them.
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
All the main PLLs are currently turned on by boot ROM or boot loader, within
the kernel we only set the fixed factor. Altough, the function imx_clk_pllv3
would provide enabling and rate calculation support.
Because PLL7 is _not_ enabled at boot up, we need enable support. With this,
we make use of the imx_clk_pllv3 function the first time in clk-vf610. In
order to be aligned, would it make sense to use the function for all the
main PLLs? I think support for all types of PLL available in Vybrid is
already there, altough this need to be verified first.
arch/arm/mach-imx/clk-vf610.c | 12 ++++++++++--
include/dt-bindings/clock/vf610-clock.h | 5 ++++-
2 files changed, 14 insertions(+), 3 deletions(-)
From: Stefan Agner <stefan@agner.ch> Date: 2014-07-18 17:01:57
Add device tree node for usbmisc which controls the non-core USB
registers. This is required to use the property to disable the over-
current detection.
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
arch/arm/boot/dts/vf610.dtsi | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
From: Stefan Agner <stefan@agner.ch> Date: 2014-07-18 17:01:59
This adds USB PHY and USB controller nodes. Vybrid SoCs have two
independent USB cores which each supports DR (dual role). However,
real OTG is not supported since the OTG ID pin is not available.
The PHYs are located within the anadig register range, hence we need
to change the length of the anadig registers.
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
arch/arm/boot/dts/vf610.dtsi | 46 +++++++++++++++++++++++++++++++++++++++++---
1 file changed, 43 insertions(+), 3 deletions(-)
From: Stefan Agner <stefan@agner.ch> Date: 2014-07-18 17:02:37
Add USB support for Colibri VF61 modules. Due to lack of pinmux
options, the USB hosts over-current protection signal of the Colibri
standard could not be connected to the PHY's over-current protection,
hence we need to disable it.
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
arch/arm/boot/dts/vf610-colibri.dts | 10 ++++++++++
1 file changed, 10 insertions(+)
From: Stefan Agner <stefan@agner.ch> Date: 2014-07-18 17:02:39
This adds support for the USB PHY in Vybrid VF610. We assume that
the disconnection without VBUS is also needed for Vybrid. For all
other flags, the presumption of innocence applies.
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
drivers/usb/phy/phy-mxs-usb.c | 5 +++++
1 file changed, 5 insertions(+)
From: Stefan Agner <stefan@agner.ch> Date: 2014-07-18 17:03:29
This adds Vybrid VF610 SoC support. The IP is very similar to i.MX6,
however the non-core registers are spread in two different register
areas. Hence we support multiple registers which are addressed by
the index of usbmisc.
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
I tried first to create two usbmisc nodes and hoped it would instanciate
the driver twice, however, the driver currently only supports one instance.
In an short attempt to add support for that, I realized that since the
data structure holding the information for each instance is within the
driver ci_hdrc_imx. For Vybrid two instances would make much more sense,
however, a i.MX6Q shares all the non-core registers in one register area,
hence only one driver can map this area. I ended up with this multiple
registers solution, altough for the Vybrid multiple instances would
probably make more sense. Any thoughts on this?
drivers/usb/chipidea/usbmisc_imx.c | 76 +++++++++++++++++++++++++++-----------
1 file changed, 54 insertions(+), 22 deletions(-)
@@ -57,6 +57,10 @@#define MX6_BM_OVER_CUR_DIS BIT(7)+#define VF610_OVER_CUR_DIS BIT(7)++#define MAX_BASE_ADDR 2+structusbmisc_ops{/* It's called once when probe a usb device */int(*init)(structimx_usbmisc_data*data);
@@ -84,20 +88,20 @@ static int usbmisc_imx25_init(struct imx_usbmisc_data *data)spin_lock_irqsave(&usbmisc->lock,flags);switch(data->index){case0:-val=readl(usbmisc->base);+val=readl(usbmisc->base[0]);val&=~(MX25_OTG_SIC_MASK|MX25_OTG_PP_BIT);val|=(MX25_EHCI_INTERFACE_DIFF_UNI&MX25_EHCI_INTERFACE_MASK)<<MX25_OTG_SIC_SHIFT;val|=(MX25_OTG_PM_BIT|MX25_OTG_OCPOL_BIT);-writel(val,usbmisc->base);+writel(val,usbmisc->base[0]);break;case1:-val=readl(usbmisc->base);+val=readl(usbmisc->base[0]);val&=~(MX25_H1_SIC_MASK|MX25_H1_PP_BIT|MX25_H1_IPPUE_UP_BIT);val|=(MX25_EHCI_INTERFACE_SINGLE_UNI&MX25_EHCI_INTERFACE_MASK)<<MX25_H1_SIC_SHIFT;val|=(MX25_H1_PM_BIT|MX25_H1_OCPOL_BIT|MX25_H1_TLL_BIT|MX25_H1_USBTE_BIT|MX25_H1_IPPUE_DOWN_BIT);-writel(val,usbmisc->base);+writel(val,usbmisc->base[0]);break;}
@@ -115,7 +119,7 @@ static int usbmisc_imx25_post(struct imx_usbmisc_data *data)if(data->index>2)return-EINVAL;-reg=usbmisc->base+MX25_USB_PHY_CTRL_OFFSET;+reg=usbmisc->base[0]+MX25_USB_PHY_CTRL_OFFSET;if(data->evdo){spin_lock_irqsave(&usbmisc->lock,flags);
@@ -149,10 +153,10 @@ static int usbmisc_imx27_init(struct imx_usbmisc_data *data)spin_lock_irqsave(&usbmisc->lock,flags);if(data->disable_oc)-val=readl(usbmisc->base)|val;+val=readl(usbmisc->base[0])|val;else-val=readl(usbmisc->base)&~val;-writel(val,usbmisc->base);+val=readl(usbmisc->base[0])&~val;+writel(val,usbmisc->base[0]);spin_unlock_irqrestore(&usbmisc->lock,flags);return0;
@@ -168,29 +172,29 @@ static int usbmisc_imx53_init(struct imx_usbmisc_data *data)return-EINVAL;/* Select a 24 MHz reference clock for the PHY */-reg=usbmisc->base+MX53_USB_OTG_PHY_CTRL_1_OFFSET;+reg=usbmisc->base[0]+MX53_USB_OTG_PHY_CTRL_1_OFFSET;val=readl(reg);val&=~MX53_USB_PHYCTRL1_PLLDIV_MASK;val|=MX53_USB_PLL_DIV_24_MHZ;-writel(val,usbmisc->base+MX53_USB_OTG_PHY_CTRL_1_OFFSET);+writel(val,usbmisc->base[0]+MX53_USB_OTG_PHY_CTRL_1_OFFSET);if(data->disable_oc){spin_lock_irqsave(&usbmisc->lock,flags);switch(data->index){case0:-reg=usbmisc->base+MX53_USB_OTG_PHY_CTRL_0_OFFSET;+reg=usbmisc->base[0]+MX53_USB_OTG_PHY_CTRL_0_OFFSET;val=readl(reg)|MX53_BM_OVER_CUR_DIS_OTG;break;case1:-reg=usbmisc->base+MX53_USB_OTG_PHY_CTRL_0_OFFSET;+reg=usbmisc->base[0]+MX53_USB_OTG_PHY_CTRL_0_OFFSET;val=readl(reg)|MX53_BM_OVER_CUR_DIS_H1;break;case2:-reg=usbmisc->base+MX53_USB_UH2_CTRL_OFFSET;+reg=usbmisc->base[0]+MX53_USB_UH2_CTRL_OFFSET;val=readl(reg)|MX53_BM_OVER_CUR_DIS_UHx;break;case3:-reg=usbmisc->base+MX53_USB_UH3_CTRL_OFFSET;+reg=usbmisc->base[0]+MX53_USB_UH3_CTRL_OFFSET;val=readl(reg)|MX53_BM_OVER_CUR_DIS_UHx;break;}
@@ -212,15 +216,31 @@ static int usbmisc_imx6q_init(struct imx_usbmisc_data *data)if(data->disable_oc){spin_lock_irqsave(&usbmisc->lock,flags);-reg=readl(usbmisc->base+data->index*4);+reg=readl(usbmisc->base[0]+data->index*4);writel(reg|MX6_BM_OVER_CUR_DIS,-usbmisc->base+data->index*4);+usbmisc->base[0]+data->index*4);spin_unlock_irqrestore(&usbmisc->lock,flags);}return0;}+staticintusbmisc_vf610_init(structimx_usbmisc_data*data)+{+u32reg;++if(data->index>=2)+return-EINVAL;++if(data->disable_oc){+reg=readl(usbmisc->base[data->index]);+writel(reg|VF610_OVER_CUR_DIS,+usbmisc->base[data->index]);+}++return0;+}+staticconststructusbmisc_opsimx25_usbmisc_ops={.init=usbmisc_imx25_init,.post=usbmisc_imx25_post,
@@ -291,7 +319,7 @@ static int usbmisc_imx_probe(struct platform_device *pdev){structresource*res;structimx_usbmisc*data;-intret;+intret,i;structof_device_id*tmp_dev;if(usbmisc)
@@ -303,10 +331,14 @@ static int usbmisc_imx_probe(struct platform_device *pdev)spin_lock_init(&data->lock);-res=platform_get_resource(pdev,IORESOURCE_MEM,0);-data->base=devm_ioremap_resource(&pdev->dev,res);-if(IS_ERR(data->base))-returnPTR_ERR(data->base);+for(i=0;i<MAX_BASE_ADDR;i++){+res=platform_get_resource(pdev,IORESOURCE_MEM,i);+data->base[i]=devm_ioremap_resource(&pdev->dev,res);++/* First base address is mandatory */+if(IS_ERR(data->base)&&!i)+returnPTR_ERR(data->base);+}data->clk=devm_clk_get(&pdev->dev,NULL);if(IS_ERR(data->clk)){
From: Peter Chen <hidden> Date: 2014-07-22 00:20:35
On Fri, Jul 18, 2014 at 07:01:36PM +0200, Stefan Agner wrote:
This patchset adds USB support for Vybrid VF610 SoC. It extends the
clock framework to support the USB PHY cocks, extends the device
tree files and adds support for the non-core registers in the
usbmisc_imx driver.
This patchset needs the eSDHC length fix available in Shawn's
for-next branch.
Why it is related to USB patchset?
The whole patchset proved to be working on a Colibri VF61. The
first USB controller runs in peripheral mode. I could successfully
use RNDIS, however with some stability issues: Suddenly the other
side was not reachable anymore and the interface needed to brought
down and back up again. I'm still investigating this.
Do you use ubuntu as host distribution? I find ubuntu will lost the
first connection for usb-ethernet-gadget(usb0) as network interface,
but once you re-config usb0 again (ifconfig usb0 ip up), it should work
and will not lose connection any more.
The second USB controller, running in USB host mode, showed no
issues so far.
Stefan Agner (6):
ARM: dts: vf610: add USB PHY and controller
ARM: imx: clk-vf610: add USBPHY clocks
ARM: dts: vf610: Add usbmisc for non-core registers
chipidea: usbmisc_imx: Add USB support for VF610 SoCs
usb: phy: mxs: Add VF610 USB PHY support
ARM: dts: vf610-colibri: add USB support
arch/arm/boot/dts/vf610-colibri.dts | 10 +++++
arch/arm/boot/dts/vf610.dtsi | 55 ++++++++++++++++++++++--
arch/arm/mach-imx/clk-vf610.c | 12 +++++-
drivers/usb/chipidea/usbmisc_imx.c | 76 +++++++++++++++++++++++----------
drivers/usb/phy/phy-mxs-usb.c | 5 +++
include/dt-bindings/clock/vf610-clock.h | 5 ++-
6 files changed, 135 insertions(+), 28 deletions(-)
--
2.0.1
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Peter Chen <hidden> Date: 2014-07-22 01:50:44
On Fri, Jul 18, 2014 at 07:01:41PM +0200, Stefan Agner wrote:
quoted hunk
This adds support for the USB PHY in Vybrid VF610. We assume that
the disconnection without VBUS is also needed for Vybrid. For all
other flags, the presumption of innocence applies.
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
drivers/usb/phy/phy-mxs-usb.c | 5 +++++
1 file changed, 5 insertions(+)
From: Peter Chen <hidden> Date: 2014-07-22 01:59:40
On Fri, Jul 18, 2014 at 07:01:40PM +0200, Stefan Agner wrote:
This adds Vybrid VF610 SoC support. The IP is very similar to i.MX6,
however the non-core registers are spread in two different register
areas. Hence we support multiple registers which are addressed by
the index of usbmisc.
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
I tried first to create two usbmisc nodes and hoped it would instanciate
the driver twice, however, the driver currently only supports one instance.
In an short attempt to add support for that, I realized that since the
data structure holding the information for each instance is within the
driver ci_hdrc_imx. For Vybrid two instances would make much more sense,
however, a i.MX6Q shares all the non-core registers in one register area,
hence only one driver can map this area. I ended up with this multiple
registers solution, altough for the Vybrid multiple instances would
probably make more sense. Any thoughts on this?
I prefer rename current usbmisc_imx as usbmisc_mix_v1 and create the
new usbmisc_imx_v2 for multiple instances case.
Peter
@@ -57,6 +57,10 @@#define MX6_BM_OVER_CUR_DIS BIT(7)+#define VF610_OVER_CUR_DIS BIT(7)++#define MAX_BASE_ADDR 2+structusbmisc_ops{/* It's called once when probe a usb device */int(*init)(structimx_usbmisc_data*data);
@@ -84,20 +88,20 @@ static int usbmisc_imx25_init(struct imx_usbmisc_data *data)spin_lock_irqsave(&usbmisc->lock,flags);switch(data->index){case0:-val=readl(usbmisc->base);+val=readl(usbmisc->base[0]);val&=~(MX25_OTG_SIC_MASK|MX25_OTG_PP_BIT);val|=(MX25_EHCI_INTERFACE_DIFF_UNI&MX25_EHCI_INTERFACE_MASK)<<MX25_OTG_SIC_SHIFT;val|=(MX25_OTG_PM_BIT|MX25_OTG_OCPOL_BIT);-writel(val,usbmisc->base);+writel(val,usbmisc->base[0]);break;case1:-val=readl(usbmisc->base);+val=readl(usbmisc->base[0]);val&=~(MX25_H1_SIC_MASK|MX25_H1_PP_BIT|MX25_H1_IPPUE_UP_BIT);val|=(MX25_EHCI_INTERFACE_SINGLE_UNI&MX25_EHCI_INTERFACE_MASK)<<MX25_H1_SIC_SHIFT;val|=(MX25_H1_PM_BIT|MX25_H1_OCPOL_BIT|MX25_H1_TLL_BIT|MX25_H1_USBTE_BIT|MX25_H1_IPPUE_DOWN_BIT);-writel(val,usbmisc->base);+writel(val,usbmisc->base[0]);break;}
@@ -115,7 +119,7 @@ static int usbmisc_imx25_post(struct imx_usbmisc_data *data)if(data->index>2)return-EINVAL;-reg=usbmisc->base+MX25_USB_PHY_CTRL_OFFSET;+reg=usbmisc->base[0]+MX25_USB_PHY_CTRL_OFFSET;if(data->evdo){spin_lock_irqsave(&usbmisc->lock,flags);
@@ -149,10 +153,10 @@ static int usbmisc_imx27_init(struct imx_usbmisc_data *data)spin_lock_irqsave(&usbmisc->lock,flags);if(data->disable_oc)-val=readl(usbmisc->base)|val;+val=readl(usbmisc->base[0])|val;else-val=readl(usbmisc->base)&~val;-writel(val,usbmisc->base);+val=readl(usbmisc->base[0])&~val;+writel(val,usbmisc->base[0]);spin_unlock_irqrestore(&usbmisc->lock,flags);return0;
@@ -168,29 +172,29 @@ static int usbmisc_imx53_init(struct imx_usbmisc_data *data)return-EINVAL;/* Select a 24 MHz reference clock for the PHY */-reg=usbmisc->base+MX53_USB_OTG_PHY_CTRL_1_OFFSET;+reg=usbmisc->base[0]+MX53_USB_OTG_PHY_CTRL_1_OFFSET;val=readl(reg);val&=~MX53_USB_PHYCTRL1_PLLDIV_MASK;val|=MX53_USB_PLL_DIV_24_MHZ;-writel(val,usbmisc->base+MX53_USB_OTG_PHY_CTRL_1_OFFSET);+writel(val,usbmisc->base[0]+MX53_USB_OTG_PHY_CTRL_1_OFFSET);if(data->disable_oc){spin_lock_irqsave(&usbmisc->lock,flags);switch(data->index){case0:-reg=usbmisc->base+MX53_USB_OTG_PHY_CTRL_0_OFFSET;+reg=usbmisc->base[0]+MX53_USB_OTG_PHY_CTRL_0_OFFSET;val=readl(reg)|MX53_BM_OVER_CUR_DIS_OTG;break;case1:-reg=usbmisc->base+MX53_USB_OTG_PHY_CTRL_0_OFFSET;+reg=usbmisc->base[0]+MX53_USB_OTG_PHY_CTRL_0_OFFSET;val=readl(reg)|MX53_BM_OVER_CUR_DIS_H1;break;case2:-reg=usbmisc->base+MX53_USB_UH2_CTRL_OFFSET;+reg=usbmisc->base[0]+MX53_USB_UH2_CTRL_OFFSET;val=readl(reg)|MX53_BM_OVER_CUR_DIS_UHx;break;case3:-reg=usbmisc->base+MX53_USB_UH3_CTRL_OFFSET;+reg=usbmisc->base[0]+MX53_USB_UH3_CTRL_OFFSET;val=readl(reg)|MX53_BM_OVER_CUR_DIS_UHx;break;}
@@ -212,15 +216,31 @@ static int usbmisc_imx6q_init(struct imx_usbmisc_data *data)if(data->disable_oc){spin_lock_irqsave(&usbmisc->lock,flags);-reg=readl(usbmisc->base+data->index*4);+reg=readl(usbmisc->base[0]+data->index*4);writel(reg|MX6_BM_OVER_CUR_DIS,-usbmisc->base+data->index*4);+usbmisc->base[0]+data->index*4);spin_unlock_irqrestore(&usbmisc->lock,flags);}return0;}+staticintusbmisc_vf610_init(structimx_usbmisc_data*data)+{+u32reg;++if(data->index>=2)+return-EINVAL;++if(data->disable_oc){+reg=readl(usbmisc->base[data->index]);+writel(reg|VF610_OVER_CUR_DIS,+usbmisc->base[data->index]);+}++return0;+}+staticconststructusbmisc_opsimx25_usbmisc_ops={.init=usbmisc_imx25_init,.post=usbmisc_imx25_post,
@@ -291,7 +319,7 @@ static int usbmisc_imx_probe(struct platform_device *pdev){structresource*res;structimx_usbmisc*data;-intret;+intret,i;structof_device_id*tmp_dev;if(usbmisc)
@@ -303,10 +331,14 @@ static int usbmisc_imx_probe(struct platform_device *pdev)spin_lock_init(&data->lock);-res=platform_get_resource(pdev,IORESOURCE_MEM,0);-data->base=devm_ioremap_resource(&pdev->dev,res);-if(IS_ERR(data->base))-returnPTR_ERR(data->base);+for(i=0;i<MAX_BASE_ADDR;i++){+res=platform_get_resource(pdev,IORESOURCE_MEM,i);+data->base[i]=devm_ioremap_resource(&pdev->dev,res);++/* First base address is mandatory */+if(IS_ERR(data->base)&&!i)+returnPTR_ERR(data->base);+}data->clk=devm_clk_get(&pdev->dev,NULL);if(IS_ERR(data->clk)){
On Fri, Jul 18, 2014 at 07:01:41PM +0200, Stefan Agner wrote:
quoted hunk
This adds support for the USB PHY in Vybrid VF610. We assume that
the disconnection without VBUS is also needed for Vybrid. For all
other flags, the presumption of innocence applies.
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
drivers/usb/phy/phy-mxs-usb.c | 5 +++++
1 file changed, 5 insertions(+)
On Fri, Jul 18, 2014 at 07:01:37PM +0200, Stefan Agner wrote:
quoted hunk
This adds USB PHY and USB controller nodes. Vybrid SoCs have two
independent USB cores which each supports DR (dual role). However,
real OTG is not supported since the OTG ID pin is not available.
The PHYs are located within the anadig register range, hence we need
to change the length of the anadig registers.
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
arch/arm/boot/dts/vf610.dtsi | 46 +++++++++++++++++++++++++++++++++++++++++---
1 file changed, 43 insertions(+), 3 deletions(-)
It doesn't really make any sense to have "fsl,imx6q-usb" here. The
following one should be less confusing.
compatible = "fsl,vf610-usb", "fsl,imx27-usb";
Shawn
On Fri, Jul 18, 2014 at 07:01:38PM +0200, Stefan Agner wrote:
This commit adds PLL7 which is required for USBPHY1. It also adds
the USB PHY and USB Controller clocks and the gates to enable them.
Signed-off-by: Stefan Agner <stefan@agner.ch>
Jingchang,
Does the patch look good to you?
Shawn
quoted hunk
---
All the main PLLs are currently turned on by boot ROM or boot loader, within
the kernel we only set the fixed factor. Altough, the function imx_clk_pllv3
would provide enabling and rate calculation support.
Because PLL7 is _not_ enabled at boot up, we need enable support. With this,
we make use of the imx_clk_pllv3 function the first time in clk-vf610. In
order to be aligned, would it make sense to use the function for all the
main PLLs? I think support for all types of PLL available in Vybrid is
already there, altough this need to be verified first.
arch/arm/mach-imx/clk-vf610.c | 12 ++++++++++--
include/dt-bindings/clock/vf610-clock.h | 5 ++++-
2 files changed, 14 insertions(+), 3 deletions(-)
From: Jingchang Lu <hidden> Date: 2014-07-22 06:58:51
-----Original Message-----
From: Shawn Guo [mailto:shawn.guo at freescale.com]
Sent: Tuesday, July 22, 2014 10:32 AM
To: Stefan Agner; Lu Jingchang-B35083
Cc: Chen Peter-B29397; s.hauer at pengutronix.de; linux-arm-
kernel at lists.infradead.org; linux-usb at vger.kernel.org; linux-
kernel at vger.kernel.org
Subject: Re: [PATCH 2/6] ARM: imx: clk-vf610: add USBPHY clocks
On Fri, Jul 18, 2014 at 07:01:38PM +0200, Stefan Agner wrote:
quoted
This commit adds PLL7 which is required for USBPHY1. It also adds the
USB PHY and USB Controller clocks and the gates to enable them.
Signed-off-by: Stefan Agner <stefan@agner.ch>
Jingchang,
Does the patch look good to you?
Shawn
For the clk creation, I think it is ok if the functionality has been tested, thanks!
Acked-by: Jingchang Lu <redacted>
From: Stefan Agner <stefan@agner.ch> Date: 2014-07-22 09:57:27
Am 2014-07-22 04:22, schrieb Shawn Guo:
On Fri, Jul 18, 2014 at 07:01:37PM +0200, Stefan Agner wrote:
quoted
This adds USB PHY and USB controller nodes. Vybrid SoCs have two
independent USB cores which each supports DR (dual role). However,
real OTG is not supported since the OTG ID pin is not available.
The PHYs are located within the anadig register range, hence we need
to change the length of the anadig registers.
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
arch/arm/boot/dts/vf610.dtsi | 46 +++++++++++++++++++++++++++++++++++++++++---
1 file changed, 43 insertions(+), 3 deletions(-)
It doesn't really make any sense to have "fsl,imx6q-usb" here. The
following one should be less confusing.
compatible = "fsl,vf610-usb", "fsl,imx27-usb";
I don't quite understand the rule here, when do we drop compatible you
suggest in fsl,imx23-usbphy and when do we keep the "fallback" as we do
for the USB controller?
Documentation/devicetree/bindings/usb/mxs-phy.txt says:
"fsl,imx23-usbphy" is still a fallback for other strings
And Documentation/devicetree/bindings/usb/ci-hdrc-imx.txt says:
On Tue, Jul 22, 2014 at 11:57:31AM +0200, Stefan Agner wrote:
Am 2014-07-22 04:22, schrieb Shawn Guo:
quoted
On Fri, Jul 18, 2014 at 07:01:37PM +0200, Stefan Agner wrote:
quoted
This adds USB PHY and USB controller nodes. Vybrid SoCs have two
independent USB cores which each supports DR (dual role). However,
real OTG is not supported since the OTG ID pin is not available.
The PHYs are located within the anadig register range, hence we need
to change the length of the anadig registers.
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
arch/arm/boot/dts/vf610.dtsi | 46 +++++++++++++++++++++++++++++++++++++++++---
1 file changed, 43 insertions(+), 3 deletions(-)
It doesn't really make any sense to have "fsl,imx6q-usb" here. The
following one should be less confusing.
compatible = "fsl,vf610-usb", "fsl,imx27-usb";
I don't quite understand the rule here, when do we drop compatible you
suggest in fsl,imx23-usbphy and when do we keep the "fallback" as we do
for the USB controller?
Documentation/devicetree/bindings/usb/mxs-phy.txt says:
quoted
"fsl,imx23-usbphy" is still a fallback for other strings
As "fsl,vf610-usbphy" should be added into mxs-phy.txt as a new
compatible string, "fsl,imx23-usbphy" will not be the "fallback" of it,
so there is no point to have "fsl,imx23-usbphy" for vf610 usbphy.
And Documentation/devicetree/bindings/usb/ci-hdrc-imx.txt says:
quoted
- compatible: Should be "fsl,imx27-usb"
The "fsl,imx27-usb" is the only compatible string defined by the
binding, and vf610 usb will also match it, so we need to have it in the
vf610 usb compatible string. "fsl,vf610-usb" is put there only for
saving DTB update in case someday vf610 usb needs a new programming
model and the binding needs to be extended to have "fsl,vf610-usb" as
a new compatible.
Shawn
From: Stefan Agner <stefan@agner.ch> Date: 2014-07-26 12:23:53
Am 2014-07-22 02:13, schrieb Peter Chen:
On Fri, Jul 18, 2014 at 07:01:36PM +0200, Stefan Agner wrote:
quoted
This patchset adds USB support for Vybrid VF610 SoC. It extends the
clock framework to support the USB PHY cocks, extends the device
tree files and adds support for the non-core registers in the
usbmisc_imx driver.
This patchset needs the eSDHC length fix available in Shawn's
for-next branch.
Why it is related to USB patchset?
The eSDHC registers are just in front of the USB registers. Due to the
wrong length, the two register areas overlapped, hence the second driver
(and I think it was USB which was loaded second) could not probe
successfully.
quoted
The whole patchset proved to be working on a Colibri VF61. The
first USB controller runs in peripheral mode. I could successfully
use RNDIS, however with some stability issues: Suddenly the other
side was not reachable anymore and the interface needed to brought
down and back up again. I'm still investigating this.
Do you use ubuntu as host distribution? I find ubuntu will lost the
first connection for usb-ethernet-gadget(usb0) as network interface,
but once you re-config usb0 again (ifconfig usb0 ip up), it should work
and will not lose connection any more.
I use a Angstrom build, an OpenEmbedded distribution. I restarted the
link using ip link set dev usb0 up/down, this brought the link back in a
pingable state, however even afterwards after some seconds of iperf, the
link hanged again...
--
Stefan