From patchwork Fri May 13 06:26:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Etienne Carriere X-Patchwork-Id: 572070 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:66c4:0:0:0:0 with SMTP id x4csp197801mal; Thu, 12 May 2022 23:29:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyF37rxW4Jz7qPU1xyBs8yf8BxgNWQJzg9K8zvj2xFGxa1JiuSNei+csVJxeUk2b68HKJok X-Received: by 2002:a17:907:7e83:b0:6f9:1fc:ebf3 with SMTP id qb3-20020a1709077e8300b006f901fcebf3mr2977177ejc.403.1652423377998; Thu, 12 May 2022 23:29:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652423377; cv=none; d=google.com; s=arc-20160816; b=sU6Qu7DhUbXqRB5N0TT+IrrQadvzTzPoiTVs1pzoxFVs1GjP1TRk3NBR75xVXSuzed 4hp27RDOCFDxsYhhWXzEqrGL5qsXU3Qt/GyrSLpjY2J+2ywv0a3F8JtC0Zsnqu00IYkC uIh0oDbEONruLKFef5aarDBfDGXak4oKUZTqzs4vuE/Bhu82fs27WiZ0Y9DBboUj0hxe T3/xzkwCjJEHUx7Y1r0BZ+PFsRDU7kt8LIEuT52vAo9hZbOmslPfBUM0ZDtcsMi8g1iy bZt4LrOihw5JK3kEDCOvf5xi7Npt0YegAPmB3Tp4VayB3YbAARI0xyCA7Sq60CuIgrzS 2DUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ehodpUW7yVvaXwoOOkgGmiAdepzuj9jv6A8OLbbMpWQ=; b=SdcJUQ4QmhzMQ2Gxpod0Pz2+gk0ZisJNSfAj+uMZ5XDOrb1EGjkHpkLpIkPKAONLWF 965f0oQ5lN44RFo0jjbtWz0SBvmUxGaUtBtSqStzTdYibbiNzWk4f5lL58sXdUGLbuaQ fhQhmkruFaHA5DRTucDiA0f7/n6RdeMa7w7hjNb0x3ztB+7QKI2UNDAh/Pyhri8J4dvX U0/arb/QLH+8VLSGvVqyNxsNErgRt2XRad/HU+MKvukpsBYYVXJ5CgoFdZCUuopkF6mW 0jE8FuoRGOlgm3qDdmDe8LDlv4BbuHy+LkIspUDm4IoqjJYjDXxQGVwsENYssljFw0rD n8ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nCMoXEBl; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id y17-20020a056402441100b00427e10fe80dsi1455740eda.547.2022.05.12.23.29.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 May 2022 23:29:37 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nCMoXEBl; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2475483ED4; Fri, 13 May 2022 08:28:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="nCMoXEBl"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9F4C283E49; Fri, 13 May 2022 08:28:36 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) (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 97D5A83D8F for ; Fri, 13 May 2022 08:28:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=etienne.carriere@linaro.org Received: by mail-wr1-x436.google.com with SMTP id h16so9347322wrb.2 for ; Thu, 12 May 2022 23:28:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ehodpUW7yVvaXwoOOkgGmiAdepzuj9jv6A8OLbbMpWQ=; b=nCMoXEBlaridFD5FEL9qthSVFB4sFXssDuTsAGdTgqyq1DaRPb7rZAgejEKymCQeq9 XHzMXyWFxdOnLWJCQlIdQZZ3CvCESY8U8ly6HA9OXXWhm/FCOXA+qHv4/QAkCxeGEppH HkYmitQlDAS+z3wA3/a+ZgrgZ8Hv1gz6JZLkzA0F/uQfYDqXy+6nrfEnOOvPY749wKHp hGwZpODl/uB073/DlEq3gautSBygq1C7d/jEyqXwCF8m7ZYMwuYauvCqKp56aeuP/mog Q8gXZqUtBqcTZXyp9yB6M9V6oX0QGeeJ0sPF4KMhr3YhlgYLp35RL/zWm+G+Csacf1Ra /rmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ehodpUW7yVvaXwoOOkgGmiAdepzuj9jv6A8OLbbMpWQ=; b=HAe+I4O0OuXi5dBDogO99yChFP6SuwZNrwjRpqJGrdXA4etnUMUIxqpMv5jOVp5z+j 2OuIt1h7eGN6pBejKPs2MBZurc1bGITu1Hmd2XpqWcR/prH1ZxNEMnk/pAFT8cU/XzUJ WRF4YO2rjYgtZI2Mfo5P0mW7hrxBiW7pfeIeSJEV0yTE32LtkMsA+97xc5ywZUqteKp0 PJy7qdzkut24VNjJdhl8PiwY8aiNaKkM5JEGE4UPSXszw/m5i/BuxpLgsxARPCyQp0Hw lXkR0zvrUn0YorifSk6swqbs1UG475EG5cqk7cteYHZTyJ4fsxI0kzebbu0y8USAyL29 5iVQ== X-Gm-Message-State: AOAM5330Wc1rGCSnJw8wPZtVzAMwt2Df3RGLlou7kruGfWl6QWfyA2uU 6ob5Flkm+alz/9vmer93kUg8DRxWld7jlA== X-Received: by 2002:a5d:4344:0:b0:20c:9156:8ec with SMTP id u4-20020a5d4344000000b0020c915608ecmr2579537wrr.71.1652423308790; Thu, 12 May 2022 23:28:28 -0700 (PDT) Received: from lmecxl1178.lme.st.com ([2a04:cec0:1194:a3aa:dc31:6fc0:bd75:771a]) by smtp.gmail.com with ESMTPSA id s18-20020a7bc0d2000000b003942a244eebsm1414235wmh.48.2022.05.12.23.28.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 May 2022 23:28:28 -0700 (PDT) From: Etienne Carriere To: u-boot@lists.denx.de Cc: Patrick Delaunay , Patrice Chotard , Etienne Carriere Subject: [PATCH 04/14] firmware: scmi: prepare uclass to pass channel reference Date: Fri, 13 May 2022 08:26:12 +0200 Message-Id: <20220513062622.155433-5-etienne.carriere@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220513062622.155433-1-etienne.carriere@linaro.org> References: <20220513062622.155433-1-etienne.carriere@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean Changes SCMI transport operator ::process_msg to pass the SCMI channel reference provided by caller SCMI protocol device. Signed-off-by: Etienne Carriere --- drivers/firmware/scmi/mailbox_agent.c | 4 +++- drivers/firmware/scmi/optee_agent.c | 4 +++- drivers/firmware/scmi/sandbox-scmi_agent.c | 1 + drivers/firmware/scmi/scmi_agent-uclass.c | 2 +- drivers/firmware/scmi/smccc_agent.c | 4 +++- include/scmi_agent-uclass.h | 4 +++- 6 files changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/firmware/scmi/mailbox_agent.c b/drivers/firmware/scmi/mailbox_agent.c index 8e4af0c8faf..aa4929aafae 100644 --- a/drivers/firmware/scmi/mailbox_agent.c +++ b/drivers/firmware/scmi/mailbox_agent.c @@ -31,7 +31,9 @@ struct scmi_mbox_channel { ulong timeout_us; }; -static int scmi_mbox_process_msg(struct udevice *dev, struct scmi_msg *msg) +static int scmi_mbox_process_msg(struct udevice *dev, + struct scmi_channel *channel, + struct scmi_msg *msg) { struct scmi_mbox_channel *chan = dev_get_plat(dev); int ret; diff --git a/drivers/firmware/scmi/optee_agent.c b/drivers/firmware/scmi/optee_agent.c index bf0647bafd1..771fa25e989 100644 --- a/drivers/firmware/scmi/optee_agent.c +++ b/drivers/firmware/scmi/optee_agent.c @@ -267,7 +267,9 @@ static void release_shm(struct udevice *dev, struct channel_session *sess) tee_shm_free(sess->tee_shm); } -static int scmi_optee_process_msg(struct udevice *dev, struct scmi_msg *msg) +static int scmi_optee_process_msg(struct udevice *dev, + struct scmi_channel *channel, + struct scmi_msg *msg) { struct channel_session sess = { }; int ret; diff --git a/drivers/firmware/scmi/sandbox-scmi_agent.c b/drivers/firmware/scmi/sandbox-scmi_agent.c index c555164d196..031882998df 100644 --- a/drivers/firmware/scmi/sandbox-scmi_agent.c +++ b/drivers/firmware/scmi/sandbox-scmi_agent.c @@ -471,6 +471,7 @@ static int sandbox_scmi_voltd_level_get(struct udevice *dev, } static int sandbox_scmi_test_process_msg(struct udevice *dev, + struct scmi_channel *channel, struct scmi_msg *msg) { switch (msg->protocol_id) { diff --git a/drivers/firmware/scmi/scmi_agent-uclass.c b/drivers/firmware/scmi/scmi_agent-uclass.c index 93cfc9c395b..c9c9c00384a 100644 --- a/drivers/firmware/scmi/scmi_agent-uclass.c +++ b/drivers/firmware/scmi/scmi_agent-uclass.c @@ -133,7 +133,7 @@ int devm_scmi_process_msg(struct udevice *dev, struct scmi_channel *channel, ops = transport_dev_ops(parent); if (ops->process_msg) - return ops->process_msg(parent, msg); + return ops->process_msg(parent, NULL, msg); return -EPROTONOSUPPORT; } diff --git a/drivers/firmware/scmi/smccc_agent.c b/drivers/firmware/scmi/smccc_agent.c index 5e166ca93ee..b7a930b24df 100644 --- a/drivers/firmware/scmi/smccc_agent.c +++ b/drivers/firmware/scmi/smccc_agent.c @@ -30,7 +30,9 @@ struct scmi_smccc_channel { struct scmi_smt smt; }; -static int scmi_smccc_process_msg(struct udevice *dev, struct scmi_msg *msg) +static int scmi_smccc_process_msg(struct udevice *dev, + struct scmi_channel *channel, + struct scmi_msg *msg) { struct scmi_smccc_channel *chan = dev_get_plat(dev); struct arm_smccc_res res; diff --git a/include/scmi_agent-uclass.h b/include/scmi_agent-uclass.h index 861ac6d1100..562a4cc99af 100644 --- a/include/scmi_agent-uclass.h +++ b/include/scmi_agent-uclass.h @@ -7,6 +7,7 @@ struct udevice; struct scmi_msg; +struct scmi_channel; /** * struct scmi_transport_ops - The functions that a SCMI transport layer must implement. @@ -18,7 +19,8 @@ struct scmi_agent_ops { * @dev: SCMI protocol device using the transport * @msg: SCMI message to be transmitted */ - int (*process_msg)(struct udevice *dev, struct scmi_msg *msg); + int (*process_msg)(struct udevice *dev, struct scmi_channel *channel, + struct scmi_msg *msg); }; #endif /* _SCMI_TRANSPORT_UCLASS_H */