apalis_t30-spl.c 908 B

12345678910111213141516171819202122232425262728293031323334
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * (C) Copyright 2010-2013
  4. * NVIDIA Corporation <www.nvidia.com>
  5. *
  6. * (C) Copyright 2021
  7. * Svyatoslav Ryhel <clamor95@gmail.com>
  8. */
  9. #include <common.h>
  10. #include <asm/arch-tegra/tegra_i2c.h>
  11. #include <linux/delay.h>
  12. /* I2C addr is in 8 bit */
  13. #define TPS65911_I2C_ADDR 0x5A
  14. #define TPS65911_VDDCTRL_OP_REG 0x28
  15. #define TPS65911_VDDCTRL_SR_REG 0x27
  16. #define TPS65911_VDDCTRL_OP_DATA (0x2400 | TPS65911_VDDCTRL_OP_REG)
  17. #define TPS65911_VDDCTRL_SR_DATA (0x0100 | TPS65911_VDDCTRL_SR_REG)
  18. void pmic_enable_cpu_vdd(void)
  19. {
  20. /*
  21. * Bring up CPU VDD via the TPS65911x PMIC on the DVC I2C bus.
  22. * First set VDD to 1.0125V, then enable the VDD regulator.
  23. */
  24. udelay(1000);
  25. tegra_i2c_ll_write(TPS65911_I2C_ADDR,
  26. TPS65911_VDDCTRL_OP_DATA);
  27. udelay(1000);
  28. tegra_i2c_ll_write(TPS65911_I2C_ADDR,
  29. TPS65911_VDDCTRL_SR_DATA);
  30. udelay(10 * 1000);
  31. }