From patchwork Tue Mar 1 08:10:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1599123 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20210112.gappssmtp.com header.i=@monstr-eu.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=aGu4gRi9; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4K7DKs4rrMz9sG8 for ; Tue, 1 Mar 2022 21:40:33 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6207C83B61; Tue, 1 Mar 2022 09:11:17 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20210112.gappssmtp.com header.i=@monstr-eu.20210112.gappssmtp.com header.b="aGu4gRi9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E16B783AA3; Tue, 1 Mar 2022 09:11:15 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) (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 B82FB811D8 for ; Tue, 1 Mar 2022 09:11:06 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=monstr@monstr.eu Received: by mail-ej1-x62d.google.com with SMTP id qa43so3239542ejc.12 for ; Tue, 01 Mar 2022 00:11:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20210112.gappssmtp.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zVnt22FJuOGZi7TERHmUWKBrkMfvkFD5Ja73T6uUKpU=; b=aGu4gRi9oRAFbXsaSH8eOm493yJ3mBOcMM+nUzw/gjUHGOlpLkymGLJCKNLxDZD4mq y9fqswxpTHZ/gAnwXragBS8nSu9mm76t7N3fThan6yms59SWVNAg2gu1TGLGbhw/eBJu rVvdgcXM3csPAM7P/F+KwW1uvrEMbLIEhTYR9mPhR9j3g0viJHMF0nrAfeeHunyuQ1Mu 5Ie/gvhNKkgTtmlhfALPJpeLBsZRYISIwXgBMA3wvfkFbBPUpehhHTLfLtFfoSLNEHiF eDSZhlFbgL/TTqW/1Db1AEPlDdWz9w3TW2dYA3xwszVyE3hZNhT+ns5YoUxQTEyrhz/l aLhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=zVnt22FJuOGZi7TERHmUWKBrkMfvkFD5Ja73T6uUKpU=; b=T5Quz9wkGedCauGzpK7BJ8tPRhSnxi9EdJmbZnfv2Lyt8dQohNNe42EBxrNOJx+Az+ FqyLFCWjXayHs+Cgbl6ACpxPsGYFOOqoN5QIbquRfsIRMwzOF8ORtbSVltaub1GvwrpC PxrcXyLAuK191knND0gUxHjqZj7LOCL84RboDeI3qD8C1QOiToSyu6Ei1RA6GI6/BBaM xcFXPLHRgSQ96aBlLPH0N8W5c8mjybLbY7wm/0R9tISd9A++dn/QphV4gT+/hbORSNKI 3g7JLBPpONJkK1GkLpBROhUcvsYiZkfPRYM3/+6g8lSB1FgjHLjlrrzaXeVf71bynxHW JxDw== X-Gm-Message-State: AOAM533Ekfs1m4KZJ/iQeUh/NjKfXVCQUD1c6zwQ38gaejiCi1Yhm+2s h+VNLov+mLzJqPiH9evEH4STjMKGcDLCCw== X-Google-Smtp-Source: ABdhPJy19LF8/JymN8UNWUJxaoHfmZI7B2hjh/w9pGjSLn7o41U+p4uxTub+xnZNjHKslY8+RUOlbA== X-Received: by 2002:a17:907:2087:b0:6cf:e170:171 with SMTP id pv7-20020a170907208700b006cfe1700171mr18387741ejb.163.1646122263789; Tue, 01 Mar 2022 00:11:03 -0800 (PST) Received: from localhost ([2a02:768:2307:40d6::f9e]) by smtp.gmail.com with ESMTPSA id e24-20020a50a698000000b00412ef0c149dsm6806339edc.16.2022.03.01.00.11.03 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 01 Mar 2022 00:11:03 -0800 (PST) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Cc: Jaehoon Chung , Michal Simek Subject: [PATCH] power: zynqmp: Use zynqmp_pmufw_node() from firmware Date: Tue, 1 Mar 2022 09:10:59 +0100 Message-Id: X-Mailer: git-send-email 2.35.1 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 Remove private xpm_configobject[] and use zynqmp_pmufw_node() which provides the same functionality. Also add debug messages for easier debugging. Fixes: e0283cbdfd49 ("power: zynqmp: Add power domain driver for ZynqMP") Signed-off-by: Michal Simek Reviewed-by: Jaehoon Chung --- drivers/power/domain/zynqmp-power-domain.c | 29 ++++------------------ 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/drivers/power/domain/zynqmp-power-domain.c b/drivers/power/domain/zynqmp-power-domain.c index 5383d0989698..6943658be429 100644 --- a/drivers/power/domain/zynqmp-power-domain.c +++ b/drivers/power/domain/zynqmp-power-domain.c @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -13,25 +14,6 @@ #include -#define NODE_ID_LOCATION 5 - -static unsigned int xpm_configobject[] = { - /* HEADER */ - 2, /* Number of remaining words in the header */ - 1, /* Number of sections included in config object */ - PM_CONFIG_OBJECT_TYPE_OVERLAY, /* Type of Config object as overlay */ - /* SLAVE SECTION */ - - PM_CONFIG_SLAVE_SECTION_ID, /* Section ID */ - 1, /* Number of slaves */ - - 0, /* Node ID which will be changed below */ - PM_SLAVE_FLAG_IS_SHAREABLE, - PM_CONFIG_IPI_PSU_CORTEXA53_0_MASK | - PM_CONFIG_IPI_PSU_CORTEXR5_0_MASK | - PM_CONFIG_IPI_PSU_CORTEXR5_1_MASK, /* IPI Mask */ -}; - static int zynqmp_pm_request_node(const u32 node, const u32 capabilities, const u32 qos, const enum zynqmp_pm_request_ack ack) { @@ -41,12 +23,9 @@ static int zynqmp_pm_request_node(const u32 node, const u32 capabilities, static int zynqmp_power_domain_request(struct power_domain *power_domain) { - /* Record power domain id */ - xpm_configobject[NODE_ID_LOCATION] = power_domain->id; - - zynqmp_pmufw_load_config_object(xpm_configobject, sizeof(xpm_configobject)); + dev_dbg(power_domain->dev, "Request for id: %ld\n", power_domain->id); - return 0; + return zynqmp_pmufw_node(power_domain->id); } static int zynqmp_power_domain_free(struct power_domain *power_domain) @@ -57,6 +36,8 @@ static int zynqmp_power_domain_free(struct power_domain *power_domain) static int zynqmp_power_domain_on(struct power_domain *power_domain) { + dev_dbg(power_domain->dev, "Domain ON for id: %ld\n", power_domain->id); + return zynqmp_pm_request_node(power_domain->id, ZYNQMP_PM_CAPABILITY_ACCESS, ZYNQMP_PM_MAX_QOS,