]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board: endeavoru: convert HTC One X to use DM PMIC
authorSvyatoslav Ryhel <clamor95@gmail.com>
Sat, 26 Aug 2023 15:35:35 +0000 (18:35 +0300)
committerSvyatoslav Ryhel <clamor95@gmail.com>
Tue, 28 Nov 2023 07:15:50 +0000 (09:15 +0200)
Since required drivers were merged, we can safely clean up the
board and switch to DM based driver with device tree support.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
arch/arm/dts/tegra30-htc-endeavoru.dts
board/htc/endeavoru/endeavoru-spl.c
board/htc/endeavoru/endeavoru.c
configs/endeavoru_defconfig

index 5c7b2deae5df9ea0e04e8f9f9459124c5e6cda7d..22320de70860035ae660f71d7dcac47531e2e352 100644 (file)
@@ -81,6 +81,7 @@
                                        regulator-name = "avdd_dsi_csi";
                                        regulator-min-microvolt = <1200000>;
                                        regulator-max-microvolt = <1200000>;
+                                       regulator-boot-on;
                                };
                        };
                };
index 7921ff1a733379d9fda5d08a1ced4292e162af04..2525b50d3e8a3d792411b6b7cb27065c0d1ab7a5 100644 (file)
@@ -9,7 +9,7 @@
  *  Svyatoslav Ryhel <clamor95@gmail.com>
  */
 
-#include <common.h>
+#include <asm/arch/tegra.h>
 #include <asm/arch-tegra/tegra_i2c.h>
 #include <linux/delay.h>
 
index e1a0b242e2cef75d3a48e9a44c264c0d2e9f4101..7fb6125b1432982ebe29dfaf9eb4c090a868a461 100644 (file)
@@ -7,48 +7,11 @@
  *  Svyatoslav Ryhel <clamor95@gmail.com>
  */
 
-#include <common.h>
 #include <dm.h>
 #include <fdt_support.h>
-#include <i2c.h>
-#include <log.h>
 #include <asm/arch/pinmux.h>
-#include <asm/arch/gp_padctrl.h>
-#include <asm/arch/gpio.h>
-#include <asm/gpio.h>
-#include <linux/delay.h>
-#include "pinmux-config-endeavoru.h"
-
-#define TPS80032_CTL1_I2C_ADDR         0x48
-#define TPS80032_PHOENIX_DEV_ON                0x25
-#define   DEVOFF                       BIT(0)
-#define TPS80032_LDO1_CFG_STATE                0x9E
-#define TPS80032_LDO1_CFG_VOLTAGE      0x9F
-
-#ifdef CONFIG_CMD_POWEROFF
-int do_poweroff(struct cmd_tbl *cmdtp, int flag,
-               int argc, char *const argv[])
-{
-       struct udevice *dev;
-       int ret;
-
-       ret = i2c_get_chip_for_busnum(0, TPS80032_CTL1_I2C_ADDR, 1, &dev);
-       if (ret) {
-               log_debug("cannot find PMIC I2C chip\n");
-               return 0;
-       }
-
-       ret = dm_i2c_reg_write(dev, TPS80032_PHOENIX_DEV_ON, DEVOFF);
-       if (ret)
-               return ret;
 
-       // wait some time and then print error
-       mdelay(5000);
-
-       printf("Failed to power off!!!\n");
-       return 1;
-}
-#endif
+#include "pinmux-config-endeavoru.h"
 
 /*
  * Routine: pinmux_init
@@ -60,38 +23,6 @@ void pinmux_init(void)
                ARRAY_SIZE(endeavoru_pinmux_common));
 }
 
-#ifdef CONFIG_MMC_SDHCI_TEGRA
-static void tps80032_voltage_init(void)
-{
-       struct udevice *dev;
-       int ret;
-
-       ret = i2c_get_chip_for_busnum(0, TPS80032_CTL1_I2C_ADDR, 1, &dev);
-       if (ret)
-               log_debug("cannot find PMIC I2C chip\n");
-
-       /* TPS80032: LDO1_REG = 1.2v to DSI */
-       ret = dm_i2c_reg_write(dev, TPS80032_LDO1_CFG_VOLTAGE, 0x03);
-       if (ret)
-               log_debug("avdd_dsi_csi voltage set failed: %d\n", ret);
-
-       /* TPS80032: LDO1_REG enable */
-       ret = dm_i2c_reg_write(dev, TPS80032_LDO1_CFG_STATE, 0x01);
-       if (ret)
-               log_debug("avdd_dsi_csi enable failed: %d\n", ret);
-}
-
-/*
- * Routine: pin_mux_mmc
- * Description: setup the MMC muxes, power rails, etc.
- */
-void pin_mux_mmc(void)
-{
-       /* Bring up DSI power */
-       tps80032_voltage_init();
-}
-#endif /* MMC */
-
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
 int ft_board_setup(void *blob, struct bd_info *bd)
 {
index d605acdfc87dbc8d754b8e3c7dc5c2c3411b9754..7212675546b9c3dcd2ebf3a404c2937b4f80aedd 100644 (file)
@@ -44,6 +44,7 @@ CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_CMD_UMS_ABORT_KEYED=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_PAUSE=y
+CONFIG_CMD_REGULATOR=y
 CONFIG_CMD_EXT4_WRITE=y
 # CONFIG_SPL_DOS_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
@@ -61,10 +62,13 @@ CONFIG_FASTBOOT_CMD_OEM_FORMAT=y
 CONFIG_SYS_I2C_TEGRA=y
 CONFIG_BUTTON_KEYBOARD=y
 CONFIG_DM_PMIC=y
+CONFIG_DM_PMIC_TPS80031=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_DM_REGULATOR_TPS80031=y
 CONFIG_PWM_TEGRA=y
 CONFIG_SYS_NS16550=y
+CONFIG_SYSRESET_TPS80031=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_TEGRA=y