diff mbox

[U-Boot,3/4] mx53loco: Turn on VUSB regulator

Message ID 1336422361-14245-3-git-send-email-festevam@gmail.com
State Accepted
Commit 768a05971030c0c57e05063f20449b8d4138293e
Headers show

Commit Message

Fabio Estevam May 7, 2012, 8:26 p.m. UTC
From: Fabio Estevam <fabio.estevam@freescale.com>

On the mx53loco board with mc34708 PMIC it is necessary to turn on VUSB regulator
so that the mx53 USBH1 PHY receives the 3.3V voltage.

Tested by inserting a USB pen drive in the upper USB slot (USBH1) and then issued the
commands:

usb start

usb info

,which correctly detected and printed the USB pen drive information.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 board/freescale/mx53loco/mx53loco.c |    9 +++++++++
 include/fsl_pmic.h                  |    1 +
 2 files changed, 10 insertions(+), 0 deletions(-)

Comments

Liu Hui-R64343 May 9, 2012, 8:58 a.m. UTC | #1
>-----Original Message-----
>From: Fabio Estevam [mailto:festevam@gmail.com]
>Sent: Tuesday, May 08, 2012 4:26 AM
>To: u-boot@lists.denx.de
>Cc: sbabic@denx.de; Liu Hui-R64343; Estevam Fabio-R49496
>Subject: [PATCH 3/4] mx53loco: Turn on VUSB regulator
>
>From: Fabio Estevam <fabio.estevam@freescale.com>
>
>On the mx53loco board with mc34708 PMIC it is necessary to turn on VUSB
>regulator so that the mx53 USBH1 PHY receives the 3.3V voltage.
>
>Tested by inserting a USB pen drive in the upper USB slot (USBH1) and then
>issued the
>commands:
>
>usb start
>
>usb info
>
>,which correctly detected and printed the USB pen drive information.
>
>Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>

Acked-by: Jason Liu <r64343@freescale.com>

>---
> board/freescale/mx53loco/mx53loco.c |    9 +++++++++
> include/fsl_pmic.h                  |    1 +
> 2 files changed, 10 insertions(+), 0 deletions(-)
>
>diff --git a/board/freescale/mx53loco/mx53loco.c
>b/board/freescale/mx53loco/mx53loco.c
>index 8c18b99..4d3b73d 100644
>--- a/board/freescale/mx53loco/mx53loco.c
>+++ b/board/freescale/mx53loco/mx53loco.c
>@@ -359,6 +359,15 @@ static int power_init(void)
> 		pmic_reg_read(p, REG_POWER_CTL2, &val);
> 		val = (val & ~TIMER_MASK_MC34708) | TIMER_4S_MC34708;
> 		ret |= pmic_reg_write(p, REG_POWER_CTL2, val);
>+
>+		/* Set VUSBSEL and VUSBEN for USB PHY supply*/
>+		pmic_reg_read(p, REG_MODE_0, &val);
>+		val |= (VUSBSEL_MC34708 | VUSBEN_MC34708);
>+		ret |= pmic_reg_write(p, REG_MODE_0, val);
>+
>+		/* Set SWBST to 5V in auto mode */
>+		val = SWBST_AUTO;
>+		ret |= pmic_reg_write(p, SWBST_CTRL, val);
> 	}
>
> 	return ret;
>diff --git a/include/fsl_pmic.h b/include/fsl_pmic.h index 3b7cd37..64c1e2e
>100644
>--- a/include/fsl_pmic.h
>+++ b/include/fsl_pmic.h
>@@ -131,5 +131,6 @@ enum {
> #define VUSBSEL_MC34708		(1 << 2)
> #define VUSBEN_MC34708		(1 << 3)
> #define SWBST_CTRL		31
>+#define SWBST_AUTO		0x8
>
> #endif
>--
>1.7.1
>
Stefano Babic May 9, 2012, 9:11 a.m. UTC | #2
On 07/05/2012 22:26, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> On the mx53loco board with mc34708 PMIC it is necessary to turn on VUSB regulator
> so that the mx53 USBH1 PHY receives the 3.3V voltage.
> 
> Tested by inserting a USB pen drive in the upper USB slot (USBH1) and then issued the
> commands:
> 
> usb start
> 
> usb info
> 
> ,which correctly detected and printed the USB pen drive information.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---


Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic
Stefano Babic May 9, 2012, 9:18 a.m. UTC | #3
On 07/05/2012 22:26, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> On the mx53loco board with mc34708 PMIC it is necessary to turn on VUSB regulator
> so that the mx53 USBH1 PHY receives the 3.3V voltage.
> 
> Tested by inserting a USB pen drive in the upper USB slot (USBH1) and then issued the
> commands:
> 
> usb start
> 
> usb info
> 
> ,which correctly detected and printed the USB pen drive information.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---

Applied to u-boot-imx, thanks

Best regards,
Stefano Babic
diff mbox

Patch

diff --git a/board/freescale/mx53loco/mx53loco.c b/board/freescale/mx53loco/mx53loco.c
index 8c18b99..4d3b73d 100644
--- a/board/freescale/mx53loco/mx53loco.c
+++ b/board/freescale/mx53loco/mx53loco.c
@@ -359,6 +359,15 @@  static int power_init(void)
 		pmic_reg_read(p, REG_POWER_CTL2, &val);
 		val = (val & ~TIMER_MASK_MC34708) | TIMER_4S_MC34708;
 		ret |= pmic_reg_write(p, REG_POWER_CTL2, val);
+
+		/* Set VUSBSEL and VUSBEN for USB PHY supply*/
+		pmic_reg_read(p, REG_MODE_0, &val);
+		val |= (VUSBSEL_MC34708 | VUSBEN_MC34708);
+		ret |= pmic_reg_write(p, REG_MODE_0, val);
+
+		/* Set SWBST to 5V in auto mode */
+		val = SWBST_AUTO;
+		ret |= pmic_reg_write(p, SWBST_CTRL, val);
 	}
 
 	return ret;
diff --git a/include/fsl_pmic.h b/include/fsl_pmic.h
index 3b7cd37..64c1e2e 100644
--- a/include/fsl_pmic.h
+++ b/include/fsl_pmic.h
@@ -131,5 +131,6 @@  enum {
 #define VUSBSEL_MC34708		(1 << 2)
 #define VUSBEN_MC34708		(1 << 3)
 #define SWBST_CTRL		31
+#define SWBST_AUTO		0x8
 
 #endif