public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3] MX28: Check if we are using a valid VBUS for power initialization
Date: Sun, 5 Aug 2012 01:40:20 +0200	[thread overview]
Message-ID: <201208050140.20363.marex@denx.de> (raw)
In-Reply-To: <CAP9ODKpLBO28RQeqKUoGGccVfjgBrNwFWvsO+_EA4X+ew93-Hw@mail.gmail.com>

Dear Otavio Salvador,

> On Sat, Aug 4, 2012 at 7:49 PM, Marek Vasut <marex@denx.de> wrote:
> > Dear Otavio Salvador,
> > 
> >> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> >> ---
[...]

> >> -     /*
> >> -      * NOTE: In original IMX-Bootlets, this also checks for VBUSVALID,
> >> -      * but their implementation always returns 1 so we omit it here.
> >> -      */
> >> -     if (readl(&power_regs->hw_power_sts) & POWER_STS_VDD5V_GT_VDDIO) {
> >> +     if (mx28_valid_vbus() &&
> > 
> > And again ... you unconditionally add something that will break other
> > boards that aren't supplied from 5V. This part isn't present in mx28
> > bootlets if I'm right, yes?
> 
> Yes; this check is there too. But the comment about the difference
> between mx23 and mx28 code is applied here too.

According to 5VCTRL register (mx28 11.12.2) bit 4 (VBUSVALID_5VDETECT), this 
check is even redundant. Actually, if you don't use the VBUSVALID comparator, 
this check might fail I think.

> >> +             (readl(&power_regs->hw_power_sts) &
> >> POWER_STS_VDD5V_GT_VDDIO)) {
> >> 
> >>               mx28_boot_valid_5v();
> >>               return;
> >>       
> >>       }
> >>       
> >>       early_delay(1000);
> >> 
> >> -     if (readl(&power_regs->hw_power_sts) & POWER_STS_VDD5V_GT_VDDIO) {
> >> +     if (mx28_valid_vbus() &&
> >> +             (readl(&power_regs->hw_power_sts) &
> >> POWER_STS_VDD5V_GT_VDDIO)) {
> >> 
> >>               mx28_boot_valid_5v();
> >>               return;
> >>       
> >>       }
> 
> Regards,

Best regards,
Marek Vasut

      reply	other threads:[~2012-08-04 23:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-04 22:44 [U-Boot] [PATCH v3] MX28: Check if we are using a valid VBUS for power initialization Otavio Salvador
2012-08-04 22:49 ` Marek Vasut
2012-08-04 23:23   ` Otavio Salvador
2012-08-04 23:40     ` Marek Vasut [this message]

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=201208050140.20363.marex@denx.de \
    --to=marex@denx.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox