[U-Boot] [PATCH 3/3] imx: mx6slevk: Add PMIC Pfuze support

Ye.Li B37916 at freescale.com
Mon Sep 15 09:18:24 CEST 2014


Initialize the Pfuze on I2C1 at mx6slekv board late init.

Signed-off-by: Ye.Li <B37916 at freescale.com>
---
Changes since v1:
- None

Changes since v2:
- None

Changes since v3:
- Use the factorized pfuze common function in pfuze init

 board/freescale/mx6slevk/mx6slevk.c |   22 ++++++++++++++++++++++
 include/configs/mx6slevk.h          |    7 +++++++
 2 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/board/freescale/mx6slevk/mx6slevk.c b/board/freescale/mx6slevk/mx6slevk.c
index fedd5c3..c027d08 100644
--- a/board/freescale/mx6slevk/mx6slevk.c
+++ b/board/freescale/mx6slevk/mx6slevk.c
@@ -21,6 +21,8 @@
 #include <mmc.h>
 #include <netdev.h>
 #include <i2c.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	0
+
 /* I2C1 for PMIC */
 struct i2c_pads_info i2c_pad_info0 = {
 	.sda = {
@@ -191,6 +195,24 @@ int board_init(void)
 	return 0;
 }
 
+static int pfuze_init(void)
+{
+	struct pmic *p;
+
+	p = pfuze_common_init(I2C_PMIC);
+	if (!p)
+		return -ENODEV;
+
+	return 0;
+}
+
+int board_late_init(void)
+{
+	pfuze_init();
+
+	return 0;
+}
+
 u32 get_board_rev(void)
 {
 	return get_cpu_rev();
diff --git a/include/configs/mx6slevk.h b/include/configs/mx6slevk.h
index bf5066f..09d0896 100644
--- a/include/configs/mx6slevk.h
+++ b/include/configs/mx6slevk.h
@@ -30,6 +30,7 @@
 #define CONFIG_SYS_MALLOC_LEN		(3 * SZ_1M)
 
 #define CONFIG_BOARD_EARLY_INIT_F
+#define CONFIG_BOARD_LATE_INIT
 #define CONFIG_MXC_GPIO
 
 #define CONFIG_MXC_UART
@@ -66,6 +67,12 @@
 #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
+
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
 #define CONFIG_CONS_INDEX		1
-- 
1.7.4.1



More information about the U-Boot mailing list