aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-bsp/u-boot/u-boot-v2012.04.01/0037-mx53loco-Turn-on-VUSB-regulator.patch
blob: 783c46040feb352c63bdd50c75cf294730389798 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
From b2297ec8b5d8efeee9adfed046afd8594f020b51 Mon Sep 17 00:00:00 2001
From: Fabio Estevam <fabio.estevam@freescale.com>
Date: Mon, 7 May 2012 10:26:00 +0000
Subject: [PATCH 37/56] mx53loco: Turn on VUSB regulator

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>
Acked-by: Stefano Babic <sbabic@denx.de>
---
 board/freescale/mx53loco/mx53loco.c |    9 +++++++++
 include/fsl_pmic.h                  |    1 +
 2 files changed, 10 insertions(+)

diff --git a/board/freescale/mx53loco/mx53loco.c b/board/freescale/mx53loco/mx53loco.c
index 8f5ded9..a49b00a 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.10