The two patches below added support for the new i.MX53 QuickStart boards, which are based on Freescale's own MC34708 PMIC (Power Management IC), replacing the previous Dialog Semi's DA9053.
The resulting binary will be working on both the DA9053 based boards and the newly MC34708 based boards.
[PATCH 1/2] mxc_i2c: fix i2c_probe() failure by using i2c_reset() [PATCH 2/2] mx53loco: add support for MC34708
From: Eric Miao eric.miao@canonical.com
i2c_reset() is the better fit to be used in i2c_probe(), and it also fixes the bug of i2c_probe() failure on mx53loco with a MC34708 PMIC.
Signed-off-by: Eric Miao eric.miao@linaro.org --- drivers/i2c/mxc_i2c.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c index ebde3c5..77369ec 100644 --- a/drivers/i2c/mxc_i2c.c +++ b/drivers/i2c/mxc_i2c.c @@ -167,8 +167,7 @@ int i2c_probe(uchar chip) { int ret;
- writew(0, I2C_BASE + I2CR); /* Reset module */ - writew(I2CR_IEN, I2C_BASE + I2CR); + i2c_reset();
writew(I2CR_IEN | I2CR_MSTA | I2CR_MTX, I2C_BASE + I2CR); ret = tx_byte(chip << 1);
From: Eric Miao eric.miao@canonical.com
A quick support for mx53 QuickStart board with MC34708.
Signed-off-by: Eric Miao eric.miao@linaro.org --- board/freescale/mx53loco/mx53loco.c | 57 +++++++++++++++++++++++++++-------- include/configs/mx53loco.h | 3 +- 2 files changed, 46 insertions(+), 14 deletions(-)
diff --git a/board/freescale/mx53loco/mx53loco.c b/board/freescale/mx53loco/mx53loco.c index 158ec32..82048e6 100644 --- a/board/freescale/mx53loco/mx53loco.c +++ b/board/freescale/mx53loco/mx53loco.c @@ -353,21 +353,48 @@ static void clock_init(void) printf("CPU: Switch DDR clock to 1GHZ failed\n"); }
+static int pmic_mc34708 = 0; + static void power_init(void) { unsigned int val; - - /* Set VDDA to 1.25V */ - val = DA9052_BUCKCORE_BCOREEN; - val |= DA_BUCKCORE_VBCORE_1_250V; - pmic_reg_write(DA9053_BUCKCORE_REG, val); - val = pmic_reg_read(DA9053_SUPPLY_REG); - val |= DA9052_SUPPLY_VBCOREGO; - pmic_reg_write(DA9053_SUPPLY_REG, val); - - /* Set Vcc peripheral to 1.35V */ - pmic_reg_write(0x2f, 0x62); - pmic_reg_write(0x3c, 0x62); + unsigned char buf[4] = { 0, 0, 0, 0 }; + + if (i2c_probe(0x08) == 0) + pmic_mc34708 = 1; + + if (pmic_mc34708) { + i2c_read(0x8, 24, 1, &buf[0], 3); + + /* increase VDDGP as 1.25V for 1GHZ on SW1 */ + buf[2] = 0x30; + i2c_write(0x8, 24, 1, buf, 3); + + i2c_read(0x8, 25, 1, &buf[0], 3); + + /* increase VCC as 1.3V on SW2 */ + buf[2] = 0x34; + i2c_write(0x8, 25, 1, buf, 3); + + /*change global reset time as 4s*/ + i2c_read(0x8, 15, 1, &buf[0], 3); + + buf[1] |= 0x1; + buf[1] &= ~0x2; + i2c_write(0x8, 15, 1, buf, 3); + } else { + /* Set VDDA to 1.25V */ + val = DA9052_BUCKCORE_BCOREEN; + val |= DA_BUCKCORE_VBCORE_1_250V; + pmic_reg_write(DA9053_BUCKCORE_REG, val); + val = pmic_reg_read(DA9053_SUPPLY_REG); + val |= DA9052_SUPPLY_VBCOREGO; + pmic_reg_write(DA9053_SUPPLY_REG, val); + + /* Set Vcc peripheral to 1.35V */ + pmic_reg_write(0x2f, 0x62); + pmic_reg_write(0x3c, 0x62); + } }
int board_early_init_f(void) @@ -393,7 +420,11 @@ int board_init(void)
int checkboard(void) { - puts("Board: MX53 LOCO\n"); + puts("Board: MX53 LOCO"); + + if (pmic_mc34708) + puts(" with MC34708");
+ puts("\n"); return 0; } diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h index 644c853..04d2ee3 100644 --- a/include/configs/mx53loco.h +++ b/include/configs/mx53loco.h @@ -56,7 +56,8 @@
/* PMIC Configs */ #define CONFIG_DIALOG_PMIC -#define CONFIG_SYS_DIALOG_PMIC_I2C_ADDR 0x48 +#define CONFIG_SYS_DIALOG_PMIC_I2C_ADDR 0x48 +#define CONFIG_SYS_MC34708_I2C_ADDR 0x08
/* MMC Configs */ #define CONFIG_FSL_ESDHC