Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp2474409rwb; Sun, 6 Aug 2023 19:58:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHUxWPP03bVCQOQADi/lwY4RRsnXIA+x8Mdh2kCXFWDI94zzasS+mJApOeZ2eYajgvx4/iJ X-Received: by 2002:a05:6a21:7983:b0:137:7198:af9b with SMTP id bh3-20020a056a21798300b001377198af9bmr6215135pzc.56.1691377093493; Sun, 06 Aug 2023 19:58:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691377093; cv=none; d=google.com; s=arc-20160816; b=sRn1MbmWn6A46uFEzc3WEcxmh3fDTqOWAt10VdTL22RXP8VCyXygGUouggkaznAoY3 OclkwlA248wR2oDivuDJ+Q5NYuTrG1zzryNKrjiHQnx6bIE/cWnd358yborEHBb5TeKh +sPk3oS468fZJuTqMjK620V5Ggep68C05wumTFlfLuW2rnG0ml7rG7E66BCMPiaAv1Mk Cy3NbWaXXfFflAxkR+h33B7RyM7WJCkBZG08VHkviENr/5z1xkRrUqCs/HCfddTmOax0 clcscf1zQKyz3mWK7OwRYfIN0H42tq4KTBCSMtFUpeO3oV3hJF6OFT4hR+83TYioWlAm Bf8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=DqACA0Bo7HdbU1khhrHyuAJEh/Bxdbnb/NceOl37CJg=; fh=tYR0/3O20M2Vb127Q5PU6annTyorU6+tcRqpEXSy8nY=; b=nPpslHZjRDxP9OrGvtIRW26+eQJSQ0km9LR/lCZ4igLIQ30ViCo+lK/Z+5yqP7Mo9Q MsJHWNkweH8a8CSSsdRULBYTt/jqALbBDVbpQoSRxqP4jBqeGYkitvaQ4oeBLntT6JR+ F4ced2ZBGCU6xYc702t9wcnj6lDcBGo+WKbCg7MqMBMEvKpIurdOnn5RSfMNSChb2f2V SaBTd5mHgqaBYOIclzL8aqRYObghv3Ky5fxe2RzY6UF3xpMBpIWwUHoe+pB44AsmmcF5 IuAvqxY9TSarCmWj0EUrzGrzsB/dtGuPV3d655teNdVUtlukN1nB6Bqr9kxITVo8M67L 6snw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qiqVSHhv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e7-20020a170902744700b001b81a112f9bsi5037588plt.586.2023.08.06.19.58.02; Sun, 06 Aug 2023 19:58:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qiqVSHhv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229881AbjHGCwO (ORCPT + 99 others); Sun, 6 Aug 2023 22:52:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229885AbjHGCwN (ORCPT ); Sun, 6 Aug 2023 22:52:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F7211986 for ; Sun, 6 Aug 2023 19:52:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D43B9612F5 for ; Mon, 7 Aug 2023 02:52:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 345ECC433C7; Mon, 7 Aug 2023 02:51:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691376724; bh=gJk6vVUXiDkmun1RcHH2FC9OYEdQQqWcGTvzESd3jtk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qiqVSHhvLFxrJT5OH8ndniw3nRBvfBjs/YcaJ6ndswkbACC/4rTH3sIDzQiS11m5m x3cEMjZUqhxk42ZR024u2P4pSQ5HlszAbBWbJZYqXLl7iv3s9zDSzwc5Dduv8who+G EEPpMRZL2/aLE1V0T80GUXLAVf3NZ7j4zjMvJQhf9qEMg9BU/PcBaF2Efv6jaJ9daJ fBxyK/qzIUIIX/z2X86WDvlI2uXn2RHhtcN3kMhfmO7CNYpglnP4dSmlGy3FzRdN6u WEkcNONDJePjlHHE6yDaQybnOkG7qI1pT/KQqPaHe7BtXv1QdVVVLWpQKUATfMj1hc CQoom4Gnh0mhQ== Date: Mon, 7 Aug 2023 10:51:53 +0800 From: Shawn Guo To: "Peng Fan (OSS)" Cc: s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, aisheng.dong@nxp.com, alexander.stein@ew.tq-group.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peng Fan Subject: Re: [PATCH V5 4/9] firmware: imx: scu: use soc name for soc_id Message-ID: <20230807025153.GM151430@dragon> References: <20230731090449.2845997-1-peng.fan@oss.nxp.com> <20230731090449.2845997-5-peng.fan@oss.nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230731090449.2845997-5-peng.fan@oss.nxp.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 31, 2023 at 05:04:44PM +0800, Peng Fan (OSS) wrote: > From: Peng Fan > > Same as soc-imx8m and soc-imx driver, use soc name for soc_id > > Signed-off-by: Peng Fan > --- > drivers/firmware/imx/imx-scu-soc.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/drivers/firmware/imx/imx-scu-soc.c b/drivers/firmware/imx/imx-scu-soc.c > index ef9103987e76..cb8377670a7d 100644 > --- a/drivers/firmware/imx/imx-scu-soc.c > +++ b/drivers/firmware/imx/imx-scu-soc.c > @@ -107,10 +107,12 @@ int imx_scu_soc_init(struct device *dev) > return -EINVAL; > > /* format soc_id value passed from SCU firmware */ > - val = id & 0x1f; > - soc_dev_attr->soc_id = devm_kasprintf(dev, GFP_KERNEL, "0x%x", val); > - if (!soc_dev_attr->soc_id) > - return -ENOMEM; > + if (of_machine_is_compatible("fsl,imx8qm")) > + soc_dev_attr->soc_id = "i.MX8QM"; > + else if (of_machine_is_compatible("fsl,imx8qxp")) > + soc_dev_attr->soc_id = "i.MX8QXP"; > + else if (of_machine_is_compatible("fsl,imx8dxl")) > + soc_dev_attr->soc_id = "i.MX8DXL"; Is it possible to deduce SoC name from the id retrieved from SCU firmware? IMO, device tree should be the last resort when there is no other sources for the such information. Shawn > > /* format revision value passed from SCU firmware */ > val = (id >> 5) & 0xf; > -- > 2.37.1 >