All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/3] imx: mx6sololite: Add I2C1 pad settings
@ 2014-09-15  7:18 Ye.Li
  2014-09-15  7:18 ` [U-Boot] [PATCH 2/3] imx: mx6slevk: Add I2C1 support Ye.Li
  2014-09-15  7:18 ` [U-Boot] [PATCH 3/3] imx: mx6slevk: Add PMIC Pfuze support Ye.Li
  0 siblings, 2 replies; 3+ messages in thread
From: Ye.Li @ 2014-09-15  7:18 UTC (permalink / raw)
  To: u-boot

Add I2C1 SDA/SCL pad settings for mx6 sololite

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

Changes since v2:
- None

Changes since v3:
- Split the I2C1 pad settings to a new patch since it is board independent.

 arch/arm/include/asm/arch-mx6/mx6sl_pins.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/arch-mx6/mx6sl_pins.h b/arch/arm/include/asm/arch-mx6/mx6sl_pins.h
index 045ccc4..ac84270 100644
--- a/arch/arm/include/asm/arch-mx6/mx6sl_pins.h
+++ b/arch/arm/include/asm/arch-mx6/mx6sl_pins.h
@@ -34,5 +34,10 @@ enum {
 	MX6_PAD_FEC_REF_CLK__FEC_REF_OUT			= IOMUX_PAD(0x424, 0x134, 0x10, 0x000, 0, 0),
 	MX6_PAD_FEC_RX_ER__GPIO_4_19				= IOMUX_PAD(0x0428, 0x0138, 5, 0x0000, 0, 0),
 	MX6_PAD_FEC_TX_CLK__GPIO_4_21				= IOMUX_PAD(0x0434, 0x0144, 5, 0x0000, 0, 0),
+
+	MX6_PAD_I2C1_SDA__I2C1_SDA					= IOMUX_PAD(0x0450, 0x0160, 0x10, 0x0720, 2, 0),
+	MX6_PAD_I2C1_SDA__GPIO_3_13					= IOMUX_PAD(0x0450, 0x0160, 5, 0x0000, 0, 0),
+	MX6_PAD_I2C1_SCL__I2C1_SCL					= IOMUX_PAD(0x044C, 0x015C, 0x10, 0x071C, 2, 0),
+	MX6_PAD_I2C1_SCL__GPIO_3_12					= IOMUX_PAD(0x044C, 0x015C, 5, 0x0000, 0, 0),
 };
 #endif	/* __ASM_ARCH_MX6_MX6SL_PINS_H__ */
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH 2/3] imx: mx6slevk: Add I2C1 support
  2014-09-15  7:18 [U-Boot] [PATCH 1/3] imx: mx6sololite: Add I2C1 pad settings Ye.Li
@ 2014-09-15  7:18 ` Ye.Li
  2014-09-15  7:18 ` [U-Boot] [PATCH 3/3] imx: mx6slevk: Add PMIC Pfuze support Ye.Li
  1 sibling, 0 replies; 3+ messages in thread
From: Ye.Li @ 2014-09-15  7:18 UTC (permalink / raw)
  To: u-boot

Enable the MXC I2C driver for mx6slevk and setup the I2C1.

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

Changes since v2:
- None

Changes since v3:
- Split the I2C1 pad setting to another new patch.

 board/freescale/mx6slevk/mx6slevk.c |   26 ++++++++++++++++++++++++++
 include/configs/mx6slevk.h          |    6 ++++++
 2 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/board/freescale/mx6slevk/mx6slevk.c b/board/freescale/mx6slevk/mx6slevk.c
index a990b4c..fedd5c3 100644
--- a/board/freescale/mx6slevk/mx6slevk.c
+++ b/board/freescale/mx6slevk/mx6slevk.c
@@ -13,12 +13,14 @@
 #include <asm/arch/sys_proto.h>
 #include <asm/gpio.h>
 #include <asm/imx-common/iomux-v3.h>
+#include <asm/imx-common/mxc_i2c.h>
 #include <asm/io.h>
 #include <linux/sizes.h>
 #include <common.h>
 #include <fsl_esdhc.h>
 #include <mmc.h>
 #include <netdev.h>
+#include <i2c.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -37,8 +39,29 @@ DECLARE_GLOBAL_DATA_PTR;
 #define SPI_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_SPEED_MED | \
 		      PAD_CTL_DSE_40ohm | PAD_CTL_SRE_FAST)
 
+#define I2C_PAD_CTRL    (PAD_CTL_PKE | PAD_CTL_PUE |            \
+	PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED |               \
+	PAD_CTL_DSE_40ohm | PAD_CTL_HYS |			\
+	PAD_CTL_ODE | PAD_CTL_SRE_FAST)
+
 #define ETH_PHY_RESET	IMX_GPIO_NR(4, 21)
 
+#define PC MUX_PAD_CTRL(I2C_PAD_CTRL)
+
+/* I2C1 for PMIC */
+struct i2c_pads_info i2c_pad_info0 = {
+	.sda = {
+		.i2c_mode = MX6_PAD_I2C1_SDA__I2C1_SDA | PC,
+		.gpio_mode = MX6_PAD_I2C1_SDA__GPIO_3_13 | PC,
+		.gp = IMX_GPIO_NR(3, 13),
+	},
+	.scl = {
+		.i2c_mode = MX6_PAD_I2C1_SCL__I2C1_SCL | PC,
+		.gpio_mode = MX6_PAD_I2C1_SCL__GPIO_3_12 | PC,
+		.gp = IMX_GPIO_NR(3, 12),
+	},
+};
+
 int dram_init(void)
 {
 	gd->ram_size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE);
@@ -162,6 +185,9 @@ int board_init(void)
 #ifdef	CONFIG_FEC_MXC
 	setup_fec();
 #endif
+
+	setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info0);
+
 	return 0;
 }
 
diff --git a/include/configs/mx6slevk.h b/include/configs/mx6slevk.h
index 3d05a64..bf5066f 100644
--- a/include/configs/mx6slevk.h
+++ b/include/configs/mx6slevk.h
@@ -60,6 +60,12 @@
 #define CONFIG_PHYLIB
 #define CONFIG_PHY_SMSC
 
+/* I2C Configs */
+#define CONFIG_CMD_I2C
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_MXC
+#define CONFIG_SYS_I2C_SPEED		  100000
+
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
 #define CONFIG_CONS_INDEX		1
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH 3/3] imx: mx6slevk: Add PMIC Pfuze support
  2014-09-15  7:18 [U-Boot] [PATCH 1/3] imx: mx6sololite: Add I2C1 pad settings Ye.Li
  2014-09-15  7:18 ` [U-Boot] [PATCH 2/3] imx: mx6slevk: Add I2C1 support Ye.Li
@ 2014-09-15  7:18 ` Ye.Li
  1 sibling, 0 replies; 3+ messages in thread
From: Ye.Li @ 2014-09-15  7:18 UTC (permalink / raw)
  To: u-boot

Initialize the Pfuze on I2C1 at mx6slekv board late init.

Signed-off-by: Ye.Li <B37916@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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-09-15  7:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-15  7:18 [U-Boot] [PATCH 1/3] imx: mx6sololite: Add I2C1 pad settings Ye.Li
2014-09-15  7:18 ` [U-Boot] [PATCH 2/3] imx: mx6slevk: Add I2C1 support Ye.Li
2014-09-15  7:18 ` [U-Boot] [PATCH 3/3] imx: mx6slevk: Add PMIC Pfuze support Ye.Li

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.