From patchwork Wed Jul 26 08:37:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 706625 Delivered-To: patch@linaro.org Received: by 2002:a5d:464f:0:b0:317:2194:b2bc with SMTP id j15csp858458wrs; Wed, 26 Jul 2023 10:01:44 -0700 (PDT) X-Google-Smtp-Source: APBJJlEfyq59c0cwT1RIZAJGtiK119FSPZ1QCd/wKYMbZtg4L0CJVGaASI8EcygMm1lMW/M/gYCl X-Received: by 2002:a5d:444c:0:b0:316:d887:624a with SMTP id x12-20020a5d444c000000b00316d887624amr1655078wrr.15.1690390904737; Wed, 26 Jul 2023 10:01:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690390904; cv=none; d=google.com; s=arc-20160816; b=dXw3D9IZ3fHr/G6ctY/br4q0kMnARpuBZ0XxSjDCj4vLoUz7AMRcU6kDzMG7eQLKsH pgyyuydfWKLJ/3U1yBYcII7QbNULH4gOg3C8uitWpBixv3meSsFOnamv7TPqvxwotKux 0swK9rNhBI+XWASyG5kOuuecMzsnJw/GED6VMh7iks1/tcH5C9YvfBt2nSopRO0WpfZl UvOGpA4f/OdyMxWiAqsaA4VM7Rbuabbn0VvXUgU8sjoQkZVXBkahElnSoeg5tilaST76 7QYiVP/zzpxGZEif44uc1L0oVmmHd0dgSxqkHEl4J4tZm1wu5tRaHuupGKJZbaGjbkv0 Y6xA== 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=4AkOQFgVRjdC49dBXTOfKYD8Fqkqe5OIC0p+nqjO3so=; fh=m4nYqZzoK9SCykCyJ/rhitDYsGwNiXM0bHxVQp6NtlE=; b=Aw2gBl+F6hxhvTmVkOIhrUPhs7NPOSl5/bvz7Wc6FOvHCFrHTg95EYXm8ble/HwoQV xmMSG7cq8HwVZFOkGEpkpDg2nAtiCJg5ECwomBwccGhkZRYZjbLlyajuLte7YTL3cnyo NfCfuFZLgXURm7FhJyhrWl60jzXkSuXXuZXu6cXcls+5R55hfbCqxqS6bMPvGJLMt5FG gc0tddHdqbBoqahtJcUANK4/2PxYqpPN/3x0NAuYHSY8gy8HvKYaxsBrxeuHzaLjeI/7 swGwGXrrI1GdiG2wPC71nS2sFl8+oS5bXDEMC1ONG5StRpKvYz4ciYdxtKcl/IrZpB3S eHUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=um+lZhxo; 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 r11-20020a5d52cb000000b0031276c26013si7383037wrv.251.2023.07.26.10.01.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 10:01:44 -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=um+lZhxo; 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 B3D4C8639D; Wed, 26 Jul 2023 19:01:42 +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="um+lZhxo"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DE92B867F0; Wed, 26 Jul 2023 19:01:40 +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-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) (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 9921D84667 for ; Wed, 26 Jul 2023 19:01:37 +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-qt1-x82d.google.com with SMTP id d75a77b69052e-403a7c0ce4dso17948251cf.1 for ; Wed, 26 Jul 2023 10:01:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690390896; x=1690995696; 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=4AkOQFgVRjdC49dBXTOfKYD8Fqkqe5OIC0p+nqjO3so=; b=um+lZhxocGg95CoFLsxdYKXQ00F6JRO1cStNrPjLmKJNfkyIqx7uHqdzuStTG9fRuD KjYMow/QxBkI6bryrQEXZyTlHgmMND0rqZynMhCTqGQirf6u0GlM4flL/GpniL6JzVAC IOa55WuFZp/UW3GdDTHuaLAjF0vF/JAotgXPD3DeOlfTsde1as/PqObmRzyk8qfslSwT JYrQFvX/Ye3JoAbltKWvC9uUlz+zpb2TBbsei05VnRnozok5FXdKkmrT1L96MYjAbzYK /rFgKuUjRJ/9NBVwSOKSywbQxH9jW3eDURiGySVVCdqCMOCdJufLpC8AUIAAfSMmUAQN lOpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690390896; x=1690995696; 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=4AkOQFgVRjdC49dBXTOfKYD8Fqkqe5OIC0p+nqjO3so=; b=SuYXAWCJGP5zjrL7Dh0KSZ85t+HodvnKSYTRsEE4tux47sp0JEfb28NwllC69zvCQn zknh+lJJM5FZs13WjhgRAAZb8TqkNkU3biETbvV2pk7Cr4/Qz4NBbabgmVUam8FInQsl Y6+eOyh6dVxugzpf4S0BMGPVMhkUNAcV4uoL21SWJD+uKK6Md5rlMZ4em9CSVU+2NOYK JW8X6meTCywvTZou7BosIxYR7hfCBg3RFO6chqITpFhpunjC/CLGXAeN7/fsHZo/usAw JLzkoxKwwo1t0b7A4mxd9ga8CTwY6lX2FrQf8NR6A73hxtz7jiJPSDZVdgpO2/R8PwlS B4Vg== X-Gm-Message-State: ABy/qLbZQbDWgbEAzV9OEsxBbnbMAbnPBMnClr0bkZVwrWW8OGrrcwmX e6uMiLWa0y1gpp65SUooU7hFiNKDVgjccaexxzU= X-Received: by 2002:a17:90a:6d64:b0:267:f0ab:ac01 with SMTP id z91-20020a17090a6d6400b00267f0abac01mr1499002pjj.0.1690360732146; Wed, 26 Jul 2023 01:38:52 -0700 (PDT) Received: from laputa.. ([2400:4050:c3e1:100:b3f9:1d29:2d48:cb41]) by smtp.gmail.com with ESMTPSA id 16-20020a17090a191000b00263c6b44dd8sm865986pjg.15.2023.07.26.01.38.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 01:38:49 -0700 (PDT) From: AKASHI Takahiro To: trini@konsulko.com, sjg@chromium.org Cc: etienne.carriere@st.com, u-boot@lists.denx.de, AKASHI Takahiro Subject: [PATCH v2 03/12] firmware: scmi: move scmi_bind_protocols() backward Date: Wed, 26 Jul 2023 17:37:59 +0900 Message-ID: <20230726083808.140780-4-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230726083808.140780-1-takahiro.akashi@linaro.org> References: <20230726083808.140780-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 --- 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 39cf15c88f75..8693e4c447b7 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_transport_device(struct udevice *dev) { struct udevice *parent = dev; @@ -208,6 +149,65 @@ int devm_scmi_process_msg(struct udevice *dev, struct scmi_msg *msg) return scmi_process_msg(parent, priv->channel, msg); } +/* + * 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; +} + UCLASS_DRIVER(scmi_agent) = { .id = UCLASS_SCMI_AGENT, .name = "scmi_agent",