summaryrefslogtreecommitdiffstats
path: root/patches/u-boot-2011.09/0006-am335x-evm-Fix-bone-pmic-shut-down-over-USB-power.patch
blob: 158483b227ca33704632efdc4284a9dd8a4251b8 (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
From 801316091ac7e14cc8fa9b0bd2cdce76bea06991 Mon Sep 17 00:00:00 2001
From: Joel A Fernandes <joelagnel@ti.com>
Date: Thu, 3 Nov 2011 22:19:19 -0500
Subject: [PATCH v2] am335x-evm: Fix bone pmic shut down over USB power
Cc: trini@ti.com,
    chase.maupin@ti.com

* Set DCDC2 to 1.2v for all power sources and board revs except for A1
* Set USB current trip point to 1300mA for all boards and power sources.
* Only Skip setting of MPU frequency to 720MHz for A1 and USB-powered boards.

Credits to Jason for noticing this. Tested with several reboots over USB on a Rev A2/3.

v2 changes:
Take care of not upping DCDC2 and LDO voltages for A1.
For A1- only operation done is to set the USB current limit.

Signed-off-by: Jason Kridner <jdk@ti.com>
Signed-off-by: Joel A Fernandes <joelagnel@ti.com>
---
Chase has volunteered to test this out on his A1.

 board/ti/am335x/evm.c |   31 ++++++++++++++++---------------
 1 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/board/ti/am335x/evm.c b/board/ti/am335x/evm.c
index e95a088..bc1119e 100644
--- a/board/ti/am335x/evm.c
+++ b/board/ti/am335x/evm.c
@@ -483,12 +483,20 @@ void spl_board_init(void)
 		if (tps65217_reg_read(STATUS, &pmic_status_reg))
 			return;
 
+		/* Increase USB current limit to 1300mA */
+		if (tps65217_reg_write(PROT_LEVEL_NONE, POWER_PATH,
+				       USB_INPUT_CUR_LIMIT_1300MA,
+				       USB_INPUT_CUR_LIMIT_MASK))
+			printf("tps65217_reg_write failure\n");
+
 		/* Only perform PMIC configurations if board rev > A1 */
 		if (!strncmp(header.version, "00A1", 4))
 			return;
 
-		if (!(pmic_status_reg & PWR_SRC_AC_BITMASK)) {
-			printf("No AC power, disabling frequency switch\n");
+		/* Set DCDC2 (MPU) voltage to 1.275V */
+		if (tps65217_voltage_update(DEFDCDC2,
+					     DCDC_VOLT_SEL_1275MV)) {
+			printf("tps65217_voltage_update failure\n");
 			return;
 		}
 
@@ -501,20 +509,13 @@ void spl_board_init(void)
 				       LDO_VOLTAGE_OUT_3_3, LDO_MASK))
 			printf("tps65217_reg_write failure\n");
 
-		/* Increase USB current limit to 1300mA */
-		if (tps65217_reg_write(PROT_LEVEL_NONE, POWER_PATH,
-				       USB_INPUT_CUR_LIMIT_1300MA,
-				       USB_INPUT_CUR_LIMIT_MASK))
-			printf("tps65217_reg_write failure\n");
-
-		/* Set DCDC2 (MPU) voltage to 1.275V */
-		if (!tps65217_voltage_update(DEFDCDC2,
-					     DCDC_VOLT_SEL_1275MV)) {
-			/* Set MPU Frequency to 720MHz */
-			mpu_pll_config(MPUPLL_M_720);
-		} else {
-			printf("tps65217_voltage_update failure\n");
+		if (!(pmic_status_reg & PWR_SRC_AC_BITMASK)) {
+			printf("No AC power, disabling frequency switch\n");
+			return;
 		}
+
+		/* Set MPU Frequency to 720MHz */
+		mpu_pll_config(MPUPLL_M_720);
 	} else {
 		/* 
 		 * EVM PMIC code.  PMIC voltage is configuring for frequency
-- 
1.7.4.1