[U-Boot] [PATCH 11/12] imx:mx6qsabreauto add ldo mode init
Peng Fan
Peng.Fan at freescale.com
Fri Jan 9 09:59:46 CET 2015
If runs at 1.2GHz, enable ldo, and adjust voltage.
Otherwise, do nothing
Signed-off-by: Peng Fan <Peng.Fan at freescale.com>
Signed-off-by: Robin Gong <b38343 at freescale.com>
---
board/freescale/mx6qsabreauto/mx6qsabreauto.c | 31 +++++++++++++++++++++++++++
include/configs/mx6qsabreauto.h | 2 ++
2 files changed, 33 insertions(+)
diff --git a/board/freescale/mx6qsabreauto/mx6qsabreauto.c b/board/freescale/mx6qsabreauto/mx6qsabreauto.c
index b29ff2b..84ac9b7 100644
--- a/board/freescale/mx6qsabreauto/mx6qsabreauto.c
+++ b/board/freescale/mx6qsabreauto/mx6qsabreauto.c
@@ -29,6 +29,7 @@
#include <asm/arch/crm_regs.h>
#include <pca953x.h>
#include <power/pmic.h>
+#include <power/pfuze100_pmic.h>
#include "../common/pfuze.h"
DECLARE_GLOBAL_DATA_PTR;
@@ -512,6 +513,7 @@ int board_spi_cs_gpio(unsigned bus, unsigned cs)
}
#endif
+static struct pmic *pfuze;
int power_init_board(void)
{
struct pmic *p;
@@ -520,6 +522,7 @@ int power_init_board(void)
p = pfuze_common_init(I2C_PMIC);
if (!p)
return -ENODEV;
+ pfuze = p;
ret = pfuze_mode_init(p, APS_PFM);
if (ret < 0)
@@ -528,6 +531,34 @@ int power_init_board(void)
return 0;
}
+#ifdef CONFIG_LDO_BYPASS_CHECK
+void ldo_mode_set(int ldo_bypass)
+{
+ unsigned int value;
+ struct pmic *p = pfuze;
+
+ if (!p)
+ return;
+
+ /* increase VDDARM/VDDSOC to support 1.2G chip */
+ if (check_1_2G()) {
+ ldo_bypass = 0; /* ldo_enable on 1.2G chip */
+ printf("1.2G chip, increase VDDARM_IN/VDDSOC_IN\n");
+ /* increase VDDARM to 1.425V */
+ pmic_reg_read(p, PFUZE100_SW1ABVOL, &value);
+ value &= ~0x3f;
+ value |= PFUZE100_SW1ABC_SETP(14250);
+ pmic_reg_write(p, PFUZE100_SW1ABVOL, value);
+
+ /* increase VDDSOC to 1.425V */
+ pmic_reg_read(p, PFUZE100_SW1CVOL, &value);
+ value &= ~0x3f;
+ value |= PFUZE100_SW1ABC_SETP(14250);
+ pmic_reg_write(p, PFUZE100_SW1CVOL, value);
+ }
+}
+#endif
+
#ifdef CONFIG_CMD_BMODE
static const struct boot_mode board_boot_modes[] = {
/* 4 bit bus width */
diff --git a/include/configs/mx6qsabreauto.h b/include/configs/mx6qsabreauto.h
index 51042ca..5b4fb65 100644
--- a/include/configs/mx6qsabreauto.h
+++ b/include/configs/mx6qsabreauto.h
@@ -80,4 +80,6 @@
#define CONFIG_POWER_PFUZE100
#define CONFIG_POWER_PFUZE100_I2C_ADDR 0x08
+#define CONFIG_LDO_BYPASS_CHECK
+
#endif /* __MX6QSABREAUTO_CONFIG_H */
--
1.8.4
More information about the U-Boot
mailing list