devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Sneeker Yeh <sneeker.yeh@gmail.com>
Cc: 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>, Felipe Balbi <balbi@ti.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Mathias Nyman <mathias.nyman@intel.com>,
	Grant Likely <grant.likely@linaro.org>,
	Alan Stern <stern@rowland.harvard.edu>,
	Paul Bolle <pebolle@tiscali.nl>,
	Hans de Goede <hdegoede@redhat.com>,
	Thomas Pugliese <thomas.pugliese@gmail.com>,
	David Mosberger <davidm@egauge.net>,
	Peter Griffin <peter.griffin@linaro.org>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	Andrew Bresticker <abrestic@chromium.org>,
	Gregory CLEMENT <gregory.clement@free-electrons.com>,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-usb@vger.kernel.org, linux-omap@vger.ker
Subject: Re: [PATCH 1/3] usb: host: f_usb20ho: add support for Fujitsu ehci/ohci USB 2.0 host controller
Date: Tue, 16 Dec 2014 10:06:15 +0100	[thread overview]
Message-ID: <94603263.7VVvg5Qn7O@wuerfel> (raw)
In-Reply-To: <1418695828-605-2-git-send-email-Sneeker.Yeh@tw.fujitsu.com>

On Tuesday 16 December 2014 10:10:26 Sneeker Yeh wrote:
> This patch adds support for EHCI compliant Host controller found
> on Fujitsu Socs.
> 
> Signed-off-by: Sneeker Yeh <Sneeker.Yeh@tw.fujitsu.com>
> ---
>  .../devicetree/bindings/usb/fujitsu-ehci.txt       |   22 ++
>  drivers/usb/host/Kconfig                           |   11 +
>  drivers/usb/host/Makefile                          |    1 +
>  drivers/usb/host/f_usb20ho_hcd.c                   |  306 ++++++++++++++++++++
>  drivers/usb/host/f_usb20ho_hcd.h                   |   35 +++
>  5 files changed, 375 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/usb/fujitsu-ehci.txt
>  create mode 100644 drivers/usb/host/f_usb20ho_hcd.c
>  create mode 100644 drivers/usb/host/f_usb20ho_hcd.h
> 
> diff --git a/Documentation/devicetree/bindings/usb/fujitsu-ehci.txt b/Documentation/devicetree/bindings/usb/fujitsu-ehci.txt
> new file mode 100644
> index 0000000..e180860
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/usb/fujitsu-ehci.txt
> @@ -0,0 +1,22 @@
> +FUJITSU GLUE COMPONENTS
> +
> +MB86S7x EHCI GLUE
> + - compatible : Should be "fujitsu,f_usb20ho_hcd"

Please try to use the binding from

Documentation/devicetree/bindings/usb/usb-ehci.txt and the respective
ohci binding first, and use two separate devic enodes.

> + - reg : Address and length of the register set for the device.
> + - interrupts : The irq number of this device that is used to interrupt the
> +   CPU
> + - clocks: from common clock binding, handle to usb clock.
> + - clock-names: from common clock binding.

You should always document the specific strings for a named property.

> + - #stream-id-cells : handle to use "arm,mmu-400" ARM IOMMU driver

Don't use that binding, we are trying to kill that off. Instead, use
an 'iommus' property.


> +	hci_res[0].start = ohci ? resource->start + F_OHCI_OFFSET :
> +		resource->start + F_EHCI_OFFSET;
> +	hci_res[0].end = ohci ?
> +			resource->start + F_OHCI_OFFSET + F_OHCI_SIZE - 1 :
> +			resource->start + F_EHCI_OFFSET + F_EHCI_SIZE - 1;
> +	hci_res[0].flags = IORESOURCE_MEM;
> +
> +	hci_res[1].start = irq;
> +	hci_res[1].flags = IORESOURCE_IRQ;
> +
> +	hci_dev = platform_device_alloc(ohci ? "ohci-platform" :
> +					"ehci-platform", 0);
> +	if (!hci_dev) {
> +		dev_err(&pdev->dev, "platform_device_alloc() failed\n");
> +		ret = -ENODEV;
> +		goto err_res;
> +	}

No need for playing games with child devices, just see how the other
drivers do it.

> +	ret = platform_device_add(hci_dev);
> +	if (ret) {
> +		dev_err(&pdev->dev, "platform_device_add() failed\n");
> +		goto err_alloc;
> +	}
> +
> +	return hci_dev;
> +
> +err_alloc:
> +	platform_device_put(hci_dev);
> +err_res:
> +	return ERR_PTR(ret);
> +}
> +
> +static u64 f_usb20ho_dma_mask =  DMA_BIT_MASK(32);

The dma mask should come from the dma-ranges property of the parent bus,
as of_platform_populate now does.

	Arnd

  reply	other threads:[~2014-12-16  9:06 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-16  2:10 [PATCH 0/3] Add support for Fujitsu USB host controller Sneeker Yeh
2014-12-16  2:10 ` [PATCH 1/3] usb: host: f_usb20ho: add support for Fujitsu ehci/ohci USB 2.0 " Sneeker Yeh
2014-12-16  9:06   ` Arnd Bergmann [this message]
2014-12-17 15:33     ` Sneeker.Yeh
     [not found]       ` <830AC58E49A426478AC39824BC0FA915D8BB402BB7-BxlyW7DJwtfE0yrG4eIIn8GT06e9YD5CS4/B3AGzWvkvtab9mdV7tw@public.gmane.org>
2014-12-17 15:44         ` Arnd Bergmann
2014-12-17 15:46           ` Sneeker.Yeh
2014-12-16  2:10 ` [PATCH 2/3] usb: dwc3: add Fujitsu Specific Glue layer Sneeker Yeh
     [not found]   ` <1418695828-605-3-git-send-email-Sneeker.Yeh-l16TxrwUIHTQFUHtdCDX3A@public.gmane.org>
2014-12-22 15:59     ` Felipe Balbi
2014-12-28 17:52       ` Sneeker Yeh
2014-12-29 16:14         ` Felipe Balbi
2015-01-04 13:16           ` Sneeker Yeh
2015-01-05 15:52             ` Felipe Balbi
     [not found]         ` <CAJ1gpc0uniw3F3O9nxTLHp9M2boxrOACYDB=fgruhLOLdqg9yA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-12-30 10:12           ` Arnd Bergmann
2015-01-03  1:21             ` Felipe Balbi
2015-01-05 15:28               ` Arnd Bergmann
2015-01-05 15:50                 ` Felipe Balbi
2015-01-04 14:32             ` Sneeker Yeh
2014-12-16  2:10 ` [PATCH 3/3] usb: dwc3: add a quirk for device disconnection issue in Synopsis dwc3 core Sneeker Yeh
2014-12-22 15:37   ` Felipe Balbi
2014-12-29  6:41     ` Sneeker Yeh
2014-12-29  8:07       ` Sneeker Yeh
     [not found]         ` <CAJ1gpc3-Wjtm54WOhO6RXjZft9BMngzyYC0-S-XnTacV-qKgMg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-12-29 16:06           ` Felipe Balbi
2015-01-04 12:55             ` Sneeker Yeh
     [not found]               ` <CAJ1gpc0Uu4vS2iA_o_W5NaE_QBWDYFZJio7yKvhpaR5f=qWcGA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-05 17:09                 ` Felipe Balbi
2015-01-11 15:19                   ` Sneeker Yeh
2015-01-12 17:20                     ` Felipe Balbi
2015-01-12 17:29                       ` Paul Bolle
2015-01-12 17:50                         ` Felipe Balbi
2015-01-14  7:08                       ` Sneeker Yeh
2015-01-14 17:02                         ` Felipe Balbi
2015-01-17 10:52                           ` Sneeker Yeh

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=94603263.7VVvg5Qn7O@wuerfel \
    --to=arnd@arndb.de \
    --cc=abrestic@chromium.org \
    --cc=balbi@ti.com \
    --cc=davidm@egauge.net \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=grant.likely@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=gregory.clement@free-electrons.com \
    --cc=hdegoede@redhat.com \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.ker \
    --cc=linux-usb@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mathias.nyman@intel.com \
    --cc=pawel.moll@arm.com \
    --cc=pebolle@tiscali.nl \
    --cc=peter.griffin@linaro.org \
    --cc=robh+dt@kernel.org \
    --cc=s.nawrocki@samsung.com \
    --cc=sneeker.yeh@gmail.com \
    --cc=stern@rowland.harvard.edu \
    --cc=thomas.pugliese@gmail.com \
    --cc=yoshihiro.shimoda.uh@renesas.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).