All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kostya Porotchkin <kostap@marvell.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [EXT] Re: [PATCH v2 4/7] mvebu: usb: xhci: Add support for VBUS controlled by GPIO
Date: Tue, 24 Jan 2017 14:57:44 +0000	[thread overview]
Message-ID: <1485270039019.33080@marvell.com> (raw)
In-Reply-To: <0eae9dc5-5837-fcbe-0f31-7a9127830706@denx.de>

Hi, Marek,
________________________________________
From: Marek Vasut <marex@denx.de>
Sent: Tuesday, January 24, 2017 16:11
To: Stefan Roese; Kostya Porotchkin; u-boot at lists.denx.de
Cc: Haim Boot; Hanna Hawa; Omri Itach; Nadav Haklai; Neta Zur Hershkovits; Igal Liberman
Subject: [EXT] Re: [U-Boot] [PATCH v2 4/7] mvebu: usb: xhci: Add support for VBUS controlled by GPIO

----------------------------------------------------------------------
On 01/24/2017 02:53 PM, Stefan Roese wrote:
> Hi Marek,
>
> (adding Marek as USB custodian to Cc)
>
> On 08.01.2017 15:52, kostap at marvell.com wrote:
>> From: Konstantin Porotchkin <kostap@marvell.com>
>>
>> Add support for "marvell,vbus-gpio" property to mvebu XHCI
>> host adapter driver.
>> This option is valid when CONFIG_DM_GPIO=y
>>
>> Change-Id: I930b3ebe001e50ae8d5abe1f3c774bcdb1739e64
>> Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
>> Cc: Stefan Roese <sr@denx.de>
>> Cc: Nadav Haklai <nadavh@marvell.com>
>> Cc: Neta Zur Hershkovits <neta@marvell.com>
>> Cc: Omri Itach <omrii@marvell.com>
>> Cc: Igal Liberman <igall@marvell.com>
>> Cc: Haim Boot <hayim@marvell.com>
>> Cc: Hanna Hawa <hannah@marvell.com>
>> ---
>> Changes for v2:
>> - Move VBUS GPIO support from board-specific function to mvebu XHCI
>> driver
>> - Increase delay after VBUS GPIO activation
>>
>>  doc/device-tree-bindings/usb/marvell.xhci-usb.txt | 29
>> +++++++++++++++++++++++
>>  drivers/usb/host/xhci-mvebu.c                     | 14 +++++++++++
>>  2 files changed, 43 insertions(+)
>>  create mode 100644 doc/device-tree-bindings/usb/marvell.xhci-usb.txt
>>
>> diff --git a/doc/device-tree-bindings/usb/marvell.xhci-usb.txt
>> b/doc/device-tree-bindings/usb/marvell.xhci-usb.txt
>> new file mode 100644
>> index 0000000..b0a53ad
>> --- /dev/null
>> +++ b/doc/device-tree-bindings/usb/marvell.xhci-usb.txt
>> @@ -0,0 +1,29 @@
>> +Marvell SOC USB controllers
>> +
>> +This controller is integrated in Armada 3700/8K.
>> +It uses the same properties as a generic XHCI host controller
>> +
>> +Required properties :
>> + - compatible: should be one or more of:
>> +   - "marvell,armada3700-xhci", "generic-xhci" for Armada 37xx SoCs
>> +   - "marvell,armada-8k-xhci", "generic-xhci" for Armada A8K SoCs
>> + - reg: should contain address and length of the standard XHCI
>> +    register set for the device.
>> + - interrupts: one XHCI interrupt should be described here.
>> +
>> +Optional properties:
>> + - clocks: reference to a clock

>Reference clock are optional ?
Actually the basis for this file was taken from kernel documentation and clocks are listed as "optional" here.

>> + - marvell,vbus-gpio : If present, specifies a gpio that needs to be
>> +   activated for the bus to be powered.

>Shouldn't this be a regulator instead ?

If it is required, I can implement the regulator method.
However as you mentioned the regulator core has to be extended for the ramp-up time support.
This is kind of a shortcut, that enables immediate community board support.
The same GPIO VBUS implementation exists in Marvell SDK.

>> +Example:
>> +    cpm_usb3_0: usb3 at 500000 {
>> +        compatible = "marvell,armada-8k-xhci",
>> +                 "generic-xhci";
>> +        reg = <0x500000 0x4000>;
>> +        interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
>> +        clocks = <&cpm_syscon0 1 22>;
>> +        marvell,vbus-gpio = <&cpm_gpio1 15 GPIO_ACTIVE_HIGH>;
>> +        status = "disabled";
>> +    };
>> +
>> diff --git a/drivers/usb/host/xhci-mvebu.c
>> b/drivers/usb/host/xhci-mvebu.c
>> index 46eb937..64801e7 100644
>> --- a/drivers/usb/host/xhci-mvebu.c
>> +++ b/drivers/usb/host/xhci-mvebu.c
>> @@ -45,6 +45,20 @@ static int xhci_usb_probe(struct udevice *dev)
>>      struct mvebu_xhci *ctx = dev_get_priv(dev);
>>      struct xhci_hcor *hcor;
>>      int len;
>> +#ifdef CONFIG_DM_GPIO
>> +    struct gpio_desc vbus_gpio;
>> +
>> +    gpio_request_by_name(dev, "marvell,vbus-gpio", 0, &vbus_gpio,
>> +                 GPIOD_IS_OUT);
>> +
>> +    if (dm_gpio_is_valid(&vbus_gpio)) {
>> +        dm_gpio_set_value(&vbus_gpio, 1);
>> +        /* Wait for the GPIO VBUS output set */
>> +        mdelay(500);

>I think if the GPIO was instead a regulator-fixed, the regulator could
>handle the delay with something like "ramp-up" delay. But I don't think
>we do support the ramp-up delay yet ... maybe this can be easily added?

So I assume you suggest to drop this one and implement the VBUS through regulator GPIO?

>> +    }
>> +#else
>> +    debug("USB VBUS on GPIO support is missing\n");
>> +#endif /* CONFIG_DM_GPIO */
>>
>>      ctx->hcd = (struct xhci_hccr *)plat->hcd_base;
>>      len = HC_LENGTH(xhci_readl(&ctx->hcd->cr_capbase));
>>
>
> Marek, do you have some comments on this USB related patch? If not,
> are you okay with me pushing it via the Marvell repository?

>I have one .

Thank you for your review!

Best Regards
Konstantin Porotchkin


--
Best regards,
Marek Vasut

  reply	other threads:[~2017-01-24 14:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-08 14:52 [U-Boot] [PATCH v2 0/7] arm64: mvebu: Add support for A8K community board kostap at marvell.com
2017-01-08 14:52 ` [U-Boot] [PATCH v2 1/7] arm64: mvebu: Update bubt command MMC block device access kostap at marvell.com
2017-01-25  7:41   ` Stefan Roese
2017-01-08 14:52 ` [U-Boot] [PATCH v2 2/7] arm64: mvebu: gpio: Add GPIO nodes to A8K family devices kostap at marvell.com
2017-01-08 14:52 ` [U-Boot] [PATCH v2 3/7] arm64: mvebu: dts: Add i2c1 pin definitions to CPM kostap at marvell.com
2017-01-08 14:52 ` [U-Boot] [PATCH v2 4/7] mvebu: usb: xhci: Add support for VBUS controlled by GPIO kostap at marvell.com
2017-01-24 13:53   ` Stefan Roese
2017-01-24 14:11     ` Marek Vasut
2017-01-24 14:57       ` Kostya Porotchkin [this message]
2017-01-24 15:03         ` [U-Boot] [EXT] " Marek Vasut
2017-02-06 13:26         ` Kostya Porotchkin
2017-02-06 19:32           ` Marek Vasut
2017-01-08 14:52 ` [U-Boot] [PATCH v2 5/7] mvebu: pcie: Add support for GPIO reset for PCIe device kostap at marvell.com
2017-01-08 14:52 ` [U-Boot] [PATCH v2 6/7] arm64: mvebu: dts: Add DTS file for MACCHIATOBin board kostap at marvell.com
2017-01-08 14:52 ` [U-Boot] [PATCH v2 7/7] arm64: mvebu: Add default configuraton " kostap at marvell.com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1485270039019.33080@marvell.com \
    --to=kostap@marvell.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.