Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp453024lqb; Fri, 24 May 2024 03:47:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVKSXB2hnBUwzlfK0iU/g4ZlRSa/u9ACbp2rql/v07a7OTASzA4OU72AZ6OJsAcPGshaF5s7lo1i2OHSlq3Pd0ajWzC69sMwnjMOsLK7Q== X-Google-Smtp-Source: AGHT+IG+CLh8iLE/pE4Pj4ShFx5GJAvCPy0Ko72YqiNUc+1VAPIH1fRMJIvtUAVZHPnfDU2wCrdV X-Received: by 2002:a05:6a00:e8b:b0:6f8:caf2:eeb1 with SMTP id d2e1a72fcca58-6f8f33b1ad2mr1918405b3a.15.1716547666519; Fri, 24 May 2024 03:47:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716547666; cv=pass; d=google.com; s=arc-20160816; b=NgPowRYjo+NQFQmMBseTPOz/DkvA1HUTOzPemRtm1RNngyeWNJnOV+uIR79xEZHgmQ tsGCZzdIL+09u1yPWDNv6rObryuna3ekV8jZrg474aGQYq1jOihEuhA4petc2xRxQ/On 9aOWflVUgsqH8dkcDy/0vYdXGKvKP0vW6DVXwh2MQHgmDhHD5NXMzPs+2tSQTAYTEWw/ iGgadqImLMp1yXXAq/g2YBEA1V7W8BSOk1IRD2w2SVJvayImLyY1xqUraHrTeFU8ymmo XMJbR3h0R55qzo3NYSiHtwVtlkbgDZ4M8d5H78Rls5Q/37DdpQCNaC90ylECFR1nDdsK WBcg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=+kpk5l8Zg5mdQeFtzvrPk45qborW8I+lLFTi3yT6obo=; fh=Jh0TN2Q1fP1HXHrZHIV/kVcJxEaV1dt0AqJ6p+68Pjk=; b=uNUJj+BuiEVS8e0iglpPPCxj6j9RINITTr08AXGQ6VDnJvYMQgcWqNhdncgCR/RiXs Nha5cgkscmRJ028oDK4olAgCIsPajOVGfZnmIjjxyHoJYImTiuNS4wGBP676kghIezLW Rl6WY2kqc4DOBQ1ckJtvpQ3ae5h5G3BdWdpCHHW4sNSpDaX5e/CrgI8fZChAms/Yp/p4 LqxTlTMa2p4y/yABdgMxBLNQ+TOBBgaFaqJBeLmCoxu/qKIKnoVHU5qOMZcbZlfiZkWQ rGW/Tkh2fRY0eX5lw4BKjQpqT/VJognIW43dZeQmu6F4Pc+nsnU47ceYdtTqkeqSCiYd 2JCg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-188615-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188615-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-68228ad2e9bsi1081543a12.565.2024.05.24.03.47.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 03:47:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-188615-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-188615-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188615-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id CB26FB21A9D for ; Fri, 24 May 2024 10:47:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 68D1A85940; Fri, 24 May 2024 10:47:34 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 48712208A1 for ; Fri, 24 May 2024 10:47:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716547653; cv=none; b=cPQvL6zFpNctijrOV+6D5777sPtCgb4bpnn1N0MeDnjfrX9DZGAgAE79ujRon4k/dQ/AeNXjqOmfiiaqUYsd1rb/+PqZDwo3wOfu+qGI9U7xadTI1+KPon4+UWtpQz7vNZxEU+yGn/BAnWuCQ+AJ493wes3AEBqmGGBwBdlDN7k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716547653; c=relaxed/simple; bh=9TvjPqCliIU3ksv9BzpmBijNYq3dOmKIiwbn2vtAAok=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=msfO4Om1f6Ab6fGjjukyZmp6ScCwTv7cTA0fY13jZEtcaN0xvUqU5EAC9cvYwmGGZv/6JN9BJJFkMhcahq5edGCKyXmW5DiS7PXdo+/EW51gKFX2UW2IHpPwS7QMSJank3iErMqXCmDdpirP9KjmSzL7mjhQ6XbkVUrcjU0dXEA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sASSE-00012m-SY; Fri, 24 May 2024 12:47:18 +0200 Received: from [2a0a:edc0:2:b01:1d::c5] (helo=pty.whiteo.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sASSD-002mZn-Tv; Fri, 24 May 2024 12:47:17 +0200 Received: from sha by pty.whiteo.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1sASSD-00Bejt-2f; Fri, 24 May 2024 12:47:17 +0200 Date: Fri, 24 May 2024 12:47:17 +0200 From: Sascha Hauer To: Pankaj Gupta Cc: Jonathan Corbet , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Pengutronix Kernel Team , Fabio Estevam , Rob Herring , Krzysztof Kozlowski , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 4/5] firmware: imx: add driver for NXP EdgeLock Enclave Message-ID: References: <20240523-imx-se-if-v2-0-5a6fd189a539@nxp.com> <20240523-imx-se-if-v2-4-5a6fd189a539@nxp.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240523-imx-se-if-v2-4-5a6fd189a539@nxp.com> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org On Thu, May 23, 2024 at 04:19:35PM +0530, Pankaj Gupta wrote: > NXP hardware IP(s) for secure-enclaves like Edgelock Enclave(ELE), > are embedded in the SoC to support the features like HSM, SHE & V2X, > using message based communication interface. > > The secure enclave FW communicates on a dedicated messaging unit(MU) > based interface(s) with application core, where kernel is running. > It exists on specific i.MX processors. e.g. i.MX8ULP, i.MX93. > > This patch adds the driver for communication interface to secure-enclave, > for exchanging messages with NXP secure enclave HW IP(s) like EdgeLock > Enclave (ELE) from Kernel-space, used by kernel management layers like > - DM-Crypt. > > Signed-off-by: Pankaj Gupta > --- > drivers/firmware/imx/Kconfig | 12 + > drivers/firmware/imx/Makefile | 2 + > drivers/firmware/imx/ele_base_msg.c | 286 +++++++++++++++++++ > drivers/firmware/imx/ele_base_msg.h | 92 +++++++ > drivers/firmware/imx/ele_common.c | 239 ++++++++++++++++ > drivers/firmware/imx/ele_common.h | 43 +++ > drivers/firmware/imx/se_ctrl.c | 531 ++++++++++++++++++++++++++++++++++++ > drivers/firmware/imx/se_ctrl.h | 99 +++++++ > include/linux/firmware/imx/se_api.h | 14 + > 9 files changed, 1318 insertions(+) > > +static int imx_fetch_se_soc_info(struct device *dev) > +{ > + struct se_if_priv *priv = dev_get_drvdata(dev); > + struct imx_se_node_info_list *info_list; > + const struct imx_se_node_info *info; > + struct soc_device_attribute *attr; > + struct soc_device *sdev; > + u64 serial_num; > + u16 soc_rev; > + int err = 0; > + > + info = priv->info; > + info_list = (struct imx_se_node_info_list *) > + device_get_match_data(dev); > + > + /* This function should be called once. > + * Check if the soc_rev is zero to continue. > + */ > + if (priv->soc_rev) > + return err; > + > + err = info->se_fetch_soc_info(dev, &soc_rev, &serial_num); > + if (err < 0) { > + dev_err(dev, "Failed to fetch SoC Info."); > + return err; > + } This is called unconditionally but is not set for i.MX93. You should either set it for i.MX93 or check it before calling it. Sascha -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |