Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B765C48BDF for ; Fri, 18 Jun 2021 16:38:26 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id EAE35610A7 for ; Fri, 18 Jun 2021 16:38:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EAE35610A7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5131E82BCF; Fri, 18 Jun 2021 18:38:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (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="bVxlz6d6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7065C82BB0; Fri, 18 Jun 2021 18:38:20 +0200 (CEST) Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) (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 54F1182BC9 for ; Fri, 18 Jun 2021 18:38:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qk1-x72a.google.com with SMTP id bj15so10672422qkb.11 for ; Fri, 18 Jun 2021 09:38:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=zBuCMInVVIzYN84y2akni3n6gyAvzmkLW1yW8yecrz8=; b=bVxlz6d6oBj6bLJm/0UXF/zoAfmgznwRDacHsfWgRCsgO5eQzYmZ4ctZ2LYuSuXEHl DRHtK0gYh2zOZkLO9/sot6a/E3NILtFIDXL9/DmoldhU/UI1AVOjBY2ZuSr29qrZUZ7/ Z8zLhk/mlE6oPhQnqgzPUFwztnAjlC2eHFs6g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=zBuCMInVVIzYN84y2akni3n6gyAvzmkLW1yW8yecrz8=; b=NQvrjWcICOLC1QB7u5UEcExhKeX61MBiW9uTxE7exJhltdWpYuMR8bSy048OouxjPD 73pwUnceI537BZJwYCbIEw0rXS7XvPai58lceun6Y8mTetV1AV+muim4c3fboggCNEc6 QpeOqsxgtjQPPacQnujd4xnGomu/IOben+HKn4KtDLk+KcCNJW0iRypexHPTIs27KYB0 jq5CwSuTEkyunxOsuFTqs51pEMh3/cKFRye2vbG7RAXbPJCqHDhXjcaMahk75YjooJmN WIoQKAnvyOQK43NVSk/NAw2m1zxIRNjOHUnUheY8b0EJmDjmvps7BLeFOeOA79WU4cuF WOmQ== X-Gm-Message-State: AOAM532nQwZAQids0PNHYjlryIuuPrWVadaS5/7Bsk2dFEah0opX8/vG Y5cNbmyqsfThsn9BEFAXW/Jk3g== X-Google-Smtp-Source: ABdhPJxYwxAK+OGAa4dxu45a2S0DaC7Ct0URxhf5TSgvdEo9KORGceHnJW9oFVLpepaDG/o8KfFGDQ== X-Received: by 2002:a37:63d6:: with SMTP id x205mr9946037qkb.501.1624034295041; Fri, 18 Jun 2021 09:38:15 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-143e-7f00-f95f-8895.res6.spectrum.com. [2603:6081:7b01:cbda:143e:7f00:f95f:8895]) by smtp.gmail.com with ESMTPSA id 5sm4367308qkj.99.2021.06.18.09.38.13 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Jun 2021 09:38:14 -0700 (PDT) Date: Fri, 18 Jun 2021 12:38:12 -0400 From: Tom Rini To: Pali =?iso-8859-1?Q?Roh=E1r?= , Marek Vasut Cc: Lokesh Vutla , Simon Glass , Ivaylo Dimitrov , Merlijn Wajer , maemo-leste@lists.dyne.org, u-boot@lists.denx.de, Pavel Machek Subject: Re: [PATCH 1/2] DM_USB: allow building without OF_CONTROL Message-ID: <20210618163812.GR9516@bill-the-cat> References: <20210618145724.2558-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="1xj3MFft1zYEeAFp" Content-Disposition: inline In-Reply-To: <20210618145724.2558-1-pali@kernel.org> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean --1xj3MFft1zYEeAFp Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable +Marek On Fri, Jun 18, 2021 at 04:57:23PM +0200, Pali Roh=E1r wrote: > From: Ivaylo Dimitrov >=20 > Currently DM_USB requires OF_CONTROL to be enabled, otherwise link errors > occur. On the other hand OF_CONTROL requires board code to be migrated to > DT, which is not always possible or required. >=20 > Fix that by conditionally compiling OF_CONTROL specific sections in USB > related drivers code in the same way like it is done in the other drivers. > Also, auto select OF_LIBFDT if DM_USB is selected but OF_CONTROL is not. > Introduce a new Kconfig option OF_NODE used to compile of_node.c in case > OF_CONTROL is not enabled. Fix deprecation warning condition as well. >=20 > Signed-off-by: Ivaylo Dimitrov > Tested-by: Pali Roh=E1r > --- > Makefile | 3 +-- > common/usb_hub.c | 2 ++ > drivers/core/Makefile | 7 ++++++- > drivers/usb/Kconfig | 6 ++++++ > drivers/usb/host/usb-uclass.c | 5 ++++- > 5 files changed, 19 insertions(+), 4 deletions(-) >=20 > diff --git a/Makefile b/Makefile > index a73481d18c14..e1cf0200b72c 100644 > --- a/Makefile > +++ b/Makefile > @@ -1114,8 +1114,7 @@ ifneq ($(CONFIG_DM),y) > @echo >&2 "See doc/driver-model/migration.rst for more info." > @echo >&2 "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D" > endif > - $(call deprecated,CONFIG_DM_USB CONFIG_OF_CONTROL CONFIG_BLK,\ > - USB,v2019.07,$(CONFIG_USB)) > + $(call deprecated,CONFIG_DM_USB CONFIG_BLK,USB,v2019.07,$(CONFIG_USB)) > $(call deprecated,CONFIG_DM_PCI,PCI,v2019.07,$(CONFIG_PCI)) > $(call deprecated,CONFIG_DM_VIDEO,video,v2019.07,\ > $(CONFIG_LCD)$(CONFIG_VIDEO)) > diff --git a/common/usb_hub.c b/common/usb_hub.c > index ba11a188ca64..c6b042a68440 100644 > --- a/common/usb_hub.c > +++ b/common/usb_hub.c > @@ -956,7 +956,9 @@ U_BOOT_DRIVER(usb_generic_hub) =3D { > UCLASS_DRIVER(usb_hub) =3D { > .id =3D UCLASS_USB_HUB, > .name =3D "usb_hub", > +#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) > .post_bind =3D dm_scan_fdt_dev, > +#endif > .post_probe =3D usb_hub_post_probe, > .child_pre_probe =3D usb_child_pre_probe, > .per_child_auto =3D sizeof(struct usb_device), > diff --git a/drivers/core/Makefile b/drivers/core/Makefile > index 5edd4e413576..2cf5873a3278 100644 > --- a/drivers/core/Makefile > +++ b/drivers/core/Makefile > @@ -15,6 +15,11 @@ obj-$(CONFIG_$(SPL_)OF_LIVE) +=3D of_access.o of_addr.o > ifndef CONFIG_DM_DEV_READ_INLINE > obj-$(CONFIG_OF_CONTROL) +=3D read.o > endif > -obj-$(CONFIG_OF_CONTROL) +=3D of_extra.o ofnode.o read_extra.o > +obj-$(CONFIG_OF_CONTROL) +=3D of_extra.o read_extra.o > +ifdef CONFIG_OF_NODE > +obj-y +=3D ofnode.o > +else > +obj-$(CONFIG_OF_CONTROL) +=3D ofnode.o > +endif > =20 > ccflags-$(CONFIG_DM_DEBUG) +=3D -DDEBUG > diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig > index f6975730bf8d..cb0593a724f0 100644 > --- a/drivers/usb/Kconfig > +++ b/drivers/usb/Kconfig > @@ -33,9 +33,15 @@ menuconfig USB > =20 > if USB > =20 > +config OF_NODE > + bool > + default n > + > config DM_USB > bool "Enable driver model for USB" > depends on USB && DM > + select OF_LIBFDT if !OF_CONTROL > + select OF_NODE if !OF_CONTROL > help > Enable driver model for USB. The USB interface is then implemented > by the USB uclass. Multiple USB controllers of different types > diff --git a/drivers/usb/host/usb-uclass.c b/drivers/usb/host/usb-uclass.c > index e3b616c3266a..71dc578550f5 100644 > --- a/drivers/usb/host/usb-uclass.c > +++ b/drivers/usb/host/usb-uclass.c > @@ -770,6 +770,7 @@ int usb_detect_change(void) > =20 > static int usb_child_post_bind(struct udevice *dev) > { > +#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) > struct usb_dev_plat *plat =3D dev_get_parent_plat(dev); > int val; > =20 > @@ -787,7 +788,7 @@ static int usb_child_post_bind(struct udevice *dev) > plat->id.match_flags |=3D USB_DEVICE_ID_MATCH_INT_CLASS; > plat->id.bInterfaceClass =3D val; > } > - > +#endif > return 0; > } > =20 > @@ -848,7 +849,9 @@ UCLASS_DRIVER(usb) =3D { > .id =3D UCLASS_USB, > .name =3D "usb", > .flags =3D DM_UC_FLAG_SEQ_ALIAS, > +#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) > .post_bind =3D dm_scan_fdt_dev, > +#endif > .priv_auto =3D sizeof(struct usb_uclass_priv), > .per_child_auto =3D sizeof(struct usb_device), > .per_device_auto =3D sizeof(struct usb_bus_priv), > --=20 > 2.20.1 >=20 --=20 Tom --1xj3MFft1zYEeAFp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmDMy/AACgkQFHw5/5Y0 tyz5vgv/Q80qDjc22DH86ZCg6QptjtCKu+UJxZ14YOh/QqU1rh5Svt/6Q/jEzg8j hXgoJqJShnnsayCHIJzRaEuyd6F4ZsFQvc9L2zSixGE5DbjnldXrUEwi5xzp4eCx sm71meS1G+210k5/4KOt8DfMwSpiH+TGB6UEzYJsQpRuZXHrNYloYd3jVj/3nHWR sD/Bw0/53gzpxiwsVprLMqInkc5YAaOgK0+3UcgLHvp6oiOhKRM37B1BUGQz88xR 6XyP6zkamcM9cQZsMSRhf+2/k/2Lv4KtBS7twR8NWK4/N3A+sKsPNeQdJWCwvo5W 4sPMcCXlbNeyry5BRhz7Rfmg+LJ6d7rACCviiMsLvBfDh84NrR7+tk6lB2pRxX8s uSf3UdE18cpM+nmQOUb0b28tCVuk8BOAsaPH7yu/aHonMgyn/mvVmxfIQnhUuVAM iMtHpKMBgXft+FW/hetextCyC+0mAq8LZCA/+EuuP7XJvyu1T6wpniZgKu/rTr43 1geBBK9w =g0if -----END PGP SIGNATURE----- --1xj3MFft1zYEeAFp--