U-boot 2011.10rc: Refresh PMIC patch with Rev A1 fixes
[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 v2] am335x-evm: Fix bone pmic shut down over USB power
5 Cc: trini@ti.com,
6     chase.maupin@ti.com
8 * Set DCDC2 to 1.2v for all power sources and board revs except for A1
9 * Set USB current trip point to 1300mA for all boards and power sources.
10 * Only Skip setting of MPU frequency to 720MHz for A1 and USB-powered boards.
12 Credits to Jason for noticing this. Tested with several reboots over USB on a Rev A2/3.
14 v2 changes:
15 Take care of not upping DCDC2 and LDO voltages for A1.
16 For A1- only operation done is to set the USB current limit.
18 Signed-off-by: Jason Kridner <jdk@ti.com>
19 Signed-off-by: Joel A Fernandes <joelagnel@ti.com>
20 ---
21 Chase has volunteered to test this out on his A1.
23  board/ti/am335x/evm.c |   31 ++++++++++++++++---------------
24  1 files changed, 16 insertions(+), 15 deletions(-)
26 diff --git a/board/ti/am335x/evm.c b/board/ti/am335x/evm.c
27 index e95a088..bc1119e 100644
28 --- a/board/ti/am335x/evm.c
29 +++ b/board/ti/am335x/evm.c
30 @@ -483,12 +483,20 @@ void spl_board_init(void)
31                 if (tps65217_reg_read(STATUS, &pmic_status_reg))
32                         return;
33  
34 +               /* Increase USB current limit to 1300mA */
35 +               if (tps65217_reg_write(PROT_LEVEL_NONE, POWER_PATH,
36 +                                      USB_INPUT_CUR_LIMIT_1300MA,
37 +                                      USB_INPUT_CUR_LIMIT_MASK))
38 +                       printf("tps65217_reg_write failure\n");
39 +
40                 /* Only perform PMIC configurations if board rev > A1 */
41                 if (!strncmp(header.version, "00A1", 4))
42                         return;
43  
44 -               if (!(pmic_status_reg & PWR_SRC_AC_BITMASK)) {
45 -                       printf("No AC power, disabling frequency switch\n");
46 +               /* Set DCDC2 (MPU) voltage to 1.275V */
47 +               if (tps65217_voltage_update(DEFDCDC2,
48 +                                            DCDC_VOLT_SEL_1275MV)) {
49 +                       printf("tps65217_voltage_update failure\n");
50                         return;
51                 }
52  
53 @@ -501,20 +509,13 @@ void spl_board_init(void)
54                                        LDO_VOLTAGE_OUT_3_3, LDO_MASK))
55                         printf("tps65217_reg_write failure\n");
56  
57 -               /* Increase USB current limit to 1300mA */
58 -               if (tps65217_reg_write(PROT_LEVEL_NONE, POWER_PATH,
59 -                                      USB_INPUT_CUR_LIMIT_1300MA,
60 -                                      USB_INPUT_CUR_LIMIT_MASK))
61 -                       printf("tps65217_reg_write failure\n");
62 -
63 -               /* Set DCDC2 (MPU) voltage to 1.275V */
64 -               if (!tps65217_voltage_update(DEFDCDC2,
65 -                                            DCDC_VOLT_SEL_1275MV)) {
66 -                       /* Set MPU Frequency to 720MHz */
67 -                       mpu_pll_config(MPUPLL_M_720);
68 -               } else {
69 -                       printf("tps65217_voltage_update failure\n");
70 +               if (!(pmic_status_reg & PWR_SRC_AC_BITMASK)) {
71 +                       printf("No AC power, disabling frequency switch\n");
72 +                       return;
73                 }
74 +
75 +               /* Set MPU Frequency to 720MHz */
76 +               mpu_pll_config(MPUPLL_M_720);
77         } else {
78                 /* 
79                  * EVM PMIC code.  PMIC voltage is configuring for frequency
80 -- 
81 1.7.4.1