summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2016-06-15 10:08:27 +0200
committerMarek Szyprowski <m.szyprowski@samsung.com>2016-06-15 12:33:11 +0200
commitc4ed681bc383b82fd407665ff1c4a4e2d4b8c1f5 (patch)
tree71e3e753963829b1a54d09b7550c889e4960a692 /board
parent3dfec13fd1ca473eb078e23b98d5267c12659f7b (diff)
downloadu-boot-c4ed681bc383b82fd407665ff1c4a4e2d4b8c1f5.tar.gz
u-boot-c4ed681bc383b82fd407665ff1c4a4e2d4b8c1f5.tar.bz2
u-boot-c4ed681bc383b82fd407665ff1c4a4e2d4b8c1f5.zip
TPL: TM2: set MAX77843 MUIC to USB path before entering download mode
Use simple soft i2c gpio bit-bang based controller to enable MUIC register write. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Change-Id: I4087fe304d49bd4b88657e6bb4f0bd438e92d6d3
Diffstat (limited to 'board')
-rw-r--r--board/samsung/tm2/tm2.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/board/samsung/tm2/tm2.c b/board/samsung/tm2/tm2.c
index a355fe33f0..8313ea8aee 100644
--- a/board/samsung/tm2/tm2.c
+++ b/board/samsung/tm2/tm2.c
@@ -15,6 +15,7 @@
#include <asm/arch/cpu.h>
#include <asm/arch/power.h>
#include <samsung-usb-phy-uboot.h>
+#include <asm/gpio.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -102,6 +103,23 @@ int board_mmc_init(bd_t *bis)
}
#endif
+#ifdef CONFIG_SYS_I2C_INIT_BOARD
+void i2c_init_board(void)
+{
+ /* Soft I2C - hsi2c_8 */
+
+ gpio_request(GPIO_I2C_SDA_PIN, "hsi2c_8_data");
+ gpio_request(GPIO_I2C_SCL_PIN, "hsi2c_8_clk");
+ gpio_direction_output(GPIO_I2C_SDA_PIN, 1);
+ gpio_direction_output(GPIO_I2C_SCL_PIN, 1);
+
+ gpio_set_pull(GPIO_I2C_SCL_PIN, S5P_GPIO_PULL_UP);
+ gpio_set_pull(GPIO_I2C_SDA_PIN, S5P_GPIO_PULL_UP);
+
+ gpio_set_drv(GPIO_I2C_SCL_PIN, S5P_GPIO_DRV_1X);
+ gpio_set_drv(GPIO_I2C_SDA_PIN, S5P_GPIO_DRV_1X);
+}
+#endif
#ifdef CONFIG_USB_DWC3
static struct dwc3_device dwc3_device_data = {
.maximum_speed = USB_SPEED_SUPER,