[U-Boot] [PATCH v3 5/5] imx: imx6q/dlsabreauto: Add PMIC Pfuze100 support

Ye.Li B37916 at freescale.com
Thu Nov 6 09:29:02 CET 2014


Add the pfuze100 initialization in power_init_board for imx6q/dl
sabreauto board.

Signed-off-by: Ye.Li <B37916 at freescale.com>
---
Changes since v1:
- Change to use pfuze common init function for sabre boards.

Changes since v2:
- Move the pfuze init to power_init_board

 board/freescale/mx6qsabreauto/mx6qsabreauto.c |   15 +++++++++++++++
 include/configs/mx6qsabreauto.h               |    6 ++++++
 2 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/board/freescale/mx6qsabreauto/mx6qsabreauto.c b/board/freescale/mx6qsabreauto/mx6qsabreauto.c
index 42ae6fa..182625c 100644
--- a/board/freescale/mx6qsabreauto/mx6qsabreauto.c
+++ b/board/freescale/mx6qsabreauto/mx6qsabreauto.c
@@ -28,6 +28,8 @@
 #include <asm/imx-common/video.h>
 #include <asm/arch/crm_regs.h>
 #include <pca953x.h>
+#include <power/pmic.h>
+#include "../common/pfuze.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -48,6 +50,8 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define PC MUX_PAD_CTRL(I2C_PAD_CTRL)
 
+#define I2C_PMIC	1
+
 int dram_init(void)
 {
 	gd->ram_size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE);
@@ -364,6 +368,17 @@ int board_spi_cs_gpio(unsigned bus, unsigned cs)
 }
 #endif
 
+int power_init_board(void)
+{
+	struct pmic *p;
+
+	p = pfuze_common_init(I2C_PMIC);
+	if (!p)
+		return -ENODEV;
+
+	return 0;
+}
+
 #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 235dd6d..91161fa 100644
--- a/include/configs/mx6qsabreauto.h
+++ b/include/configs/mx6qsabreauto.h
@@ -48,4 +48,10 @@
 #define CONFIG_SYS_I2C_MXC
 #define CONFIG_SYS_I2C_SPEED		100000
 
+/* PMIC */
+#define CONFIG_POWER
+#define CONFIG_POWER_I2C
+#define CONFIG_POWER_PFUZE100
+#define CONFIG_POWER_PFUZE100_I2C_ADDR	0x08
+
 #endif                         /* __MX6QSABREAUTO_CONFIG_H */
-- 
1.7.4.1



More information about the U-Boot mailing list