From patchwork Fri May 13 06:26: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: 572076 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:66c4:0:0:0:0 with SMTP id x4csp198329mal; Thu, 12 May 2022 23:30:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBhc3YbqNcwGVosSVB5OkxhgN6IiVGRPP9hJhY+r3Rp1ajz7K51CKKXJaiUGUkX6WBNy2B X-Received: by 2002:a17:907:3f86:b0:6db:b745:f761 with SMTP id hr6-20020a1709073f8600b006dbb745f761mr2805871ejc.610.1652423447018; Thu, 12 May 2022 23:30:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652423447; cv=none; d=google.com; s=arc-20160816; b=NSFhsoicL0q9qdxfCp5Vgqx9kVt1o+t0vWWz5/4ErR8AT52Bz97N+bbV1wax/wtsIH Q08XBJC1dOyv5+O9aJlTbaaIomfzSfJHLFDZBHNIeHUJVW1SQpySpDkDruUMiFyFgoln jYhwAWxykC7wYY/kqwjNz9BUhPvWHBHmk/h0Ew+TLbSjL3ay4bWsdC2Suj5jKgaTrbRW inWMknGNESWalZiBsefC/G8I7brEvF/suFezH1Dja7BvaeyFS/ZjnvWqqfeYHjeEmduQ 2CrQ1eXyrGsk1EYL1/4TAp9m4p3dTc3fKREJsRNLL+7BEqy6jpL7PaeeXfF8j+Y3it+d dh7w== 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=wK1Q0mcaCtwHUN6vXM1a1M5jRI4V554c9SUlteJk2HY=; b=yE/eimg3W0upwgWJq9cfIjE7cXceBTcr9B1CN4yYYLq4zXvZfgthWbSUrmwjk23STU JHS2xFH0BSqF3zMTxRxHE6RIa/rCxWZA3mV3JXNf/IUBBgs8jaClo3/iIFlINUz8GjpN 7ryvl6GsQLwJtlUwcTgH5NvxpoOS3oVI546wXjsPJtlNaK0BltKSqloxo/7fI1bDVIV1 RqbpjEpyBp0g33QYdvFhJZ7V1Wv+cpEgJp453g15szhATBnJieWSp3XOubjzLAokc6Ve 4Mza0D1b7XlC8OrLm8qkufYJZ2vX8TiugV5OH73Qn+C0hD5fVOWBJfs4WxdOleLJtLAY Zqtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lbSrtwC1; 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 r20-20020a056402235400b00427cb81f020si1140193eda.250.2022.05.12.23.30.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 May 2022 23:30:47 -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=lbSrtwC1; 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 B7E4F840AD; Fri, 13 May 2022 08:29:24 +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="lbSrtwC1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CD57183ED4; Fri, 13 May 2022 08:28:42 +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-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) (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 851ED83EDC for ; Fri, 13 May 2022 08:28:36 +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-x429.google.com with SMTP id f2so3026407wrc.0 for ; Thu, 12 May 2022 23:28:36 -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=wK1Q0mcaCtwHUN6vXM1a1M5jRI4V554c9SUlteJk2HY=; b=lbSrtwC12TADg+MSR7ZSZUHGcOzBpvRDExWrLs/1HHAx9GqbDDoM3472yZD8DVr0TQ 3dt5+My2z21leY0g5+d8KRNJF0LvcDdVtEUztcwnFY8PeKKtFXTYKKeG0Ch/hkVeHtcE +JVVb+1Qg9AiDJfZ6Ufby2A9yfcocg66MNt4dyS9a9etEMqrGDEV6u+rxSkeT7cZdh53 QiB0yoekMwaC5+lHsl/UEka74sP6LDsJcw9G6jH8W1x/iR9KYvm9epM13JIKwzLPudn4 cXnpPEAKJCgV7NwkCkrkcxEXIZWcFZ+1YNAPgLg/Nb6A4ppFw7/zmPMeRRBrX8DndyLW /Y4g== 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=wK1Q0mcaCtwHUN6vXM1a1M5jRI4V554c9SUlteJk2HY=; b=RllwPWnAWClmLq7Z2n/uXMxO/S0sp38eiB8UAey3+SwS/W4bnL22xqXbN17xTLrZ8F l3ZHh6k2aX9ldrnKyVwKdNh6B/I67x5U2SMjj8fCZUniGl3p6O4h6+kXpOELQn521cSH LCe6Jg0pnEiHpDDC21rAkcWHLCFHbckRR5Xeh0oKN2WVa4I0W5hOFndCi165NCZuIEgJ 3NJl7zZ/dUK/u/dvlL5cL6uBnVDe++r1GhW9HMBnb6sOJn6UMyJ18bDjxe6aYvwu65pw NzM71ZHCQWQY4UdmtUv7N7mvw0gzOr7Zqj5U4bfaazoxXjwJRV+nUf9A3ywnDn9McPrp JQKw== X-Gm-Message-State: AOAM530eZyxb59x5BX44R/uYIb1eShIVRcvAO4/Ey18G1bdMW9qQhKd6 Q3yXbg9Ay6dh/gQN4wWBiUDYhN3ZHBpbbw== X-Received: by 2002:adf:e587:0:b0:20a:cfbb:ac08 with SMTP id l7-20020adfe587000000b0020acfbbac08mr2429477wrm.718.1652423315432; Thu, 12 May 2022 23:28:35 -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.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 May 2022 23:28:35 -0700 (PDT) From: Etienne Carriere To: u-boot@lists.denx.de Cc: Patrick Delaunay , Patrice Chotard , Etienne Carriere Subject: [PATCH 11/14] reset: scmi: support SCMI multi-channel Date: Fri, 13 May 2022 08:26:19 +0200 Message-Id: <20220513062622.155433-12-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 Update SCMI reset controller driver to get its assigned SCMI channel during initialization. This change allows SCMI reset domain protocol to use a dedicated channel when defined in the DT. The reference is saved in SCMI reset controller driver private data. Signed-off-by: Etienne Carriere --- drivers/reset/reset-scmi.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/reset/reset-scmi.c b/drivers/reset/reset-scmi.c index 30b26ec9d31..6101bd2a1e8 100644 --- a/drivers/reset/reset-scmi.c +++ b/drivers/reset/reset-scmi.c @@ -15,6 +15,7 @@ static int scmi_reset_set_level(struct reset_ctl *rst, bool assert_not_deassert) { + struct scmi_channel **scmi_channel_ref = dev_get_priv(rst->dev); struct scmi_rd_reset_in in = { .domain_id = rst->id, .flags = assert_not_deassert ? SCMI_RD_RESET_FLAG_ASSERT : 0, @@ -26,7 +27,7 @@ static int scmi_reset_set_level(struct reset_ctl *rst, bool assert_not_deassert) in, out); int ret; - ret = devm_scmi_process_msg(rst->dev, NULL, &msg); + ret = devm_scmi_process_msg(rst->dev, *scmi_channel_ref, &msg); if (ret) return ret; @@ -45,6 +46,7 @@ static int scmi_reset_deassert(struct reset_ctl *rst) static int scmi_reset_request(struct reset_ctl *rst) { + struct scmi_channel **scmi_channel_ref = dev_get_priv(rst->dev); struct scmi_rd_attr_in in = { .domain_id = rst->id, }; @@ -58,7 +60,7 @@ static int scmi_reset_request(struct reset_ctl *rst) * We don't really care about the attribute, just check * the reset domain exists. */ - ret = devm_scmi_process_msg(rst->dev, NULL, &msg); + ret = devm_scmi_process_msg(rst->dev, *scmi_channel_ref, &msg); if (ret) return ret; @@ -71,8 +73,17 @@ static const struct reset_ops scmi_reset_domain_ops = { .rst_deassert = scmi_reset_deassert, }; +static int scmi_reset_probe(struct udevice *dev) +{ + struct scmi_channel **scmi_channel_ref = dev_get_priv(dev); + + return devm_scmi_of_get_channel(dev, scmi_channel_ref); +} + U_BOOT_DRIVER(scmi_reset_domain) = { .name = "scmi_reset_domain", .id = UCLASS_RESET, .ops = &scmi_reset_domain_ops, + .probe = scmi_reset_probe, + .priv_auto = sizeof(struct scmi_channel *), };