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 A0385C77B7F for ; Wed, 3 May 2023 21:57:40 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1C8CB8478D; Wed, 3 May 2023 23:57:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="eTjsPsk8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F12F48476D; Wed, 3 May 2023 23:57:36 +0200 (CEST) Received: from mail-yw1-x1130.google.com (mail-yw1-x1130.google.com [IPv6:2607:f8b0:4864:20::1130]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4A3E784788 for ; Wed, 3 May 2023 23:57:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-yw1-x1130.google.com with SMTP id 00721157ae682-55a829411b5so33246437b3.1 for ; Wed, 03 May 2023 14:57:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; t=1683151053; x=1685743053; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=92Ee2EcwiWdNqPoNTK6gHdpIvcvX15F00rtT5C8r2PQ=; b=eTjsPsk8U7iLkGQNlORr3TIl21EGGCjC/7YtNEDs2uT387ziIobXFXOQCvCmD5VKLv RlXb2gieQQtKKfsPcyBSt3xhDkOCmbUfQT6vkVkmZ46GvEqDrCEMRnlAxu3LzbyVM41D DtSam0c2PiJdhdSHCJNKwoEx3abH51ic5Fu1w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683151053; x=1685743053; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=92Ee2EcwiWdNqPoNTK6gHdpIvcvX15F00rtT5C8r2PQ=; b=ajy/FcCD24Zj8cSzEWQaYKcoGfO9gNsM9Fur/WC4cdOySumLbNjZajDEpYw936o+oF PNZQSU001DDmUIM/bgFxYPKJTiq5oiF1PZNCYjyP5pUzme5FAZMmQwgPw5/mGvneH9mc xo8dmu3skoFHc8lTKhPynsRXItihrK3ikbrr7my0tDAwCUpK9pSVgMG64nw7Uxd5n7mD zTEPe9PTCi/GYOyyw7pPPbhiSHqO5Uf99n9NWsA0gtdPLeqBGUKnBxfR8cwM/yloE88h +a0EubDe3P96hIY/FPrcVsXcahMDJGvnIlyQlSgZFEXHyF5V726bELhxDj5lXgNNBj8V uKlw== X-Gm-Message-State: AC+VfDzkwf31KR+M77vDYzpGxcyV/G988KLVVT6btN3jCuMUSVqbVDjd dsw51AeUxr5+vIFlkjLsVkrO1A== X-Google-Smtp-Source: ACHHUZ5wQvi+keaWoxKrY76HS38jtnK1Pih8R9Y6azBnnuFURknI5F8DdB3N0TVcwmHfQ0fKZXbISQ== X-Received: by 2002:a81:6a05:0:b0:52e:f109:ba7a with SMTP id f5-20020a816a05000000b0052ef109ba7amr3202ywc.51.1683151052723; Wed, 03 May 2023 14:57:32 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b00-6400-ba0c-869b-261a-b526.res6.spectrum.com. [2603:6081:7b00:6400:ba0c:869b:261a:b526]) by smtp.gmail.com with ESMTPSA id v131-20020a816189000000b00545a08184c9sm8947211ywb.89.2023.05.03.14.57.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 14:57:32 -0700 (PDT) Date: Wed, 3 May 2023 17:57:30 -0400 From: Tom Rini To: Marek Vasut Cc: u-boot@lists.denx.de, Lukasz Majewski Subject: Re: [PATCH] usb: gadget: Compile USB ethernet gadget only if NET is enabled Message-ID: <20230503215730.GB600017@bill-the-cat> 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> <8bcea380-94ec-db01-254f-e2f41d4aa4b9@denx.de> <20230501211849.GH1134230@bill-the-cat> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="60E52Ix4lpsi6STB" Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett 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 --60E52Ix4lpsi6STB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 03, 2023 at 11:43:57PM +0200, Marek Vasut wrote: > On 5/1/23 23:18, Tom Rini wrote: > > On Mon, May 01, 2023 at 10:49:37PM +0200, Marek Vasut wrote: > > > 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: > > > > > > > >=20 > > > > > > > > > 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 an= d USB ethernet > > > > > > > > > gadget is enabled in U-Boot proper, but not in SPL. > > > > > > > > >=20 > > > > > > > > > Signed-off-by: Marek Vasut > > > > > > > > > --- > > > > > > > > > Cc: Lukasz Majewski > > > > > > > > > --- > > > > > > > > > drivers/usb/gadget/Makefile | 2 ++ > > > > > > > > > 1 file changed, 2 insertions(+) > > > > > > > > >=20 > > > > > > > > > diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/ga= dget/Makefile > > > > > > > > > index 6cfe0f3a041..36f65e7eb95 100644 > > > > > > > > > --- a/drivers/usb/gadget/Makefile > > > > > > > > > +++ b/drivers/usb/gadget/Makefile > > > > > > > > > @@ -34,8 +34,10 @@ endif > > > > > > > > > obj-$(CONFIG_CI_UDC) +=3D ci_udc.o > > > > > > > > > +ifeq ($(CONFIG_$(SPL_TPL_)NET),y) > > > > > > > > > obj-$(CONFIG_USB_ETHER) +=3D ether.o > > > > > > > > > obj-$(CONFIG_USB_ETH_RNDIS) +=3D rndis.o > > > > > > > > > +endif > > > > > > > > > # Devices not related to the new gadget layer depend= on CONFIG_USB_DEVICE > > > > > > > > > # This is really only N900 and USBTTY now. > > > > > > > >=20 > > > > > > > > Why can't we just enforce this via Kconfig? > > > > > > >=20 > > > > > > > Because there is no SPL/TPL USB_ETHER Kconfig . > > > > > > > Do we want to grow the Kconfig file with those instead ? > > > > > >=20 > > > > > > Ah right. Yes, we have SPL_USB_ETHER today > > > > >=20 > > > > > This is exactly the opposite of what I wrote. > > > > >=20 > > > > > And no, we do NOT have this symbol, see: > > > > >=20 > > > > > $ git grep SPL_USB_ETHER drivers/usb | wc -l > > > > > 0 > > > >=20 > > > > Yes, it resides in common/spl/Kconfig > > >=20 > > > Uhhhhh, such USB symbol is not supposed to be there in the first plac= e. > >=20 > > There's long running debate on where some symbols should be for a better > > overall experience of enabling features. >=20 > Putting my USB maintainer hat on, USB drivers related symbols should be in > drivers/usb/ . With everything in Kconfig finally, I have no objection to someone making patches to clean up and make the menus more consistent. However you'd like to move all of SPL*USB* out of common/spl/Kconfig and under drivers/usb/ is OK with me. > > > However, looking at the meaning of that symbol, it seems it governs > > > something else -- USB ethernet device(s) (like the USB-ethernet adapt= er > > > 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 > > > ? > > >=20 > > > Do I read it right ? > > >=20 > > > And if so, then, back to my original reply -- there is no SPL_USB_ETH= ER > > > symbol. Does it make more sense to really add one (not misnamed one) = or not > > > ? > >=20 > > We should re-work things as needed so that we have more Kconfig symbols, > > as needed. There's some overlap / overloading of things today as > > platforms have been able to (and I think am335x_evm is still one that > > builds for) supporting making a USB RNDIS gadget device happen in SPL, > > so that we can then be fed the next stage of U-Boot. >=20 > I have a hardware where I only want USB ethernet support in U-Boot, not in > SPL, hence this patch. >=20 > But the symbol which is currently named SPL_USB_ETHER as defined in commo= n/ > does NOT ungate SPL CDC ethernet support, it ungates SPL USB host ethernet > (like those ASIX USB-ethernet adapters), do you agree ? >=20 > If yes, then the symbol itself should be renamed . What I see in terms of wording in common/spl/Kconfig doesn't match what it builds, which is what it's intended to build. Fire up a build of am335x_evm_defconfig and look at what's under drivers/usb/ which is what the platform wants. Gadget ethernet via RNDIS. So the help is wrong on SPL_USB_ETHER. --=20 Tom --60E52Ix4lpsi6STB Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmRS2McACgkQFHw5/5Y0 tyyEBgwAkeempMZLSHmGe7UBVz1d7/ing+vx+1UyAmvUb8vB8hzZM4ssF0rGSKpQ qMKpmIOS2uYLjde4XYhI8jR8P+1N7ib3AX+3MW2ZjlVXNfIyN87zsx2Fcq9Qpp2M boC8udmJA74kxOOkz4FSFF1WGA5ckt/aPuezRz86W8U1ZdSxF7lwAyQ4ulLyyL4N kBsNnHwHh85ytGLv0HO3LHmCDmu9955bHhg0Q0BP1WpzcdGGPBpbJGLEi5/pvJ/R eejcYz7F6SoMM+8WrS9gr1q/WHxU5ZwDPxrpBFFusJ1PlUamC4FoncBvU4LTGuh1 ye/6Oarg5HTztJfzRjFq5/G7h89uwG52YQ3PVmKZaYP/zGNyWXj9oL4zP0Lxox/c H0p72vEBKgIxo7XY1DGlU2PSjUjckCI/D7JFAHhEDZTSVb0y3/T3tSdw8YuokqJg 9bJ/s7W/MNrjpkRsK3uQNc60rbbHNkeTN+DwjAX7lstr/e1S6+2rk5rTZPdgAFxh +SihxyFx =3QiW -----END PGP SIGNATURE----- --60E52Ix4lpsi6STB--