From mboxrd@z Thu Jan 1 00:00:00 1970 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=-8.0 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,USER_AGENT_MUTT 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 CE8A0C43381 for ; Mon, 4 Mar 2019 13:20:13 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9966E20645 for ; Mon, 4 Mar 2019 13:20:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mebCX+Kk"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qWwR6mvK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9966E20645 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=XuqClOHaDaj56zRwLA9S5EHyQc71WunmV068Pjyw12A=; b=mebCX+KkFQ4UBTT7AmOvvtGCT dU2iEzKI1O6XRMxzmLtuUyExSE6KINL3qj43dPXu4nMAevykeg5Q9eVpgCTx1OZ2StjUzKCGsyfDI YtmYpOdTKWx8oZU/a+U2XpT+sQh5z/U07KigOx9jD1zdc7DSDPsI+q2ZnVPjnizeZF4gJI0eHfew+ RyEChy11aTmU8R5WHrfmiQS8pwdiDpCi8K51Hj64XFRPxDIfiUTYSG/uzLW/jc9Thg+ZaOvao9OIe j2Arb/e0v/vZvnCJ+Q6U/wqU2ettOTH79O/SxeW4OAGFxBdPZJItJCxZTpmVuc55h1y9z48UHyfuk HpZDv+pKQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h0nVk-000378-2B; Mon, 04 Mar 2019 13:20:04 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h0nVf-0002qR-T5 for linux-arm-kernel@lists.infradead.org; Mon, 04 Mar 2019 13:20:01 +0000 Received: by mail-wr1-x443.google.com with SMTP id o17so5515902wrw.3 for ; Mon, 04 Mar 2019 05:19:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=cSCoB7iuhomVqyUAdJ7ny4SQBfiZfYIRuQdOH0h+A5o=; b=qWwR6mvKpg8+eQKNiRwSgvb2Ev9wCHILpwk6ZGovJIull0P8lSVVjdiwvcJWyZ1SDu 767GClL9pp8gmew9LqhkoFfT7y6/feH4afddVa10Zbd79OUveqtvFTt9tGbAcXf6mSlm CfXkMFI1G2U1pc42Yh61kXJbuM2NnNvf3A3jvdQxEyywD7ilurUw0iabNVaGNmYJiKIt SrCLCCjTNaygTmCFoZa9IOfo8mQZaLnCSNvqZZLbxbXjoY9xKvhTxFhI+DkPJt4usjpt Ig72/8k9QkgViRoCtWzENyzJvi4EGNW3vWDrx23Lp8yYU8nPWMSTf8UGr3D0BnnrJX7J Zqaw== 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=cSCoB7iuhomVqyUAdJ7ny4SQBfiZfYIRuQdOH0h+A5o=; b=IL05xzvwMC5eLt/K9l9cozieSMlj8p25wuIoIhX1RGlYkjSED76pxZvsT6vXJRUzVX GaIVbEvvqCQ0v5LAcKGha0wAjhq8F7BVYDw1+XVHBzYYUFwa8ZM78uLpTYJ7cWqbtDH/ iNhseUbO/4lRue/qNGbCVJn1eUmfIBHiV9h8Kwei5P3129zeGKJlpqGQRDb0+riWXdd9 PBUbBouamQIQLxNR5TX3THnhP/qvaQzNHF6Z0RJIzO0RDIaQeE2F04Saoo++VVdrqu1w cKUfpDCVqjjORvqeasNGSZtFIJFqLFmX5dEKKZD6DW8k2gBWXmKwd7UhBe5LdDAhYn4O LUPA== X-Gm-Message-State: APjAAAWSdOu716y3pBkrnSrOc34QbXbjBb1/2wQ5/A11hzdLw65ioNlV T1TPiiuQ7SUpqRWD1JM+HGU= X-Google-Smtp-Source: APXvYqyFWX/tN9ujhNVzRYODIpNCGOC2f9sT0VE4xqN58c1Ps8FRjQNMEPGSdWEbOgAB2V471Y4cBg== X-Received: by 2002:adf:f103:: with SMTP id r3mr13884167wro.50.1551705598197; Mon, 04 Mar 2019 05:19:58 -0800 (PST) Received: from localhost (pD9E51D2D.dip0.t-ipconnect.de. [217.229.29.45]) by smtp.gmail.com with ESMTPSA id v10sm11369205wrn.26.2019.03.04.05.19.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Mar 2019 05:19:57 -0800 (PST) Date: Mon, 4 Mar 2019 14:19:56 +0100 From: Thierry Reding To: Kejia Hu Subject: Re: [PATCH v2 1/6] soc/tegra: initial tegra-automotive detection Message-ID: <20190304131956.GJ9040@ulmo> References: <20190301153540.14954-1-kejia.hu@codethink.co.uk> <20190301153540.14954-2-kejia.hu@codethink.co.uk> MIME-Version: 1.0 In-Reply-To: <20190301153540.14954-2-kejia.hu@codethink.co.uk> User-Agent: Mutt/1.11.3 (2019-02-01) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190304_052000_108620_48006084 X-CRM114-Status: GOOD ( 19.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Ben Dooks , Thomas Preston , linux-tegra@vger.kernel.org, digetx@gmail.com, linux-arm-kernel@lists.infradead.org Content-Type: multipart/mixed; boundary="===============1089446718941155943==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============1089446718941155943== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="7AwgMNpd3VkAVXjS" Content-Disposition: inline --7AwgMNpd3VkAVXjS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 01, 2019 at 03:35:35PM +0000, Kejia Hu wrote: > From: Ben Dooks >=20 > Add an initial soc_is_tegra_auto() with detection > via a change in the device-tree. >=20 > Also print the path taken through soc_is_tegra_auto() to > allow debugging. Only print when debug is enabled as this > function may be be called from multiple places, resulting > in duplicated messages in production. >=20 > Signed-off-by: Ben Dooks > Signed-off-by: Thomas Preston > Signed-off-by: Kejia Hu > --- > drivers/soc/tegra/common.c | 23 +++++++++++++++++++++++ > drivers/soc/tegra/fuse/tegra-apbmisc.c | 2 ++ > include/soc/tegra/common.h | 1 + > include/soc/tegra/fuse.h | 1 + > 4 files changed, 27 insertions(+) >=20 > diff --git a/drivers/soc/tegra/common.c b/drivers/soc/tegra/common.c > index 7bfb154d6fa5..a10bd26fb5df 100644 > --- a/drivers/soc/tegra/common.c > +++ b/drivers/soc/tegra/common.c > @@ -9,6 +9,7 @@ > #include > =20 > #include > +#include > =20 > static const struct of_device_id tegra_machine_match[] =3D { > { .compatible =3D "nvidia,tegra20", }, > @@ -34,3 +35,25 @@ bool soc_is_tegra(void) > =20 > return match !=3D NULL; > } > + > +static const struct of_device_id tegra_machine_match_auto[] =3D { > + { .compatible =3D "nvidia,tegra20auto", }, > + { .compatible =3D "nvidia,tegra30auto", }, > + { }, > +}; > + > +bool soc_is_tegra_auto(void) > +{ > + struct device_node *root; > + bool id_match =3D false; > + > + root =3D of_find_node_by_path("/"); > + > + if (root && of_match_node(tegra_machine_match_auto, root)) > + id_match =3D true; > + > + pr_debug("%s of_device_id match %d, tegra_sku_info.is_automotive %d\n", > + __func__, id_match, tegra_sku_info.is_automotive); > + > + return id_match || tegra_sku_info.is_automotive; > +} Why do we need two ways of specifying the same thing? If we can read this information from fuses, I don't think we need the extra compatible string matching. Also, if you're going to use this exclusively for clock setup, then the alternative is to do that as part of the board's device tree, as Dmitry pointed out. Thierry --7AwgMNpd3VkAVXjS Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAlx9JfoACgkQ3SOs138+ s6ERjQ/6Ay3gZcRVoP/6DVVhcgS4TqaXaB7C2xvQpSxVmfzlRxNiAONrM8q3akzx Hth+ZyvTcroPMLAyzPX5vkHa4ai4XgOnjJrKFvI40NjtZ3+VLss03KLIX70LHwQk tWHX+G1m98hX8oAMHNzufTofd7BGiaqStMXZYbb75wJh/Lx+utoreJo9QOmMOmZv lo9yScTvlXrSsxwK9m4AToIpaY5ml41SptoXtBXvUcSUu8326koGqWFfm5PUUkqJ pSiwwMA2duOKfpVSD4K8fBARQAigbatsTXUX5Oh8BqFu2jOywwiezegJq2b6XEgY xzI5eXTQ3R4lOgThv5DQ8m6K9rcDdc8gFiFir0iNF1xd/sbZ9GrRfExRcAo+mB3E Lh/L16KBvmn437ALkeFce6Y59trp4fy4Afn46D2IrJnfq5gc4OAP1sEUsvGNNgnH pmrBHYJMzskpaMh5CI3UwoTHzCiwYEBu2RiQoM6TDVDkcfy2QEVsI4SS+qOoGE8U pYE9uOQfv5x81qKwv2amSr8ttotaGf8Dcz23b31EcMDVmrb34v0av8CBiHSz1U5E Y116gTthzhoqfvUjBL9iarcNYnEn2UQ+5CMTIjz55htOzAn9D4i9pM5j2hPjKX0z KAw/iK02FLhWAzZIPl8yM7oUYtN098nGDXQNoswSMdSN4jQsDV8= =KOLS -----END PGP SIGNATURE----- --7AwgMNpd3VkAVXjS-- --===============1089446718941155943== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============1089446718941155943==--