All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Alistair Popple <alistair@popple.id.au>
Cc: linuxppc-dev@lists.ozlabs.org, linux-usb@vger.kernel.org,
	Alan Stern <stern@rowland.harvard.edu>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>
Subject: Re: [RFC PATCH] ehci-platform: Merge ppc-of EHCI driver into the ehci-platform driver
Date: Thu, 07 Nov 2013 06:57:00 +1100	[thread overview]
Message-ID: <1383767820.4776.124.camel@pasglop> (raw)
In-Reply-To: <1690980.YlPWToa1rW@mexican>

On Wed, 2013-11-06 at 18:39 +1100, Alistair Popple wrote:

> diff --git a/arch/powerpc/boot/dts/sequoia.dts 
> b/arch/powerpc/boot/dts/sequoia.dts
> index b1d3292..e28371e 100644
> --- a/arch/powerpc/boot/dts/sequoia.dts
> +++ b/arch/powerpc/boot/dts/sequoia.dts
> @@ -153,7 +153,7 @@
>  		};
>  
>  		USB0: ehci@e0000300 {
> -			compatible = "ibm,usb-ehci-440epx", "usb-ehci";
> +			compatible = "ibm,usb-ehci-440epx";

Compatible properties are string lists so it *should* be ok to have all
of them in the list. However I do remember Russell mentioning a problem
with the current matching code so adding him on CC for comments.


> +/*
> + * 440EPx Errata USBH_3
> + * Fix: Enable Break Memory Transfer (BMT) in INSNREG3
> + */
> +#define PPC440EPX_EHCI0_INSREG_BMT	(0x1 << 0)
> +static int
> +ppc44x_enable_bmt(struct device_node *dn)
> +{
> +	__iomem u32 *insreg_virt;
> +
> +	insreg_virt = of_iomap(dn, 1);
> +	if (!insreg_virt)
> +		return  -EINVAL;
> +
> +	out_be32(insreg_virt + 3, PPC440EPX_EHCI0_INSREG_BMT);
> +
> +	iounmap(insreg_virt);
> +	return 0;
> +}
> +

I would go even further and add the 44x workarounds to the normal
platform device, with a compatible check in there. That isn't the
first time we add quirks to an existing driver.

> +	/* Initialise platform data from device tree if available. */
> +	if (!dn) {

That was supposed to be if (dn) no ?

> +		if (of_get_property(dn, "big-endian", NULL)) {
> +			pdata->big_endian_mmio = 1;
> +			pdata->big_endian_desc = 1;
> +		}
> +		if (of_get_property(dn, "big-endian-regs", NULL))
> +			pdata->big_endian_mmio = 1;
> +		if (of_get_property(dn, "big-endian-desc", NULL))
> +			pdata->big_endian_desc = 1;
> +	}
> +
>  	irq = platform_get_irq(dev, 0);
>  	if (irq < 0) {
>  		dev_err(&dev->dev, "no irq provided");
> @@ -203,9 +216,10 @@ static int ehci_platform_resume(struct device *dev)
>  #define ehci_platform_resume	NULL
>  #endif /* CONFIG_PM */
>  
> -static const struct of_device_id vt8500_ehci_ids[] = {
> +static const struct of_device_id ehci_platform_ids[] = {
>  	{ .compatible = "via,vt8500-ehci", },
>  	{ .compatible = "wm,prizm-ehci", },
> +	{ .compatible = "usb-ehci", },
>  	{}
>  };

Cheers,
Ben.

  parent reply	other threads:[~2013-11-06 19:57 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-05  5:31 [PATCH 1/7] IBM Akebono: Add support to AHCI platform driver Alistair Popple
2013-11-05  5:31 ` [PATCH 2/7] IBM Akebono: Add a SDHCI " Alistair Popple
2013-11-05  5:31 ` [PATCH 3/7] IBM Akebono: Add support for a new PHY to the IBM emac driver Alistair Popple
2013-11-05 18:16   ` Ben Hutchings
2013-11-05 18:16     ` Ben Hutchings
2013-11-05 19:54     ` Benjamin Herrenschmidt
2013-11-05 19:54       ` Benjamin Herrenschmidt
2013-11-05 23:11       ` Ben Hutchings
2013-11-05 23:11         ` Ben Hutchings
2013-11-06  1:34         ` Alistair Popple
2013-11-06  1:34           ` Alistair Popple
2013-11-06 16:40           ` Ben Hutchings
2013-11-06 16:40             ` Ben Hutchings
2013-11-07  2:39             ` Alistair Popple
2013-11-07  2:39               ` Alistair Popple
2013-11-05 18:47   ` Florian Fainelli
2013-11-05 18:47     ` Florian Fainelli
2013-11-06  0:08     ` Alistair Popple
2013-11-06  0:08       ` Alistair Popple
2013-11-06  0:16       ` Florian Fainelli
2013-11-06  0:16         ` Florian Fainelli
2013-11-06  1:38         ` Alistair Popple
2013-11-06  1:38           ` Alistair Popple
2013-11-06  2:17           ` Benjamin Herrenschmidt
2013-11-06  2:17             ` Benjamin Herrenschmidt
2013-11-06  2:23             ` Florian Fainelli
2013-11-06  2:23               ` Florian Fainelli
2013-11-05  5:31 ` [PATCH 4/7] IBM Akebono: Add support to the OHCI platform driver for Akebono Alistair Popple
2013-11-05 15:04   ` Alan Stern
2013-11-07  3:34     ` Alistair Popple
2013-11-07  4:55       ` Benjamin Herrenschmidt
2013-11-07 15:04       ` Alan Stern
2013-11-05  5:31 ` [PATCH 5/7] IBM Akebono: Add support to the EHCI " Alistair Popple
2013-11-05 15:04   ` Alan Stern
2013-11-05 19:52     ` Benjamin Herrenschmidt
2013-11-06  3:50       ` Alistair Popple
2013-11-06  3:58         ` Benjamin Herrenschmidt
2013-11-06  7:39           ` [RFC PATCH] ehci-platform: Merge ppc-of EHCI driver into the ehci-platform driver Alistair Popple
2013-11-06 16:14             ` Alan Stern
2013-11-07  2:34               ` Alistair Popple
2013-11-06 19:57             ` Benjamin Herrenschmidt [this message]
2013-11-07  2:35               ` Alistair Popple
2013-11-05  5:31 ` [PATCH 6/7] IBM Currituck: Clean up board specific code before adding Akebono code Alistair Popple
2013-11-05  5:31 ` [PATCH 7/7] IBM Akebono: Add the Akebono platform Alistair Popple

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=1383767820.4776.124.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=alistair@popple.id.au \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=linuxppc-dev@lists.ozlabs.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 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.