u-boot 2011.10rc: Fix pmic shut down over USB power
[glsdk/meta-ti-glsdk.git] / recipes-bsp / u-boot / u-boot / 2011.09git / 0006-am335x-evm-Fix-bone-pmic-shut-down-over-USB-power.patch
1 From 801316091ac7e14cc8fa9b0bd2cdce76bea06991 Mon Sep 17 00:00:00 2001
2 From: Joel A Fernandes <joelagnel@ti.com>
3 Date: Thu, 3 Nov 2011 22:19:19 -0500
4 Subject: [PATCH] am335x-evm: Fix bone pmic shut down over USB power
5 Cc: trini@ti.com
7 * Set DCDC2 to 1.2v for all boards irrespective of board version, or power source.
8 * Set USB current trip point to 1300mA for all boards and power sources.
9 * Only Skip setting of MPU frequency to 720MHz for A1 and USB-powered boards.
11 Credits to Jason for noticing this. Tested with 20 reboots over USB.
13 Signed-off-by: Jason Kridner <jdk@ti.com>
14 Signed-off-by: Joel A Fernandes <joelagnel@ti.com>
15 ---
16  board/ti/am335x/evm.c |   27 ++++++++++++++-------------
17  1 files changed, 14 insertions(+), 13 deletions(-)
19 diff --git a/board/ti/am335x/evm.c b/board/ti/am335x/evm.c
20 index e95a088..bd3c09a 100644
21 --- a/board/ti/am335x/evm.c
22 +++ b/board/ti/am335x/evm.c
23 @@ -483,12 +483,10 @@ void spl_board_init(void)
24                 if (tps65217_reg_read(STATUS, &pmic_status_reg))
25                         return;
26  
27 -               /* Only perform PMIC configurations if board rev > A1 */
28 -               if (!strncmp(header.version, "00A1", 4))
29 -                       return;
30 -
31 -               if (!(pmic_status_reg & PWR_SRC_AC_BITMASK)) {
32 -                       printf("No AC power, disabling frequency switch\n");
33 +               /* Set DCDC2 (MPU) voltage to 1.275V */
34 +               if (tps65217_voltage_update(DEFDCDC2,
35 +                                            DCDC_VOLT_SEL_1275MV)) {
36 +                       printf("tps65217_voltage_update failure\n");
37                         return;
38                 }
39  
40 @@ -507,14 +505,17 @@ void spl_board_init(void)
41                                        USB_INPUT_CUR_LIMIT_MASK))
42                         printf("tps65217_reg_write failure\n");
43  
44 -               /* Set DCDC2 (MPU) voltage to 1.275V */
45 -               if (!tps65217_voltage_update(DEFDCDC2,
46 -                                            DCDC_VOLT_SEL_1275MV)) {
47 -                       /* Set MPU Frequency to 720MHz */
48 -                       mpu_pll_config(MPUPLL_M_720);
49 -               } else {
50 -                       printf("tps65217_voltage_update failure\n");
51 +               /* Only perform PMIC configurations if board rev > A1 */
52 +               if (!strncmp(header.version, "00A1", 4))
53 +                       return;
54 +
55 +               if (!(pmic_status_reg & PWR_SRC_AC_BITMASK)) {
56 +                       printf("No AC power, disabling frequency switch\n");
57 +                       return;
58                 }
59 +
60 +               /* Set MPU Frequency to 720MHz */
61 +               mpu_pll_config(MPUPLL_M_720);
62         } else {
63                 /* 
64                  * EVM PMIC code.  PMIC voltage is configuring for frequency
65 -- 
66 1.7.4.1