From patchwork Sun Jan 25 01:07:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Graeme Russ X-Patchwork-Id: 432453 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id DDBD414027A for ; Sun, 25 Jan 2015 12:08:35 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 541D14B6ED; Sun, 25 Jan 2015 02:08:30 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id df6XI9Mhb+ig; Sun, 25 Jan 2015 02:08:30 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C3EB74B6F0; Sun, 25 Jan 2015 02:08:29 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C87644B6EF for ; Sun, 25 Jan 2015 02:08:17 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aRalcjl055we for ; Sun, 25 Jan 2015 02:08:17 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-pd0-f179.google.com (mail-pd0-f179.google.com [209.85.192.179]) by theia.denx.de (Postfix) with ESMTPS id 9A3C44B701 for ; Sun, 25 Jan 2015 02:08:11 +0100 (CET) Received: by mail-pd0-f179.google.com with SMTP id v10so5058956pde.10 for ; Sat, 24 Jan 2015 17:08:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hWagMdrYIoeXnzFK0/BPHbRxIfn9e+VPJrLfQLyLshw=; b=Dbw6UGciv6oEWe7r+ohNqayMEXQNigj3N5YjMoMpFa+7gZ9wXRbbO/Za+HNk3XH/38 sXPyQf8rFwDO70pYud6cPLAD8LJvP/a1ZcjZrSobHlFMQcRvlyTItMcZzoECYwS+6ymy Hxbnt0s7huRthoJ7/Q1vYM99ap+fd/bWgKYzck9/IOvbkaGP6wM6N2Q+30PtUkV6Gr5o fC4NyRkU4L+lPTWOqo/aSXQtbUYbq1mpN+JUe2OMe7HSedm8oL2GOXLBkKgc8qOWIrqj y5Jo13YdDVcmCuUXjR5tyre8FjmrD+gqtyEZMg5ZL+HqLFCJhSKEmp2eODnDKTTcMY5m 5qBg== X-Gm-Message-State: ALoCoQla9xPgS7aO6smhX9+gq8sDoZ/o40y8EJB2J2EvqTXQ4Dp0ZqtU5mqHfCfp4YmdrpP1zd2z X-Received: by 10.70.37.104 with SMTP id x8mr22710270pdj.119.1422148090006; Sat, 24 Jan 2015 17:08:10 -0800 (PST) Received: from ws1.lan ([1.148.229.174]) by mx.google.com with ESMTPSA id fz15sm5865840pdb.71.2015.01.24.17.08.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Jan 2015 17:08:09 -0800 (PST) From: Graeme Russ To: u-boot@lists.denx.de Date: Sun, 25 Jan 2015 12:07:52 +1100 Message-Id: <1422148073-20190-3-git-send-email-gruss@tss-engineering.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1422148073-20190-1-git-send-email-gruss@tss-engineering.com> References: <1422148073-20190-1-git-send-email-gruss@tss-engineering.com> Cc: Damien Gotfroi Subject: [U-Boot] [v3 PATCH 2/3] arm: mxs: Enable booting of mx28 without battery X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Section 4.1.2 of Freescale Application Note AN4199 describes the configuration required to operate the mx28 from a 5V source without a battery. This patch changes the behaviour of the dropout control of the DC-DC converter (refer to section 11.12.9 of the mx28 Application Processor Reference Manual - Document Number: MCIMX28RM, Rev 2, 08/2013) to the following: - Always use 4P2 Linear Regulator if CONFIG_SYS_MXS_VDD5V_ONLY is defined - Switch between 4P2 Linear Regulator and Battery, using whichever has the highest voltage if CONFIG_SYS_MXS_VDD5V_ONLY isnot set (this is the same as the pre-patch behaviour) Signed-off-by: Graeme Russ Signed-off-by: Damien Gotfroi --- Changes in v2 - Implemented Damien Gotfroi's simplified version Changes in v3 - Updated commit message - Explicitly use POWER_DCDC4P2_DROPOUT_CTRL_SRC_4P2 for the DCDC4P2_DROPOUT_CONFIG define (it is 0x0 so it make no functional difference) --- arch/arm/cpu/arm926ejs/mxs/spl_power_init.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c b/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c index 7fb734e..c342217 100644 --- a/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c +++ b/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c @@ -14,6 +14,13 @@ #include "mxs_init.h" +#ifdef CONFIG_SYS_MXS_VDD5V_ONLY +#define DCDC4P2_DROPOUT_CONFIG POWER_DCDC4P2_DROPOUT_CTRL_100MV | \ + POWER_DCDC4P2_DROPOUT_CTRL_SRC_4P2 +#else +#define DCDC4P2_DROPOUT_CONFIG POWER_DCDC4P2_DROPOUT_CTRL_100MV | \ + POWER_DCDC4P2_DROPOUT_CTRL_SRC_SEL +#endif /** * mxs_power_clock2xtal() - Switch CPU core clock source to 24MHz XTAL * @@ -303,8 +310,7 @@ static void mxs_power_init_4p2_params(void) clrsetbits_le32(&power_regs->hw_power_dcdc4p2, POWER_DCDC4P2_DROPOUT_CTRL_MASK, - POWER_DCDC4P2_DROPOUT_CTRL_100MV | - POWER_DCDC4P2_DROPOUT_CTRL_SRC_SEL); + DCDC4P2_DROPOUT_CONFIG); clrsetbits_le32(&power_regs->hw_power_5vctrl, POWER_5VCTRL_CHARGE_4P2_ILIMIT_MASK,