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 EC015C77B7C for ; Mon, 1 May 2023 20:49:41 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7C562862D4; Mon, 1 May 2023 22:49:39 +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=1682974179; bh=gjAVZ2CeqFLtNRFYjjYnXpDreL691Z7UwpjyEMFYx48=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=hu/xfZNe4rWg6s/e23ClEV21zeNlMeazERon6FGlcUJNxEU45UmWiP/DtsYjCuBlI 4odfvQGAEgeTRkXG9Ol/cTvj+gIjdHECxvRZagpLmgNBPEZJHjU1Ms/7qKxYn3YA1l oxDUR+raNU5cQskChqSAdzzpl2pJeLaKrXjK5FWrfUb/WfLidSuAGkpK7vUK50e1nS jSFU3nKYfmyjsyNZLcl8exz6ac+VXzTA5f62afi8VV8kGWD+Hbjismvs/0gfNu9Sp3 P0LjeCxfnUTKWNkXnl+/nFZ9w7tJUG9tNEMVKB6w6ztRekzZorsXN4wMHkKRmHs1Ui RMZUY/u/yNcjQ== 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 20BB0862D1; Mon, 1 May 2023 22:49:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1682974178; bh=gjAVZ2CeqFLtNRFYjjYnXpDreL691Z7UwpjyEMFYx48=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=TMJ0dv2jPFwl484lfvpM20SRKqMh4VdXbbrk80UZfq9eWbClPdbcROz7CZ3VkGoGu mA58DUYA6PbUChKy0r2Z1vTOrJwcb4iv8OUBmZ1xsxDgfb+TcaLha+LGZ1ku8eC/2U xzUE5KDEAmpz0TacC+wdeLvtSTX69ZmIbyzjPvKCAr8azMRO1W8zlFrIpQ3SscEQgu OM5lEfqhqzO8PG/KPJFvGUB3vhX5tnR3it29GzwMpWNEpdvx2oNBU+/eLYfqwhR2lx oM1iF9E4OFjuHvf7xkuOARTaKw8WlviZd9FkkHzIW9YjzarhV+ct0D9lIV9oRwOGA/ Of9OYQ5Hb0elQ== Message-ID: <8bcea380-94ec-db01-254f-e2f41d4aa4b9@denx.de> Date: Mon, 1 May 2023 22:49:37 +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> <9eef63ed-ccdd-77bf-8255-b5c8a19dad41@denx.de> <20230501185348.GF1134230@bill-the-cat> Content-Language: en-US From: Marek Vasut In-Reply-To: <20230501185348.GF1134230@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 20:53, Tom Rini wrote: > On Mon, May 01, 2023 at 07:40:57PM +0200, Marek Vasut wrote: >> 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 > > Yes, it resides in common/spl/Kconfig Uhhhhh, such USB symbol is not supposed to be there in the first place. However, looking at the meaning of that symbol, it seems it governs something else -- USB ethernet device(s) (like the USB-ethernet adapter which you plug into USB host port). So, the SPL_USB_ETHER symbol name is incorrectly named too and should be renamed to something else first I think ? Do I read it right ? And if so, then, back to my original reply -- there is no SPL_USB_ETHER symbol. Does it make more sense to really add one (not misnamed one) or not ?