From db44a4caf2a2c24d345c8e70756578441702c964 Mon Sep 17 00:00:00 2001 From: Robby Cai Date: Fri, 25 Nov 2011 22:14:00 +0800 Subject: 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 --- board/freescale/mx53_pcba/mx53_pcba.c | 16 +++++++++++++--- 1 file 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; -- cgit v1.1