Re: [PATCH 081/141] USB: add USB EHCI support for MPC5121 SoC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/29/2010 10:17 AM, Uwe Kleine-König wrote:
> Hello Greg, hello Anatolij,
> 
> On Fri, Oct 22, 2010 at 10:56:27AM -0700, Greg Kroah-Hartman wrote:
>> From: Anatolij Gustschin <agust-ynQEQJNshbs@xxxxxxxxxxxxxxxx>
>>
>> Extends FSL EHCI platform driver glue layer to support
>> MPC5121 USB controllers. MPC5121 Rev 2.0 silicon EHCI
>> registers are in big endian format. The appropriate flags
>> [...]
> This broke building an mx25 config (ARCH=arm) (no defconfig):
> 
> 	  CC      drivers/usb/host/fsl-mph-dr-of.o
> 	drivers/usb/host/fsl-mph-dr-of.c: In function 'get_dr_mode_data':
> 	drivers/usb/host/fsl-mph-dr-of.c:49: error: implicit declaration of function 'of_get_property'
> 	drivers/usb/host/fsl-mph-dr-of.c:49: warning: assignment makes pointer from integer without a cast
> 	drivers/usb/host/fsl-mph-dr-of.c:56: error: dereferencing pointer to incomplete type
> 	drivers/usb/host/fsl-mph-dr-of.c: In function 'fsl_usb2_device_register':
> 	drivers/usb/host/fsl-mph-dr-of.c:96: error: 'struct pdev_archdata' has no member named 'dma_mask'
> 	drivers/usb/host/fsl-mph-dr-of.c: In function 'fsl_usb2_mph_dr_of_probe':
> 	drivers/usb/host/fsl-mph-dr-of.c:124: error: 'struct device' has no member named 'of_node'
> 	drivers/usb/host/fsl-mph-dr-of.c:133: error: implicit declaration of function 'of_device_is_available'
> 	drivers/usb/host/fsl-mph-dr-of.c:136: error: implicit declaration of function 'of_match_device'
> 	drivers/usb/host/fsl-mph-dr-of.c:136: warning: assignment makes pointer from integer without a cast
> 	drivers/usb/host/fsl-mph-dr-of.c:148: error: implicit declaration of function 'of_device_is_compatible'
> 	drivers/usb/host/fsl-mph-dr-of.c:167: warning: assignment makes pointer from integer without a cast
> 	drivers/usb/host/fsl-mph-dr-of.c: At top level:
> 	drivers/usb/host/fsl-mph-dr-of.c:288: error: unknown field 'of_match_table' specified in initializer
> 	drivers/usb/host/fsl-mph-dr-of.c:288: warning: initialization from incompatible pointer type
> 	make[5]: *** [drivers/usb/host/fsl-mph-dr-of.o] Error 1
> 	make[4]: *** [drivers/usb/host] Error 2
> 	make[3]: *** [drivers/usb] Error 2
> 	make[2]: *** [drivers] Error 2
> 	make[1]: *** [sub-make] Error 2
> 	make: *** [all] Error 2

I think the problem is to compile the file "fsl-mph-dr-of" on ARM in
the first place. The file was introduced in
"126512e3f274802ca65ebeca8660237f0361ad48", this are the relevant hunks:

> diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
> index 2d926ce..f3a90b0 100644
> --- a/drivers/usb/host/Kconfig
> +++ b/drivers/usb/host/Kconfig
> @@ -112,10 +112,14 @@ config XPS_USB_HCD_XILINX
>                 support both high speed and full speed devices, or high speed
>                 devices only.
> 
> +config USB_FSL_MPH_DR_OF
> +       tristate
> +
>  config USB_EHCI_FSL
>         bool "Support for Freescale on-chip EHCI USB controller"
>         depends on USB_EHCI_HCD && FSL_SOC
>         select USB_EHCI_ROOT_HUB_TT
> +       select USB_FSL_MPH_DR_OF

Does a "if OF" help here?

>         ---help---
>           Variation of ARC USB block used in some Freescale chips.
> 
> diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
> index f041442..19b3a30 100644
> --- a/drivers/usb/host/Makefile
> +++ b/drivers/usb/host/Makefile
> @@ -31,4 +31,5 @@ obj-$(CONFIG_USB_R8A66597_HCD)        += r8a66597-hcd.o
>  obj-$(CONFIG_USB_ISP1760_HCD)  += isp1760.o
>  obj-$(CONFIG_USB_HWA_HCD)      += hwa-hc.o
>  obj-$(CONFIG_USB_IMX21_HCD)    += imx21-hcd.o
> +obj-$(CONFIG_USB_FSL_MPH_DR_OF)        += fsl-mph-dr-of.o
> 

patch follows,
cheers, Marc

-------->8-------->8-------->8-------->8-------->8-------->8-------->8-------->8--------


From b0040e8d011cf586c8095f7c46b7a53889140a2a Mon Sep 17 00:00:00 2001
From: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>
Date: Fri, 29 Oct 2010 10:38:59 +0200
Subject: [PATCH] USB: Fix FSL USB driver on non Open Firmware systems
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Commit 126512e3f274802ca65ebeca8660237f0361ad48 added support for FSL's USB
controller on powerpc. In this commit the Open Firmware code was selected
and compiled unconditionally.

This breaks on ARM systems from FSL which use the same driver (.i.e. the i.MX
series), because ARM don't have OF support (yet). This patch fixes the problem
by only selecting the OF code on systems if Open Firmware support.

Reported-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>
Compile-Tested-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
---
 drivers/usb/gadget/Kconfig |    2 +-
 drivers/usb/host/Kconfig   |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index b739ca8..607d0db 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -158,7 +158,7 @@ config USB_GADGET_FSL_USB2
 	boolean "Freescale Highspeed USB DR Peripheral Controller"
 	depends on FSL_SOC || ARCH_MXC
 	select USB_GADGET_DUALSPEED
-	select USB_FSL_MPH_DR_OF
+	select USB_FSL_MPH_DR_OF if OF
 	help
 	   Some of Freescale PowerPC processors have a High Speed
 	   Dual-Role(DR) USB controller, which supports device mode.
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index bf2e7d2..66b2002 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -121,7 +121,7 @@ config USB_EHCI_FSL
 	bool "Support for Freescale on-chip EHCI USB controller"
 	depends on USB_EHCI_HCD && FSL_SOC
 	select USB_EHCI_ROOT_HUB_TT
-	select USB_FSL_MPH_DR_OF
+	select USB_FSL_MPH_DR_OF if OF
 	---help---
 	  Variation of ARC USB block used in some Freescale chips.
 
-- 
1.7.2.3

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux