public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jagan Teki <jagan@openedev.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v6 13/21] SabreSD: Enable DM_I2C and DM_PMIC
Date: Thu, 18 May 2017 16:30:23 +0530	[thread overview]
Message-ID: <1495105231-1723-14-git-send-email-jagan@openedev.com> (raw)
In-Reply-To: <1495105231-1723-1-git-send-email-jagan@openedev.com>

From: Jagan Teki <jagan@amarulasolutions.com>

(1) Enable
    DM_I2C
    DM_PMIC
    DM_PMIC_PFUZE100
(2) Removed
    setup_i2c
    power_init_board

I2C Log:
--------
=> i2c bus
Bus 0:  i2c at 021a0000
Bus 1:  i2c at 021a4000
   08: pfuze100 at 08, offset len 1, flags 0
Bus 2:  i2c at 021a8000
=> i2c dev 1
Setting bus to 1
=> i2c speed 100000
Setting bus speed to 100000 Hz
=> i2c probe
Valid chip addresses: 08 48
=> i2c md 08 0x0 0x20
0000: 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10    ................
0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
=> i2c md 48 0x0 0x20
0000: 00 f0 00 00 00 00 00 00 00 00 00 80 70 41 41 41    ............pAAA
0010: 00 00 00 80 70 41 41 41 41 41 41 41 41 41 41 41    ....pAAAAAAAAAAA

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
 arch/arm/cpu/armv7/mx6/Kconfig          |  3 ++
 board/freescale/mx6sabresd/mx6sabresd.c | 72 ---------------------------------
 include/configs/mx6sabresd.h            | 15 -------
 3 files changed, 3 insertions(+), 87 deletions(-)

diff --git a/arch/arm/cpu/armv7/mx6/Kconfig b/arch/arm/cpu/armv7/mx6/Kconfig
index 42ac9b9..314a61f 100644
--- a/arch/arm/cpu/armv7/mx6/Kconfig
+++ b/arch/arm/cpu/armv7/mx6/Kconfig
@@ -214,8 +214,11 @@ config TARGET_MX6SABRESD
 	select BOARD_LATE_INIT
 	select OF_CONTROL
 	select DM
+	select DM_I2C
 	select DM_GPIO
 	select DM_MMC
+	select DM_PMIC
+	select DM_PMIC_PFUZE100
 	select DM_THERMAL
 	select PINCTRL
 	select PINCTRL_IMX6
diff --git a/board/freescale/mx6sabresd/mx6sabresd.c b/board/freescale/mx6sabresd/mx6sabresd.c
index 7af263d..cbd952f 100644
--- a/board/freescale/mx6sabresd/mx6sabresd.c
+++ b/board/freescale/mx6sabresd/mx6sabresd.c
@@ -12,7 +12,6 @@
 #include <asm/arch/mx6-pins.h>
 #include <linux/errno.h>
 #include <asm/gpio.h>
-#include <asm/imx-common/mxc_i2c.h>
 #include <asm/imx-common/iomux-v3.h>
 #include <asm/imx-common/boot_mode.h>
 #include <asm/imx-common/video.h>
@@ -22,10 +21,6 @@
 #include <asm/arch/crm_regs.h>
 #include <asm/io.h>
 #include <asm/arch/sys_proto.h>
-#include <i2c.h>
-#include <power/pmic.h>
-#include <power/pfuze100_pmic.h>
-#include "../common/pfuze.h"
 #include <usb.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -40,14 +35,6 @@ 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_PUS_100K_UP |			\
-	PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_HYS |	\
-	PAD_CTL_ODE | PAD_CTL_SRE_FAST)
-
-#define I2C_PMIC	1
-
-#define I2C_PAD MUX_PAD_CTRL(I2C_PAD_CTRL)
-
 #define DISP0_PWR_EN	IMX_GPIO_NR(1, 21)
 
 int dram_init(void)
@@ -152,32 +139,6 @@ static void enable_lvds(struct display_info_t const *dev)
 	enable_backlight();
 }
 
-static struct i2c_pads_info mx6q_i2c_pad_info1 = {
-	.scl = {
-		.i2c_mode = MX6Q_PAD_KEY_COL3__I2C2_SCL | I2C_PAD,
-		.gpio_mode = MX6Q_PAD_KEY_COL3__GPIO4_IO12 | I2C_PAD,
-		.gp = IMX_GPIO_NR(4, 12)
-	},
-	.sda = {
-		.i2c_mode = MX6Q_PAD_KEY_ROW3__I2C2_SDA | I2C_PAD,
-		.gpio_mode = MX6Q_PAD_KEY_ROW3__GPIO4_IO13 | I2C_PAD,
-		.gp = IMX_GPIO_NR(4, 13)
-	}
-};
-
-static struct i2c_pads_info mx6dl_i2c_pad_info1 = {
-	.scl = {
-		.i2c_mode = MX6DL_PAD_KEY_COL3__I2C2_SCL | I2C_PAD,
-		.gpio_mode = MX6DL_PAD_KEY_COL3__GPIO4_IO12 | I2C_PAD,
-		.gp = IMX_GPIO_NR(4, 12)
-	},
-	.sda = {
-		.i2c_mode = MX6DL_PAD_KEY_ROW3__I2C2_SDA | I2C_PAD,
-		.gpio_mode = MX6DL_PAD_KEY_ROW3__GPIO4_IO13 | I2C_PAD,
-		.gp = IMX_GPIO_NR(4, 13)
-	}
-};
-
 static void setup_spi(void)
 {
 	SETUP_IOMUX_PADS(ecspi1_pads);
@@ -471,10 +432,6 @@ int board_init(void)
 #ifdef CONFIG_MXC_SPI
 	setup_spi();
 #endif
-	if (is_mx6dq() || is_mx6dqp())
-		setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, &mx6q_i2c_pad_info1);
-	else
-		setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, &mx6dl_i2c_pad_info1);
 #ifdef CONFIG_USB_EHCI_MX6
 	setup_usb();
 #endif
@@ -482,35 +439,6 @@ int board_init(void)
 	return 0;
 }
 
-int power_init_board(void)
-{
-	struct pmic *p;
-	unsigned int reg;
-	int ret;
-
-	p = pfuze_common_init(I2C_PMIC);
-	if (!p)
-		return -ENODEV;
-
-	ret = pfuze_mode_init(p, APS_PFM);
-	if (ret < 0)
-		return ret;
-
-	/* Increase VGEN3 from 2.5 to 2.8V */
-	pmic_reg_read(p, PFUZE100_VGEN3VOL, &reg);
-	reg &= ~LDO_VOL_MASK;
-	reg |= LDOB_2_80V;
-	pmic_reg_write(p, PFUZE100_VGEN3VOL, reg);
-
-	/* Increase VGEN5 from 2.8 to 3V */
-	pmic_reg_read(p, PFUZE100_VGEN5VOL, &reg);
-	reg &= ~LDO_VOL_MASK;
-	reg |= LDOB_3_00V;
-	pmic_reg_write(p, PFUZE100_VGEN5VOL, reg);
-
-	return 0;
-}
-
 #ifdef CONFIG_MXC_SPI
 int board_spi_cs_gpio(unsigned bus, unsigned cs)
 {
diff --git a/include/configs/mx6sabresd.h b/include/configs/mx6sabresd.h
index b90afe0..9d82355 100644
--- a/include/configs/mx6sabresd.h
+++ b/include/configs/mx6sabresd.h
@@ -50,21 +50,6 @@
 #define CONFIG_PCIE_IMX_POWER_GPIO	IMX_GPIO_NR(3, 19)
 #endif
 
-/* I2C Configs */
-#ifdef CONFIG_SYS_I2C_MXC
-#define CONFIG_SYS_I2C
-#define CONFIG_SYS_I2C_MXC_I2C1		/* enable I2C bus 1 */
-#define CONFIG_SYS_I2C_MXC_I2C2		/* enable I2C bus 2 */
-#define CONFIG_SYS_I2C_MXC_I2C3		/* enable I2C bus 3 */
-#define CONFIG_SYS_I2C_SPEED		  100000
-#endif
-
-/* PMIC */
-#define CONFIG_POWER
-#define CONFIG_POWER_I2C
-#define CONFIG_POWER_PFUZE100
-#define CONFIG_POWER_PFUZE100_I2C_ADDR	0x08
-
 /* USB Configs */
 #ifdef CONFIG_CMD_USB
 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET
-- 
1.9.1

  parent reply	other threads:[~2017-05-18 11:00 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-18 11:00 [U-Boot] [PATCH v6 00/21] ARM: i.MX6: SabreSD: Add dts support Jagan Teki
2017-05-18 11:00 ` [U-Boot] [PATCH v6 01/21] mx6sabresd: MAINTAINERS: Remove invalid defconfigs F: list Jagan Teki
2017-05-18 12:16   ` Fabio Estevam
2017-05-18 11:00 ` [U-Boot] [PATCH v6 02/21] mx6sabresd: README: Fix to add space on dd command Jagan Teki
2017-05-18 12:17   ` Fabio Estevam
2017-05-18 15:41     ` Jagan Teki
2017-05-18 11:00 ` [U-Boot] [PATCH v6 03/21] ARM: i.MX6: sabresd: Remove SPL_I2C_SUPPORT Jagan Teki
2017-05-18 12:18   ` Fabio Estevam
2017-05-18 11:00 ` [U-Boot] [PATCH v6 04/21] ARM: dts: i.MX6: Add imx6qdl-sabresd.dtsi Jagan Teki
2017-05-18 12:20   ` Fabio Estevam
2017-05-22 16:51     ` Jagan Teki
2017-05-22 17:01       ` Fabio Estevam
2017-05-18 11:00 ` [U-Boot] [PATCH v6 05/21] ARM: dts: i.MX6: Add imx6q-sabresd.dts Jagan Teki
2017-05-18 11:00 ` [U-Boot] [PATCH v6 06/21] ARM: dts: i.MX6: Add imx6dl-sabresd.dts Jagan Teki
2017-05-18 11:00 ` [U-Boot] [PATCH v6 07/21] ARM: dts: i.MX6: Add imx6qp.dtsi Jagan Teki
2017-05-18 11:00 ` [U-Boot] [PATCH v6 08/21] ARM: dts: i.MX6: Add imx6qp-sabresd.dts Jagan Teki
2017-05-18 11:00 ` [U-Boot] [PATCH v6 09/21] sabresd: i.MX6Q: Add initial dts support Jagan Teki
2017-05-18 11:00 ` [U-Boot] [PATCH v6 10/21] sabresd: i.MX6QP: " Jagan Teki
2017-05-18 11:00 ` [U-Boot] [PATCH v6 11/21] SabreSD: i.MX6DL: " Jagan Teki
2017-05-18 11:00 ` [U-Boot] [PATCH v6 12/21] SabreSD: Move CONFIG_SYS_I2C_MXC to defconfigs Jagan Teki
2017-05-18 11:00 ` Jagan Teki [this message]
2017-05-18 12:22   ` [U-Boot] [PATCH v6 13/21] SabreSD: Enable DM_I2C and DM_PMIC Fabio Estevam
2017-05-18 12:41     ` Fabio Estevam
2017-05-22 14:38       ` Jagan Teki
2017-05-22 14:48         ` Fabio Estevam
2017-05-18 11:00 ` [U-Boot] [PATCH v6 14/21] SabreSD: Enable CONFIG_DM_REGULATOR Jagan Teki
2017-05-18 12:23   ` Fabio Estevam
2017-05-18 11:00 ` [U-Boot] [PATCH v6 15/21] SabreSD: Enable DM_USB Jagan Teki
2017-05-18 11:00 ` [U-Boot] [PATCH v6 16/21] i.MX6: Sabre: Move CONFIG_FEC_MXC to defconfigs Jagan Teki
2017-05-18 11:00 ` [U-Boot] [PATCH v6 17/21] i.MX6: SabreSD: Enable DM_ETH Jagan Teki
2017-05-18 12:26   ` Fabio Estevam
2017-05-18 11:00 ` [U-Boot] [PATCH v6 18/21] i.MX6: sabresd: Drop checkboard Jagan Teki
2017-05-18 11:00 ` [U-Boot] [PATCH v6 19/21] i.MX6: SabreSD: Cleanup board code Jagan Teki
2017-05-18 11:00 ` [U-Boot] [PATCH v6 20/21] i.MX6: SabreSD: mx6sabresd_spl_defconfig => mx6sabresd_defconfig Jagan Teki
2017-05-18 12:27   ` Fabio Estevam
2017-05-18 11:00 ` [U-Boot] [PATCH v6 21/21] SabreSD: README: Update with dtb changes Jagan Teki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1495105231-1723-14-git-send-email-jagan@openedev.com \
    --to=jagan@openedev.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox