From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Sun, 5 Aug 2012 01:40:20 +0200 Subject: [U-Boot] [PATCH v3] MX28: Check if we are using a valid VBUS for power initialization In-Reply-To: References: <1344120280-7469-1-git-send-email-otavio@ossystems.com.br> <201208050049.04363.marex@denx.de> Message-ID: <201208050140.20363.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Otavio Salvador, > On Sat, Aug 4, 2012 at 7:49 PM, Marek Vasut wrote: > > Dear Otavio Salvador, > > > >> Signed-off-by: Otavio Salvador > >> --- [...] > >> - /* > >> - * 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