summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorRobby Cai <R63905@freescale.com>2011-11-25 22:14:00 +0800
committerRobby Cai <R63905@freescale.com>2011-11-28 11:23:11 +0800
commitdb44a4caf2a2c24d345c8e70756578441702c964 (patch)
tree9af9f455ac4f7cf3b48614bdbe2483c4cd5c4bbe /board
parentf1229ce6330c3e66eadf92d85881519c894e93cb (diff)
downloadu-boot-imx-db44a4caf2a2c24d345c8e70756578441702c964.zip
u-boot-imx-db44a4caf2a2c24d345c8e70756578441702c964.tar.gz
u-boot-imx-db44a4caf2a2c24d345c8e70756578441702c964.tar.bz2
ENGR00163239-1 mc34708: fix not charging issue in uboot
there's some incorrect setting in spi mode, fixed in this patch. Signed-off-by: Robby Cai <R63905@freescale.com>
Diffstat (limited to 'board')
-rw-r--r--board/freescale/mx53_pcba/mx53_pcba.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/board/freescale/mx53_pcba/mx53_pcba.c b/board/freescale/mx53_pcba/mx53_pcba.c
index 9ef654b..df3f2fc 100644
--- a/board/freescale/mx53_pcba/mx53_pcba.c
+++ b/board/freescale/mx53_pcba/mx53_pcba.c
@@ -463,7 +463,12 @@ int setup_pmic_voltages_spi(void)
/* Charger Source: set VBUS threshold low to 4.25V,
* set Weak VBUS threshold to 4.275V */
val = pmic_reg(slave, 53, 0, 0);
- val = (val & 0xfc7038) | 0x8e47;
+
+ val = (val & ~0x7) | 0x7; /* VBUSTL */
+ val = (val & ~0x1c0) | 0x40; /* VBUSWEAK */
+ val = (val & ~0xe00) | 0xe00; /* AUXTL */
+ val = (val & ~0x38000) | 0x8000; /* AUXWEAK */
+
if (pmic_reg(slave, 53, val, 1) == -1) {
printf("%s:spi_write 53:error\n", __func__);
return -1;
@@ -476,10 +481,12 @@ int setup_pmic_voltages_spi(void)
return -1;
}
- /* Change CC current to 1550mA */
/* Change CV voltage as 4.2v */
+ /* Change CC current to 1550mA */
val = pmic_reg(slave, 51, 0, 0);
- val = (val & 0xf83f00) | 0x7c0d8;
+ val = (val & ~0xfc0) | 0x8c0; /* CHRCV */
+ val = (val & ~0xf000) | 0xd000; /* CHRCC */
+
if (pmic_reg(slave, 51, val, 1) == -1) {
printf("%s:spi_write:error\n", __func__);
return -1;
@@ -493,6 +500,9 @@ int setup_pmic_voltages_spi(void)
printf("%s:spi_write:error\n", __func__);
return -1;
}
+
+ spi_pmic_free(slave);
+
} else {
printf("spi_pmic_probe failed!\n");
return -1;