From patchwork Tue Sep 12 06:19:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 721747 Delivered-To: patch@linaro.org Received: by 2002:adf:f64d:0:b0:31d:da82:a3b4 with SMTP id x13csp1476308wrp; Mon, 11 Sep 2023 23:21:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH3HBTEtINSbe2bSXeuG1S/QBQsMcsDpUB0/tikxLCcMUiutftqkvHgTtqUR4Am7uPNFXns X-Received: by 2002:a5d:550e:0:b0:31f:335b:f436 with SMTP id b14-20020a5d550e000000b0031f335bf436mr964113wrv.22.1694499709942; Mon, 11 Sep 2023 23:21:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694499709; cv=none; d=google.com; s=arc-20160816; b=X326VNTGCxuXTvz5oE4uetnSA1ekttBoQGrkGPhQ5/7WJVOYpmOjK+9YIpX01J77q6 /xxzhnpV3Do4oW+TRnisiogluFSFlsJAnfIeC8ocnap9rSjuBF5woW1SmsQxJY+0udia zeaeowGWaZDl2C7ygY/rwF/0DabMkRNyMEQ9nnbV0lKVjqxfHd8dun+qq0e6wUVzF7Dn R96fGdsiCJSoBQIZ2mR7Qg3DQyLbTVAps0iGdUtfUq6wMNl+Bvtl6eZdiBNhVzgDE0vG fN5iMc3q/uigTXz7ftTc8xcuLXWuZRDF9E71gu1dQyCw2cLv5EWbPrKv7mv3ytebBHZN TFAA== 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=mDeANqlcGmJwpgmbU2X16rPKMZ2AGafAub5KGnX2sKg=; fh=K4dQhL74gef2glEqNOnE2YOBTqRi7qf0ycKBewrN6K8=; b=eodPtLUX9AgiFsnNPl9qgGVuzOVIKwOEuUsR4NR68W1xFA1fOUh5IOEHYJQJdn9ucl W1wtf0FGg9vXEXasOev2rufvWXxq3qKmnf9rzi0fweCM0VO7tLLZjL4cccoSjdaaJ7MB NuB30oXvSmpvfaOvujzIBsZUNYOXRTuIaSuyYuQN8twi99Y8/dk5Ccoa9o6l2op311Tv 7DY0jqJbwzT7UVwoX7OkIr/50p1MR04Z4cf60rTXxi1i0CiElYQ2CgMqDBaJHw7gpupZ WngL77vXuoNr4DyYPK2XnvJ7xxFKz5j9bp1CKxOSpH69AWcjIbCD/anRelQfavmGnAfI uLtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="B/oltpSi"; 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 h2-20020a5d5482000000b0031fbab792a7si265504wrv.6.2023.09.11.23.21.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Sep 2023 23:21:49 -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="B/oltpSi"; 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 E506186E2C; Tue, 12 Sep 2023 08:21: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=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="B/oltpSi"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3288086E22; Tue, 12 Sep 2023 08:21:28 +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-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) (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 4844D86E20 for ; Tue, 12 Sep 2023 08:21:25 +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-pl1-x62f.google.com with SMTP id d9443c01a7336-1c3c4eafe95so2647885ad.1 for ; Mon, 11 Sep 2023 23:21:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694499683; x=1695104483; 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=mDeANqlcGmJwpgmbU2X16rPKMZ2AGafAub5KGnX2sKg=; b=B/oltpSiD3vH1wCCyDDp/XdWxJwWuL1TwvfqxDkpSz4SE5m2RVrDlPCOqB8Q/lGHB+ myQMXDjKZ5a0MtLGAVsWun1+KgooYtn82tZfJkuRx4WtqI40/OdLoPwMigYOMSF0GLyS oNvBohM7y+MYwDHQnWS8RQcefmT1eMuRWJ/v2Ufs9W/WmHtSnKuSNORqkWMeoc2PaaFQ DIwERYDLj4HBptSf29Cb6U4/gFYmnVUAkxD0Mv80P0fiQpjt04kGkFp7S6IJ9FU7YUYv f8HhMFdd8GMyCwhbOsFGKM6dBHg7d4B2Wr11qvvYM3zsHMvkxGHHhL5/GTFTpgFtUBIc jT6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694499683; x=1695104483; 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=mDeANqlcGmJwpgmbU2X16rPKMZ2AGafAub5KGnX2sKg=; b=Bh9gpaAvrmPc5JicR8Z5oJnE3rm5hJ6wr3YEMMR6ClCCIw7i2zLnUseSVlK/h/zR1k wHzRYpBo5boF6oW01drrsWBZWYFduHJIU44pawiyEc99DFv3psKlqnVaGe00SYuM044B CtpeyMbKGYcWK5LCgWXXmYwi/p/RemIBh6iwK4NJv1N5KjvUbH1Zwczo8n+hTs2WmJ+g oxcEf9sAHaf3kYNkJn+dOBL4/7t5PCK1+ZHjN9sldgZXJ8UN6y6AG7l419zRZbcr0cvu Qlg+mvwE/N136oos9rjJN4cVNCIw/4rsEjo689QOHTpNrhnpjSgWIrm3MP5vbEf57Cym D90Q== X-Gm-Message-State: AOJu0Yw4+9fYgBu/nLgVCuPLMoD8SZvIKOfHfsJVnNNdP04IbdmLD7E7 g4JL47s0O/sNJuOOaQnTkzaymfBJEUHjQVbHE2oKew== X-Received: by 2002:a17:902:d4c3:b0:1c3:411c:9b98 with SMTP id o3-20020a170902d4c300b001c3411c9b98mr13679835plg.3.1694499683618; Mon, 11 Sep 2023 23:21:23 -0700 (PDT) Received: from octopus.. ([2400:4050:c3e1:100:bf3d:658b:e9f7:3af5]) by smtp.gmail.com with ESMTPSA id a15-20020a170902eccf00b001bc2831e1a8sm7503970plh.80.2023.09.11.23.21.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Sep 2023 23:21:23 -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 v4 03/13] firmware: scmi: move scmi_bind_protocols() backward Date: Tue, 12 Sep 2023 15:19:52 +0900 Message-Id: <20230912062002.57361-4-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230912062002.57361-1-takahiro.akashi@linaro.org> References: <20230912062002.57361-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 75744cb35d7c..0b97569eb1a0 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; @@ -216,6 +157,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",