From patchwork Tue May 31 16:09:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Etienne Carriere X-Patchwork-Id: 577451 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:330b:0:0:0:0 with SMTP id f11csp1300982mag; Tue, 31 May 2022 09:10:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6otQPgSOxWymp2JYj+laDBApt7bENY9n8Tjebiug8iVY56RXHtw1TYeLP729CmXnlLhC2 X-Received: by 2002:a05:6e02:1521:b0:2d1:5e40:b94b with SMTP id i1-20020a056e02152100b002d15e40b94bmr31160744ilu.182.1654013449172; Tue, 31 May 2022 09:10:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654013449; cv=none; d=google.com; s=arc-20160816; b=l5Jd0oofRHxRtxtcmBkjesCF/mymG8Yr4mzJHPmgAMyq/ls9bre0DUVz/vCbz3iYNl L405LVlzOxMJBcJQ3vgz1sYJeooVeCOXt/ptaYMCCwpkW3QrHNTcfN0qSKk5pfMitGyS dn5U5m6DRvsRf6El7yHiTFD+zzCbE3qrloKs7wcrSV/9T94j3mQ0+YhNbOkfLZ768+ov lQINw6hLhCBksHbJeHUx4fWxdeuRzwEMY9GZmdAJ/1/hPBJFWUuekN9P1BIM8DAUKKQQ lWTaFvmWjNR2LUYRx2BTdNcZmccSZs6P9FZGix/KHxDMHrdK0r3pAbNbvf/Ppt3vJG65 MQGQ== 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=gjG2yTB37I83WcA+ZXkAyrz1HLZPROmXz5OUn8BO06Y=; b=YTJO/bfN+X9LZTT2Y5uM831XLbcDoR0fJorlhq/oVHMJyekCsvSJK7/V4nm+eoazUG 8IfNdqiinUTkJZRAhRQ38H+NvP7qNwZWlGVpUgOjMcMCGiF86AAFLAl3OTOi15wwU2Q9 CCQIuMV0NSDPVvD+Qqg4tbtQklnyMMqwADrU1+CemGf5r0GtSviZP/MM38qcOvTQ7vwv wxQ0AfPLJ6BSsm+n20eTtLCAaUgAnvPy04gk/PcDnvioe42bwoxIjvhNEymd0Br3TuuH HFh17BbqH09UpVpKZJwVXPzJ59wBQDsCp/WCbgUMpqOUdecPhZ8TlmRiIVQQirxruegH lumA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pe6Jw9tO; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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. [85.214.62.61]) by mx.google.com with ESMTPS id i36-20020a056638382400b00330b30137bdsi13864605jav.42.2022.05.31.09.10.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 May 2022 09:10:49 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pe6Jw9tO; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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 6735884288; Tue, 31 May 2022 18:10:16 +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="pe6Jw9tO"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 548018427D; Tue, 31 May 2022 18:09:48 +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-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) (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 6C87783EDE for ; Tue, 31 May 2022 18:09:41 +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-wm1-x331.google.com with SMTP id r129so3009013wmr.3 for ; Tue, 31 May 2022 09:09:41 -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=gjG2yTB37I83WcA+ZXkAyrz1HLZPROmXz5OUn8BO06Y=; b=pe6Jw9tOt6NXAh2j1eP3ZoeptjRHhz+wEe2HoFEHkmhqxE66GqL8JGBTiFrJuMdU9H 3wXbEIWEItdB3xWwKITduDOUeCjvyA64qecqgfMm7Y6NA1gTTINj41XVKpq/76lyZ6DC vISHHfldCPKBbfeqGHTcpkGeP0pk9U+VgM+iA3w8B3ihBGQ3L+vDa2HLpC7qe8A/14OM tu7Rdn+sCpEnqmsolOS1Q2xDOv/pmRccRxb+n0I+rKAlvFZGRQYRhrRmCFu7Box6b9Xc bJHpUkUIBw3k2L6roV/mC0gwBppkcm0ofMq3rEELHGdr5AsEM4Ktby1LXztyKg5mbhN2 pOsw== 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=gjG2yTB37I83WcA+ZXkAyrz1HLZPROmXz5OUn8BO06Y=; b=5Dc/oke8EUFvE+RIKGvhPg3MtggUgUnQlAoCFN376akGkOS853m2KbAi2DDFX17Ydd SQBMNKuYl6CIktHuy2SqJ8h6JNL4mLfcTQP0V3bWRS2FXsC87gQbVuwaNg47M5j524Ft 2nM9dyWeJnnzQqFMPJIJM7M92snM2frS+sYmM/0qA9Ire7LLCCU80EPY49N9Kaq4tO+M rjvIlC0qHJDjL5rVuSjf8vSbfA+VkN9DtCiI6y5LLypBUKIptH3h+yMfa+uyxe7AiWlE YscRWtNcSlhPdBhMM7uIrhstlFf+kfYjjj1tUQB64XaL/uOuU2UTiWswYXxbPPwhBs9Y DNgQ== X-Gm-Message-State: AOAM531MinAbIilqTh+oVjekRjpk4lodf74iqkLRvlryuYm3frO+0kcS xdQy9rhwRMZFZmh4IjQpL2osaxZ17LXErQ== X-Received: by 2002:a05:600c:34d1:b0:397:4c0d:598a with SMTP id d17-20020a05600c34d100b003974c0d598amr24156940wmq.36.1654013380431; Tue, 31 May 2022 09:09:40 -0700 (PDT) Received: from lmecxl1178.lme.st.com ([2a04:cec0:117a:a94e:9569:2e63:8a35:2cc5]) by smtp.gmail.com with ESMTPSA id r23-20020a05600c321700b0039aa4d054f8sm2884035wmp.5.2022.05.31.09.09.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 May 2022 09:09:40 -0700 (PDT) From: Etienne Carriere To: u-boot@lists.denx.de Cc: Patrick Delaunay , Patrice Chotard , etienne.carriere@linaro.org Subject: [PATCH v2 04/14] firmware: scmi: prepare uclass to pass channel reference Date: Tue, 31 May 2022 18:09:19 +0200 Message-Id: <20220531160929.931150-5-etienne.carriere@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220531160929.931150-1-etienne.carriere@linaro.org> References: <20220531160929.931150-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 --- No change since v1. --- 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 */