From patchwork Fri Nov 30 16:51:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pantelis Antoniou X-Patchwork-Id: 202993 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 722262C0097 for ; Sat, 1 Dec 2012 03:52:27 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6A6144A0F5; Fri, 30 Nov 2012 17:52:16 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id b-ymWMu4YGSA; Fri, 30 Nov 2012 17:52:16 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 931564A0F8; Fri, 30 Nov 2012 17:51:55 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 172F14A090 for ; Fri, 30 Nov 2012 17:51:48 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ffvfLhjFMjR0 for ; Fri, 30 Nov 2012 17:51:43 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from li42-95.members.linode.com (li42-95.members.linode.com [209.123.162.95]) by theia.denx.de (Postfix) with ESMTPS id 994CA4A096 for ; Fri, 30 Nov 2012 17:51:41 +0100 (CET) Received: from sles11esa.localdomain (unknown [195.97.110.117]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: panto) by li42-95.members.linode.com (Postfix) with ESMTPSA id 20AB09C1A1; Fri, 30 Nov 2012 16:51:38 +0000 (UTC) From: Pantelis Antoniou To: Marek Vasut , u-boot@lists.denx.de Date: Fri, 30 Nov 2012 18:51:25 +0200 Message-Id: <1354294293-2801-2-git-send-email-panto@antoniou-consulting.com> X-Mailer: git-send-email 1.7.12 In-Reply-To: <1354294293-2801-1-git-send-email-panto@antoniou-consulting.com> References: <1354294293-2801-1-git-send-email-panto@antoniou-consulting.com> Cc: Tom Rini , Pantelis Antoniou Subject: [U-Boot] [PATCH 1/9] usb: Fix bug when both DFU & ETHER are defined X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de When both CONFIG_USB_GADGET & CONFIG_USB_ETHER are defined the makefile links objects twice. The cleanest way to fix is to use a new define, CONFIG_USB_UTIL which must be defined when either CONFIG_USB_ETHER or CONFIG_USB_GADGET are defined. All affected boards have been modified as well. Signed-off-by: Pantelis Antoniou --- drivers/usb/gadget/Makefile | 8 ++++++-- include/configs/am335x_evm.h | 1 + include/configs/am3517_evm.h | 1 + include/configs/h2200.h | 1 + include/configs/omap3_beagle.h | 1 + include/configs/s5p_goni.h | 1 + include/configs/s5pc210_universal.h | 1 + include/configs/trats.h | 1 + 8 files changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile index 040eaba..167f24f 100644 --- a/drivers/usb/gadget/Makefile +++ b/drivers/usb/gadget/Makefile @@ -25,15 +25,19 @@ include $(TOPDIR)/config.mk LIB := $(obj)libusb_gadget.o +# required for both USB_GADGET & USB_ETHER +ifdef CONFIG_USB_UTIL +COBJS-y += epautoconf.o config.o usbstring.o +endif + # new USB gadget layer dependencies ifdef CONFIG_USB_GADGET -COBJS-y += epautoconf.o config.o usbstring.o COBJS-$(CONFIG_USB_GADGET_S3C_UDC_OTG) += s3c_udc_otg.o COBJS-$(CONFIG_USBDOWNLOAD_GADGET) += g_dnl.o COBJS-$(CONFIG_DFU_FUNCTION) += f_dfu.o endif ifdef CONFIG_USB_ETHER -COBJS-y += ether.o epautoconf.o config.o usbstring.o +COBJS-y += ether.o COBJS-$(CONFIG_USB_ETH_RNDIS) += rndis.o COBJS-$(CONFIG_MV_UDC) += mv_udc.o COBJS-$(CONFIG_CPU_PXA25X) += pxa25x_udc.o diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h index ab9549b..ee19e54 100644 --- a/include/configs/am335x_evm.h +++ b/include/configs/am335x_evm.h @@ -278,6 +278,7 @@ #ifdef CONFIG_MUSB_GADGET #define CONFIG_USB_ETHER +#define CONFIG_USB_UTIL #define CONFIG_USB_ETH_RNDIS #endif /* CONFIG_MUSB_GADGET */ diff --git a/include/configs/am3517_evm.h b/include/configs/am3517_evm.h index ba15325..3aedff3 100644 --- a/include/configs/am3517_evm.h +++ b/include/configs/am3517_evm.h @@ -123,6 +123,7 @@ #ifdef CONFIG_MUSB_GADGET #define CONFIG_USB_GADGET_DUALSPEED #define CONFIG_USB_ETHER +#define CONFIG_USB_UTIL #define CONFIG_USB_ETH_RNDIS #endif /* CONFIG_MUSB_GADGET */ diff --git a/include/configs/h2200.h b/include/configs/h2200.h index 516a26e..fc27bf0 100644 --- a/include/configs/h2200.h +++ b/include/configs/h2200.h @@ -170,6 +170,7 @@ #define CONFIG_USB_GADGET_PXA2XX #define CONFIG_USB_ETHER +#define CONFIG_USB_UTIL #define CONFIG_USB_ETH_SUBSET #define CONFIG_USBNET_DEV_ADDR "de:ad:be:ef:00:01" diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index 12d65f2..04fbb5d 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -123,6 +123,7 @@ #define CONFIG_USB_GADGET_DUALSPEED #define CONFIG_TWL4030_USB 1 #define CONFIG_USB_ETHER +#define CONFIG_USB_UTIL #define CONFIG_USB_ETHER_RNDIS /* USB EHCI */ diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h index 56e8347..1e180ade 100644 --- a/include/configs/s5p_goni.h +++ b/include/configs/s5p_goni.h @@ -231,6 +231,7 @@ #define CONFIG_I2C_MULTI_BUS #define CONFIG_SYS_MAX_I2C_BUS 7 #define CONFIG_USB_GADGET +#define CONFIG_USB_UTIL #define CONFIG_USB_GADGET_S3C_UDC_OTG #define CONFIG_USB_GADGET_DUALSPEED diff --git a/include/configs/s5pc210_universal.h b/include/configs/s5pc210_universal.h index 894f38b..07ab884 100644 --- a/include/configs/s5pc210_universal.h +++ b/include/configs/s5pc210_universal.h @@ -258,6 +258,7 @@ #define CONFIG_POWER_MAX8998 #define CONFIG_USB_GADGET +#define CONFIG_USB_UTIL #define CONFIG_USB_GADGET_S3C_UDC_OTG #define CONFIG_USB_GADGET_DUALSPEED diff --git a/include/configs/trats.h b/include/configs/trats.h index 355029e..7c2c875 100644 --- a/include/configs/trats.h +++ b/include/configs/trats.h @@ -245,6 +245,7 @@ #define CONFIG_POWER_BATTERY #define CONFIG_POWER_BATTERY_TRATS #define CONFIG_USB_GADGET +#define CONFIG_USB_UTIL #define CONFIG_USB_GADGET_S3C_UDC_OTG #define CONFIG_USB_GADGET_DUALSPEED #define CONFIG_USB_GADGET_VBUS_DRAW 2