Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F31F8EB64DA for ; Tue, 4 Jul 2023 12:34:55 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 42F7B85F9F; Tue, 4 Jul 2023 14:34:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=londelec.com 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=londelec-com.20221208.gappssmtp.com header.i=@londelec-com.20221208.gappssmtp.com header.b="H7LNXDW8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BD93286195; Mon, 3 Jul 2023 18:34:17 +0200 (CEST) Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) (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 833718662B for ; Mon, 3 Jul 2023 18:34:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=londelec.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=cody@londelec.com Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-3143b88faebso611329f8f.3 for ; Mon, 03 Jul 2023 09:34:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=londelec-com.20221208.gappssmtp.com; s=20221208; t=1688402053; x=1690994053; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=TeopkiX2bfb94lp3SNPRQnKzUoixLKeEfJL75IWBBHY=; b=H7LNXDW8Ez8KsSgElZZt2WI9vs1hKxyjDnrKp9MUT03EgldpSyihLFrXugo3fOTyf+ qNdYpV3bekSK9hoBzdZa1csUYw1bo8kTutceqnbCrEky1EOuXKcZeQtat0Z6iA9T2hU6 +1iB9hB2Ut6qgnj+vKsP9okobtLnPzL0t0cPceQhTB2s1m+MOO7CSodV/ocL4vZOWhxy lc/gJMCnXdn6uTlSkCwbAADlG+3QTRc8KD0swTJ5c3Rn3sr1flNvB6/lj0DZP39b6VrQ tL/pegXmXp0IlwzA1iPVechQhK7Mj7AbjiPAht2FGb+2evymARm3S5fWObA66Oxe3mKl nJbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688402053; x=1690994053; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=TeopkiX2bfb94lp3SNPRQnKzUoixLKeEfJL75IWBBHY=; b=lSgN2Vuk5ffTX7nLYyL/CYGPt04fqph1pfMF0CMLX8ROi+X3ML+yoFxJcx+7h8531H lmU8EXdSPwK7RRRH3vEH9AHt6MODMu4xZvHIWCH+EVXOfN+8oZOJcaOpkkCWlPHytBOy 9ISdmyng+FDp8H9CMTsQFGpT9SN3Huhzr+91Hv+1cmtIyaNUuQQPiEOoOdxFuFMDqe7A RW6BYobkuCpIivSMUUEea4AUbcq0bye9MFiDMYh0oqnl25LrYBaJaNRReYbjEhKo1qxF YguXwEbVnaYCABzoOeZwxihhtZXJHKFIqD4CSw2sGS/zjlLp7YqPSB+XGMfSZkr/WiCo KTAw== X-Gm-Message-State: ABy/qLYYJoRho3/oSJUvP/ntphYhw8unTmac/59dkkZ6PDOhTpfnUNsD l1tvEwCXQ0eZMqCLoiwOED++RMoHsaHKBJowVZT/ZM+1/pU+uw== X-Google-Smtp-Source: APBJJlEgpPSYkvETUhrjWvnW1l1Pu+ZKJWOzvwtHTU83SK44jCcwsYBY0x6xTopHjLwRaKr3k12SlA== X-Received: by 2002:adf:fe51:0:b0:314:3344:72f6 with SMTP id m17-20020adffe51000000b00314334472f6mr4739225wrs.32.1688402052809; Mon, 03 Jul 2023 09:34:12 -0700 (PDT) Received: from localhost.localdomain ([89.47.62.110]) by smtp.gmail.com with ESMTPSA id l6-20020a7bc446000000b003fba137857esm18826025wmi.14.2023.07.03.09.34.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 09:34:12 -0700 (PDT) From: Cody Green To: u-boot@lists.denx.de Cc: Cody Green , Stefano Babic , Marek Vasut , Fabio Estevam Subject: [PATCH 2/2] mxs: Don't enable 4P2 reg if MXS is powered only from DCDC_BATT Date: Mon, 3 Jul 2023 17:33:40 +0100 Message-Id: <20230703163340.101490-2-cody@londelec.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Tue, 04 Jul 2023 14:34:28 +0200 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 'mxs_power_enable_4p2()' function call was added to 'mxs_batt_boot()' in 'commit a0f97610757d' to enable DCDC converter when board is powered from 5V and has detected sufficient battery voltage. This involves enabling 4P2 regulator and there is a code in 'mxs_power_enable_4p2()' that disables VDDIO, VDDA, VDDD outputs of the DCDC converter and enables BO for each power rail: setbits_le32(&power_regs->hw_power_vddioctrl, POWER_VDDIOCTRL_DISABLE_FET | POWER_VDDIOCTRL_PWDN_BRNOUT); There is no issue if the MXS is powered from the 5V source and linear regulators are supplying power to the VDDIO, VDDA, VDDD rails. However, if the MXS is powered only from the DCDC_BATT without 5V, disabling the DCDC converter outputs causes VDDIO, VDDA, VDDD rails to lose power. The proposed solution is not to call the 'mxs_power_enable_4p2()' function if the MXS is powered only by the DCDC_BATT, because there is no reason to enable 4P2 regulator in this case. Also 5V brownout should not be enabled in 'mxs_power_init()' and linear regulator checks should be disabled in 'mxs_power_set_vddx()'. Signed-off-by: Cody Green Cc: Stefano Babic Cc: Marek Vasut Cc: Fabio Estevam --- arch/arm/cpu/arm926ejs/mxs/spl_power_init.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c b/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c index 33b76533e4..72172705f2 100644 --- a/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c +++ b/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c @@ -752,7 +752,9 @@ static void mxs_batt_boot(void) POWER_5VCTRL_CHARGE_4P2_ILIMIT_MASK, 0x8 << POWER_5VCTRL_CHARGE_4P2_ILIMIT_OFFSET); +#ifndef CFG_SPL_MXS_NO_VDD5V_SOURCE mxs_power_enable_4p2(); +#endif } /** @@ -1137,8 +1139,11 @@ static void mxs_power_set_vddx(const struct mxs_vddx_cfg *cfg, cur_target += cfg->lowest_mV; adjust_up = new_target > cur_target; + +#ifndef CFG_SPL_MXS_NO_VDD5V_SOURCE if (cfg->powered_by_linreg) powered_by_linreg = cfg->powered_by_linreg(); +#endif if (adjust_up && cfg->bo_irq) { if (powered_by_linreg) { @@ -1269,7 +1274,9 @@ void mxs_power_init(void) POWER_CTRL_VBUS_VALID_IRQ | POWER_CTRL_BATT_BO_IRQ | POWER_CTRL_DCDC4P2_BO_IRQ, &power_regs->hw_power_ctrl_clr); +#ifndef CFG_SPL_MXS_NO_VDD5V_SOURCE writel(POWER_5VCTRL_PWDN_5VBRNOUT, &power_regs->hw_power_5vctrl_set); +#endif early_delay(1000); } -- 2.25.1