All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Harvey <tharvey@gateworks.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 07/12] imx:mx6 Support LDO bypass
Date: Tue, 10 Feb 2015 06:50:54 -0800	[thread overview]
Message-ID: <CAJ+vNU2CHAy9PxBTJsf98Cj0jRcpQRptsOXMK8385QhbQGe6Aw@mail.gmail.com> (raw)
In-Reply-To: <54D9EA4D.7010307@denx.de>

On Tue, Feb 10, 2015 at 3:23 AM, Stefano Babic <sbabic@denx.de> wrote:
>
> Ok - with this explanation, I would try to understand how the changes
> can be split. If the feature/change works for several boards, it makes
> sense to have it common and general. If it is only for one board, must
> flow into the board directory.

It should be common as there are several boards which use PMIC's and can use it.

>
> It looks like that ldo-bypass is strictly dependent on the board.
> Firstly, it must have PMIC, and not all boards have it. Your last sentence:

Any board that has a PMIC capable of regulating VDD_ARM_IN and
VDD_SOC_IN to the setpoints from the IMX6 datasheet can operate in LDO
bypass mode, unless operating at 1.2GHz in which case the datasheet
states that the LDO must be used (not bypassed) to avoid ripple
sensitivity issues.

>
>> In ldo-bypass mode, we need trigger WDOG_B pin to reset pmic in
>> ldo-bypass mode. So add set_wdog_reset to do this work.
>
> This looks to me as an item very bound to the board. Could it be
> possible to use another pin (I do not know the schematics, I remember
> that such as reset pin was fix on previous i.MX) ? If answer is yes, can
> these changes be used by other board or are they only for sabresd ?
>

agreed - this is a board-specific pinmux

>
>> Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
>> Signed-off-by: Robin Gong <b38343@freescale.com>
>> Signed-off-by: Nitin Garg <nitin.garg@freescale.com>
>> ---
>>  arch/arm/cpu/armv7/mx6/soc.c              | 141 ++++++++++++++++++++++++++++++
>>  arch/arm/include/asm/arch-mx6/sys_proto.h |   9 ++
>>  2 files changed, 150 insertions(+)
>>
>> diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c
>> index 5f5f497..5d02755 100644
>> --- a/arch/arm/cpu/armv7/mx6/soc.c
>> +++ b/arch/arm/cpu/armv7/mx6/soc.c
>> @@ -18,6 +18,7 @@
>>  #include <asm/arch/sys_proto.h>
>>  #include <asm/imx-common/boot_mode.h>
>>  #include <asm/imx-common/dma.h>
>> +#include <libfdt.h>
>>  #include <stdbool.h>
>>  #include <asm/arch/mxc_hdmi.h>
>>  #include <asm/arch/crm_regs.h>
>> @@ -429,6 +430,146 @@ void s_init(void)
>>       writel(mask528, &anatop->pfd_528_clr);
>>  }
>>
>> +#ifdef CONFIG_LDO_BYPASS_CHECK
>> +DECLARE_GLOBAL_DATA_PTR;
>> +static int ldo_bypass;
>
> mmmhh....global to the module ?
>
>> +
>> +int check_ldo_bypass(void)
>> +{
>> +     const int *ldo_mode;
>> +     int node;
>> +
>> +     /* get the right fdt_blob from the global working_fdt */
>> +     gd->fdt_blob = working_fdt;
>> +     /* Get the node from FDT for anatop ldo-bypass */
>> +     node = fdt_node_offset_by_compatible(gd->fdt_blob, -1,
>> +             "fsl,imx6q-gpc");
>> +     if (node < 0) {
>> +             printf("No gpc device node %d, force to ldo-enable.\n", node);
>> +             return 0;
>> +     }
>> +     ldo_mode = fdt_getprop(gd->fdt_blob, node, "fsl,ldo-bypass", NULL);
>
> I am quite lost. I have searched in kernel (current TOT), and I have not
> found such property. Can you help me to understand ?

Right - you won't find it because its a Freescale vendor kernel
implementation only. A hack if you ask me to avoid having to doing
ldo-byapss the right way.

Here are the threads that I know of regarding ldo-bypass in the
kernel, where it needs to be:

https://lkml.org/lkml/2014/12/18/255
https://lkml.org/lkml/2014/10/31/3

Peng,

I think what you are trying to do here is to put the anatop regulators
in bypass mode so that the Freescale vendor kernel leaves them
bypassed (which is what the 3.10.x based vendor kernels supporting
device-tree at http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git
do). This is what the Freescale vendor U-Boot does and so they have
created a horrible dependence between kernel and bootloader.

Instead you may be interested in what I did for our BSP's that use the
Freescale vendor kernel. Instead of touching U-Boot, I look for the
fsl,ldo-bypass node in the kernel and enable it just like their
bootloader would have:
https://github.com/Gateworks/linux-imx6/commit/a1af6ac6f00b4da7c8a5656e8ff093d4ab5cadee

That said, I would love to see some help getting IMX6 ldo-bypass
support upstream. All of our boards have an external PMIC and are
capable of bypass mode. Bypassing the LDO on such boards really helps
reduce overall board power consumption as well as move heat from the
CPU to the PMIC.

Tim

  reply	other threads:[~2015-02-10 14:50 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-09  8:59 [U-Boot] [PATCH 00/12] imx:mx6 add ldo bypass Peng Fan
2015-01-09  8:59 ` [U-Boot] [PATCH 01/12] imx:mx6slevk add pmic and i2c configuration Peng Fan
2015-01-09  8:59 ` [U-Boot] [PATCH 02/12] imx:mx6sl add I2c pad settings Peng Fan
2015-01-09  8:59 ` [U-Boot] [PATCH 03/12] imx:mx6slevk implement power init board Peng Fan
2015-02-10 11:01   ` Stefano Babic
2015-01-09  8:59 ` [U-Boot] [PATCH 04/12] imx:mx6 update mxc_ccm_reg Peng Fan
2015-02-10 11:03   ` Stefano Babic
2015-02-11  2:19     ` Peng Fan
2015-01-09  8:59 ` [U-Boot] [PATCH 05/12] imx:mx6 update fuse_bank0_regs Peng Fan
2015-02-10 11:51   ` Stefano Babic
2015-01-09  8:59 ` [U-Boot] [PATCH 06/12] pmic:pfuze add macro for setting voltage Peng Fan
2015-02-10 11:54   ` Stefano Babic
2015-02-11  2:06     ` Peng Fan
2015-01-09  8:59 ` [U-Boot] [PATCH 07/12] imx:mx6 Support LDO bypass Peng Fan
2015-02-10 11:23   ` Stefano Babic
2015-02-10 14:50     ` Tim Harvey [this message]
2015-02-10 14:59       ` Fabio Estevam
2015-02-10 15:29         ` Tim Harvey
2015-02-11  8:42       ` Stefano Babic
2015-02-10 14:33   ` Tim Harvey
2015-02-11 10:49     ` Robin Gong
2015-02-11 15:47       ` Tim Harvey
2015-02-13  0:08         ` Tim Harvey
2015-02-13  7:20           ` Robin Gong
2015-02-13  8:16         ` Robin Gong
2015-02-24 15:56           ` Tim Harvey
2015-01-09  8:59 ` [U-Boot] [PATCH 08/12] imx:mx6slevk add ldo mode set function Peng Fan
2015-01-09  8:59 ` [U-Boot] [PATCH 09/12] imx:mx6sabresd Add ldo_mode_set function Peng Fan
2015-01-09  8:59 ` [U-Boot] [PATCH 10/12] imx:mx6sxsabresd add ldo mode set function Peng Fan
2015-01-09  8:59 ` [U-Boot] [PATCH 11/12] imx:mx6qsabreauto add ldo mode init Peng Fan
2015-01-09  8:59 ` [U-Boot] [PATCH 12/12] ARM:imx call ldo_mode_set in arch_preboot_os Peng Fan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJ+vNU2CHAy9PxBTJsf98Cj0jRcpQRptsOXMK8385QhbQGe6Aw@mail.gmail.com \
    --to=tharvey@gateworks.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.