3 * NVIDIA Corporation <www.nvidia.com>
5 * SPDX-License-Identifier: GPL-2.0+
10 #include <power/as3722.h>
11 #include <power/pmic.h>
13 #include <asm/arch/gpio.h>
14 #include <asm/arch/pinmux.h>
16 #include "pinmux-config-jetson-tk1.h"
18 DECLARE_GLOBAL_DATA_PTR;
21 * Routine: pinmux_init
22 * Description: Do individual peripheral pinmux configs
24 void pinmux_init(void)
26 pinmux_clear_tristate_input_clamping();
28 gpio_config_table(jetson_tk1_gpio_inits,
29 ARRAY_SIZE(jetson_tk1_gpio_inits));
31 pinmux_config_pingrp_table(jetson_tk1_pingrps,
32 ARRAY_SIZE(jetson_tk1_pingrps));
34 pinmux_config_drvgrp_table(jetson_tk1_drvgrps,
35 ARRAY_SIZE(jetson_tk1_drvgrps));
37 pinmux_config_mipipadctrlgrp_table(jetson_tk1_mipipadctrlgrps,
38 ARRAY_SIZE(jetson_tk1_mipipadctrlgrps));
41 #ifdef CONFIG_PCI_TEGRA
42 /* TODO: Convert to driver model */
43 static int as3722_sd_enable(struct udevice *pmic, unsigned int sd)
50 err = pmic_clrsetbits(pmic, AS3722_SD_CONTROL, 0, 1 << sd);
52 error("failed to update SD control register: %d", err);
59 int tegra_pcie_board_init(void)
64 ret = uclass_get_device_by_driver(UCLASS_PMIC,
65 DM_GET_DRIVER(pmic_as3722), &dev);
67 debug("%s: Failed to find PMIC\n", __func__);
71 ret = as3722_sd_enable(dev, 4);
73 error("failed to enable SD4: %d\n", ret);
77 ret = as3722_sd_set_voltage(dev, 4, 0x24);
79 error("failed to set SD4 voltage: %d\n", ret);