diff mbox series

[V3,6/6] usb: host: Add ability to build new Broadcom STB USB drivers

Message ID 1541453493-34981-7-git-send-email-alcooperx@gmail.com (mailing list archive)
State Superseded
Headers show
Series Add XHCI, EHCI and OHCI support for Broadcom STB SoS's | expand

Commit Message

Alan Cooper Nov. 5, 2018, 9:31 p.m. UTC
Add the build system changes needed to get the Broadcom STB XHCI,
EHCI and OHCI functionality working. The link order for XHCI was
changed in the Makefile because of the way STB XHCI, EHCI and OHCI
controllers share a port which requires that the XHCI driver be
initialized first. Also update MAINTAINERS.

Signed-off-by: Al Cooper <alcooperx@gmail.com>
---
 MAINTAINERS               |  9 +++++++++
 drivers/usb/host/Kconfig  | 29 +++++++++++++++++++++++++++++
 drivers/usb/host/Makefile | 18 ++++++++++++------
 3 files changed, 50 insertions(+), 6 deletions(-)

Comments

Arnd Bergmann Nov. 6, 2018, 11:09 a.m. UTC | #1
On 11/5/18, Al Cooper <alcooperx@gmail.com> wrote:

> +
> +config USB_BRCM
> +	tristate "Broadcom STB USB support"
> +	depends on ARCH_BRCMSTB
> +	select USB_OHCI_HCD_PLATFORM if USB_OHCI_HCD
> +	select USB_EHCI_BRCM if USB_EHCI_HCD
> +	select USB_XHCI_BRCM if USB_XHCI_HCD
> +	select USB_XHCI_PLATFORM if USB_XHCI_HCD
> +	select BRCM_USB_PHY if USB_OHCI_HCD || USB_EHCI_HCD || USB_XHCI_HCD
> +	select GENERIC_PHY if BRCM_USB_PHY
> +	default ARCH_BRCMSTB

Is there a build time dependency on the PHY layer? If not, I would suggest
dropping the last two 'select' statements. I would also suggest
making the dependency 'depends on ARCH_BRCMSTB || COMPILE_TEST'
to allow building it on other architecture for better build testing, and
dropping the 'default' line. Just add this to the defconfig like the other
drivers you have.

      Arnd
Alan Cooper Nov. 6, 2018, 3:55 p.m. UTC | #2
On Tue, Nov 6, 2018 at 6:09 AM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On 11/5/18, Al Cooper <alcooperx@gmail.com> wrote:
>
> > +
> > +config USB_BRCM
> > +     tristate "Broadcom STB USB support"
> > +     depends on ARCH_BRCMSTB
> > +     select USB_OHCI_HCD_PLATFORM if USB_OHCI_HCD
> > +     select USB_EHCI_BRCM if USB_EHCI_HCD
> > +     select USB_XHCI_BRCM if USB_XHCI_HCD
> > +     select USB_XHCI_PLATFORM if USB_XHCI_HCD
> > +     select BRCM_USB_PHY if USB_OHCI_HCD || USB_EHCI_HCD || USB_XHCI_HCD
> > +     select GENERIC_PHY if BRCM_USB_PHY
> > +     default ARCH_BRCMSTB
>
> Is there a build time dependency on the PHY layer? If not, I would suggest
> dropping the last two 'select' statements. I would also suggest
> making the dependency 'depends on ARCH_BRCMSTB || COMPILE_TEST'
> to allow building it on other architecture for better build testing, and
> dropping the 'default' line. Just add this to the defconfig like the other
> drivers you have.

I added COMPILE_TEST and dropped the last 2 select lines.
Most of our other drivers default to "y" for "ARCH_BRCMSTB", would it
be better if I changed it to "default y"?

Thanks
Al

>
>       Arnd
Arnd Bergmann Nov. 6, 2018, 6:22 p.m. UTC | #3
On 11/6/18, Alan Cooper <alcooperx@gmail.com> wrote:
> On Tue, Nov 6, 2018 at 6:09 AM Arnd Bergmann <arnd@arndb.de> wrote:
>>
>> On 11/5/18, Al Cooper <alcooperx@gmail.com> wrote:
>>
>> > +
>> > +config USB_BRCM
>> > +     tristate "Broadcom STB USB support"
>> > +     depends on ARCH_BRCMSTB
>> > +     select USB_OHCI_HCD_PLATFORM if USB_OHCI_HCD
>> > +     select USB_EHCI_BRCM if USB_EHCI_HCD
>> > +     select USB_XHCI_BRCM if USB_XHCI_HCD
>> > +     select USB_XHCI_PLATFORM if USB_XHCI_HCD
>> > +     select BRCM_USB_PHY if USB_OHCI_HCD || USB_EHCI_HCD ||
>> > USB_XHCI_HCD
>> > +     select GENERIC_PHY if BRCM_USB_PHY
>> > +     default ARCH_BRCMSTB
>>
>> Is there a build time dependency on the PHY layer? If not, I would
>> suggest
>> dropping the last two 'select' statements. I would also suggest
>> making the dependency 'depends on ARCH_BRCMSTB || COMPILE_TEST'
>> to allow building it on other architecture for better build testing, and
>> dropping the 'default' line. Just add this to the defconfig like the
>> other
>> drivers you have.
>
> I added COMPILE_TEST and dropped the last 2 select lines.
> Most of our other drivers default to "y" for "ARCH_BRCMSTB", would it
> be better if I changed it to "default y"?

No, "default ARCH_BRCMSTB" is better than "default y", but I'd recommend
to just not have non-essential drivers default-on.

      Arnd
Alan Cooper Nov. 6, 2018, 7:33 p.m. UTC | #4
On Tue, Nov 6, 2018 at 1:22 PM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On 11/6/18, Alan Cooper <alcooperx@gmail.com> wrote:
> > On Tue, Nov 6, 2018 at 6:09 AM Arnd Bergmann <arnd@arndb.de> wrote:
> >>
> >> On 11/5/18, Al Cooper <alcooperx@gmail.com> wrote:
> >>
> >> > +
> >> > +config USB_BRCM
> >> > +     tristate "Broadcom STB USB support"
> >> > +     depends on ARCH_BRCMSTB
> >> > +     select USB_OHCI_HCD_PLATFORM if USB_OHCI_HCD
> >> > +     select USB_EHCI_BRCM if USB_EHCI_HCD
> >> > +     select USB_XHCI_BRCM if USB_XHCI_HCD
> >> > +     select USB_XHCI_PLATFORM if USB_XHCI_HCD
> >> > +     select BRCM_USB_PHY if USB_OHCI_HCD || USB_EHCI_HCD ||
> >> > USB_XHCI_HCD
> >> > +     select GENERIC_PHY if BRCM_USB_PHY
> >> > +     default ARCH_BRCMSTB
> >>
> >> Is there a build time dependency on the PHY layer? If not, I would
> >> suggest
> >> dropping the last two 'select' statements. I would also suggest
> >> making the dependency 'depends on ARCH_BRCMSTB || COMPILE_TEST'
> >> to allow building it on other architecture for better build testing, and
> >> dropping the 'default' line. Just add this to the defconfig like the
> >> other
> >> drivers you have.
> >
> > I added COMPILE_TEST and dropped the last 2 select lines.
> > Most of our other drivers default to "y" for "ARCH_BRCMSTB", would it
> > be better if I changed it to "default y"?
>
> No, "default ARCH_BRCMSTB" is better than "default y", but I'd recommend
> to just not have non-essential drivers default-on.
>
>       Arnd

Okay.

Thanks
Al
diff mbox series

Patch

diff --git a/MAINTAINERS b/MAINTAINERS
index e8e1d86bd505..c4e7bcb7f992 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2991,6 +2991,15 @@  S:	Supported
 F:	drivers/i2c/busses/i2c-brcmstb.c
 F:	Documentation/devicetree/bindings/i2c/i2c-brcmstb.txt
 
+BROADCOM BRCMSTB USB XHCI, EHCI and OHCI DRIVERS
+M:	Al Cooper <alcooperx@gmail.com>
+L:	linux-usb@vger.kernel.org
+L:	bcm-kernel-feedback-list@broadcom.com
+S:	Maintained
+F:	drivers/usb/host/xhci-brcm.*
+F:	drivers/usb/host/ohci-brcm.c
+F:	Documentation/devicetree/bindings/usb/brcm,bcm7445-*.txt
+
 BROADCOM BRCMSTB USB2 and USB3 PHY DRIVER
 M:	Al Cooper <alcooperx@gmail.com>
 L:	linux-kernel@vger.kernel.org
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 16758b12a5e9..ec6b4582ab12 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -94,6 +94,35 @@  config USB_XHCI_TEGRA
 	  Say 'Y' to enable the support for the xHCI host controller
 	  found in NVIDIA Tegra124 and later SoCs.
 
+config USB_OHCI_BRCM
+       tristate
+
+config USB_EHCI_BRCM
+       tristate
+
+config USB_XHCI_BRCM
+       tristate
+
+config BRCM_USB_PHY
+       tristate
+
+config USB_BRCM
+	tristate "Broadcom STB USB support"
+	depends on ARCH_BRCMSTB
+	select USB_OHCI_HCD_PLATFORM if USB_OHCI_HCD
+	select USB_EHCI_BRCM if USB_EHCI_HCD
+	select USB_XHCI_BRCM if USB_XHCI_HCD
+	select USB_XHCI_PLATFORM if USB_XHCI_HCD
+	select BRCM_USB_PHY if USB_OHCI_HCD || USB_EHCI_HCD || USB_XHCI_HCD
+	select GENERIC_PHY if BRCM_USB_PHY
+	default ARCH_BRCMSTB
+	help
+	  Say Y to enable support for XHCI, EHCI and OHCI host controllers
+	  found in Broadcom STB SoC's.
+
+	  Disabling this will keep the controllers and corresponding
+	  PHYs powered down.
+
 endif # USB_XHCI_HCD
 
 config USB_EHCI_HCD
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index 84514f71ae44..9bdd64b710ee 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -31,6 +31,10 @@  ifneq ($(CONFIG_USB_XHCI_RCAR), )
 	xhci-plat-hcd-y		+= xhci-rcar.o
 endif
 
+ifneq ($(CONFIG_USB_XHCI_BRCM), )
+	xhci-plat-hcd-y		+= xhci-brcm.o
+endif
+
 ifneq ($(CONFIG_DEBUG_FS),)
 	xhci-hcd-y		+= xhci-debugfs.o
 endif
@@ -39,6 +43,13 @@  obj-$(CONFIG_USB_WHCI_HCD)	+= whci/
 
 obj-$(CONFIG_USB_PCI)	+= pci-quirks.o
 
+obj-$(CONFIG_USB_XHCI_HCD)	+= xhci-hcd.o
+obj-$(CONFIG_USB_XHCI_PCI)	+= xhci-pci.o
+obj-$(CONFIG_USB_XHCI_PLATFORM) += xhci-plat-hcd.o
+obj-$(CONFIG_USB_XHCI_HISTB)	+= xhci-histb.o
+obj-$(CONFIG_USB_XHCI_MTK)	+= xhci-mtk.o
+obj-$(CONFIG_USB_XHCI_TEGRA)	+= xhci-tegra.o
+
 obj-$(CONFIG_USB_EHCI_HCD)	+= ehci-hcd.o
 obj-$(CONFIG_USB_EHCI_PCI)	+= ehci-pci.o
 obj-$(CONFIG_USB_EHCI_HCD_PLATFORM)	+= ehci-platform.o
@@ -52,6 +63,7 @@  obj-$(CONFIG_USB_EHCI_EXYNOS)	+= ehci-exynos.o
 obj-$(CONFIG_USB_EHCI_HCD_AT91) += ehci-atmel.o
 obj-$(CONFIG_USB_EHCI_TEGRA)	+= ehci-tegra.o
 obj-$(CONFIG_USB_W90X900_EHCI)	+= ehci-w90x900.o
+obj-$(CONFIG_USB_EHCI_BRCM)	+= ehci-brcm.o
 
 obj-$(CONFIG_USB_OXU210HP_HCD)	+= oxu210hp-hcd.o
 obj-$(CONFIG_USB_ISP116X_HCD)	+= isp116x-hcd.o
@@ -72,12 +84,6 @@  obj-$(CONFIG_USB_OHCI_HCD_DAVINCI)	+= ohci-da8xx.o
 
 obj-$(CONFIG_USB_UHCI_HCD)	+= uhci-hcd.o
 obj-$(CONFIG_USB_FHCI_HCD)	+= fhci.o
-obj-$(CONFIG_USB_XHCI_HCD)	+= xhci-hcd.o
-obj-$(CONFIG_USB_XHCI_PCI)	+= xhci-pci.o
-obj-$(CONFIG_USB_XHCI_PLATFORM) += xhci-plat-hcd.o
-obj-$(CONFIG_USB_XHCI_HISTB)	+= xhci-histb.o
-obj-$(CONFIG_USB_XHCI_MTK)	+= xhci-mtk.o
-obj-$(CONFIG_USB_XHCI_TEGRA)	+= xhci-tegra.o
 obj-$(CONFIG_USB_SL811_HCD)	+= sl811-hcd.o
 obj-$(CONFIG_USB_SL811_CS)	+= sl811_cs.o
 obj-$(CONFIG_USB_U132_HCD)	+= u132-hcd.o