jetson-tk1.c 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 <netdev.h>
  9. #include <power/as3722.h>
  10. #include <asm/arch/gpio.h>
  11. #include <asm/arch/pinmux.h>
  12. #include <asm/arch-tegra/gpu.h>
  13. #include "pinmux-config-jetson-tk1.h"
  14. DECLARE_GLOBAL_DATA_PTR;
  15. /*
  16. * Routine: pinmux_init
  17. * Description: Do individual peripheral pinmux configs
  18. */
  19. void pinmux_init(void)
  20. {
  21. pinmux_clear_tristate_input_clamping();
  22. gpio_config_table(jetson_tk1_gpio_inits,
  23. ARRAY_SIZE(jetson_tk1_gpio_inits));
  24. pinmux_config_pingrp_table(jetson_tk1_pingrps,
  25. ARRAY_SIZE(jetson_tk1_pingrps));
  26. pinmux_config_drvgrp_table(jetson_tk1_drvgrps,
  27. ARRAY_SIZE(jetson_tk1_drvgrps));
  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. err = as3722_gpio_configure(pmic, 1, AS3722_GPIO_OUTPUT_VDDH |
  50. AS3722_GPIO_INVERT);
  51. if (err < 0) {
  52. error("failed to configure GPIO#1 as output: %d\n", err);
  53. return err;
  54. }
  55. err = as3722_gpio_direction_output(pmic, 2, 1);
  56. if (err < 0) {
  57. error("failed to set GPIO#2 high: %d\n", err);
  58. return err;
  59. }
  60. return 0;
  61. }
  62. int board_eth_init(bd_t *bis)
  63. {
  64. return pci_eth_init(bis);
  65. }
  66. #endif /* PCI */
  67. int ft_board_setup(void *blob, bd_t *bd)
  68. {
  69. gpu_enable_node(blob, "/gpu@0,57000000");
  70. return 0;
  71. }