2 * Copyright (C) 2012 Lucas Stach
4 * SPDX-License-Identifier: GPL-2.0+
8 #include <asm/arch/clock.h>
9 #include <asm/arch/funcmux.h>
10 #include <asm/arch/pinmux.h>
11 #include <asm/arch-tegra/ap.h>
12 #include <asm/arch-tegra/board.h>
13 #include <asm/arch-tegra/tegra.h>
17 int arch_misc_init(void)
19 if (readl(NV_PA_BASE_SRAM + NVBOOTINFOTABLE_BOOTTYPE) ==
21 printf("USB recovery mode\n");
26 #ifdef CONFIG_TEGRA_MMC
28 * Routine: pin_mux_mmc
29 * Description: setup the pin muxes/tristate values for the SDMMC(s)
31 void pin_mux_mmc(void)
33 funcmux_select(PERIPH_ID_SDMMC4, FUNCMUX_SDMMC4_ATB_GMA_4_BIT);
34 pinmux_tristate_disable(PMUX_PINGRP_GMB);
38 #ifdef CONFIG_TEGRA_NAND
39 void pin_mux_nand(void)
41 funcmux_select(PERIPH_ID_NDFLASH, FUNCMUX_NDFLASH_KBC_8_BIT);
44 * configure pingroup ATC to something unrelated to
45 * avoid ATC overriding KBC
47 pinmux_set_func(PMUX_PINGRP_ATC, PMUX_FUNC_GMI);
51 #ifdef CONFIG_USB_EHCI_TEGRA
52 void pin_mux_usb(void)
54 /* module internal USB bus to connect ethernet chipset */
55 funcmux_select(PERIPH_ID_USB2, FUNCMUX_USB2_ULPI);
57 /* ULPI reference clock output */
58 pinmux_set_func(PMUX_PINGRP_CDEV2, PMUX_FUNC_PLLP_OUT4);
59 pinmux_tristate_disable(PMUX_PINGRP_CDEV2);
62 pinmux_tristate_disable(PMUX_PINGRP_UAC);
65 pinmux_tristate_disable(PMUX_PINGRP_DTE);
67 /* Reset ASIX using LAN_RESET */
68 gpio_request(GPIO_PV4, "LAN_RESET");
69 gpio_direction_output(GPIO_PV4, 0);
70 pinmux_tristate_disable(PMUX_PINGRP_GPV);
72 gpio_set_value(GPIO_PV4, 1);
74 /* USBH_PEN: USB 1 aka Tegra USB port 3 VBus */
75 pinmux_tristate_disable(PMUX_PINGRP_SPIG);
79 #ifdef CONFIG_VIDEO_TEGRA
81 * Routine: pin_mux_display
82 * Description: setup the pin muxes/tristate values for the LCD interface)
84 void pin_mux_display(void)
87 * Manually untristate BL_ON (PT4 - SODIMM 71) as specified through
90 pinmux_tristate_disable(PMUX_PINGRP_DTA);
92 pinmux_set_func(PMUX_PINGRP_SDC, PMUX_FUNC_PWM);
93 pinmux_tristate_disable(PMUX_PINGRP_SDC);