Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 45884C77B73 for ; Mon, 1 May 2023 17:41:01 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 058CF8628D; Mon, 1 May 2023 19:40:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1682962859; bh=D8tfNxrAaoc/8wr1m2a0+xkVUr1oj9t38ecCZQzo6dY=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=kDjLW8wrqJDtlg9CvxT9wQMM1D8iA6sANzkP3NFPMNLt9uQyUY16obo7eQ8wwC7RL 9+QKEXD4LSCxYtW5AsFP4rQehA83Az9T68Jgghx041pbEPfRSlREMHbP2DM+/Z0MU/ DYXsiOcRXCZvT/HUtxdKZQax+lF+a3u8/dJ5uwy5IqQ5wqTJBXgVN7Biaazov0y882 wR193Kpw1pRjOzjbvRu996dXfprYiqdnDz4ZhK2XM+jkBbbwmToCCjI7/C+QLH71gE DHYTG5k1T6mXfYaW4mycRrSrHvJ89WD/JDIX0P3VeIsE6GJIRR2enRWnFCoG7KnWo3 +sGLY9L9gQOfQ== Received: from [127.0.0.1] (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 9E31E86277; Mon, 1 May 2023 19:40:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1682962857; bh=D8tfNxrAaoc/8wr1m2a0+xkVUr1oj9t38ecCZQzo6dY=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=cKEjbiXeuRBNmtbCZfNquAzW35opyU+kaifqotoJbegSZI5xHEixFIJ6fWIgV8vkx BcRoQuXv63g7aJj6prFe6x1LlUK0pZ+Uk9jC6fFrXwdsCi8WXeFsV10tbv/ZdB6JNA Ak+aXG9E8QVsUXocLSDDENDCSWlVOsJpz648UrD8Thue4ZG5jzMLVZ4yzVDEvgnx+T jE8MiXxHKQSLdrB1hFK8UJcuKxcb935SFpPZOxb1tJgHgjWt/I5Li0xF1W7h6TlH8M rD4XebtFmVfYbHx8exFO1QNL7Zg9fftY94j8DxpUEW0/PpCcUR8QNQvefckCSt1cYt 4x5SVLiyXTB+A== Message-ID: <9eef63ed-ccdd-77bf-8255-b5c8a19dad41@denx.de> Date: Mon, 1 May 2023 19:40:57 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH] usb: gadget: Compile USB ethernet gadget only if NET is enabled To: Tom Rini Cc: u-boot@lists.denx.de, Lukasz Majewski References: <20230430212035.379838-1-marex@denx.de> <20230501134756.GX1134230@bill-the-cat> <20230501172333.GE1134230@bill-the-cat> Content-Language: en-US From: Marek Vasut In-Reply-To: <20230501172333.GE1134230@bill-the-cat> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean On 5/1/23 19:23, Tom Rini wrote: > On Mon, May 01, 2023 at 06:53:52PM +0200, Marek Vasut wrote: >> On 5/1/23 15:47, Tom Rini wrote: >>> On Sun, Apr 30, 2023 at 11:20:35PM +0200, Marek Vasut wrote: >>> >>>> In case NET networking is not enabled, it is not possible to compile >>>> the USB ethernet gadget. Protect the symbols in Makefile to avoid build >>>> failure. Such build failure may occur e.g. in case NET and USB ethernet >>>> gadget is enabled in U-Boot proper, but not in SPL. >>>> >>>> Signed-off-by: Marek Vasut >>>> --- >>>> Cc: Lukasz Majewski >>>> --- >>>> drivers/usb/gadget/Makefile | 2 ++ >>>> 1 file changed, 2 insertions(+) >>>> >>>> diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile >>>> index 6cfe0f3a041..36f65e7eb95 100644 >>>> --- a/drivers/usb/gadget/Makefile >>>> +++ b/drivers/usb/gadget/Makefile >>>> @@ -34,8 +34,10 @@ endif >>>> obj-$(CONFIG_CI_UDC) += ci_udc.o >>>> +ifeq ($(CONFIG_$(SPL_TPL_)NET),y) >>>> obj-$(CONFIG_USB_ETHER) += ether.o >>>> obj-$(CONFIG_USB_ETH_RNDIS) += rndis.o >>>> +endif >>>> # Devices not related to the new gadget layer depend on CONFIG_USB_DEVICE >>>> # This is really only N900 and USBTTY now. >>> >>> Why can't we just enforce this via Kconfig? >> >> Because there is no SPL/TPL USB_ETHER Kconfig . >> Do we want to grow the Kconfig file with those instead ? > > Ah right. Yes, we have SPL_USB_ETHER today This is exactly the opposite of what I wrote. And no, we do NOT have this symbol, see: $ git grep SPL_USB_ETHER drivers/usb | wc -l 0 , and could just add > SPL_USB_ETH_RNDIS. Are there TPL users today for this? There's no > TPL_USB at all. [...]