devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2 0/6] Add XHCI, EHCI and OHCI support for Broadcom STB SoS's
@ 2018-10-17 22:29 Al Cooper
  2018-10-17 22:29 ` [PATCH V2 1/6] dt-bindings: Add Broadcom STB OHCI, EHCI and XHCI binding document Al Cooper
                   ` (5 more replies)
  0 siblings, 6 replies; 16+ messages in thread
From: Al Cooper @ 2018-10-17 22:29 UTC (permalink / raw)
  To: linux-kernel
  Cc: Al Cooper, Alan Stern, Alban Bedel, Alex Elder, Andrew Morton,
	Arnd Bergmann, Avi Fishman, bcm-kernel-feedback-list,
	Bjorn Andersson, Chunfeng Yun, David S. Miller, devicetree,
	Dmitry Osipenko, Greg Kroah-Hartman, Gustavo A. R. Silva,
	Hans de Goede, James Hogan, Jianguo Sun, Johan Hovold, Kees Cook,
	linux-usb@

V2 - Based on feedback, the functionality for XHCI and OHCI was
     moved from Broadcom platform drivers into the standard XHCI
     and OHCI platform drivers. The EHCI functionality still uses
     a Broadcom EHCI driver because of the workarounds needed for
     bugs in the EHCI controller.

This adds support for the XHCI, EHCI and OHCI host controllers found
in Broadcom STB SoC's. These drivers depend on getting access to the
new Broadcom STB USB PHY driver through a device-tree phandle and
will fail if the driver is not available.

Al Cooper (6):
  dt-bindings: Add Broadcom STB OHCI, EHCI and XHCI binding document
  usb: core: Add ability to skip phy exit on suspend and init on resume
  usb: xhci: xhci-plat: Add support for Broadcom STB SoC's
  usb: ohci-platform: Add support for Broadcom STB SoC's
  usb: ehci: Add new EHCI driver for Broadcom STB SoC's
  usb: host: Add ability to build new Broadcom STB USB drivers

 .../devicetree/bindings/usb/brcm,bcm7445-ehci.txt  |  22 ++
 .../devicetree/bindings/usb/brcm,bcm7445-ohci.txt  |  22 ++
 .../devicetree/bindings/usb/brcm,bcm7445-xhci.txt  |  23 ++
 MAINTAINERS                                        |   9 +
 drivers/usb/core/hcd.c                             |   8 +-
 drivers/usb/core/phy.c                             |  18 +-
 drivers/usb/core/phy.h                             |   9 +-
 drivers/usb/host/Kconfig                           |  29 ++
 drivers/usb/host/Makefile                          |  18 +-
 drivers/usb/host/ehci-brcm.c                       | 291 +++++++++++++++++++++
 drivers/usb/host/ohci-platform.c                   |  35 ++-
 drivers/usb/host/xhci-brcm.c                       |  17 ++
 drivers/usb/host/xhci-brcm.h                       |  16 ++
 drivers/usb/host/xhci-plat.c                       |   8 +
 include/linux/usb/hcd.h                            |   3 +
 include/linux/usb/ohci_pdriver.h                   |   1 +
 16 files changed, 504 insertions(+), 25 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/usb/brcm,bcm7445-ehci.txt
 create mode 100644 Documentation/devicetree/bindings/usb/brcm,bcm7445-ohci.txt
 create mode 100644 Documentation/devicetree/bindings/usb/brcm,bcm7445-xhci.txt
 create mode 100644 drivers/usb/host/ehci-brcm.c
 create mode 100644 drivers/usb/host/xhci-brcm.c
 create mode 100644 drivers/usb/host/xhci-brcm.h

-- 
1.9.0.138.g2de3478

^ permalink raw reply	[flat|nested] 16+ messages in thread
* [PATCH V2 4/6] usb: ohci-platform: Add support for Broadcom STB SoC's
@ 2018-10-30 18:20 Alan Cooper
  2018-10-30 20:08 ` Arnd Bergmann
  0 siblings, 1 reply; 16+ messages in thread
From: Alan Cooper @ 2018-10-30 18:20 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: : Linux Kernel Mailing List, Alan Stern, Alban Bedel, Alex Elder,
	Andrew Morton, Avi Fishman, bcm-kernel-feedback-list,
	Bjorn Andersson, Chunfeng Yun, David Miller, DTML,
	Dmitry Osipenko, gregkh, Gustavo A. R. Silva, Hans de Goede,
	James Hogan, Jianguo Sun, Johan Hovold, Kees Cook, USB list,
	Lu Baolu, Mark Rutland, Martin Blumenstingl, Mathias Nyman,
	Mathias Nyman, Mauro Carvalho Chehab, Rishabh Bhatnagar,
	Rob Herring, Roger Quadros

[-- Attachment #1: Type: text/plain, Size: 2557 bytes --]

> On 10/24/18 3:11 AM, Arnd Bergmann wrote:
>
> On Wed, Oct 17, 2018 at 11:30 PM Al Cooper <alcooperx@gmail.com> wrote:
>
> Add support for Broadcom STB SoC's to the ohci platform driver.
>
> Signed-off-by: Al Cooper <alcooperx@gmail.com>
> ---
>  drivers/usb/host/ohci-platform.c | 35 +++++++++++++++++++++++++++++------
>  include/linux/usb/ohci_pdriver.h |  1 +
>  2 files changed, 30 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/usb/host/ohci-platform.c
b/drivers/usb/host/ohci-platform.c
> index 65a1c3fdc88c..363d6fa676a5 100644
> --- a/drivers/usb/host/ohci-platform.c
> +++ b/drivers/usb/host/ohci-platform.c
> @@ -22,6 +22,7 @@
>  #include <linux/module.h>
>  #include <linux/err.h>
>  #include <linux/of.h>
> +#include <linux/of_device.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/reset.h>
> @@ -99,12 +100,24 @@ static int ohci_platform_probe(struct
platform_device *dev)
>         if (usb_disabled())
>                 return -ENODEV;
>
> -       /*
> -        * Use reasonable defaults so platforms don't have to provide
these
> -        * with DT probing on ARM.
> -        */
> -       if (!pdata)
> -               pdata = &ohci_platform_defaults;
> +       if (!pdata) {
> +               const struct usb_ohci_pdata *match_pdata;
> +
> +               match_pdata = of_device_get_match_data(&dev->dev);
> +               if (match_pdata) {
> +                       pdata = devm_kzalloc(&dev->dev, sizeof(*pdata),
> +                                            GFP_KERNEL);
> +                       if (!pdata)
> +                               return -ENOMEM;
> +                       *pdata = *match_pdata;
>
> It looks like you copy the const pdata to get a non-const version.
> Have you tried
> propagating the 'const' modifier so that users can rely on that here?

The problem is that the const pdata from of_device_get_match() needs to be
saved in device->platform_data which is not a const pointer (and can't be
changed). How can I propagate the "const" to solve the problem?

>
> +               } else {
> +                       /*
> +                        * Use reasonable defaults so platforms don't have
> +                        * to provide these with DT probing on ARM.
> +                        */
> +                       pdata = &ohci_platform_defaults;
> +               }
> +       }
>
> That would also allow you to unify it with the else path by listing
> the ohci_platform_defaults
> in the id table for all other compatible strings.
>
>        Arnd

[-- Attachment #2: Type: text/html, Size: 3401 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2018-10-30 20:08 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-17 22:29 [PATCH V2 0/6] Add XHCI, EHCI and OHCI support for Broadcom STB SoS's Al Cooper
2018-10-17 22:29 ` [PATCH V2 1/6] dt-bindings: Add Broadcom STB OHCI, EHCI and XHCI binding document Al Cooper
2018-10-18 20:38   ` Rob Herring
2018-10-17 22:29 ` [PATCH V2 2/6] usb: core: Add ability to skip phy exit on suspend and init on resume Al Cooper
2018-10-18  1:46   ` Chunfeng Yun
2018-10-17 22:29 ` [PATCH V2 3/6] usb: xhci: xhci-plat: Add support for Broadcom STB SoC's Al Cooper
2018-10-18 16:49   ` kbuild test robot
2018-10-19  4:53   ` kbuild test robot
2018-10-17 22:29 ` [PATCH V2 4/6] usb: ohci-platform: " Al Cooper
2018-10-24  7:11   ` Arnd Bergmann
2018-10-17 22:29 ` [PATCH V2 5/6] usb: ehci: Add new EHCI driver " Al Cooper
2018-10-24  7:14   ` Arnd Bergmann
2018-10-17 22:29 ` [PATCH V2 6/6] usb: host: Add ability to build new Broadcom STB USB drivers Al Cooper
2018-10-18 14:35   ` Alan Stern
  -- strict thread matches above, loose matches on Subject: below --
2018-10-30 18:20 [PATCH V2 4/6] usb: ohci-platform: Add support for Broadcom STB SoC's Alan Cooper
2018-10-30 20:08 ` Arnd Bergmann

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).