]>
Commit | Line | Data |
---|---|---|
6bbda883 LS |
1 | /* |
2 | * Copyright (C) 2012 Lucas Stach | |
3 | * | |
1a459660 | 4 | * SPDX-License-Identifier: GPL-2.0+ |
6bbda883 LS |
5 | */ |
6 | ||
7 | #include <common.h> | |
6bbda883 LS |
8 | #include <asm/arch/clock.h> |
9 | #include <asm/arch/funcmux.h> | |
10 | #include <asm/arch/pinmux.h> | |
a5825625 | 11 | #include <asm/arch-tegra/ap.h> |
6bbda883 | 12 | #include <asm/arch-tegra/board.h> |
a5825625 | 13 | #include <asm/arch-tegra/tegra.h> |
d1db97aa | 14 | #include <asm/gpio.h> |
a5825625 MZ |
15 | #include <asm/io.h> |
16 | ||
17 | int arch_misc_init(void) | |
18 | { | |
19 | if (readl(NV_PA_BASE_SRAM + NVBOOTINFOTABLE_BOOTTYPE) == | |
20 | NVBOOTTYPE_RECOVERY) | |
21 | printf("USB recovery mode\n"); | |
22 | ||
23 | return 0; | |
24 | } | |
6bbda883 LS |
25 | |
26 | #ifdef CONFIG_TEGRA_MMC | |
c9aa831e TW |
27 | /* |
28 | * Routine: pin_mux_mmc | |
29 | * Description: setup the pin muxes/tristate values for the SDMMC(s) | |
30 | */ | |
31 | void pin_mux_mmc(void) | |
6bbda883 LS |
32 | { |
33 | funcmux_select(PERIPH_ID_SDMMC4, FUNCMUX_SDMMC4_ATB_GMA_4_BIT); | |
70ad375e | 34 | pinmux_tristate_disable(PMUX_PINGRP_GMB); |
6bbda883 LS |
35 | } |
36 | #endif | |
d1db97aa MZ |
37 | |
38 | #ifdef CONFIG_TEGRA_NAND | |
39 | void pin_mux_nand(void) | |
40 | { | |
41 | funcmux_select(PERIPH_ID_NDFLASH, FUNCMUX_NDFLASH_KBC_8_BIT); | |
76a30fed MZ |
42 | |
43 | /* | |
44 | * configure pingroup ATC to something unrelated to | |
45 | * avoid ATC overriding KBC | |
46 | */ | |
47 | pinmux_set_func(PMUX_PINGRP_ATC, PMUX_FUNC_GMI); | |
d1db97aa MZ |
48 | } |
49 | #endif | |
50 | ||
51 | #ifdef CONFIG_USB_EHCI_TEGRA | |
52 | void pin_mux_usb(void) | |
53 | { | |
54 | /* module internal USB bus to connect ethernet chipset */ | |
55 | funcmux_select(PERIPH_ID_USB2, FUNCMUX_USB2_ULPI); | |
56 | ||
57 | /* ULPI reference clock output */ | |
58 | pinmux_set_func(PMUX_PINGRP_CDEV2, PMUX_FUNC_PLLP_OUT4); | |
59 | pinmux_tristate_disable(PMUX_PINGRP_CDEV2); | |
60 | ||
61 | /* PHY reset GPIO */ | |
62 | pinmux_tristate_disable(PMUX_PINGRP_UAC); | |
63 | ||
64 | /* VBus GPIO */ | |
65 | pinmux_tristate_disable(PMUX_PINGRP_DTE); | |
66 | ||
00a5270b MZ |
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); | |
71 | udelay(5); | |
72 | gpio_set_value(GPIO_PV4, 1); | |
73 | ||
74 | /* USBH_PEN: USB 1 aka Tegra USB port 3 VBus */ | |
d1db97aa MZ |
75 | pinmux_tristate_disable(PMUX_PINGRP_SPIG); |
76 | } | |
77 | #endif |