From patchwork Tue Sep 26 06:57:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 726384 Delivered-To: patch@linaro.org Received: by 2002:adf:ea87:0:b0:31d:da82:a3b4 with SMTP id s7csp2780093wrm; Mon, 25 Sep 2023 23:59:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGpPSGXPn8C1j+YykpVeIUr40GoWrOZWfGvikxhdz0It9l8397E6a4lb6l3O0WOBSxDxkm6 X-Received: by 2002:a5d:618c:0:b0:319:7c0f:d920 with SMTP id j12-20020a5d618c000000b003197c0fd920mr7576273wru.57.1695711555621; Mon, 25 Sep 2023 23:59:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695711555; cv=none; d=google.com; s=arc-20160816; b=SqIFb6Da07KaM6OFxEV1ljAVUQfQGObH3Rt1O5VAZi4h+Tz4uGSptiC/POPHVdvuUz +lTdX9zuOXcirsMAMx2s+FCoxJwX0cU1PAzT8yER7gYEAC4mWXZy79QrxGr7sBHHnq/C 4VMEAofcaGe+JQ8B1dAoLZ2R6vFRKSffmY/hUi5m3dHb09jZuszLzNEUaUEBxuwF+6LO zURkxU9z7UMr6j00Auv6geYniS9sL7IxCQFvnULMAa1Zj2/djtSq1CiEEHJ2W+Zyar40 yAOYunmrFRRu4NS7oOdgo0jr6i2AEGn78W6kGF/zPRMuOkVFz14ZCEiSEO/A3iUev0Hf y62A== 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=pCRhEiNZjXNhx0qdWTCaYuD1CA83EGtZrc+sEunGweE=; fh=K4dQhL74gef2glEqNOnE2YOBTqRi7qf0ycKBewrN6K8=; b=NQR1otuq5Kzn17gnKaYfGJ5JiB7uMN79APxjWFyhxjhXzFbKvI88l979LZ/HnQ9RJq rqxeU4ZkAjCMvsktCjsCKsf9+VjdDuKfwavM2zXLQdfse51bg5vYiPvtD/StxttmGNR/ EBYwi+iEW+fk0uqVpww54//eWPwbv/NZWY8gwfJgwGQZCDbwZeO1igr4d/dwY5mKxZ59 92dDsJRbzpbG/IJTQMFHITnGHh7OgTV2Fp/2C5YwQ7PKMRN7Zn0XrRVZax5DWCErOHIp C2LyJ8nr1120UCAffS0oPi0ekRvdwxY9EYY6cG4PsU/GSAxqa/dCJuvwmWNQ8YF/jXRR dHwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p9XZkP41; 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 o6-20020a5d4086000000b0032152f6bdaasi5811568wrp.267.2023.09.25.23.59.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 23:59:15 -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=p9XZkP41; 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 7AF3B86D22; Tue, 26 Sep 2023 08:58:28 +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="p9XZkP41"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B576886D22; Tue, 26 Sep 2023 08:58:27 +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 autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x333.google.com (mail-ot1-x333.google.com [IPv6:2607:f8b0:4864:20::333]) (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 D12F986D2D for ; Tue, 26 Sep 2023 08:58: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=takahiro.akashi@linaro.org Received: by mail-ot1-x333.google.com with SMTP id 46e09a7af769-6bc57401cb9so1111453a34.0 for ; Mon, 25 Sep 2023 23:58:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695711503; x=1696316303; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pCRhEiNZjXNhx0qdWTCaYuD1CA83EGtZrc+sEunGweE=; b=p9XZkP41mjbMZ7Y09Bq7ia9sbxECWmPpb5I593F2YPeF8JlG5q/ZTqTlA01PojMZsT KhBYc0nL3d2SE9H+iZ3egLLUCTpkv0ko4+V2MBUg7lMzUtuPpQo+8wkCTXr/cmCKpDZ2 Wm227k36jBjP+iKFYxD/L+klHTRHTO12570lbkwwtu/Rd7ors9bQenqcgjmFgtXtJs7R ac/Lhp7WGt/1ot7PJPWwOhzL9VHdt5SR61tm8MMwwWawSmXZuUaOTz/4Tk8lfqGCDcGu +NMF0+WMN6lCiSe8VayTdR0tDqlOUkEAPKw5xNBqYZHtsx2+h+9eF/nh8oTRL2XY7lAd fP9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695711503; x=1696316303; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pCRhEiNZjXNhx0qdWTCaYuD1CA83EGtZrc+sEunGweE=; b=b+ylRg4EwdoJbBSacDAYC1vn50+Aoq4d71P54kUCT8z5cPToEGbyXpOQTe4emQDo3F /MeK0YibIw9SQdNk1GTd0hW2hqKhdsbk/T9QrFSip8e38s9xVXbMdyM4A2RVBu1I0Scl rlj4iMRuwK6WBc579iOQv+0m/YAlJFWl4fWzjlVslgUUK3tnnqoSjWH51XuFa4i8ERgr sdW69CAun2boM3czigkztHm4OLuIPjMELzWeG7x1HUpf1A7CLZA9Vub/ZA11qWyCwZ9A kLkx57snZlxrIC8lLvBADRsdoeKJdWYjiYYUj5sDVGqWVErXlBisVd+yoG/Y1vdMTBEX VkEg== X-Gm-Message-State: AOJu0Yy1/ksk1jJUZNLMFD0pRa7gEIh0WlleozfBTiZuHgi0ww5HDoht d1W2RmEHzr0SdvQmdRPIv8SpaA== X-Received: by 2002:a05:6830:308b:b0:6b7:36af:1937 with SMTP id g11-20020a056830308b00b006b736af1937mr7686681ots.0.1695711503389; Mon, 25 Sep 2023 23:58:23 -0700 (PDT) Received: from octopus.. ([2400:4050:c3e1:100:6585:aea6:5002:a825]) by smtp.gmail.com with ESMTPSA id s2-20020a639242000000b0057825bd3448sm8758874pgn.51.2023.09.25.23.58.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 23:58:22 -0700 (PDT) From: AKASHI Takahiro To: trini@konsulko.com, sjg@chromium.org Cc: etienne.carriere@st.com, u-boot@lists.denx.de, AKASHI Takahiro , Etienne Carriere Subject: [PATCH v5 06/16] firmware: scmi: move scmi_bind_protocols() backward Date: Tue, 26 Sep 2023 15:57:40 +0900 Message-Id: <20230926065750.734440-7-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230926065750.734440-1-takahiro.akashi@linaro.org> References: <20230926065750.734440-1-takahiro.akashi@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.8 at phobos.denx.de X-Virus-Status: Clean Move the location of scmi_bind_protocols() backward for changes in later patches. There is no change in functionality. Signed-off-by: AKASHI Takahiro Reviewed-by: Simon Glass Reviewed-by: Etienne Carriere --- v4 * remove scmi_bind_protocols() from the original place. See patch#1 * s/depeding/depending/ --- drivers/firmware/scmi/scmi_agent-uclass.c | 118 +++++++++++----------- 1 file changed, 59 insertions(+), 59 deletions(-) diff --git a/drivers/firmware/scmi/scmi_agent-uclass.c b/drivers/firmware/scmi/scmi_agent-uclass.c index a28692f39f4d..1fa1e9eef966 100644 --- a/drivers/firmware/scmi/scmi_agent-uclass.c +++ b/drivers/firmware/scmi/scmi_agent-uclass.c @@ -52,65 +52,6 @@ int scmi_to_linux_errno(s32 scmi_code) return -EPROTO; } -/* - * SCMI agent devices binds devices of various uclasses depeding on - * the FDT description. scmi_bind_protocol() is a generic bind sequence - * called by the uclass at bind stage, that is uclass post_bind. - */ -static int scmi_bind_protocols(struct udevice *dev) -{ - int ret = 0; - ofnode node; - const char *name; - - dev_for_each_subnode(node, dev) { - struct driver *drv = NULL; - u32 protocol_id; - - if (!ofnode_is_enabled(node)) - continue; - - if (ofnode_read_u32(node, "reg", &protocol_id)) - continue; - - name = ofnode_get_name(node); - switch (protocol_id) { - case SCMI_PROTOCOL_ID_CLOCK: - if (CONFIG_IS_ENABLED(CLK_SCMI)) - drv = DM_DRIVER_GET(scmi_clock); - break; - case SCMI_PROTOCOL_ID_RESET_DOMAIN: - if (IS_ENABLED(CONFIG_RESET_SCMI)) - drv = DM_DRIVER_GET(scmi_reset_domain); - break; - case SCMI_PROTOCOL_ID_VOLTAGE_DOMAIN: - if (IS_ENABLED(CONFIG_DM_REGULATOR_SCMI)) { - node = ofnode_find_subnode(node, "regulators"); - if (!ofnode_valid(node)) { - dev_err(dev, "no regulators node\n"); - return -ENXIO; - } - drv = DM_DRIVER_GET(scmi_voltage_domain); - } - break; - default: - break; - } - - if (!drv) { - dev_dbg(dev, "Ignore unsupported SCMI protocol %#x\n", - protocol_id); - continue; - } - - ret = device_bind(dev, drv, name, NULL, node, NULL); - if (ret) - break; - } - - return ret; -} - static struct udevice *find_scmi_protocol_device(struct udevice *dev) { struct udevice *parent = NULL, *protocol; @@ -217,6 +158,65 @@ int devm_scmi_process_msg(struct udevice *dev, struct scmi_msg *msg) return scmi_process_msg(protocol->parent, priv->channel, msg); } +/* + * SCMI agent devices binds devices of various uclasses depending on + * the FDT description. scmi_bind_protocol() is a generic bind sequence + * called by the uclass at bind stage, that is uclass post_bind. + */ +static int scmi_bind_protocols(struct udevice *dev) +{ + int ret = 0; + ofnode node; + const char *name; + + dev_for_each_subnode(node, dev) { + struct driver *drv = NULL; + u32 protocol_id; + + if (!ofnode_is_enabled(node)) + continue; + + if (ofnode_read_u32(node, "reg", &protocol_id)) + continue; + + name = ofnode_get_name(node); + switch (protocol_id) { + case SCMI_PROTOCOL_ID_CLOCK: + if (CONFIG_IS_ENABLED(CLK_SCMI)) + drv = DM_DRIVER_GET(scmi_clock); + break; + case SCMI_PROTOCOL_ID_RESET_DOMAIN: + if (IS_ENABLED(CONFIG_RESET_SCMI)) + drv = DM_DRIVER_GET(scmi_reset_domain); + break; + case SCMI_PROTOCOL_ID_VOLTAGE_DOMAIN: + if (IS_ENABLED(CONFIG_DM_REGULATOR_SCMI)) { + node = ofnode_find_subnode(node, "regulators"); + if (!ofnode_valid(node)) { + dev_err(dev, "no regulators node\n"); + return -ENXIO; + } + drv = DM_DRIVER_GET(scmi_voltage_domain); + } + break; + default: + break; + } + + if (!drv) { + dev_dbg(dev, "Ignore unsupported SCMI protocol %#x\n", + protocol_id); + continue; + } + + ret = device_bind(dev, drv, name, NULL, node, NULL); + if (ret) + break; + } + + return ret; +} + UCLASS_DRIVER(scmi_agent) = { .id = UCLASS_SCMI_AGENT, .name = "scmi_agent",