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 C2A3AC4332F for ; Tue, 8 Nov 2022 16:41:35 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2F52484FD0; Tue, 8 Nov 2022 17:40:40 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1667925641; bh=OyqbedIW3OlC+a4Exeui16qtyr8/EoQaRGoIHrAoXX0=; h=From:To:Subject:In-reply-to:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From; b=aqJIN08vqkn7EHkVfO+LkHH9KWlFX5n6hSXmwM/QqmjNRhjiKZyUIlW252HcQ2lvP hk449IEG/RLVdsGiPZFYcY+3Wq1hriPJ6yU5LgHLKVqyUK4R/xZgbwwAWjm6lhwVc8 ZD4m78exXw2N7AzwptzLU3Zb5LQjYZrjoCjnxf1a4tJS7OZyTcgkx3z88svwtUd4UK 9aD1atmRHZVGtQYtR9SN0k9vd5WbR8ycsufH9G7wT1CaGvzSbYpnO3cUEXD29WFdTS jw0o2tqDCYIb4nQG2t5EQDQWuSFuryeTHNOAWJ+KyKoFNKrm1mpRuJYHs1jRA8bTow NKgGL+9u+kAnA== Received: by phobos.denx.de (Postfix, from userid 109) id C21B58502B; Tue, 8 Nov 2022 17:39:34 +0100 (CET) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id AA3FD85087 for ; Tue, 8 Nov 2022 17:38:38 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sbabic@denx.de Received: from frontend03.mail.m-online.net (unknown [192.168.6.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4N6DLk33Xfz1r1Mk; Tue, 8 Nov 2022 17:38:38 +0100 (CET) Received: from localhost (dynscan3.mnet-online.de [192.168.6.84]) by mail.m-online.net (Postfix) with ESMTP id 4N6DLk2wRFz1qqlR; Tue, 8 Nov 2022 17:38:38 +0100 (CET) X-Amavis-Alert: BAD HEADER SECTION, Missing required header field: "Date" Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan3.mail.m-online.net [192.168.6.84]) (amavisd-new, port 10024) with ESMTP id l1IB4BMbvdec; Tue, 8 Nov 2022 17:38:37 +0100 (CET) Received: from papero (host-88-217-136-221.customer.m-online.net [88.217.136.221]) by mail.mnet-online.de (Postfix) with ESMTP; Tue, 8 Nov 2022 17:38:37 +0100 (CET) From: sbabic@denx.de X-Patchwork-Submitter: Adam Ford X-Patchwork-Id: 1693399 X-Patchwork-Delegate: sbabic@denx.de To: Adam Ford ,u-boot@lists.denx.de Subject: [PATCH V2 4/4] imx: imx8mn-beacon: Fix out of spec voltage In-reply-to: <20221022134345.7613-4-aford173@gmail.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Message-Id: <20221108163934.C21B58502B@phobos.denx.de> Date: Tue, 8 Nov 2022 17:38:59 +0100 (CET) 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.6 at phobos.denx.de X-Virus-Status: Clean > The DDR is configured for LPDDR4 running at 1.6GHz which requires > the voltage on the PMIC to rise a bit before initializing LPDDR4 > or it will be running out of spec. > Signed-off-by: Adam Ford > Reviewed-by: Fabio Estevam > Reviewed-by: Peng Fan > diff --git a/board/beacon/imx8mn/spl.c b/board/beacon/imx8mn/spl.c > index 029f71bc99..9acd916180 100644 > --- a/board/beacon/imx8mn/spl.c > +++ b/board/beacon/imx8mn/spl.c > @@ -74,6 +74,38 @@ static iomux_v3_cfg_t const pwm_pads[] = { > IMX8MN_PAD_GPIO1_IO01__PWM1_OUT | MUX_PAD_CTRL(PWM1_PAD_CTRL), > }; > > +static int power_init_board(void) > +{ > + struct udevice *dev; > + int ret; > + > + ret = pmic_get("pmic@4b", &dev); > + if (ret == -ENODEV) { > + puts("No pmic\n"); > + return 0; > + } > + > + if (ret != 0) > + return ret; > + > + /* decrease RESET key long push time from the default 10s to 10ms */ > + pmic_reg_write(dev, BD718XX_PWRONCONFIG1, 0x0); > + > + /* unlock the PMIC regs */ > + pmic_reg_write(dev, BD718XX_REGLOCK, 0x1); > + > + /* increase VDD_SOC to typical value 0.85v before first DRAM access */ > + pmic_reg_write(dev, BD718XX_BUCK1_VOLT_RUN, 0x0f); > + > + /* increase VDD_DRAM to 0.975v for 3Ghz DDR */ > + pmic_reg_write(dev, BD718XX_1ST_NODVS_BUCK_VOLT, 0x83); > + > + /* lock the PMIC regs */ > + pmic_reg_write(dev, BD718XX_REGLOCK, 0x11); > + > + return 0; > +} > + > int board_early_init_f(void) > { > /* Claiming pwm pins prevents LCD flicker during startup*/ > @@ -107,6 +139,9 @@ void board_init_f(ulong dummy) > > enable_tzc380(); > > + /* LPDDR4 at 1.6GHz requires a voltage adjustment on the PMIC */ > + power_init_board(); > + > /* DDR initialization */ > spl_dram_init(); > Applied to u-boot-imx, master, thanks ! Best regards, Stefano Babic -- ===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de =====================================================================