From patchwork Tue Sep 12 19:01:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 112380 Delivered-To: patch@linaro.org Received: by 10.80.202.13 with SMTP id d13csp29155edi; Tue, 12 Sep 2017 12:11:34 -0700 (PDT) X-Google-Smtp-Source: ADKCNb5kHMoT8bmhYaOYZCnChytkH0pTFfb/niKhBMw2aomfn9TSDg91iNzPV/gJ/RdnR/ruhj4X X-Received: by 10.80.201.134 with SMTP id w6mr13398933edh.56.1505243494467; Tue, 12 Sep 2017 12:11:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505243494; cv=none; d=google.com; s=arc-20160816; b=gMQ2j4i9AkkHScZ0Bl0guhTyAOR5JzzcWWZO+M3yUj6ThwaDT8yqCK1pSk45xA0ylg 8RZSozIQZGZutyk3mISvI8yji+y30Bbr308dv7HQV7AB5MTiBLmVZEwgxpy4R3ka5hWG NFmphV79bjTMqJN1sp5vXrylO4FYVFdpdMkjhMvKTdjS3NnWCqwV3pQaY1NPzTJ6cOwh Q5y6SOJTWWyJfTP12PH8Jt+kXIefsnaRGm71v6xQ6yGXy7NL9GXTa6mzmQgyssPjnfcu N5AKnkNlDu0N35iJdOaXJCmWIfjCeCILOyFI3ldnuoGEdGRMSd7sX7XuonTB73H+0WVl E6pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:references :in-reply-to:message-id:date:to:from:arc-authentication-results; bh=oQln6/oUSz+tnsLUv0b6o1cObTekxRdV8SCsD2p0FCk=; b=seFwrhdcNDrQo2fxTMDSWtzF+ASXZHALx9gZ3/sHp/PnJsmyCupQGICiA3l96v5rLV KLQheJpS/QRbh+qvOW/CgaG9T0hDq5qKNqBv580Ieqmeapqmj2OpXPwStOtsk9xmtVL8 0dm0Nim3vWkKEtL7Wz5qyKLihndvS2xPhYfkPas4b2J2BOD0NKlRetGSsPlZ9yxbmeFc JQpb2S9pA9ZcaZyQohpEBeHer6xCoDP/BAUzBqdFl3x/ENMufvZ9zIIxE91t9DYPeUQW Ca/pfJnSkbbY769A+9yajO5kTslRF+hPQeG3zHFabBHlQ0H8o3evK2KArknLJwM1hakX GLYA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id r10si2892062edr.56.2017.09.12.12.11.34; Tue, 12 Sep 2017 12:11:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id CC67EC22199; Tue, 12 Sep 2017 19:10:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 536DAC221C8; Tue, 12 Sep 2017 19:02:12 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 30C87C221BB; Tue, 12 Sep 2017 19:01:58 +0000 (UTC) Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by lists.denx.de (Postfix) with ESMTP id 470DBC22053 for ; Tue, 12 Sep 2017 19:01:50 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 1752E20981; Tue, 12 Sep 2017 21:01:50 +0200 (CEST) Received: from localhost (LFbn-TOU-1-209-191.w86-201.abo.wanadoo.fr [86.201.56.191]) by mail.free-electrons.com (Postfix) with ESMTPSA id DB7D120867; Tue, 12 Sep 2017 21:01:49 +0200 (CEST) From: Maxime Ripard To: Tom Rini , Jagan Teki Date: Tue, 12 Sep 2017 21:01:35 +0200 Message-Id: X-Mailer: git-send-email 2.13.5 In-Reply-To: References: In-Reply-To: References: Cc: Thomas Petazzoni , marex@denx.de, u-boot@lists.denx.de, Maxime Ripard Subject: [U-Boot] [PATCH v2 07/14] usb: gadget: usb_ether: Move settings to common X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The usb_ether gadget duplicates the USB settings for the manufacturer, product ID and vendor ID. Make sure we use the common option so that we can expect a single VID/PID couple for a single device. Reviewed-by: Simon Glass Reviewed-by: Lukasz Majewski Signed-off-by: Maxime Ripard --- configs/sama5d2_ptc_nandflash_defconfig | 1 + configs/sama5d2_ptc_spiflash_defconfig | 1 + configs/vinco_defconfig | 1 + drivers/usb/gadget/Kconfig | 2 ++ drivers/usb/gadget/ether.c | 16 ++++++++-------- include/configs/ma5d4evk.h | 1 - include/configs/sama5d2_ptc.h | 1 - include/configs/vinco.h | 1 - scripts/config_whitelist.txt | 1 - 9 files changed, 13 insertions(+), 12 deletions(-) diff --git a/configs/sama5d2_ptc_nandflash_defconfig b/configs/sama5d2_ptc_nandflash_defconfig index 6672a5ce11f7..431056a50a8b 100644 --- a/configs/sama5d2_ptc_nandflash_defconfig +++ b/configs/sama5d2_ptc_nandflash_defconfig @@ -29,5 +29,6 @@ CONFIG_USB=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_STORAGE=y CONFIG_USB_GADGET=y +CONFIG_USB_GADGET_MANUFACTURER="Atmel SAMA5D2_PTC" CONFIG_USB_GADGET_ATMEL_USBA=y CONFIG_USB_ETHER=y diff --git a/configs/sama5d2_ptc_spiflash_defconfig b/configs/sama5d2_ptc_spiflash_defconfig index 9a23a808f1b3..66bb671820a6 100644 --- a/configs/sama5d2_ptc_spiflash_defconfig +++ b/configs/sama5d2_ptc_spiflash_defconfig @@ -30,5 +30,6 @@ CONFIG_USB=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_STORAGE=y CONFIG_USB_GADGET=y +CONFIG_USB_GADGET_MANUFACTURER="Atmel SAMA5D2_PTC" CONFIG_USB_GADGET_ATMEL_USBA=y CONFIG_USB_ETHER=y diff --git a/configs/vinco_defconfig b/configs/vinco_defconfig index 08aa8c52a254..57ca8f949077 100644 --- a/configs/vinco_defconfig +++ b/configs/vinco_defconfig @@ -31,6 +31,7 @@ CONFIG_USB=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_STORAGE=y CONFIG_USB_GADGET=y +CONFIG_USB_GADGET_MANUFACTURER="L+G VInCo" CONFIG_USB_GADGET_ATMEL_USBA=y CONFIG_USB_ETHER=y CONFIG_USB_HOST_ETHER=y diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index 7bbfde26d0be..ef13bd2edb66 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig @@ -44,12 +44,14 @@ config USB_GADGET_MANUFACTURER config USB_GADGET_VENDOR_NUM hex "Vendor ID of the USB device" + help Vendor ID of the USB device emulated, reported to the host device. This is usually the board or SoC vendor's, unless you've registered for one. config USB_GADGET_PRODUCT_NUM hex "Product ID of the USB device" + help Product ID of the USB device emulated, reported to the host device. config USB_GADGET_ATMEL_USBA diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c index 2cf5c8d31e25..dbb578258f96 100644 --- a/drivers/usb/gadget/ether.c +++ b/drivers/usb/gadget/ether.c @@ -273,8 +273,8 @@ static inline int BITRATE(struct usb_gadget *g) * static ushort idProduct; */ -#if defined(CONFIG_USBNET_MANUFACTURER) -static char *iManufacturer = CONFIG_USBNET_MANUFACTURER; +#if defined(CONFIG_USB_GADGET_MANUFACTURER) +static char *iManufacturer = CONFIG_USB_GADGET_MANUFACTURER; #else static char *iManufacturer = "U-Boot"; #endif @@ -2073,11 +2073,11 @@ static int eth_bind(struct usb_gadget *gadget) * to choose the right configuration otherwise. */ if (rndis) { -#if defined(CONFIG_USB_RNDIS_VENDOR_ID) && defined(CONFIG_USB_RNDIS_PRODUCT_ID) +#if defined(CONFIG_USB_GADGET_VENDOR_NUM) && defined(CONFIG_USB_GADGET_PRODUCT_NUM) device_desc.idVendor = - __constant_cpu_to_le16(CONFIG_USB_RNDIS_VENDOR_ID); + __constant_cpu_to_le16(CONFIG_USB_GADGET_VENDOR_NUM); device_desc.idProduct = - __constant_cpu_to_le16(CONFIG_USB_RNDIS_PRODUCT_ID); + __constant_cpu_to_le16(CONFIG_USB_GADGET_PRODUCT_NUM); #else device_desc.idVendor = __constant_cpu_to_le16(RNDIS_VENDOR_NUM); @@ -2092,9 +2092,9 @@ static int eth_bind(struct usb_gadget *gadget) * supporting one submode of the "SAFE" variant of MDLM.) */ } else { -#if defined(CONFIG_USB_CDC_VENDOR_ID) && defined(CONFIG_USB_CDC_PRODUCT_ID) - device_desc.idVendor = cpu_to_le16(CONFIG_USB_CDC_VENDOR_ID); - device_desc.idProduct = cpu_to_le16(CONFIG_USB_CDC_PRODUCT_ID); +#if defined(CONFIG_USB_GADGET_VENDOR_NUM) && defined(CONFIG_USB_GADGET_PRODUCT_NUM) + device_desc.idVendor = cpu_to_le16(CONFIG_USB_GADGET_VENDOR_NUM); + device_desc.idProduct = cpu_to_le16(CONFIG_USB_GADGET_PRODUCT_NUM); #else if (!cdc) { device_desc.idVendor = diff --git a/include/configs/ma5d4evk.h b/include/configs/ma5d4evk.h index 6d25d84c6eb6..3aeb7e6ef136 100644 --- a/include/configs/ma5d4evk.h +++ b/include/configs/ma5d4evk.h @@ -97,7 +97,6 @@ #ifdef CONFIG_CMD_USB /* USB device */ -#define CONFIG_USBNET_MANUFACTURER "AriesEmbedded" #define CONFIG_USB_FUNCTION_MASS_STORAGE #define CONFIG_SYS_DFU_DATA_BUF_SIZE (1 * 1024 * 1024) #define DFU_DEFAULT_POLL_TIMEOUT 300 diff --git a/include/configs/sama5d2_ptc.h b/include/configs/sama5d2_ptc.h index 543592e3a574..2328c7614ed7 100644 --- a/include/configs/sama5d2_ptc.h +++ b/include/configs/sama5d2_ptc.h @@ -60,7 +60,6 @@ #endif /* USB device */ -#define CONFIG_USBNET_MANUFACTURER "Atmel SAMA5D2_PTC" /* Ethernet Hardware */ #define CONFIG_MACB diff --git a/include/configs/vinco.h b/include/configs/vinco.h index f5aaaa2ffe91..0a23b93f669e 100644 --- a/include/configs/vinco.h +++ b/include/configs/vinco.h @@ -64,7 +64,6 @@ #endif /* USB device */ -#define CONFIG_USBNET_MANUFACTURER "L+G VInCo" /* Ethernet Hardware */ #define CONFIG_PHY_SMSC diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index bbc3d4351bbd..5cb6ce6612d1 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -4983,7 +4983,6 @@ CONFIG_USBD_SERIAL_OUT_PKTSIZE CONFIG_USBD_VENDORID CONFIG_USBID_ADDR CONFIG_USBNET_DEV_ADDR -CONFIG_USBNET_MANUFACTURER CONFIG_USBTTY CONFIG_USB_AM35X CONFIG_USB_ATMEL