All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	barebox@lists.infradead.org, Jason Cooper <jason@lakedaemon.net>,
	Andrew Lunn <andrew@lunn.ch>
Subject: Re: [PATCH RFC 1/4] usb: add Marvell MVEBU USB support
Date: Mon, 30 Jun 2014 09:46:22 +0200	[thread overview]
Message-ID: <53B115CE.1080801@gmail.com> (raw)
In-Reply-To: <20140630063006.GD14257@pengutronix.de>

On 06/30/2014 08:30 AM, Sascha Hauer wrote:
>> +	if (usb->mode == USB_DR_MODE_HOST &&
>> +	    IS_ENABLED(CONFIG_USB_MVEBU_HOST)) {
>> +		ret = regulator_enable(usb->vbus);
>> +		if (ret)
>> +			return ret;
>> +		ret = ehci_register(dev, &usb->ehci);
>> +		if (ret)
>> +			regulator_disable(usb->vbus);
>> +	} else if (usb->mode == USB_DR_MODE_PERIPHERAL &&
>> +		   IS_ENABLED(CONFIG_USB_MVEBU_DEVICE)) {
>> +		ret = regulator_disable(usb->vbus);
>> +		if (ret)
>> +			return ret;
>> +		ret = ci_udc_register(dev, usb->base);
>> +	} else {
>> +		dev_err(dev, "Unsupported USB role\n");
>> +		ret = -ENODEV;
>> +	}
> 
> This should probably be shared between i.MX and mvebu. I have a patch
> somewhere which implements a device parameter to switch between host and
> device mode. It could be used for both i.MX and mvebu.

Yes. As Jason already mentioned we probably should have a pure ChipIdea
probe() without any vendor-specific stuff.

For Marvell SoCs there is a set of registers that has to be configured
for DMA accesses, but I think we can move them into the bus driver
instead. We could have a list of compatibles and register offsets in
bus/mvebu.c that takes care of the registers on MVEBU for fooHCI IP.
I'll have to double-check if the register content is retained during
clk gating.

Having a ChipIdea probe() will also allow i.MX to reuse the same
function after it has set up the Freescale specific stuff.

> Otherwise the series looks fine to me.

Ok. BTW, I have a similar patch set for SDHCI that I'll send as RFC
in a day or two.

Sebastian



_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2014-06-30  7:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-25 14:08 [PATCH RFC 0/4] MVEBU SoC full USB support Sebastian Hesselbarth
2014-06-25 14:08 ` [PATCH RFC 1/4] usb: add Marvell MVEBU " Sebastian Hesselbarth
2014-06-30  6:30   ` Sascha Hauer
2014-06-30  7:46     ` Sebastian Hesselbarth [this message]
2014-06-25 14:08 ` [PATCH RFC 2/4] ARM: dts: add new USB nodes to Kirkwood Guruplug Sebastian Hesselbarth
2014-06-25 14:08 ` [PATCH RFC 3/4] ARM: dts: add new USB nodes to Dove CuBox Sebastian Hesselbarth
2014-06-25 14:08 ` [PATCH RFC 4/4] ARM: dts: add new USB nodes to Armada 370 Mirabox Sebastian Hesselbarth
2014-06-25 19:18 ` [PATCH RFC 0/4] MVEBU SoC full USB support Jason Cooper
2014-06-25 19:27   ` Sebastian Hesselbarth
2014-06-26 12:08     ` Sebastian Hesselbarth
2014-06-25 19:40 ` Thomas Petazzoni

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=53B115CE.1080801@gmail.com \
    --to=sebastian.hesselbarth@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=barebox@lists.infradead.org \
    --cc=jason@lakedaemon.net \
    --cc=s.hauer@pengutronix.de \
    --cc=thomas.petazzoni@free-electrons.com \
    /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.