]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - board/samsung/odroid/odroid.c
odroid u3: enable dm i2c support
[karo-tx-uboot.git] / board / samsung / odroid / odroid.c
index 33003ee9b563fb7a7385ea053b265b3b3aaa35ed..e3517f2eb24101f8614b53c120d30f37ea5caa06 100644 (file)
@@ -382,6 +382,22 @@ static void board_gpio_init(void)
        gpio_set_pull(EXYNOS4X12_GPIO_X31, S5P_GPIO_PULL_UP);
        gpio_set_drv(EXYNOS4X12_GPIO_X31, S5P_GPIO_DRV_4X);
        gpio_direction_input(EXYNOS4X12_GPIO_X31);
+
+       /* Blue LED (Odroid X2/U2/U3) */
+       gpio_request(EXYNOS4X12_GPIO_C10, "Blue LED");
+
+       gpio_direction_output(EXYNOS4X12_GPIO_C10, 0);
+
+#ifdef CONFIG_CMD_USB
+       /* USB3503A Reference frequency */
+       gpio_request(EXYNOS4X12_GPIO_X30, "USB3503A RefFreq");
+
+       /* USB3503A Connect */
+       gpio_request(EXYNOS4X12_GPIO_X34, "USB3503A Connect");
+
+       /* USB3503A Reset */
+       gpio_request(EXYNOS4X12_GPIO_X35, "USB3503A Reset");
+#endif
 }
 
 static int pmic_init_max77686(void)
@@ -399,15 +415,6 @@ static int pmic_init_max77686(void)
        return 0;
 }
 
-#ifdef CONFIG_SYS_I2C_INIT_BOARD
-static void board_init_i2c(void)
-{
-       /* I2C_0 */
-       if (exynos_pinmux_config(PERIPH_ID_I2C0, PINMUX_FLAG_NONE))
-               debug("I2C%d not configured\n", (I2C_0));
-}
-#endif
-
 int exynos_early_init_f(void)
 {
        board_clock_init();
@@ -428,10 +435,7 @@ int exynos_init(void)
 
 int exynos_power_init(void)
 {
-#ifdef CONFIG_SYS_I2C_INIT_BOARD
-       board_init_i2c();
-#endif
-       pmic_init(I2C_0);
+       pmic_init(0);
        pmic_init_max77686();
 
        return 0;
@@ -462,9 +466,39 @@ struct s3c_plat_otg_data s5pc210_otg_data = {
        .usb_phy_ctrl   = EXYNOS4X12_USBPHY_CONTROL,
        .usb_flags      = PHY0_SLEEP,
 };
+#endif
+
+#if defined(CONFIG_USB_GADGET) || defined(CONFIG_CMD_USB)
 
 int board_usb_init(int index, enum usb_init_type init)
 {
+#ifdef CONFIG_CMD_USB
+       struct pmic *p_pmic;
+
+       /* Set Ref freq 0 => 24MHz, 1 => 26MHz*/
+       /* Odroid Us have it at 24MHz, Odroid Xs at 26MHz */
+       if (gd->board_type == ODROID_TYPE_U3)
+               gpio_direction_output(EXYNOS4X12_GPIO_X30, 0);
+       else
+               gpio_direction_output(EXYNOS4X12_GPIO_X30, 1);
+
+       /* Disconnect, Reset, Connect */
+       gpio_direction_output(EXYNOS4X12_GPIO_X34, 0);
+       gpio_direction_output(EXYNOS4X12_GPIO_X35, 0);
+       gpio_direction_output(EXYNOS4X12_GPIO_X35, 1);
+       gpio_direction_output(EXYNOS4X12_GPIO_X34, 1);
+
+       /* Power off and on BUCK8 for LAN9730 */
+       debug("LAN9730 - Turning power buck 8 OFF and ON.\n");
+
+       p_pmic = pmic_get("MAX77686_PMIC");
+       if (p_pmic && !pmic_probe(p_pmic)) {
+               max77686_set_buck_voltage(p_pmic, 8, 750000);
+               max77686_set_buck_voltage(p_pmic, 8, 3300000);
+       }
+
+#endif
+
        debug("USB_udc_probe\n");
        return s3c_udc_probe(&s5pc210_otg_data);
 }