Devicetree
 help / color / mirror / Atom feed
* [PATCH 12/12] clk: bcm281xx: define a bus clock
From: Alex Elder @ 2014-02-20  0:13 UTC (permalink / raw)
  To: mturquette, bcm, mporter, robh+dt, pawel.moll, mark.rutland,
	ijc+devicetree, galak, linux
  Cc: bcm-kernel-feedback-list, devicetree, linux-arm-kernel,
	linux-kernel
In-Reply-To: <1392855182-21155-1-git-send-email-elder@linaro.org>

Define the bus clock "bsc3_apb".  This bus clock has to be managed
using the CCU policy mechanism, so add the definitions required for
that to the clock and its CCU.

This one bus clock in particular is defined because it is needed
by peripheral clock "bsc3".  Our boot loader does not properly
activate "bsc3_apb", and as a result, "bsc3" isn't able to function
properly.  With "bsc3_apb" specified as a prerequisite clock for
"bsc3", the latter works correctly.

For now only this one bus clock is defined, because it allows
correct operation of "bsc3".  Others can be added later as needed
(and this patch serves to show how that's done).

Signed-off-by: Alex Elder <elder@linaro.org>
---
 arch/arm/boot/dts/bcm11351.dtsi      |    3 ++-
 drivers/clk/bcm/clk-bcm281xx.c       |   13 ++++++++++++-
 include/dt-bindings/clock/bcm281xx.h |    3 ++-
 3 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/bcm11351.dtsi b/arch/arm/boot/dts/bcm11351.dtsi
index 94b36f6..ff56891 100644
--- a/arch/arm/boot/dts/bcm11351.dtsi
+++ b/arch/arm/boot/dts/bcm11351.dtsi
@@ -247,7 +247,8 @@
 					     "bsc1",
 					     "bsc2",
 					     "bsc3",
-					     "pwm";
+					     "pwm",
+					     "bsc3_apb";
 		};
 
 		ref_1m_clk: ref_1m {
diff --git a/drivers/clk/bcm/clk-bcm281xx.c b/drivers/clk/bcm/clk-bcm281xx.c
index 43fa0b6..40ed2c1 100644
--- a/drivers/clk/bcm/clk-bcm281xx.c
+++ b/drivers/clk/bcm/clk-bcm281xx.c
@@ -321,8 +321,17 @@ static struct peri_clk_data pwm_data = {
 	.trig		= TRIGGER(0x0afc, 15),
 };
 
+static struct bus_clk_data bsc3_apb_data = {
+	.policy		= POLICY(0x0048, 4),
+	.gate		= HW_SW_GATE(0x0484, 16, 0, 1),
+};
+
 static struct ccu_data slave_ccu_data = {
 	BCM281XX_CCU_COMMON(slave, SLAVE),
+	.policy		= {
+		.enable		= CCU_LVM_EN(0x0034, 0),
+		.control	= CCU_POLICY_CTL(0x000c, 0, 1, 2),
+	},
 	.kona_clks	= {
 		[BCM281XX_SLAVE_CCU_UARTB] =
 			KONA_CLK(slave, uartb, peri),
@@ -341,9 +350,11 @@ static struct ccu_data slave_ccu_data = {
 		[BCM281XX_SLAVE_CCU_BSC2] =
 			KONA_CLK(slave, bsc2, peri),
 		[BCM281XX_SLAVE_CCU_BSC3] =
-			KONA_CLK(slave, bsc3, peri),
+			KONA_CLK_PREREQ(slave, bsc3, peri, bsc3_apb),
 		[BCM281XX_SLAVE_CCU_PWM] =
 			KONA_CLK(slave, pwm, peri),
+		[BCM281XX_SLAVE_CCU_BSC3_APB] =
+			KONA_CLK(slave, bsc3_apb, bus),
 		[BCM281XX_SLAVE_CCU_CLOCK_COUNT] = LAST_KONA_CLK,
 	},
 };
diff --git a/include/dt-bindings/clock/bcm281xx.h b/include/dt-bindings/clock/bcm281xx.h
index e009694..57591b1 100644
--- a/include/dt-bindings/clock/bcm281xx.h
+++ b/include/dt-bindings/clock/bcm281xx.h
@@ -60,6 +60,7 @@
 #define BCM281XX_SLAVE_CCU_BSC2			7
 #define BCM281XX_SLAVE_CCU_BSC3			8
 #define BCM281XX_SLAVE_CCU_PWM			9
-#define BCM281XX_SLAVE_CCU_CLOCK_COUNT		10
+#define BCM281XX_SLAVE_CCU_BSC3_APB		10
+#define BCM281XX_SLAVE_CCU_CLOCK_COUNT		11
 
 #endif /* _CLOCK_BCM281XX_H */
-- 
1.7.9.5

^ permalink raw reply related

* Re: [PATCH 0/2] Translate of PCI address without PCI enabled
From: Ezequiel Garcia @ 2014-02-20  0:50 UTC (permalink / raw)
  To: Gregory CLEMENT
  Cc: Grant Likely, Rob Herring, devicetree, linux-kernel, Jason Cooper,
	Andrew Lunn, Sebastian Hesselbarth, Thomas Petazzoni,
	linux-arm-kernel, Lior Amsalem, Tawfik Bayouk, Nadav Haklai
In-Reply-To: <1392848096-17838-1-git-send-email-gregory.clement@free-electrons.com>

On Wed, Feb 19, 2014 at 11:14:54PM +0100, Gregory CLEMENT wrote:
> Hello,
> 
> This patch set makes the use of the of PCI address translator less
> restrictive. At the end it will allow to use the mvebu_get_soc_id
> unconditionally.
> 
> The mvebu SoC (such as Kirkwood, Dove or Armada XP for instance) come
> with an IP of a PCI controller. The ID and the revision of a SoC are
> stored in the registers of this controller. Being able to get this
> information allows to deals with errata more dynamically.
> 
> To manage to read this information, we need to map the registers, and
> for this we need to use the of PCI translator which depend of the PCI
> support.
> 
> However there are mvebu board without any PCI devices, and where
> selecting the PCI support would be useless.
> 
> Moreover translating an address from a PCI node of the device-tree
> into a CPU physical address doesn't require the core PCI
> support. Those translations are just related to the device tree
> itself.
> 
> The 1st patch introduces a new config symbol: OF_ADDRESS_PCI, which
> will be selected as soon as PCI will be selected, so we remains in the
> same situation the current code. It should go to the of tree.
> 
> The 2nd patch selects OF_ADDRESS_PCI as soon as ARCH_MVEBU will be
> selected. This will make mvebu_get_soc_id available even without the
> PCI support. It should go to the mvebu tree.
> 
> Thanks,
> 
> Gregory CLEMENT (2):
>   of: Allows to use the PCI translator without the PCI core
>   ARM: mvebu: Allows to get the SoC ID even without PCI enabled
> 
>  arch/arm/mach-mvebu/Kconfig | 1 +
>  drivers/of/Kconfig          | 4 ++++
>  drivers/of/address.c        | 8 +++++---
>  3 files changed, 10 insertions(+), 3 deletions(-)
> 
> -- 
> 1.8.1.2
> 

On XP GP and CONFIG_PCI=n, without the patches I get this:

  mvebu-soc-id: cannot map registers

and after applying the patches I have:

  mvebu-soc-id: MVEBU SoC ID=0x7846, Rev=0x2

Tested-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Reviewed-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>

Thanks for taking care of this.
-- 
Ezequiel García, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com

^ permalink raw reply

* Re: [PATCH 3/4] tty: serial: bcm63xx_uart: add support for DT probing
From: Florian Fainelli @ 2014-02-20  1:29 UTC (permalink / raw)
  To: Jonas Gorski
  Cc: linux-serial, devicetree@vger.kernel.org, Maxime Bizon,
	Greg Kroah-Hartman
In-Reply-To: <CAOiHx==rYbsy66zRUc-QXTS7ZjaX8v9kiomp+m33+tcEtKC-dA@mail.gmail.com>

2014-02-19 16:00 GMT-08:00 Jonas Gorski <jogo@openwrt.org>:
> On Thu, Feb 20, 2014 at 12:22 AM, Florian Fainelli <f.fainelli@gmail.com> wrote:
>> Add a matching table for the the bcm63xx_uart driver on the compatible
>> string "brcm,bcm63xx-uart" which covers all BCM63xx implementations.
>> Also make sure that we convert the id based on the uart aliases provided
>> by the relevant Device Tree.
>>
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>> ---
>>  drivers/tty/serial/bcm63xx_uart.c | 11 +++++++++++
>>  1 file changed, 11 insertions(+)
>>
>> diff --git a/drivers/tty/serial/bcm63xx_uart.c b/drivers/tty/serial/bcm63xx_uart.c
>> index 37e7e33..538e84c 100644
>> --- a/drivers/tty/serial/bcm63xx_uart.c
>> +++ b/drivers/tty/serial/bcm63xx_uart.c
>> @@ -31,6 +31,7 @@
>>  #include <linux/serial_core.h>
>>  #include <linux/serial_bcm63xx.h>
>>  #include <linux/io.h>
>> +#include <linux/of.h>
>>
>>  #define BCM63XX_NR_UARTS       2
>>
>> @@ -806,6 +807,9 @@ static int bcm_uart_probe(struct platform_device *pdev)
>>         struct clk *clk;
>>         int ret;
>>
>> +       if (pdev->dev.of_node)
>> +               pdev->id = of_alias_get_id(pdev->dev.of_node, "uart");
>> +
>>         if (pdev->id < 0 || pdev->id >= BCM63XX_NR_UARTS)
>>                 return -EINVAL;
>>
>> @@ -857,6 +861,12 @@ static int bcm_uart_remove(struct platform_device *pdev)
>>         return 0;
>>  }
>>
>> +static const struct of_device_id bcm63xx_of_match[] = {
>> +       { .compatible = "brcm,bcm63xx-uart" },
>
> From my understanding, this should be "brcm,bcm6345-uart", because
> this kind of uart appeared first on bcm6345 (well, maybe bcm6335, no
> idea which one of these two was first, but the latter was never
> supported in mainline anyway).

That's right, in fact, I think it might be desirable to handle both
compatible string, just as a hint that it is compatible with the
entire bcm63xx family. Would that work for you?

> The same applies to 4/4.
>
>> +       { /* sentinel */ }
>> +};
>> +MODULE_DEVICE_TABLE(of, bcm63xx_of_match);
>> +
>>  /*
>>   * platform driver stuff
>>   */
>> @@ -866,6 +876,7 @@ static struct platform_driver bcm_uart_platform_driver = {
>>         .driver = {
>>                 .owner = THIS_MODULE,
>>                 .name  = "bcm63xx_uart",
>> +               .of_match_table = bcm63xx_of_match,
>
> You could guard this one with of_match_ptr (and then bcm63xx_of_match
> with CONFIG_OF. Probably not much, but it's the little things ;-)

Good catch.
-- 
Florian

^ permalink raw reply

* Re: [PATCH v2 0/4] Add audio card DT node support for Vybird-TWR board
From: Shawn Guo @ 2014-02-20  1:37 UTC (permalink / raw)
  To: Xiubo Li
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, linux-lFZ/pmaqli7XmaaqVzeoHQ,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1392795751-13351-1-git-send-email-Li.Xiubo-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

On Wed, Feb 19, 2014 at 03:42:27PM +0800, Xiubo Li wrote:
> Xiubo Li (4):
>   ARM: dts: vf610: Add edma mux Tx and Rx support for SAI node.
>   ARM: dts: vf610-twr: Enable SAI ALSA SoC DAI device
>   ARM: dts: vf610-twr: Enable SGTL5000 codec.
>   ARM: dts: vf610-twr: Add simple-card support.

Applied all, thanks.

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH] ARM: dts: imx6qdl-sabreauto: Support debug LED
From: Shawn Guo @ 2014-02-20  1:40 UTC (permalink / raw)
  To: Liu Ying
  Cc: kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1392794148-335-1-git-send-email-Ying.Liu-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

On Wed, Feb 19, 2014 at 03:15:48PM +0800, Liu Ying wrote:
> The D9 LED controlled by gpio on the imx6qdl-sabreauto
> CPU board is a debug LED according to the board design.
> This patch adds the relevant device tree nodes to the
> imx6qdl-sabreauto device tree file to support this LED.
> 
> Signed-off-by: Liu Ying <Ying.Liu-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

Applied, thanks.

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH] of: give priority to the compatible match in __of_match_node()
From: Stephen N Chivers @ 2014-02-20  2:05 UTC (permalink / raw)
  To: Grant Likely
  Cc: Chris Proctor, Kevin Hao, Arnd Bergmann,
	devicetree@vger.kernel.org, Stephen N Chivers, Paul Gortmaker,
	Rob Herring, Rob Herring, Scott Wood, linuxppc-dev,
	Sebastian Hesselbarth
In-Reply-To: <20140219204134.E4A2DC4088D@trevor.secretlab.ca>

Grant Likely <glikely@secretlab.ca> wrote on 02/20/2014 07:41:34 AM:

> From: Grant Likely <grant.likely@linaro.org>
> To: Paul Gortmaker <paul.gortmaker@windriver.com>, Rob Herring 
> <robherring2@gmail.com>
> Cc: Kevin Hao <haokexin@gmail.com>, "devicetree@vger.kernel.org" 
> <devicetree@vger.kernel.org>, Arnd Bergmann <arnd@arndb.de>, Chris 
> Proctor <cproctor@csc.com.au>, Stephen N Chivers 
> <schivers@csc.com.au>, Rob Herring <robh+dt@kernel.org>, Scott Wood 
> <scottwood@freescale.com>, linuxppc-dev <linuxppc-
> dev@lists.ozlabs.org>, Sebastian Hesselbarth 
<sebastian.hesselbarth@gmail.com>
> Date: 02/20/2014 07:41 AM
> Subject: Re: [PATCH] of: give priority to the compatible match in 
> __of_match_node()
> Sent by: Grant Likely <glikely@secretlab.ca>
> 
> On Wed, 19 Feb 2014 13:25:54 -0500, Paul Gortmaker 
> <paul.gortmaker@windriver.com> wrote:
> > On Thu, Feb 13, 2014 at 2:01 PM, Rob Herring <robherring2@gmail.com> 
wrote:
> > > On Wed, Feb 12, 2014 at 5:38 AM, Kevin Hao <haokexin@gmail.com> 
wrote:
> > >> When the device node do have a compatible property, we definitely
> > >> prefer the compatible match besides the type and name. Only if
> > >> there is no such a match, we then consider the candidate which
> > >> doesn't have compatible entry but do match the type or name with
> > >> the device node.
> > >>
> > >> This is based on a patch from Sebastian Hesselbarth.
> > >>   http://patchwork.ozlabs.org/patch/319434/
> > >>
> > >> I did some code refactoring and also fixed a bug in the original 
patch.
> > >
> > > I'm inclined to just revert this once again and avoid possibly
> > > breaking yet another platform.
> > 
> > Well, for what it is worth, today's (Feb19th) linux-next tree fails to 
boot
> > on my sbc8548.   It fails with:
> 
> I think I've got it fixed now with the latest series. Please try the
> devicetree/merge branch on git://git.secretlab.ca/git/linux
I have tested this with the following platforms: MVME5100, MVME4100,
SAM440EP and MPC8349MITXGP. All boot and reach the login state on the
serial console.

The MVME4100 is a MPC8548 platform like the SBC8548 and
suffered from the same PHY address is too large problem
when used with todays linux-next.

Tested-by: Stephen Chivers <schivers@csc.com>
> 
> g.
> 
> > -----------------------------------------------
> > libphy: Freescale PowerQUICC MII Bus: probed
> > mdio_bus ethernet@e002400: /soc8548@e0000000/ethernet@24000/mdio@520
> > PHY address 1312 is too large
> > libphy: Freescale PowerQUICC MII Bus: probed
> > libphy: Freescale PowerQUICC MII Bus: probed
> > mdio_bus ethernet@e002500: /soc8548@e0000000/ethernet@25000/mdio@520
> > PHY address 1312 is too large
> > libphy: Freescale PowerQUICC MII Bus: probed
> > TCP: cubic registered
> > Initializing XFRM netlink socket
> > NET: Registered protocol family 17
> > <fail nfs mount>
> > -----------------------------------------------
> > 
> > On a normal boot, we should see this:
> > -----------------------------------------------
> > libphy: Freescale PowerQUICC MII Bus: probed
> > libphy: Freescale PowerQUICC MII Bus: probed
> > fsl-gianfar e0024000.ethernet: enabled errata workarounds, flags: 0x4
> > fsl-gianfar e0024000.ethernet eth0: mac: 02:e0:0c:00:05:fd
> > fsl-gianfar e0024000.ethernet eth0: Running with NAPI enabled
> > fsl-gianfar e0024000.ethernet eth0: RX BD ring size for Q[0]: 256
> > fsl-gianfar e0024000.ethernet eth0: TX BD ring size for Q[0]: 256
> > fsl-gianfar e0025000.ethernet: enabled errata workarounds, flags: 0x4
> > fsl-gianfar e0025000.ethernet eth1: mac: 02:e0:0c:00:06:fd
> > fsl-gianfar e0025000.ethernet eth1: Running with NAPI enabled
> > fsl-gianfar e0025000.ethernet eth1: RX BD ring size for Q[0]: 256
> > fsl-gianfar e0025000.ethernet eth1: TX BD ring size for Q[0]: 256
> > TCP: cubic registered
> > Initializing XFRM netlink socket
> > NET: Registered protocol family 17
> > -----------------------------------------------
> > 
> > 
> > Git bisect says:
> > 
> > ee8b26ad943aa34acc03ae6cde2b81d8d3d483d4 is the first bad commit
> > commit ee8b26ad943aa34acc03ae6cde2b81d8d3d483d4
> > Author: Kevin Hao <haokexin@gmail.com>
> > Date:   Tue Feb 18 15:57:30 2014 +0800
> > 
> >     of: reimplement the matching method for __of_match_node()
> > 
> >     In the current implementation of __of_match_node(), it will 
compare
> >     each given match entry against all the node's compatible strings
> >     with of_device_is_compatible().
> > 
> >     To achieve multiple compatible strings per node with ordering from
> >     specific to generic, this requires given matches to be ordered 
from
> >     specific to generic. For most of the drivers this is not true and
> >     also an alphabetical ordering is more sane there.
> > 
> >     Therefore, we define a following priority order for the match, and
> >     then scan all the entries to find the best match.
> >       1. specific compatible && type && name
> >       2. specific compatible && type
> >       3. specific compatible && name
> >       4. specific compatible
> >       5. general compatible && type && name
> >       6. general compatible && type
> >       7. general compatible && name
> >       8. general compatible
> >       9. type && name
> >       10. type
> >       11. name
> > 
> >     This is based on some pseudo-codes provided by Grant Likely.
> > 
> >     Signed-off-by: Kevin Hao <haokexin@gmail.com>
> >     [grant.likely: Changed multiplier to 4 which makes more sense]
> >     Signed-off-by: Grant Likely <grant.likely@linaro.org>
> > 
> > :040000 040000 8f5dd19174417aece63b308ff299a5dbe2efa5a0
> > 8401b0e3903e23e973845ee75b26b04345d803d2 M      drivers
> > 
> > As a double check, I checked out the head of linux-next, and did a
> > revert of the above commit, and my sbc8548 can then boot properly.
> > 
> > Not doing anything fancy ; using the defconfig exactly as-is, and
> > ensuring the dtb is fresh from linux-next HEAD of today.
> > 
> > Thanks,
> > Paul.
> > --
> > 
> > >
> > > However, I think I would like to see this structured differently. We
> > > basically have 2 ways of matching: the existing pre-3.14 way and the
> > > desired match on best compatible only. All new bindings should match
> > > with the new way and the old way needs to be kept for compatibility.
> > > So lets structure the code that way. Search the match table first 
for
> > > best compatible with name and type NULL, then search the table the 
old
> > > way. I realize it appears you are doing this, but it is not clear 
this
> > > is the intent of the code. I would like to see this written as a 
patch
> > > with commit 105353145eafb3ea919 reverted first and you add a new 
match
> > > function to call first and then fallback to the existing function.
> > >
> > > Rob
> > >
> > >>
> > >> Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> > >> Signed-off-by: Kevin Hao <haokexin@gmail.com>
> > >> ---
> > >>  drivers/of/base.c | 55 ++++++++++++++++++++++++++++++++++++
> +------------------
> > >>  1 file changed, 37 insertions(+), 18 deletions(-)
> > >>
> > >> diff --git a/drivers/of/base.c b/drivers/of/base.c
> > >> index ff85450d5683..9d655df458bd 100644
> > >> --- a/drivers/of/base.c
> > >> +++ b/drivers/of/base.c
> > >> @@ -730,32 +730,45 @@ out:
> > >>  }
> > >>  EXPORT_SYMBOL(of_find_node_with_property);
> > >>
> > >> +static int of_match_type_or_name(const struct device_node *node,
> > >> +                               const struct of_device_id *m)
> > >> +{
> > >> +       int match = 1;
> > >> +
> > >> +       if (m->name[0])
> > >> +               match &= node->name && !strcmp(m->name, 
node->name);
> > >> +
> > >> +       if (m->type[0])
> > >> +               match &= node->type && !strcmp(m->type, 
node->type);
> > >> +
> > >> +       return match;
> > >> +}
> > >> +
> > >>  static
> > >>  const struct of_device_id *__of_match_node(const struct 
> of_device_id *matches,
> > >>                                            const struct 
> device_node *node)
> > >>  {
> > >>         const char *cp;
> > >>         int cplen, l;
> > >> +       const struct of_device_id *m;
> > >> +       int match;
> > >>
> > >>         if (!matches)
> > >>                 return NULL;
> > >>
> > >>         cp = __of_get_property(node, "compatible", &cplen);
> > >> -       do {
> > >> -               const struct of_device_id *m = matches;
> > >> +       while (cp && (cplen > 0)) {
> > >> +               m = matches;
> > >>
> > >>                 /* Check against matches with current 
> compatible string */
> > >>                 while (m->name[0] || m->type[0] || 
m->compatible[0]) {
> > >> -                       int match = 1;
> > >> -                       if (m->name[0])
> > >> -                               match &= node->name
> > >> -                                       && !strcmp(m->name, 
node->name);
> > >> -                       if (m->type[0])
> > >> -                               match &= node->type
> > >> -                                       && !strcmp(m->type, 
node->type);
> > >> -                       if (m->compatible[0])
> > >> -                               match &= cp
> > >> -                                       && !of_compat_cmp
> (m->compatible, cp,
> > >> +                       if (!m->compatible[0]) {
> > >> +                               m++;
> > >> +                               continue;
> > >> +                       }
> > >> +
> > >> +                       match = of_match_type_or_name(node, m);
> > >> +                       match &= cp && 
!of_compat_cmp(m->compatible, cp,
> > >>                                                         strlen
> (m->compatible));
> > >>                         if (match)
> > >>                                 return m;
> > >> @@ -763,12 +776,18 @@ const struct of_device_id 
> *__of_match_node(const struct of_device_id *matches,
> > >>                 }
> > >>
> > >>                 /* Get node's next compatible string */
> > >> -               if (cp) {
> > >> -                       l = strlen(cp) + 1;
> > >> -                       cp += l;
> > >> -                       cplen -= l;
> > >> -               }
> > >> -       } while (cp && (cplen > 0));
> > >> +               l = strlen(cp) + 1;
> > >> +               cp += l;
> > >> +               cplen -= l;
> > >> +       }
> > >> +
> > >> +       m = matches;
> > >> +       /* Check against matches without compatible string */
> > >> +       while (m->name[0] || m->type[0] || m->compatible[0]) {
> > >> +               if (!m->compatible[0] && 
of_match_type_or_name(node, m))
> > >> +                       return m;
> > >> +               m++;
> > >> +       }
> > >>
> > >>         return NULL;
> > >>  }
> > >> --
> > >> 1.8.5.3
> > >>
> > >> --
> > >> To unsubscribe from this list: send the line "unsubscribe 
devicetree" in
> > >> the body of a message to majordomo@vger.kernel.org
> > >> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > > _______________________________________________
> > > Linuxppc-dev mailing list
> > > Linuxppc-dev@lists.ozlabs.org
> > > https://lists.ozlabs.org/listinfo/linuxppc-dev
> 

^ permalink raw reply

* exynos4412-odroidx.dts doesn't boot
From: Matthew Thode @ 2014-02-20  3:01 UTC (permalink / raw)
  To: ben-linux-elnMNo+KYs3YtjvyW6yDsg,
	kgene.kim-Sze3O3UU22JBDgjK7y7TUQ, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	pawel.moll-5wv7dgnIgG8, mark.rutland-5wv7dgnIgG8,
	ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, linux-lFZ/pmaqli7XmaaqVzeoHQ,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	thomas.ag-Sze3O3UU22JBDgjK7y7TUQ, Steev Klimaszewski

[-- Attachment #1: Type: text/plain, Size: 568 bytes --]

doesn't show anything past Starting Linux... even with earlyprintk and
debug_ll enabled (and S3C_UART1)

It also seems to be missing the secure firmware bit (doesn't boot with it).

kernel command line was as follows

setenv bootargs "console=ttySAC1,115200n8 root=/dev/mmcblk0p2 rootwait
ro mem=1023M verbose earlyprintk=serial,ttySAC1,115200n8"

tar'd up the boot dir for you as well.
http://dev.gentoo.org/~prometheanfire/dist/kernels/odroidx-boot.tar

What is missing from mainline to get this to work and why isn't it in?

-- 
-- Matthew Thode


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* Re: [PATCH v2 0/3] usb: chipidea: msm: Clean and fix glue layer driver
From: Tim Bird @ 2014-02-20  4:07 UTC (permalink / raw)
  To: Ivan T. Ivanov
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Rob Landley, Peter Chen, Grant Likely, Greg Kroah-Hartman,
	David Brown, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Linux Kernel Mailing List, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1392821911.17130.63.camel@iivanov-dev>

Thanks very much.  I will try out the things you mention and let you
know if I make progress.
 -- Tim


On Wed, Feb 19, 2014 at 6:58 AM, Ivan T. Ivanov <iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org> wrote:
>
> Hi Tim,
>
> On Tue, 2014-02-18 at 22:21 -0800, Tim Bird wrote:
>> Ivan,
>>
>> I'm having tremendous problems getting this driver to initialize.  For
>> some reason, I can't get the driver to actually transition the
>> hardware into peripheral mode.  At first I was getting a lot of probe
>> deferrals, based on not finding the regulators early enough in the
>> boot, and I thought it was an issue with the gadget drivers loading
>> before the driver could complete its setup.  However, I switched
>> everything to loading via modules, and now have less probe deferrals,
>> but I still can't get the driver to activate.
>
> My understanding for gadget drivers is that you can have only one
> of them active in particular time. When compiled in kernel you can
> chose only one of them, also you can have only one module (function)
> loaded.
>
>
>>   I see zero interrupts.
>
> Right, I think that we will not see interrupts until we have
> SPMI drivers which could control PMIC chip, PMIC is responsible
> to do ID line detection and generate IRQ to APQ/MSM chip.
>
>> In particular the routine hw_device_state (which turns on interrupts
>> in the controller) is never called, because I can't get
>> msm_otg_start_peripheral to actually kick the hardware.
>>
>
> OTG state machine is not used at all. This phy-"otg" driver is
> working only in "peripheral" mode, because of missing PMIC
> communication.
>
> The only callback which you could see to be executed is
> struct usb_otg::set_peripheral(), when you load gadget driver.
>
>
> <snip>
>
> (Would you mind sharing your config?).
>
> Sure. Attached.
>
>
>> I tried configuring the qcom,otg-control for user controlled mode
>> setting (via debugfs),
>
> Never testes this. It was there before.
>
>>
>> My kernel is based on an internal Sony 3.13-rc6 kernel with clock and
>> regulator patches applied, as well as your phy-msm-usb.c patches from
>> November and your chipidea patches from yesterday.
>
> You will need also 4th chipidea patch[1]. I have dropped it, because
> I will like to upstream PHY driver changes first. They are depended
> anyway.
>
> To reduce dependency to other drivers, I could recommend you to
> use Zero gadget driver. It should be enough to test USB stack,
> where APQ device will be peripheral and development workstation
> will be a host[2].
>
>
> # cat zero.sh
> #!/bin/sh
> cd /lib/modules/$(uname -r)/kernel/drivers/usb/gadget
> insmod ./libcomposite.ko
> insmod ./usb_f_ss_lb.ko
> insmod ./g_zero.ko
>
>
>> [   22.454287] [<c022afd8>] (warn_slowpath_common+0x68/0x88) from
>> [<c022b08c>] (warn_slowpath_fmt+0x30/0x40)
>> [   22.463060] [<c022b08c>] (warn_slowpath_fmt+0x30/0x40) from
>> [<bf005024>] (msm_otg_probe+0x24/0x904 [phy_msm_usb])
>> [   22.472703] [<bf005024>] (msm_otg_probe+0x24/0x904 [phy_msm_usb])
>
> This is know non-fatal issue. I will try to see how to fix it.
>
>
> Regards,
> Ivan
>
> [1] usb: chipidea: msm: Use USB PHY API to control PHY state
> [2] http://www.linux-usb.org/usbtest/
>
>



-- 
 -- Tim Bird
Senior Software Engineer, Sony Mobile
Architecture Group Chair, CE Workgroup, Linux Foundation
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: devicetree repository separation/migration
From: Frank Rowand @ 2014-02-20  4:58 UTC (permalink / raw)
  To: Grant Likely
  Cc: Sascha Hauer, Tim Bird, Olof Johansson, Jason Cooper, Rob Herring,
	Ian Campbell, Pawel Moll, Mark Rutland, Kumar Gala, Rob Landley,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-spec-u79uwXL29TY76Z2rM5mHXA,
	devicetree-compiler-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <CACxGe6uhA6FMR76WJGVEt44x6bQOC=woCkDr6ZUH30hTd8f2wA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On 2/19/2014 1:15 PM, Grant Likely wrote:
> On Wed, Feb 19, 2014 at 8:16 PM, Frank Rowand <frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> On 2/19/2014 1:08 AM, Sascha Hauer wrote:
>>> On Tue, Feb 18, 2014 at 02:44:15PM -0800, Tim Bird wrote:
>>>> I'm not in favor of separating the device tree information from the kernel.
>>>>
>>>> If we switch, then whatever synchronization issues other projects
>>>> are having now with synching with the device tree info from the kernel will
>>>> just then become the problem of the kernel developers, who will then
>>>> have to sync with the device tree info from another repository.  If the
>>>> sync issues can't be solved now for them, why or how would it be solved
>>>> post-separation for us?  (It sounds like a zero-sum game of pain transfer
>>>> to me.)
>>>>
>>>> I'm relatively unfamiliar with the arguments.  Can someone provide
>>>> a brief list of reasons this is needed, and how the inconvenience to Linux
>>>> kernel developers will be minimized, should it proceed?
>>>
>>
>>
>>> One of the reasons for doing devicetrees is to separate the hardware
>>> description from the code so that:
>>> - Other OSes (and bootloaders) can use the same description to start on
>>>   a given hardware
>>> - A generic Kernel can be started on any hardware
>>> - A hardware describes itself, makes itself more introspecitve so we can
>>>   go away from very specialized kernels
>>
>> Tim knows this ^^^^.  He was asking for the arguments for moving dts files
>> out of the linux kernel source tree.
> 
> We've made the decision that devicetree bindings need to be treated as
> ABI, but as long as the .dts files live in the kernel there will
> always be the temptation to just tweak things in lock-step and nobody
> will notice. Splitting the files out gives that extra push to think
> about whether changes to a binding will backwards compatible with a
> tree that doesn't have those changes because the chances are a lot
> higher that someone will hit that combination.
> 
> The other argument is shared source between
> BSD/U-Boot/Barebox/Linux/etc. Until we have a separate .dts repo there
> is no good way to share the database of hardware descriptions.

We could provide an easy export (see below).  What do you think?

-Frank



Proof of concept: export devicetree source and header files

Not-signed-off-by: Frank Rowand <frank.rowand-/MT0OVThwyLZJqsBc5GL+g@public.gmane.org>


---
 Makefile                   |   27 	26 +	1 -	0 !
 scripts/Makefile.dtsexport |   19 	19 +	0 -	0 !
 scripts/dts.sh             |   11 	11 +	0 -	0 !
 3 files changed, 56 insertions(+), 1 deletion(-)

Index: b/Makefile
===================================================================
--- a/Makefile
+++ b/Makefile
@@ -234,6 +234,9 @@ endif
 # Where to locate arch specific headers
 hdr-arch  := $(SRCARCH)
 
+# Where to locate arch specific dts
+dts-arch  := $(SRCARCH)
+
 KCONFIG_CONFIG	?= .config
 export KCONFIG_CONFIG
 
@@ -463,7 +466,7 @@ version_h := include/generated/uapi/linu
 no-dot-config-targets := clean mrproper distclean \
 			 cscope gtags TAGS tags help %docs check% coccicheck \
 			 $(version_h) headers_% archheaders archscripts \
-			 kernelversion %src-pkg
+			 kernelversion %src-pkg dts_export%
 
 config-targets := 0
 mixed-targets  := 0
@@ -933,6 +936,26 @@ firmware_install: FORCE
 	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_install
 
 # ---------------------------------------------------------------------------
+# devicetree source and headers export
+
+#Default location for installed headers
+export EXPORT_DTS_PATH = $(KBUILD_OUTPUT)/usr/dts
+
+PHONY += dts_export_headers
+dts_export_headers: scripts_basic
+	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.dtsexport obj=include/dt-bindings
+	@echo $(KERNELRELEASE) >$(EXPORT_DTS_PATH)/linux_version
+
+PHONY += dts_export_all
+dts_export_all: dts_export_headers
+	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/dts.sh
+
+PHONY += dts_export
+dts_export:
+	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.dtsexport obj=arch/$(dts-arch)/boot/dts
+
+
+# ---------------------------------------------------------------------------
 # Kernel headers
 
 #Default location for installed headers
@@ -1160,6 +1183,8 @@ help:
 	@echo  '  modules_prepare - Set up for building external modules'
 	@echo  '  tags/TAGS	  - Generate tags file for editors'
 	@echo  '  cscope	  - Generate cscope index'
+	@echo  '  dts_export_all  - Export devicetree source and headers to EXPORT_DTS_PATH'
+	@echo  '                    (default: $(EXPORT_DTS_PATH))'
 	@echo  '  gtags           - Generate GNU GLOBAL index'
 	@echo  '  kernelrelease	  - Output the release version string'
 	@echo  '  kernelversion	  - Output the version stored in Makefile'
Index: b/scripts/Makefile.dtsexport
===================================================================
--- /dev/null
+++ b/scripts/Makefile.dtsexport
@@ -0,0 +1,19 @@
+# ==========================================================================
+# Exporting dts source and header files
+#
+# ==========================================================================
+
+srcpath := $(srctree)/$(obj)/*
+dstpath := $(EXPORT_DTS_PATH)/$(obj)
+
+include scripts/Kbuild.include
+
+
+quiet_cmd_install = EXPORT $(subst $(srctree)/,,$(srcpath))
+      cmd_install = mkdir -p $(dstpath); cp -a $(srcpath) $(dstpath)
+
+
+.PHONY: export
+export:
+	$(call cmd,install)
+
Index: b/scripts/dts.sh
===================================================================
--- /dev/null
+++ b/scripts/dts.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+# Run dts_export command for all architectures
+
+# Stop on error
+set -e
+
+for arch in $(ls ${srctree}/arch); do
+	if [ -d ${srctree}/arch/${arch}/boot/dts ]; then
+		make ARCH=${arch} dts_export
+	fi
+done
--
To unsubscribe from this list: send the line "unsubscribe devicetree-compiler" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PATCH v10 00/15] Add power management support for mxs phy
From: Peter Chen @ 2014-02-20  5:14 UTC (permalink / raw)
  To: balbi, shawn.guo, robh+dt, grant.likely, pawel.moll, mark.rutland
  Cc: alexander.shishkin, linux-usb, linux-arm-kernel, festevam, marex,
	kernel, m.grzeschik, frank.li, peter.chen, gregkh, devicetree,
	linux-doc

Hi Felipe & Shawn,

The serial adds power management support for MXS PHY, it includes:

- Add one PHY API .set_wakeup, and related API implementation at mxs phy driver
- misc changes and bug fixes for mxs phy to support low power mode and wakeup.

It is based on the lastest Greg's usb-next, 3.14-rc3.

Changes for v10:
- Nothing related with function change.
- It adds dt maintainers to To list, and cc devicetree@vger.kernel.org,
wait dt-maintainer's ack for 1/15, 4/15.
- Add last three dts patches for reference which have already
at Shawn's tree.

Changes for v9:
- Fix the build warning if CONFIG_SUSPEND is not set

Changes for v8:
- Shawn has already applied two dts patches, so delete them at
  v8 version, http://marc.info/?l=linux-arm-kernel&m=138785188404939&w=2
- Using of_get_property to avoid imx6 fail at probe when using old DTB [5/12]
- Do not consider failure if alias id is not existed, it can avoid fail
  at probe when using old DTB [8/12]
- We don't need more changes for [8/12] change due to we use
  "mxs_phy->port_id ==" as condition

Changes for v7:
- Fixed indentation problem at binding doc [1/14]
- s/ganranteed/guaranteed, and add explanation for "auto setting" [3/14]
- add static before SIMPLE_DEV_PM_OPS [13/14]
- add one patch to change usb device description [7/14]
- Delete the .nofity_suspend and .notify_resume due to Felipe
  does not agree to add them as PHY API, will use other ways to implement
  them in future.

Changes for v6:
- Add description for IC bug fixes logic. [9/15]
- Move is_imx6q_phy and is_imx6sl_phy from [9/15] to [14/15] 
- %s/mxs_phy_clock_switch/mxs_phy_clock_switch_delay to reflect
the function meaning more precise [15/15]

Changes for v5:
Add Marc and Michael Grzeschik's commnets
- typo error at [2/15]
- sqhash patches which introducing mxs_phy_disconnect_line and
fixed but at this function. [13/15]
- Introducing flag MXS_PHY_NEED_IP_FIX who stands for the SoCs
who have IC fixes. [2/15, 8/15]
- Delete one patch for low speed connection problem at every rare
situations due to the root cause has still not found.

Peter Chen (15):
  usb: doc: phy-mxs: Add more compatible strings
  usb: phy-mxs: Add platform judgement code
  usb: phy-mxs: Add auto clock and power setting
  usb: doc: phy-mxs: update binding for adding anatop phandle
  usb: phy-mxs: Add anatop regmap
  usb: phy-mxs: change description of usb device speed
  usb: phy-mxs: Enable IC fixes for related SoCs
  usb: phy-mxs: add controller id
  usb: phy: Add set_wakeup API
  usb: phy-mxs: Add implementation of set_wakeup
  usb: phy-mxs: Add system suspend/resume API
  usb: phy-mxs: Add sync time after controller clear phcd
  ARM: dts: mxs: add mxs phy controller id
  ARM: dts: imx6: add anatop phandle for usbphy
  ARM: dts: imx6: add mxs phy controller id

 Documentation/devicetree/bindings/usb/mxs-phy.txt |    5 +-
 arch/arm/boot/dts/imx23.dtsi                      |    1 +
 arch/arm/boot/dts/imx28.dtsi                      |    2 +
 arch/arm/boot/dts/imx6qdl.dtsi                    |    4 +
 arch/arm/boot/dts/imx6sl.dtsi                     |    4 +
 drivers/usb/phy/phy-mxs-usb.c                     |  310 ++++++++++++++++++++-
 include/linux/usb/phy.h                           |   16 +
 7 files changed, 327 insertions(+), 15 deletions(-)

-- 
1.7.8



^ permalink raw reply

* [PATCH v10 01/15] usb: doc: phy-mxs: Add more compatible strings
From: Peter Chen @ 2014-02-20  5:14 UTC (permalink / raw)
  To: balbi, shawn.guo, robh+dt, grant.likely, pawel.moll, mark.rutland
  Cc: alexander.shishkin, linux-usb, linux-arm-kernel, festevam, marex,
	kernel, m.grzeschik, frank.li, peter.chen, gregkh, devicetree,
	linux-doc
In-Reply-To: <1392873284-9386-1-git-send-email-peter.chen@freescale.com>

Add "fsl,imx6q-usbphy" for imx6dq and imx6dl, add
"fsl,imx6sl-usbphy" for imx6sl.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
---
 Documentation/devicetree/bindings/usb/mxs-phy.txt |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/Documentation/devicetree/bindings/usb/mxs-phy.txt b/Documentation/devicetree/bindings/usb/mxs-phy.txt
index 5835b27..b43d4c9e 100644
--- a/Documentation/devicetree/bindings/usb/mxs-phy.txt
+++ b/Documentation/devicetree/bindings/usb/mxs-phy.txt
@@ -1,7 +1,8 @@
 * Freescale MXS USB Phy Device
 
 Required properties:
-- compatible: Should be "fsl,imx23-usbphy"
+- compatible: "fsl,imx23-usbphy" for imx23 and imx28, "fsl,imx6q-usbphy"
+  for imx6dq and imx6dl, "fsl,imx6sl-usbphy" for imx6sl
 - reg: Should contain registers location and length
 - interrupts: Should contain phy interrupt
 
-- 
1.7.8



^ permalink raw reply related

* [PATCH v10 02/15] usb: phy-mxs: Add platform judgement code
From: Peter Chen @ 2014-02-20  5:14 UTC (permalink / raw)
  To: balbi, shawn.guo, robh+dt, grant.likely, pawel.moll, mark.rutland
  Cc: alexander.shishkin, linux-usb, linux-arm-kernel, festevam, marex,
	kernel, m.grzeschik, frank.li, peter.chen, gregkh, devicetree,
	linux-doc
In-Reply-To: <1392873284-9386-1-git-send-email-peter.chen@freescale.com>

The mxs-phy has several bugs and features at different
versions, the driver code can get it through of_device_id.data.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
---
 drivers/usb/phy/phy-mxs-usb.c |   58 ++++++++++++++++++++++++++++++++++------
 1 files changed, 49 insertions(+), 9 deletions(-)

diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c
index b42897b..cf58d8e 100644
--- a/drivers/usb/phy/phy-mxs-usb.c
+++ b/drivers/usb/phy/phy-mxs-usb.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012 Freescale Semiconductor, Inc.
+ * Copyright 2012-2013 Freescale Semiconductor, Inc.
  * Copyright (C) 2012 Marek Vasut <marex@denx.de>
  * on behalf of DENX Software Engineering GmbH
  *
@@ -20,6 +20,7 @@
 #include <linux/delay.h>
 #include <linux/err.h>
 #include <linux/io.h>
+#include <linux/of_device.h>
 
 #define DRIVER_NAME "mxs_phy"
 
@@ -34,13 +35,55 @@
 #define BM_USBPHY_CTRL_ENUTMILEVEL2		BIT(14)
 #define BM_USBPHY_CTRL_ENHOSTDISCONDETECT	BIT(1)
 
+#define to_mxs_phy(p) container_of((p), struct mxs_phy, phy)
+
+/* Do disconnection between PHY and controller without vbus */
+#define MXS_PHY_DISCONNECT_LINE_WITHOUT_VBUS	BIT(0)
+
+/*
+ * The PHY will be in messy if there is a wakeup after putting
+ * bus to suspend (set portsc.suspendM) but before setting PHY to low
+ * power mode (set portsc.phcd).
+ */
+#define MXS_PHY_ABNORMAL_IN_SUSPEND		BIT(1)
+
+/*
+ * The SOF sends too fast after resuming, it will cause disconnection
+ * between host and high speed device.
+ */
+#define MXS_PHY_SENDING_SOF_TOO_FAST		BIT(2)
+
+struct mxs_phy_data {
+	unsigned int flags;
+};
+
+static const struct mxs_phy_data imx23_phy_data = {
+	.flags = MXS_PHY_ABNORMAL_IN_SUSPEND | MXS_PHY_SENDING_SOF_TOO_FAST,
+};
+
+static const struct mxs_phy_data imx6q_phy_data = {
+	.flags = MXS_PHY_SENDING_SOF_TOO_FAST |
+		MXS_PHY_DISCONNECT_LINE_WITHOUT_VBUS,
+};
+
+static const struct mxs_phy_data imx6sl_phy_data = {
+	.flags = MXS_PHY_DISCONNECT_LINE_WITHOUT_VBUS,
+};
+
+static const struct of_device_id mxs_phy_dt_ids[] = {
+	{ .compatible = "fsl,imx6sl-usbphy", .data = &imx6sl_phy_data, },
+	{ .compatible = "fsl,imx6q-usbphy", .data = &imx6q_phy_data, },
+	{ .compatible = "fsl,imx23-usbphy", .data = &imx23_phy_data, },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, mxs_phy_dt_ids);
+
 struct mxs_phy {
 	struct usb_phy phy;
 	struct clk *clk;
+	const struct mxs_phy_data *data;
 };
 
-#define to_mxs_phy(p) container_of((p), struct mxs_phy, phy)
-
 static int mxs_phy_hw_init(struct mxs_phy *mxs_phy)
 {
 	int ret;
@@ -138,6 +181,8 @@ static int mxs_phy_probe(struct platform_device *pdev)
 	struct clk *clk;
 	struct mxs_phy *mxs_phy;
 	int ret;
+	const struct of_device_id *of_id =
+			of_match_device(mxs_phy_dt_ids, &pdev->dev);
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	base = devm_ioremap_resource(&pdev->dev, res);
@@ -168,6 +213,7 @@ static int mxs_phy_probe(struct platform_device *pdev)
 	mxs_phy->phy.type		= USB_PHY_TYPE_USB2;
 
 	mxs_phy->clk = clk;
+	mxs_phy->data = of_id->data;
 
 	platform_set_drvdata(pdev, mxs_phy);
 
@@ -187,12 +233,6 @@ static int mxs_phy_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id mxs_phy_dt_ids[] = {
-	{ .compatible = "fsl,imx23-usbphy", },
-	{ /* sentinel */ }
-};
-MODULE_DEVICE_TABLE(of, mxs_phy_dt_ids);
-
 static struct platform_driver mxs_phy_driver = {
 	.probe = mxs_phy_probe,
 	.remove = mxs_phy_remove,
-- 
1.7.8



^ permalink raw reply related

* [PATCH v10 03/15] usb: phy-mxs: Add auto clock and power setting
From: Peter Chen @ 2014-02-20  5:14 UTC (permalink / raw)
  To: balbi-l0cyMroinI0, shawn.guo-QSEj5FYQhm4dnm+yROfE0A,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8
  Cc: alexander.shishkin-VuQAYsv1563Yd54FQh9/CA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	festevam-Re5JQEeQqe8AvxtiuMwx3w, marex-ynQEQJNshbs,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ, m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ,
	frank.li-KZfg59tc24xl57MIdRCFDg,
	peter.chen-KZfg59tc24xl57MIdRCFDg,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-doc-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1392873284-9386-1-git-send-email-peter.chen-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

The auto setting is used to open related power and clocks
automatically after receiving wakeup signal.

With this feature, the PHY's clock and power can be recovered
correctly from low power mode, it is guaranteed by IC logic.

Signed-off-by: Peter Chen <peter.chen-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
---
 drivers/usb/phy/phy-mxs-usb.c |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c
index cf58d8e..d7adca3 100644
--- a/drivers/usb/phy/phy-mxs-usb.c
+++ b/drivers/usb/phy/phy-mxs-usb.c
@@ -31,6 +31,11 @@
 
 #define BM_USBPHY_CTRL_SFTRST			BIT(31)
 #define BM_USBPHY_CTRL_CLKGATE			BIT(30)
+#define BM_USBPHY_CTRL_ENAUTOSET_USBCLKS	BIT(26)
+#define BM_USBPHY_CTRL_ENAUTOCLR_USBCLKGATE	BIT(25)
+#define BM_USBPHY_CTRL_ENAUTOCLR_PHY_PWD	BIT(20)
+#define BM_USBPHY_CTRL_ENAUTOCLR_CLKGATE	BIT(19)
+#define BM_USBPHY_CTRL_ENAUTO_PWRON_PLL		BIT(18)
 #define BM_USBPHY_CTRL_ENUTMILEVEL3		BIT(15)
 #define BM_USBPHY_CTRL_ENUTMILEVEL2		BIT(14)
 #define BM_USBPHY_CTRL_ENHOSTDISCONDETECT	BIT(1)
@@ -96,9 +101,18 @@ static int mxs_phy_hw_init(struct mxs_phy *mxs_phy)
 	/* Power up the PHY */
 	writel(0, base + HW_USBPHY_PWD);
 
-	/* enable FS/LS device */
-	writel(BM_USBPHY_CTRL_ENUTMILEVEL2 |
-	       BM_USBPHY_CTRL_ENUTMILEVEL3,
+	/*
+	 * USB PHY Ctrl Setting
+	 * - Auto clock/power on
+	 * - Enable full/low speed support
+	 */
+	writel(BM_USBPHY_CTRL_ENAUTOSET_USBCLKS |
+		BM_USBPHY_CTRL_ENAUTOCLR_USBCLKGATE |
+		BM_USBPHY_CTRL_ENAUTOCLR_PHY_PWD |
+		BM_USBPHY_CTRL_ENAUTOCLR_CLKGATE |
+		BM_USBPHY_CTRL_ENAUTO_PWRON_PLL |
+		BM_USBPHY_CTRL_ENUTMILEVEL2 |
+		BM_USBPHY_CTRL_ENUTMILEVEL3,
 	       base + HW_USBPHY_CTRL_SET);
 
 	return 0;
-- 
1.7.8


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH v10 04/15] usb: doc: phy-mxs: update binding for adding anatop phandle
From: Peter Chen @ 2014-02-20  5:14 UTC (permalink / raw)
  To: balbi, shawn.guo, robh+dt, grant.likely, pawel.moll, mark.rutland
  Cc: alexander.shishkin, linux-usb, linux-arm-kernel, festevam, marex,
	kernel, m.grzeschik, frank.li, peter.chen, gregkh, devicetree,
	linux-doc
In-Reply-To: <1392873284-9386-1-git-send-email-peter.chen@freescale.com>

Add anatop phandle which is used to access anatop registers to
control PHY's power and other USB operations.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
---
 Documentation/devicetree/bindings/usb/mxs-phy.txt |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/Documentation/devicetree/bindings/usb/mxs-phy.txt b/Documentation/devicetree/bindings/usb/mxs-phy.txt
index b43d4c9e..fc6659d 100644
--- a/Documentation/devicetree/bindings/usb/mxs-phy.txt
+++ b/Documentation/devicetree/bindings/usb/mxs-phy.txt
@@ -5,10 +5,12 @@ Required properties:
   for imx6dq and imx6dl, "fsl,imx6sl-usbphy" for imx6sl
 - reg: Should contain registers location and length
 - interrupts: Should contain phy interrupt
+- fsl,anatop: phandle for anatop register, it is only for imx6 SoC series
 
 Example:
 usbphy1: usbphy@020c9000 {
 	compatible = "fsl,imx6q-usbphy", "fsl,imx23-usbphy";
 	reg = <0x020c9000 0x1000>;
 	interrupts = <0 44 0x04>;
+	fsl,anatop = <&anatop>;
 };
-- 
1.7.8



^ permalink raw reply related

* [PATCH v10 05/15] usb: phy-mxs: Add anatop regmap
From: Peter Chen @ 2014-02-20  5:14 UTC (permalink / raw)
  To: balbi-l0cyMroinI0, shawn.guo-QSEj5FYQhm4dnm+yROfE0A,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8
  Cc: alexander.shishkin-VuQAYsv1563Yd54FQh9/CA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	festevam-Re5JQEeQqe8AvxtiuMwx3w, marex-ynQEQJNshbs,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ, m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ,
	frank.li-KZfg59tc24xl57MIdRCFDg,
	peter.chen-KZfg59tc24xl57MIdRCFDg,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-doc-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1392873284-9386-1-git-send-email-peter.chen-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

It is needed by imx6 SoC series, but not for imx23 and imx28.

Signed-off-by: Peter Chen <peter.chen-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
---
 drivers/usb/phy/phy-mxs-usb.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c
index d7adca3..2411e05 100644
--- a/drivers/usb/phy/phy-mxs-usb.c
+++ b/drivers/usb/phy/phy-mxs-usb.c
@@ -21,6 +21,8 @@
 #include <linux/err.h>
 #include <linux/io.h>
 #include <linux/of_device.h>
+#include <linux/regmap.h>
+#include <linux/mfd/syscon.h>
 
 #define DRIVER_NAME "mxs_phy"
 
@@ -87,6 +89,7 @@ struct mxs_phy {
 	struct usb_phy phy;
 	struct clk *clk;
 	const struct mxs_phy_data *data;
+	struct regmap *regmap_anatop;
 };
 
 static int mxs_phy_hw_init(struct mxs_phy *mxs_phy)
@@ -197,6 +200,7 @@ static int mxs_phy_probe(struct platform_device *pdev)
 	int ret;
 	const struct of_device_id *of_id =
 			of_match_device(mxs_phy_dt_ids, &pdev->dev);
+	struct device_node *np = pdev->dev.of_node;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	base = devm_ioremap_resource(&pdev->dev, res);
@@ -216,6 +220,17 @@ static int mxs_phy_probe(struct platform_device *pdev)
 		return -ENOMEM;
 	}
 
+	/* Some SoCs don't have anatop registers */
+	if (of_get_property(np, "fsl,anatop", NULL)) {
+		mxs_phy->regmap_anatop = syscon_regmap_lookup_by_phandle
+			(np, "fsl,anatop");
+		if (IS_ERR(mxs_phy->regmap_anatop)) {
+			dev_dbg(&pdev->dev,
+				"failed to find regmap for anatop\n");
+			return PTR_ERR(mxs_phy->regmap_anatop);
+		}
+	}
+
 	mxs_phy->phy.io_priv		= base;
 	mxs_phy->phy.dev		= &pdev->dev;
 	mxs_phy->phy.label		= DRIVER_NAME;
-- 
1.7.8


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH v10 06/15] usb: phy-mxs: change description of usb device speed
From: Peter Chen @ 2014-02-20  5:14 UTC (permalink / raw)
  To: balbi, shawn.guo, robh+dt, grant.likely, pawel.moll, mark.rutland
  Cc: alexander.shishkin, linux-usb, linux-arm-kernel, festevam, marex,
	kernel, m.grzeschik, frank.li, peter.chen, gregkh, devicetree,
	linux-doc
In-Reply-To: <1392873284-9386-1-git-send-email-peter.chen@freescale.com>

Change "high speed" to "HS"
Change "non-high speed" to "FS/LS"

Implementation of notify_suspend and notify_resume will be different
according to mxs_phy_data->flags.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
---
 drivers/usb/phy/phy-mxs-usb.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c
index 2411e05..1663a66 100644
--- a/drivers/usb/phy/phy-mxs-usb.c
+++ b/drivers/usb/phy/phy-mxs-usb.c
@@ -168,8 +168,8 @@ static int mxs_phy_suspend(struct usb_phy *x, int suspend)
 static int mxs_phy_on_connect(struct usb_phy *phy,
 		enum usb_device_speed speed)
 {
-	dev_dbg(phy->dev, "%s speed device has connected\n",
-		(speed == USB_SPEED_HIGH) ? "high" : "non-high");
+	dev_dbg(phy->dev, "%s device has connected\n",
+		(speed == USB_SPEED_HIGH) ? "HS" : "FS/LS");
 
 	if (speed == USB_SPEED_HIGH)
 		writel(BM_USBPHY_CTRL_ENHOSTDISCONDETECT,
@@ -181,8 +181,8 @@ static int mxs_phy_on_connect(struct usb_phy *phy,
 static int mxs_phy_on_disconnect(struct usb_phy *phy,
 		enum usb_device_speed speed)
 {
-	dev_dbg(phy->dev, "%s speed device has disconnected\n",
-		(speed == USB_SPEED_HIGH) ? "high" : "non-high");
+	dev_dbg(phy->dev, "%s device has disconnected\n",
+		(speed == USB_SPEED_HIGH) ? "HS" : "FS/LS");
 
 	if (speed == USB_SPEED_HIGH)
 		writel(BM_USBPHY_CTRL_ENHOSTDISCONDETECT,
-- 
1.7.8



^ permalink raw reply related

* [PATCH v10 07/15] usb: phy-mxs: Enable IC fixes for related SoCs
From: Peter Chen @ 2014-02-20  5:14 UTC (permalink / raw)
  To: balbi, shawn.guo, robh+dt, grant.likely, pawel.moll, mark.rutland
  Cc: alexander.shishkin, linux-usb, linux-arm-kernel, festevam, marex,
	kernel, m.grzeschik, frank.li, peter.chen, gregkh, devicetree,
	linux-doc
In-Reply-To: <1392873284-9386-1-git-send-email-peter.chen@freescale.com>

Two PHY bugs are fixed by IC logic, but these bits are not
enabled by default, so we enable them at driver.
The two bugs are: MXS_PHY_ABNORMAL_IN_SUSPEND and MXS_PHY_SENDING_SOF_TOO_FAST
which are described at code.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
---
 drivers/usb/phy/phy-mxs-usb.c |   23 +++++++++++++++++++++--
 1 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c
index 1663a66..cb71135 100644
--- a/drivers/usb/phy/phy-mxs-usb.c
+++ b/drivers/usb/phy/phy-mxs-usb.c
@@ -31,6 +31,10 @@
 #define HW_USBPHY_CTRL_SET			0x34
 #define HW_USBPHY_CTRL_CLR			0x38
 
+#define HW_USBPHY_IP				0x90
+#define HW_USBPHY_IP_SET			0x94
+#define HW_USBPHY_IP_CLR			0x98
+
 #define BM_USBPHY_CTRL_SFTRST			BIT(31)
 #define BM_USBPHY_CTRL_CLKGATE			BIT(30)
 #define BM_USBPHY_CTRL_ENAUTOSET_USBCLKS	BIT(26)
@@ -42,6 +46,8 @@
 #define BM_USBPHY_CTRL_ENUTMILEVEL2		BIT(14)
 #define BM_USBPHY_CTRL_ENHOSTDISCONDETECT	BIT(1)
 
+#define BM_USBPHY_IP_FIX                       (BIT(17) | BIT(18))
+
 #define to_mxs_phy(p) container_of((p), struct mxs_phy, phy)
 
 /* Do disconnection between PHY and controller without vbus */
@@ -60,6 +66,14 @@
  */
 #define MXS_PHY_SENDING_SOF_TOO_FAST		BIT(2)
 
+/*
+ * IC has bug fixes logic, they include
+ * MXS_PHY_ABNORMAL_IN_SUSPEND and MXS_PHY_SENDING_SOF_TOO_FAST
+ * which are described at above flags, the RTL will handle it
+ * according to different versions.
+ */
+#define MXS_PHY_NEED_IP_FIX			BIT(3)
+
 struct mxs_phy_data {
 	unsigned int flags;
 };
@@ -70,11 +84,13 @@ static const struct mxs_phy_data imx23_phy_data = {
 
 static const struct mxs_phy_data imx6q_phy_data = {
 	.flags = MXS_PHY_SENDING_SOF_TOO_FAST |
-		MXS_PHY_DISCONNECT_LINE_WITHOUT_VBUS,
+		MXS_PHY_DISCONNECT_LINE_WITHOUT_VBUS |
+		MXS_PHY_NEED_IP_FIX,
 };
 
 static const struct mxs_phy_data imx6sl_phy_data = {
-	.flags = MXS_PHY_DISCONNECT_LINE_WITHOUT_VBUS,
+	.flags = MXS_PHY_DISCONNECT_LINE_WITHOUT_VBUS |
+		MXS_PHY_NEED_IP_FIX,
 };
 
 static const struct of_device_id mxs_phy_dt_ids[] = {
@@ -118,6 +134,9 @@ static int mxs_phy_hw_init(struct mxs_phy *mxs_phy)
 		BM_USBPHY_CTRL_ENUTMILEVEL3,
 	       base + HW_USBPHY_CTRL_SET);
 
+	if (mxs_phy->data->flags & MXS_PHY_NEED_IP_FIX)
+		writel(BM_USBPHY_IP_FIX, base + HW_USBPHY_IP_SET);
+
 	return 0;
 }
 
-- 
1.7.8



^ permalink raw reply related

* [PATCH v10 08/15] usb: phy-mxs: add controller id
From: Peter Chen @ 2014-02-20  5:14 UTC (permalink / raw)
  To: balbi, shawn.guo, robh+dt, grant.likely, pawel.moll, mark.rutland
  Cc: alexander.shishkin, linux-usb, linux-arm-kernel, festevam, marex,
	kernel, m.grzeschik, frank.li, peter.chen, gregkh, devicetree,
	linux-doc
In-Reply-To: <1392873284-9386-1-git-send-email-peter.chen@freescale.com>

It is used to access un-regulator registers according to
different controllers.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
---
 drivers/usb/phy/phy-mxs-usb.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c
index cb71135..3009ab5 100644
--- a/drivers/usb/phy/phy-mxs-usb.c
+++ b/drivers/usb/phy/phy-mxs-usb.c
@@ -106,6 +106,7 @@ struct mxs_phy {
 	struct clk *clk;
 	const struct mxs_phy_data *data;
 	struct regmap *regmap_anatop;
+	int port_id;
 };
 
 static int mxs_phy_hw_init(struct mxs_phy *mxs_phy)
@@ -250,6 +251,11 @@ static int mxs_phy_probe(struct platform_device *pdev)
 		}
 	}
 
+	ret = of_alias_get_id(np, "usbphy");
+	if (ret < 0)
+		dev_dbg(&pdev->dev, "failed to get alias id, errno %d\n", ret);
+	mxs_phy->port_id = ret;
+
 	mxs_phy->phy.io_priv		= base;
 	mxs_phy->phy.dev		= &pdev->dev;
 	mxs_phy->phy.label		= DRIVER_NAME;
-- 
1.7.8



^ permalink raw reply related

* [PATCH v10 09/15] usb: phy: Add set_wakeup API
From: Peter Chen @ 2014-02-20  5:14 UTC (permalink / raw)
  To: balbi, shawn.guo, robh+dt, grant.likely, pawel.moll, mark.rutland
  Cc: alexander.shishkin, linux-usb, linux-arm-kernel, festevam, marex,
	kernel, m.grzeschik, frank.li, peter.chen, gregkh, devicetree,
	linux-doc
In-Reply-To: <1392873284-9386-1-git-send-email-peter.chen@freescale.com>

This API is used to set wakeup enable at PHY registers, in that
case, the PHY can be waken up from suspend due to external events,
like vbus change, dp/dm change and id change.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
---
 include/linux/usb/phy.h |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h
index 6c0b1c5..c2c6f49 100644
--- a/include/linux/usb/phy.h
+++ b/include/linux/usb/phy.h
@@ -111,6 +111,13 @@ struct usb_phy {
 	int	(*set_suspend)(struct usb_phy *x,
 				int suspend);
 
+	/*
+	 * Set wakeup enable for PHY, in that case, the PHY can be
+	 * waken up from suspend status due to external events,
+	 * like vbus change, dp/dm change and id.
+	 */
+	int	(*set_wakeup)(struct usb_phy *x, bool enabled);
+
 	/* notify phy connect status change */
 	int	(*notify_connect)(struct usb_phy *x,
 			enum usb_device_speed speed);
@@ -265,6 +272,15 @@ usb_phy_set_suspend(struct usb_phy *x, int suspend)
 }
 
 static inline int
+usb_phy_set_wakeup(struct usb_phy *x, bool enabled)
+{
+	if (x && x->set_wakeup)
+		return x->set_wakeup(x, enabled);
+	else
+		return 0;
+}
+
+static inline int
 usb_phy_notify_connect(struct usb_phy *x, enum usb_device_speed speed)
 {
 	if (x && x->notify_connect)
-- 
1.7.8



^ permalink raw reply related

* [PATCH v10 10/15] usb: phy-mxs: Add implementation of set_wakeup
From: Peter Chen @ 2014-02-20  5:14 UTC (permalink / raw)
  To: balbi-l0cyMroinI0, shawn.guo-QSEj5FYQhm4dnm+yROfE0A,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8
  Cc: alexander.shishkin-VuQAYsv1563Yd54FQh9/CA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	festevam-Re5JQEeQqe8AvxtiuMwx3w, marex-ynQEQJNshbs,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ, m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ,
	frank.li-KZfg59tc24xl57MIdRCFDg,
	peter.chen-KZfg59tc24xl57MIdRCFDg,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-doc-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1392873284-9386-1-git-send-email-peter.chen-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

When we need the PHY can be waken up by external signals,
we can call this API. Besides, we call mxs_phy_disconnect_line
at this API to close the connection between USB PHY and
controller, after that, the line state from controller is SE0.
Once the PHY is out of power, without calling mxs_phy_disconnect_line,
there are unknown wakeups due to dp/dm floating at device mode.

Signed-off-by: Peter Chen <peter.chen-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
---
 drivers/usb/phy/phy-mxs-usb.c |  116 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 116 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c
index 3009ab5..da2eb6c 100644
--- a/drivers/usb/phy/phy-mxs-usb.c
+++ b/drivers/usb/phy/phy-mxs-usb.c
@@ -31,6 +31,9 @@
 #define HW_USBPHY_CTRL_SET			0x34
 #define HW_USBPHY_CTRL_CLR			0x38
 
+#define HW_USBPHY_DEBUG_SET			0x54
+#define HW_USBPHY_DEBUG_CLR			0x58
+
 #define HW_USBPHY_IP				0x90
 #define HW_USBPHY_IP_SET			0x94
 #define HW_USBPHY_IP_CLR			0x98
@@ -39,6 +42,9 @@
 #define BM_USBPHY_CTRL_CLKGATE			BIT(30)
 #define BM_USBPHY_CTRL_ENAUTOSET_USBCLKS	BIT(26)
 #define BM_USBPHY_CTRL_ENAUTOCLR_USBCLKGATE	BIT(25)
+#define BM_USBPHY_CTRL_ENVBUSCHG_WKUP		BIT(23)
+#define BM_USBPHY_CTRL_ENIDCHG_WKUP		BIT(22)
+#define BM_USBPHY_CTRL_ENDPDMCHG_WKUP		BIT(21)
 #define BM_USBPHY_CTRL_ENAUTOCLR_PHY_PWD	BIT(20)
 #define BM_USBPHY_CTRL_ENAUTOCLR_CLKGATE	BIT(19)
 #define BM_USBPHY_CTRL_ENAUTO_PWRON_PLL		BIT(18)
@@ -48,6 +54,25 @@
 
 #define BM_USBPHY_IP_FIX                       (BIT(17) | BIT(18))
 
+#define BM_USBPHY_DEBUG_CLKGATE			BIT(30)
+
+/* Anatop Registers */
+#define ANADIG_USB1_VBUS_DET_STAT		0x1c0
+#define ANADIG_USB2_VBUS_DET_STAT		0x220
+
+#define ANADIG_USB1_LOOPBACK_SET		0x1e4
+#define ANADIG_USB1_LOOPBACK_CLR		0x1e8
+#define ANADIG_USB2_LOOPBACK_SET		0x244
+#define ANADIG_USB2_LOOPBACK_CLR		0x248
+
+#define BM_ANADIG_USB1_VBUS_DET_STAT_VBUS_VALID	BIT(3)
+#define BM_ANADIG_USB2_VBUS_DET_STAT_VBUS_VALID	BIT(3)
+
+#define BM_ANADIG_USB1_LOOPBACK_UTMI_DIG_TST1	BIT(2)
+#define BM_ANADIG_USB1_LOOPBACK_TSTI_TX_EN	BIT(5)
+#define BM_ANADIG_USB2_LOOPBACK_UTMI_DIG_TST1	BIT(2)
+#define BM_ANADIG_USB2_LOOPBACK_TSTI_TX_EN	BIT(5)
+
 #define to_mxs_phy(p) container_of((p), struct mxs_phy, phy)
 
 /* Do disconnection between PHY and controller without vbus */
@@ -141,6 +166,79 @@ static int mxs_phy_hw_init(struct mxs_phy *mxs_phy)
 	return 0;
 }
 
+/* Return true if the vbus is there */
+static bool mxs_phy_get_vbus_status(struct mxs_phy *mxs_phy)
+{
+	unsigned int vbus_value;
+
+	if (mxs_phy->port_id == 0)
+		regmap_read(mxs_phy->regmap_anatop,
+			ANADIG_USB1_VBUS_DET_STAT,
+			&vbus_value);
+	else if (mxs_phy->port_id == 1)
+		regmap_read(mxs_phy->regmap_anatop,
+			ANADIG_USB2_VBUS_DET_STAT,
+			&vbus_value);
+
+	if (vbus_value & BM_ANADIG_USB1_VBUS_DET_STAT_VBUS_VALID)
+		return true;
+	else
+		return false;
+}
+
+static void __mxs_phy_disconnect_line(struct mxs_phy *mxs_phy, bool disconnect)
+{
+	void __iomem *base = mxs_phy->phy.io_priv;
+	u32 reg;
+
+	if (disconnect)
+		writel_relaxed(BM_USBPHY_DEBUG_CLKGATE,
+			base + HW_USBPHY_DEBUG_CLR);
+
+	if (mxs_phy->port_id == 0) {
+		reg = disconnect ? ANADIG_USB1_LOOPBACK_SET
+			: ANADIG_USB1_LOOPBACK_CLR;
+		regmap_write(mxs_phy->regmap_anatop, reg,
+			BM_ANADIG_USB1_LOOPBACK_UTMI_DIG_TST1 |
+			BM_ANADIG_USB1_LOOPBACK_TSTI_TX_EN);
+	} else if (mxs_phy->port_id == 1) {
+		reg = disconnect ? ANADIG_USB2_LOOPBACK_SET
+			: ANADIG_USB2_LOOPBACK_CLR;
+		regmap_write(mxs_phy->regmap_anatop, reg,
+			BM_ANADIG_USB2_LOOPBACK_UTMI_DIG_TST1 |
+			BM_ANADIG_USB2_LOOPBACK_TSTI_TX_EN);
+	}
+
+	if (!disconnect)
+		writel_relaxed(BM_USBPHY_DEBUG_CLKGATE,
+			base + HW_USBPHY_DEBUG_SET);
+
+	/* Delay some time, and let Linestate be SE0 for controller */
+	if (disconnect)
+		usleep_range(500, 1000);
+}
+
+static void mxs_phy_disconnect_line(struct mxs_phy *mxs_phy, bool on)
+{
+	bool vbus_is_on = false;
+
+	/* If the SoCs don't need to disconnect line without vbus, quit */
+	if (!(mxs_phy->data->flags & MXS_PHY_DISCONNECT_LINE_WITHOUT_VBUS))
+		return;
+
+	/* If the SoCs don't have anatop, quit */
+	if (!mxs_phy->regmap_anatop)
+		return;
+
+	vbus_is_on = mxs_phy_get_vbus_status(mxs_phy);
+
+	if (on && !vbus_is_on)
+		__mxs_phy_disconnect_line(mxs_phy, true);
+	else
+		__mxs_phy_disconnect_line(mxs_phy, false);
+
+}
+
 static int mxs_phy_init(struct usb_phy *phy)
 {
 	int ret;
@@ -185,6 +283,23 @@ static int mxs_phy_suspend(struct usb_phy *x, int suspend)
 	return 0;
 }
 
+static int mxs_phy_set_wakeup(struct usb_phy *x, bool enabled)
+{
+	struct mxs_phy *mxs_phy = to_mxs_phy(x);
+	u32 value = BM_USBPHY_CTRL_ENVBUSCHG_WKUP |
+			BM_USBPHY_CTRL_ENDPDMCHG_WKUP |
+				BM_USBPHY_CTRL_ENIDCHG_WKUP;
+	if (enabled) {
+		mxs_phy_disconnect_line(mxs_phy, true);
+		writel_relaxed(value, x->io_priv + HW_USBPHY_CTRL_SET);
+	} else {
+		writel_relaxed(value, x->io_priv + HW_USBPHY_CTRL_CLR);
+		mxs_phy_disconnect_line(mxs_phy, false);
+	}
+
+	return 0;
+}
+
 static int mxs_phy_on_connect(struct usb_phy *phy,
 		enum usb_device_speed speed)
 {
@@ -265,6 +380,7 @@ static int mxs_phy_probe(struct platform_device *pdev)
 	mxs_phy->phy.notify_connect	= mxs_phy_on_connect;
 	mxs_phy->phy.notify_disconnect	= mxs_phy_on_disconnect;
 	mxs_phy->phy.type		= USB_PHY_TYPE_USB2;
+	mxs_phy->phy.set_wakeup		= mxs_phy_set_wakeup;
 
 	mxs_phy->clk = clk;
 	mxs_phy->data = of_id->data;
-- 
1.7.8


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH v10 11/15] usb: phy-mxs: Add system suspend/resume API
From: Peter Chen @ 2014-02-20  5:14 UTC (permalink / raw)
  To: balbi, shawn.guo, robh+dt, grant.likely, pawel.moll, mark.rutland
  Cc: alexander.shishkin, linux-usb, linux-arm-kernel, festevam, marex,
	kernel, m.grzeschik, frank.li, peter.chen, gregkh, devicetree,
	linux-doc
In-Reply-To: <1392873284-9386-1-git-send-email-peter.chen@freescale.com>

We need this to keep PHY's power on or off during the system
suspend mode. If we need to enable USB wakeup, then we
must keep PHY's power being on during the system suspend mode.
Otherwise, we need to keep PHY's power being off to save power.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
---
 drivers/usb/phy/phy-mxs-usb.c |   61 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 61 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c
index da2eb6c..31ef59f 100644
--- a/drivers/usb/phy/phy-mxs-usb.c
+++ b/drivers/usb/phy/phy-mxs-usb.c
@@ -57,6 +57,10 @@
 #define BM_USBPHY_DEBUG_CLKGATE			BIT(30)
 
 /* Anatop Registers */
+#define ANADIG_ANA_MISC0			0x150
+#define ANADIG_ANA_MISC0_SET			0x154
+#define ANADIG_ANA_MISC0_CLR			0x158
+
 #define ANADIG_USB1_VBUS_DET_STAT		0x1c0
 #define ANADIG_USB2_VBUS_DET_STAT		0x220
 
@@ -65,6 +69,9 @@
 #define ANADIG_USB2_LOOPBACK_SET		0x244
 #define ANADIG_USB2_LOOPBACK_CLR		0x248
 
+#define BM_ANADIG_ANA_MISC0_STOP_MODE_CONFIG	BIT(12)
+#define BM_ANADIG_ANA_MISC0_STOP_MODE_CONFIG_SL BIT(11)
+
 #define BM_ANADIG_USB1_VBUS_DET_STAT_VBUS_VALID	BIT(3)
 #define BM_ANADIG_USB2_VBUS_DET_STAT_VBUS_VALID	BIT(3)
 
@@ -134,6 +141,16 @@ struct mxs_phy {
 	int port_id;
 };
 
+static inline bool is_imx6q_phy(struct mxs_phy *mxs_phy)
+{
+	return mxs_phy->data == &imx6q_phy_data;
+}
+
+static inline bool is_imx6sl_phy(struct mxs_phy *mxs_phy)
+{
+	return mxs_phy->data == &imx6sl_phy_data;
+}
+
 static int mxs_phy_hw_init(struct mxs_phy *mxs_phy)
 {
 	int ret;
@@ -387,6 +404,8 @@ static int mxs_phy_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, mxs_phy);
 
+	device_set_wakeup_capable(&pdev->dev, true);
+
 	ret = usb_add_phy_dev(&mxs_phy->phy);
 	if (ret)
 		return ret;
@@ -403,6 +422,47 @@ static int mxs_phy_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_PM_SLEEP
+static void mxs_phy_enable_ldo_in_suspend(struct mxs_phy *mxs_phy, bool on)
+{
+	unsigned int reg = on ? ANADIG_ANA_MISC0_SET : ANADIG_ANA_MISC0_CLR;
+
+	/* If the SoCs don't have anatop, quit */
+	if (!mxs_phy->regmap_anatop)
+		return;
+
+	if (is_imx6q_phy(mxs_phy))
+		regmap_write(mxs_phy->regmap_anatop, reg,
+			BM_ANADIG_ANA_MISC0_STOP_MODE_CONFIG);
+	else if (is_imx6sl_phy(mxs_phy))
+		regmap_write(mxs_phy->regmap_anatop,
+			reg, BM_ANADIG_ANA_MISC0_STOP_MODE_CONFIG_SL);
+}
+
+static int mxs_phy_system_suspend(struct device *dev)
+{
+	struct mxs_phy *mxs_phy = dev_get_drvdata(dev);
+
+	if (device_may_wakeup(dev))
+		mxs_phy_enable_ldo_in_suspend(mxs_phy, true);
+
+	return 0;
+}
+
+static int mxs_phy_system_resume(struct device *dev)
+{
+	struct mxs_phy *mxs_phy = dev_get_drvdata(dev);
+
+	if (device_may_wakeup(dev))
+		mxs_phy_enable_ldo_in_suspend(mxs_phy, false);
+
+	return 0;
+}
+#endif /* CONFIG_PM_SLEEP */
+
+static SIMPLE_DEV_PM_OPS(mxs_phy_pm, mxs_phy_system_suspend,
+		mxs_phy_system_resume);
+
 static struct platform_driver mxs_phy_driver = {
 	.probe = mxs_phy_probe,
 	.remove = mxs_phy_remove,
@@ -410,6 +470,7 @@ static struct platform_driver mxs_phy_driver = {
 		.name = DRIVER_NAME,
 		.owner	= THIS_MODULE,
 		.of_match_table = mxs_phy_dt_ids,
+		.pm = &mxs_phy_pm,
 	 },
 };
 
-- 
1.7.8



^ permalink raw reply related

* [PATCH v10 12/15] usb: phy-mxs: Add sync time after controller clear phcd
From: Peter Chen @ 2014-02-20  5:14 UTC (permalink / raw)
  To: balbi-l0cyMroinI0, shawn.guo-QSEj5FYQhm4dnm+yROfE0A,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8
  Cc: alexander.shishkin-VuQAYsv1563Yd54FQh9/CA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	festevam-Re5JQEeQqe8AvxtiuMwx3w, marex-ynQEQJNshbs,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ, m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ,
	frank.li-KZfg59tc24xl57MIdRCFDg,
	peter.chen-KZfg59tc24xl57MIdRCFDg,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-doc-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1392873284-9386-1-git-send-email-peter.chen-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

After clear portsc.phcd, PHY needs 200us stable time for switch
32K clock to AHB clock.

Signed-off-by: Peter Chen <peter.chen-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
---
 drivers/usb/phy/phy-mxs-usb.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c
index 31ef59f..c42bdf0 100644
--- a/drivers/usb/phy/phy-mxs-usb.c
+++ b/drivers/usb/phy/phy-mxs-usb.c
@@ -151,6 +151,15 @@ static inline bool is_imx6sl_phy(struct mxs_phy *mxs_phy)
 	return mxs_phy->data == &imx6sl_phy_data;
 }
 
+/*
+ * PHY needs some 32K cycles to switch from 32K clock to
+ * bus (such as AHB/AXI, etc) clock.
+ */
+static void mxs_phy_clock_switch_delay(void)
+{
+	usleep_range(300, 400);
+}
+
 static int mxs_phy_hw_init(struct mxs_phy *mxs_phy)
 {
 	int ret;
@@ -261,6 +270,7 @@ static int mxs_phy_init(struct usb_phy *phy)
 	int ret;
 	struct mxs_phy *mxs_phy = to_mxs_phy(phy);
 
+	mxs_phy_clock_switch_delay();
 	ret = clk_prepare_enable(mxs_phy->clk);
 	if (ret)
 		return ret;
@@ -289,6 +299,7 @@ static int mxs_phy_suspend(struct usb_phy *x, int suspend)
 		       x->io_priv + HW_USBPHY_CTRL_SET);
 		clk_disable_unprepare(mxs_phy->clk);
 	} else {
+		mxs_phy_clock_switch_delay();
 		ret = clk_prepare_enable(mxs_phy->clk);
 		if (ret)
 			return ret;
-- 
1.7.8


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH v10 13/15] ARM: dts: mxs: add mxs phy controller id
From: Peter Chen @ 2014-02-20  5:14 UTC (permalink / raw)
  To: balbi, shawn.guo, robh+dt, grant.likely, pawel.moll, mark.rutland
  Cc: alexander.shishkin, linux-usb, linux-arm-kernel, festevam, marex,
	kernel, m.grzeschik, frank.li, peter.chen, gregkh, devicetree,
	linux-doc
In-Reply-To: <1392873284-9386-1-git-send-email-peter.chen@freescale.com>

We need to use controller id to access different register regions
for mxs phy.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 arch/arm/boot/dts/imx23.dtsi |    1 +
 arch/arm/boot/dts/imx28.dtsi |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/imx23.dtsi b/arch/arm/boot/dts/imx23.dtsi
index 581b754..8a99a64 100644
--- a/arch/arm/boot/dts/imx23.dtsi
+++ b/arch/arm/boot/dts/imx23.dtsi
@@ -23,6 +23,7 @@
 		serial1 = &auart1;
 		spi0 = &ssp0;
 		spi1 = &ssp1;
+		usbphy0 = &usbphy0;
 	};
 
 	cpus {
diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi
index f8e9b20..7da22b3 100644
--- a/arch/arm/boot/dts/imx28.dtsi
+++ b/arch/arm/boot/dts/imx28.dtsi
@@ -32,6 +32,8 @@
 		serial4 = &auart4;
 		spi0 = &ssp1;
 		spi1 = &ssp2;
+		usbphy0 = &usbphy0;
+		usbphy1 = &usbphy1;
 	};
 
 	cpus {
-- 
1.7.8



^ permalink raw reply related

* [PATCH v10 14/15] ARM: dts: imx6: add anatop phandle for usbphy
From: Peter Chen @ 2014-02-20  5:14 UTC (permalink / raw)
  To: balbi, shawn.guo, robh+dt, grant.likely, pawel.moll, mark.rutland
  Cc: alexander.shishkin, linux-usb, linux-arm-kernel, festevam, marex,
	kernel, m.grzeschik, frank.li, peter.chen, gregkh, devicetree,
	linux-doc
In-Reply-To: <1392873284-9386-1-git-send-email-peter.chen@freescale.com>

Add anatop phandle for usbphy

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 arch/arm/boot/dts/imx6qdl.dtsi |    2 ++
 arch/arm/boot/dts/imx6sl.dtsi  |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi
index fb28b2e..047b147 100644
--- a/arch/arm/boot/dts/imx6qdl.dtsi
+++ b/arch/arm/boot/dts/imx6qdl.dtsi
@@ -557,6 +557,7 @@
 				reg = <0x020c9000 0x1000>;
 				interrupts = <0 44 0x04>;
 				clocks = <&clks 182>;
+				fsl,anatop = <&anatop>;
 			};
 
 			usbphy2: usbphy@020ca000 {
@@ -564,6 +565,7 @@
 				reg = <0x020ca000 0x1000>;
 				interrupts = <0 45 0x04>;
 				clocks = <&clks 183>;
+				fsl,anatop = <&anatop>;
 			};
 
 			snvs@020cc000 {
diff --git a/arch/arm/boot/dts/imx6sl.dtsi b/arch/arm/boot/dts/imx6sl.dtsi
index 28558f1..30322b5 100644
--- a/arch/arm/boot/dts/imx6sl.dtsi
+++ b/arch/arm/boot/dts/imx6sl.dtsi
@@ -489,6 +489,7 @@
 				reg = <0x020c9000 0x1000>;
 				interrupts = <0 44 0x04>;
 				clocks = <&clks IMX6SL_CLK_USBPHY1>;
+				fsl,anatop = <&anatop>;
 			};
 
 			usbphy2: usbphy@020ca000 {
@@ -496,6 +497,7 @@
 				reg = <0x020ca000 0x1000>;
 				interrupts = <0 45 0x04>;
 				clocks = <&clks IMX6SL_CLK_USBPHY2>;
+				fsl,anatop = <&anatop>;
 			};
 
 			snvs@020cc000 {
-- 
1.7.8



^ permalink raw reply related

* [PATCH v10 15/15] ARM: dts: imx6: add mxs phy controller id
From: Peter Chen @ 2014-02-20  5:14 UTC (permalink / raw)
  To: balbi-l0cyMroinI0, shawn.guo-QSEj5FYQhm4dnm+yROfE0A,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8
  Cc: alexander.shishkin-VuQAYsv1563Yd54FQh9/CA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	festevam-Re5JQEeQqe8AvxtiuMwx3w, marex-ynQEQJNshbs,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ, m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ,
	frank.li-KZfg59tc24xl57MIdRCFDg,
	peter.chen-KZfg59tc24xl57MIdRCFDg,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-doc-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1392873284-9386-1-git-send-email-peter.chen-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

We need to use controller id to access different register regions
for mxs phy.

Signed-off-by: Peter Chen <peter.chen-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Signed-off-by: Shawn Guo <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
 arch/arm/boot/dts/imx6qdl.dtsi |    2 ++
 arch/arm/boot/dts/imx6sl.dtsi  |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi
index 047b147..581c4c9 100644
--- a/arch/arm/boot/dts/imx6qdl.dtsi
+++ b/arch/arm/boot/dts/imx6qdl.dtsi
@@ -33,6 +33,8 @@
 		spi1 = &ecspi2;
 		spi2 = &ecspi3;
 		spi3 = &ecspi4;
+		usbphy0 = &usbphy1;
+		usbphy1 = &usbphy2;
 	};
 
 	intc: interrupt-controller@00a01000 {
diff --git a/arch/arm/boot/dts/imx6sl.dtsi b/arch/arm/boot/dts/imx6sl.dtsi
index 30322b5..a06d939 100644
--- a/arch/arm/boot/dts/imx6sl.dtsi
+++ b/arch/arm/boot/dts/imx6sl.dtsi
@@ -27,6 +27,8 @@
 		spi1 = &ecspi2;
 		spi2 = &ecspi3;
 		spi3 = &ecspi4;
+		usbphy0 = &usbphy1;
+		usbphy1 = &usbphy2;
 	};
 
 	cpus {
-- 
1.7.8


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox