Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3023583ybi; Tue, 2 Jul 2019 00:36:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqy0O0o2looFU32NDl8Ckd/p4xrmPL8GLE8/z7FNmMd5PelIaJT9ChOYWeXXDjryaEjBZuZZ X-Received: by 2002:a63:6fc9:: with SMTP id k192mr15959327pgc.20.1562052971314; Tue, 02 Jul 2019 00:36:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562052971; cv=none; d=google.com; s=arc-20160816; b=MVJmzgCt1/sOkwKAr4y6GDw9xvj/h+myjlucBPTY2pdtfW5fskih9bDpN6R/GUtIZq JzVBQGHTPwY+4ftKXhblZK/nSdEEzE5E2rrh46lwi9Uwq5WMbRVEqeoaRCwlIKs0J796 AwHu9bchgHq/faG8vRdojb09EC42PMfjvs25IZsTlzpLPXgmDzHNNP7Vt4VMEKN6Hrkp bTVl6gk7ekGSeZHA0j8jQXjIvuEXtA9q/RkCQUrJoS2rsRjWpCM2nR52AId8GLE4kf8j AJ3XU1z0Tj2TMREJL3z7qdamGH2/f6r+erPi5YI9NFCOi2X7jAoScje1iaO9MSfdYbw8 okqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=tRYcE116sAuabO9Qx0LnyMIsOu/oM3tOFbPlHVkYbx4=; b=yRXGi2CrfGg6q1Owb34ChEPy1OysTybtzP2AcLsqRfg3p2P4u39oMUs2Pz7HHrWenL xGrbX28DGCSsSRUde0Ucca2mHLQYN7ie8qnibTuBdSLrMhXwgiysTdUG5WP3MUubW18Q 8P0WTKhPAXgzynmB004PJ2LjYSGzt5XSD4VvuLDVgMFP00+Dht0g80F4w11lUA6oS5w5 WvDaH3AZuFea31OODu2P/6MBYfmai+ycoSiWf857ux+OrLQLFXnmDwiYPuVTftOi7E3m 3+/hYYypUV9+mprlF9mT6NIq/dpti2h/ZfOWtbH8oGPpVAKmHOiUKhwZfbgzX25Hot9A M92g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y84si14150174pfc.33.2019.07.02.00.35.55; Tue, 02 Jul 2019 00:36:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726011AbfGBHf0 (ORCPT + 99 others); Tue, 2 Jul 2019 03:35:26 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:50095 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725802AbfGBHf0 (ORCPT ); Tue, 2 Jul 2019 03:35:26 -0400 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1hiDJz-0001Yv-CL; Tue, 02 Jul 2019 09:35:23 +0200 Received: from mfe by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1hiDJy-00009W-PR; Tue, 02 Jul 2019 09:35:22 +0200 Date: Tue, 2 Jul 2019 09:35:22 +0200 From: Marco Felsch To: Anson.Huang@nxp.com Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, aisheng.dong@nxp.com, abel.vesa@nxp.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Linux-imx@nxp.com Subject: Re: [PATCH V2] soc: imx-scu: Add SoC UID(unique identifier) support Message-ID: <20190702073522.blujpmxddw7brr7c@pengutronix.de> References: <20190628032544.8317-1-Anson.Huang@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190628032544.8317-1-Anson.Huang@nxp.com> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 09:31:59 up 45 days, 13:50, 49 users, load average: 0.13, 0.05, 0.01 User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Anson, On 19-06-28 11:25, Anson.Huang@nxp.com wrote: > From: Anson Huang > > Add i.MX SCU SoC's UID(unique identifier) support, user > can read it from sysfs: > > root@imx8qxpmek:~# cat /sys/devices/soc0/soc_uid > 7B64280B57AC1898 > > Signed-off-by: Anson Huang > --- > Changes since V1: > - Improve the comment of skipping SCFW API return value check for getting UID. > --- > drivers/soc/imx/soc-imx-scu.c | 39 +++++++++++++++++++++++++++++++++++++++ > 1 file changed, 39 insertions(+) > > diff --git a/drivers/soc/imx/soc-imx-scu.c b/drivers/soc/imx/soc-imx-scu.c > index 676f612..3eacb54 100644 > --- a/drivers/soc/imx/soc-imx-scu.c > +++ b/drivers/soc/imx/soc-imx-scu.c > @@ -27,6 +27,40 @@ struct imx_sc_msg_misc_get_soc_id { > } data; > } __packed; > > +struct imx_sc_msg_misc_get_soc_uid { > + struct imx_sc_rpc_msg hdr; > + u32 uid_low; > + u32 uid_high; > +} __packed; > + > +static ssize_t soc_uid_show(struct device *dev, > + struct device_attribute *attr, char *buf) > +{ > + struct imx_sc_msg_misc_get_soc_uid msg; > + struct imx_sc_rpc_msg *hdr = &msg.hdr; > + u64 soc_uid; > + > + hdr->ver = IMX_SC_RPC_VERSION; > + hdr->svc = IMX_SC_RPC_SVC_MISC; > + hdr->func = IMX_SC_MISC_FUNC_UNIQUE_ID; > + hdr->size = 1; > + > + /* > + * SCU FW API always returns an error even the > + * function is successfully executed, so skip > + * returned value check. > + */ > + imx_scu_call_rpc(soc_ipc_handle, &msg, true); Please can you add a TODO: or FIXME: tag and also provide the firmware version containing the bug? I know that developers are very busy and follow-up fixes never reach mainline ;) Regards, Marco > + > + soc_uid = msg.uid_high; > + soc_uid <<= 32; > + soc_uid |= msg.uid_low; > + > + return sprintf(buf, "%016llX\n", soc_uid); > +} > + > +static DEVICE_ATTR_RO(soc_uid); > + > static int imx_scu_soc_id(void) > { > struct imx_sc_msg_misc_get_soc_id msg; > @@ -102,6 +136,11 @@ static int imx_scu_soc_probe(struct platform_device *pdev) > goto free_revision; > } > > + ret = device_create_file(soc_device_to_device(soc_dev), > + &dev_attr_soc_uid); > + if (ret) > + goto free_revision; > + > return 0; > > free_revision: > -- > 2.7.4 > > > -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |