From patchwork Fri Mar 15 15:10:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 780522 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp253787wrs; Fri, 15 Mar 2024 08:12:46 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUxT9rG4ZJl8/6LzzMXSXKSQ5j539p+4G0QJAz8zwvlr4feb2xrPkbLD4vZe4CuzKw15hgf3QWUwrW0s0p1T5Kh X-Google-Smtp-Source: AGHT+IEpe09kr31Atlg0jngYyOvVZXhliNREIm52MpEsGGvf2xymr+owERmlVUpR6eI/Hc4uWYLQ X-Received: by 2002:a5d:4b82:0:b0:33e:bf0f:8156 with SMTP id b2-20020a5d4b82000000b0033ebf0f8156mr3393711wrt.38.1710515566364; Fri, 15 Mar 2024 08:12:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710515566; cv=none; d=google.com; s=arc-20160816; b=n7a7rPnAHoJB6ICXFDnDVn/T+20MkGR3vzvDD7WHpR4k3daVgBEQ9vexbVyJ8bNEB0 toFdL3j9SKFcZLPdwhjGWAia/mzuSlZRLHMbTHFnotNUS/KWiVPiiqJRu+QvnDHMcmJj sknNyzvwKU6HYWbO7CtM1zT8CiTqP2aVfIDl3Ml++jJhKCO+F/+YBnCOOI2IRev4uDj+ 4E/QW940I73ge4hb4dgTaR4lEVvCRHUu4IaluXYn58pLqG9RNZ4Hf4kfBvFQ8HI7uowg JnGqk8veFK25mdzLQWua+0IqK6u1Xs0pZxxRPtlAW0iUBHY9Ypod4n/ToEWVGPMm2egw oFqw== 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:cc:to:in-reply-to:references :message-id:content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=HxlOsugX2/wIO/P7KsmKCSR/CeuUXJcHxpYPD4HuMPo=; fh=gSVpyLKtvZ+QePPYgVwr0OwBuSQ/slJGUurC/y9msiw=; b=EFKFr5/xaOWY/EgKSb6+LANLOE3M+2kH5D5PC65P97Ct/UYXgWeMpqbMr+3Rh2iUD/ dfD7iQZ5TMUG0bPR8Isgn61xKEDo3EQc2PpRUo4rsyjWNhgd2ybeb/A3d/SlDVwFU85U U9eOO+KHA9J+4AvJYaUrSHl8bpo87ujrrtMDISoI8wzN83+g9++pPirB5Xf6wrRLa1Ui oQN4PexcWSyQoOwJlQjgdOKiinFUCzDLoXV66a7sDpRpGjFGUQv5aoCT0WM6BcWf/PWm zB1X+5EDiMHV/TeTaMYNsHYcTXt3XqiEItXV575Ha9U5UwimDnGnufeXLNOmn6jInuTB GL/Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uFq5DrQg; 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 g9-20020adfe409000000b0033e0f66423csi1773395wrm.184.2024.03.15.08.12.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 08:12:46 -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=uFq5DrQg; 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 D441F87FEF; Fri, 15 Mar 2024 16:10:53 +0100 (CET) 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="uFq5DrQg"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E8B788801F; Fri, 15 Mar 2024 16:10:48 +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=-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=unavailable 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 92ED688023 for ; Fri, 15 Mar 2024 16:10:40 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=caleb.connolly@linaro.org Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-33e6aca1ca9so1676774f8f.2 for ; Fri, 15 Mar 2024 08:10:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710515440; x=1711120240; darn=lists.denx.de; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=HxlOsugX2/wIO/P7KsmKCSR/CeuUXJcHxpYPD4HuMPo=; b=uFq5DrQgzkugw9zhtf17coZj9ibue6w9AVFLCs71+pWiuQiI+q6PoZ4me0Xz515nhw W1kPfBh+/GAMTt7JNtZGl7TAJVN2PfT/4fEmnUsiCZCrmKwvvrUo8ais5xY7yAsHNcKZ KnSiL7qTkYAu6UpYHnlWfRy93uc8rpyZwARhTLLbNvgmX6xosVuO3LsBbZkDnQOzBkm0 mqJBcBcqstWug70YT7oBLM5G6wpGhpU5Rx0K/9D2RHBPSFxXYZ0cLd/bhH/RvY0+9QEL s4cn87CkU0cNxBaXBSL9JY+V7XRi0zLM7X9/9zDsPD6LVd4leOqlNfzRzoWi+MtF4QRx Mf4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710515440; x=1711120240; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HxlOsugX2/wIO/P7KsmKCSR/CeuUXJcHxpYPD4HuMPo=; b=s/fwxFbsAznuTtIampZuc133juqMITZyumsNxPTVj5Fyar1TUzKEwQrY281K2CEAxf N3/aTKDvnWerVxuXp+9aje9NtHvH97q3y4RZ1RaEimALQixkyo8SpM7QQxpitMxRz7hx Xwa/QAB4hc3f/59Llj2kToLzfYcEA9cVP4xZqxIczo7MUp1HwuN8FymgURwjFTj3MrqU 7GjKnpuLaFz++PFvoZmR/HLl1/Lh1qtOu7pVQTTkfblyOMF8T7c0JQTLg2M9BlVsB5mb GcLh1WH1ckFAtRJsbXdTITovSPE1QUM3chwXcf4i8YBclTX6k3G9CDPToQTG2oi9NFpF c5KQ== X-Gm-Message-State: AOJu0Yxetg4OtAnYY6CjXWf83IUajuSQF2j/FjbhlhwSMpp4B7AT49FY /t0dBTidU0ceC+inRC/GjVpQAU9E/L31EkUu4+rYPRk5+toxhn8JFVoOE7z1pSdS7iCucgMxk6z z X-Received: by 2002:adf:fa0e:0:b0:33e:cbec:b2bd with SMTP id m14-20020adffa0e000000b0033ecbecb2bdmr2800266wrr.9.1710515439870; Fri, 15 Mar 2024 08:10:39 -0700 (PDT) Received: from lion.localdomain (host-92-17-96-232.as13285.net. [92.17.96.232]) by smtp.gmail.com with ESMTPSA id n6-20020a5d4006000000b0033e699fc6b4sm3398141wrp.69.2024.03.15.08.10.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 08:10:39 -0700 (PDT) From: Caleb Connolly Date: Fri, 15 Mar 2024 15:10:20 +0000 Subject: [PATCH v2 11/14] mach-snapdragon: fixup power-domains MIME-Version: 1.0 Message-Id: <20240315-b4-qcom-livetree-v2-11-ab635774b2dc@linaro.org> References: <20240315-b4-qcom-livetree-v2-0-ab635774b2dc@linaro.org> In-Reply-To: <20240315-b4-qcom-livetree-v2-0-ab635774b2dc@linaro.org> To: Tom Rini , Caleb Connolly , Neil Armstrong , Sumit Garg , Lukasz Majewski , Sean Anderson Cc: u-boot@lists.denx.de X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=2538; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=eATLOOhI4TMycRloeb2rEN+Hpuc/Br8JMYSeGYyQmIY=; b=owGbwMvMwCFYaeA6f6eBkTjjabUkhtQvKY835HU45L8PffhOkP3iOru60G+6ovFBU/etT8xIa F0rIOPbUcrCIMjBICumyCJ+Ypll09rL9hrbF1yAmcPKBDKEgYtTACYSKs7wP9rv7fWquhem22bd TJpW/+tMZp1C9enM2wu1ONJ+RlUETWf4Hzxnl0J6lMTmyws2T709ffrt6DU/CpXkZ8/RX2Kyc0V dxX8A X-Developer-Key: i=caleb.connolly@linaro.org; a=openpgp; fpr=83B24DA7FE145076BC38BB250CD904EB673A7C47 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 We don't support the RPM(h)PD power domains in U-Boot, and we don't need to - the necessary resources are on, and we aren't going to enter any low power modes. We could try using a no-op device, but this requires adding a compatible for every platform, and just pollutes the driver model. So instead let's just remove every "power-domains" property that references the RPM(h)pd power controller. This takes <1ms as we're using OF_LIVE. Of note, this only applies to drivers which are loading post-relocation. Drivers loaded pre-reloc that reference the rpm(h)pd still need DM_FLAG_DEFAULT_PD_CTRL_OFF in their flags. Signed-off-by: Caleb Connolly --- arch/arm/mach-snapdragon/of_fixup.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/arch/arm/mach-snapdragon/of_fixup.c b/arch/arm/mach-snapdragon/of_fixup.c index 6810c8617cc0..49f1fc1948f3 100644 --- a/arch/arm/mach-snapdragon/of_fixup.c +++ b/arch/arm/mach-snapdragon/of_fixup.c @@ -21,8 +21,9 @@ #include #include #include #include +#include /* U-Boot only supports USB high-speed mode on Qualcomm platforms with DWC3 * USB controllers. Rather than requiring source level DT changes, we fix up * DT here. This improves compatibility with upstream DT and simplifies the @@ -108,8 +109,39 @@ static void fixup_usb_nodes(void) log_warning("Failed to fixup node %s: %d\n", glue_np->name, ret); } } +/* Remove all references to the rpmhpd device */ +static void fixup_power_domains(void) +{ + struct device_node *pd = NULL, *np = NULL; + struct property *prop; + const __be32 *val; + + /* All Qualcomm platforms name the rpm(h)pd "power-controller" */ + for_each_of_allnodes(pd) { + if (pd->name && !strcmp("power-controller", pd->name)) + break; + } + + /* Sanity check that this is indeed a power domain controller */ + if (!of_find_property(pd, "#power-domain-cells", NULL)) { + log_err("Found power-controller but it doesn't have #power-domain-cells\n"); + return; + } + + /* Remove all references to the power domain controller */ + for_each_of_allnodes(np) { + if (!(prop = of_find_property(np, "power-domains", NULL))) + continue; + + val = prop->value; + if (val[0] == cpu_to_fdt32(pd->phandle)) + of_remove_property(np, prop); + } +} + void qcom_of_fixup_nodes(void) { fixup_usb_nodes(); + fixup_power_domains(); }