mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Maciej S. Szmigiero" <mail@maciej.szmigiero.name>
To: Peter Chen <peter.chen@freescale.com>
Cc: USB list <linux-usb@vger.kernel.org>,
	Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Markus Pargmann <mpa@pengutronix.de>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Fabio Estevam <festevam@gmail.com>,
	Alan Stern <stern@rowland.harvard.edu>
Subject: Re: [PATCH] usb: ci_hdrc_imx: add optional hub clock
Date: Wed, 24 Jun 2015 18:27:10 +0200	[thread overview]
Message-ID: <558ADA5E.3070902@maciej.szmigiero.name> (raw)
In-Reply-To: <20150623025534.GA15147@shlinux2>

Hi Peter,

W dniu 23.06.2015 04:55, Peter Chen pisze:
> On Mon, Jun 22, 2015 at 12:54:14AM +0800, Maciej S. Szmigiero wrote:
>> This patch adds ability to define optional clock of connected
>> USB hub to ChipIdea i.MX usb controller driver.
>>
>> This is needed for example for UDOO board.
>> Previously, this board DT file used a fact that non-core registers
>> of this USB controller have a separate driver (usbmisc_imx) which
>> did allow defining a separate clock.
>>
>> Because the non-core registers are in fact using the same clock as
>> main controller this allowed to use one of such clock definitions
>> to enable USB hub clock instead.
>>
>> However, since commit 73dea4a912b2
>> ("usb: chipidea: usbmisc_imx: delete clock information") this
>> possibility no longer exists and loading USB support on this board
>> results in a hard SoC lockup.
>>
>> Note that this is not specific to particular USB hub chip used,
>> rather than to a particular board.
>> Since this is a DT-based board there is no board platform file to
>> put such clock enable.
>> Also, USB bus devices aren't instantiated in DT file since it is an
>> enumerable bus.
>>
>> NOP PHY also can't be used as clock consumer since this
>> USB controller needs a true MXS phy definition, which accepts only
>> one clock (different from USB controller one).
>>
>> Based on a patch previously submitted by Fabio Estevam, with consent.
>>
>> Signed-off-by: Maciej Szmigiero <mail@maciej.szmigiero.name>
>>
(..)
> Hi Maciej,
> 
> As I said before, the USB HUB is just an USB peripheral, we should
> not put a peripheral's clock information to controller driver, I think
> hub driver should take responsibilities for it, just like other usb
> pheripheral drivers, like usb modem, etc. You can talk it with Alan
> Stern about it.

I understand you position, but there is a problem with this solution
that USB devices - including hubs - as devices on an enumerable bus
don't have DT bindings to put such clock handle in,
since they are instantiated by their bus scanning code. 

If such devices would be added to DT at least there would be need to
somehow match the discovered device with its DT counterpart.
In case of USB this would need address like controller X,
port x (or port x,y,z in case of multiple hubs in between controller
and device).

As far I see there is nothing like this in USB core yet.

Of course, there is still possibly to add something like a generic
OF USB hub driver which will take care of configuring extra clocks,
pins, GPIOs, etc. but which will be otherwise unrelated to normal
USB hub driver.

Best regards,
Maciej Szmigiero


      reply	other threads:[~2015-06-24 16:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-21 16:54 Maciej S. Szmigiero
2015-06-23  2:55 ` Peter Chen
2015-06-24 16:27   ` Maciej S. Szmigiero [this message]

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=558ADA5E.3070902@maciej.szmigiero.name \
    --to=mail@maciej.szmigiero.name \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=galak@codeaurora.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mpa@pengutronix.de \
    --cc=pawel.moll@arm.com \
    --cc=peter.chen@freescale.com \
    --cc=robh+dt@kernel.org \
    --cc=stern@rowland.harvard.edu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®