jetson-tk1.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * (C) Copyright 2014
  3. * NVIDIA Corporation <www.nvidia.com>
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #include <common.h>
  8. #include <power/as3722.h>
  9. #include <asm/arch/gpio.h>
  10. #include <asm/arch/pinmux.h>
  11. #include "pinmux-config-jetson-tk1.h"
  12. DECLARE_GLOBAL_DATA_PTR;
  13. /*
  14. * Routine: pinmux_init
  15. * Description: Do individual peripheral pinmux configs
  16. */
  17. void pinmux_init(void)
  18. {
  19. pinmux_clear_tristate_input_clamping();
  20. gpio_config_table(jetson_tk1_gpio_inits,
  21. ARRAY_SIZE(jetson_tk1_gpio_inits));
  22. pinmux_config_pingrp_table(jetson_tk1_pingrps,
  23. ARRAY_SIZE(jetson_tk1_pingrps));
  24. pinmux_config_drvgrp_table(jetson_tk1_drvgrps,
  25. ARRAY_SIZE(jetson_tk1_drvgrps));
  26. pinmux_config_mipipadctrlgrp_table(jetson_tk1_mipipadctrlgrps,
  27. ARRAY_SIZE(jetson_tk1_mipipadctrlgrps));
  28. }
  29. #ifdef CONFIG_PCI_TEGRA
  30. int tegra_pcie_board_init(void)
  31. {
  32. struct udevice *pmic;
  33. int err;
  34. err = as3722_init(&pmic);
  35. if (err) {
  36. error("failed to initialize AS3722 PMIC: %d\n", err);
  37. return err;
  38. }
  39. err = as3722_sd_enable(pmic, 4);
  40. if (err < 0) {
  41. error("failed to enable SD4: %d\n", err);
  42. return err;
  43. }
  44. err = as3722_sd_set_voltage(pmic, 4, 0x24);
  45. if (err < 0) {
  46. error("failed to set SD4 voltage: %d\n", err);
  47. return err;
  48. }
  49. return 0;
  50. }
  51. #endif /* PCI */