1 /* 2 * (C) Copyright 2014-2016 3 * Stefan Agner <stefan@agner.ch> 4 * 5 * SPDX-License-Identifier: GPL-2.0+ 6 */ 7 8 #include <common.h> 9 #include <asm/arch/gp_padctrl.h> 10 #include <asm/arch/pinmux.h> 11 #include <asm/arch-tegra/ap.h> 12 #include <asm/arch-tegra/tegra.h> 13 #include <asm/gpio.h> 14 #include <asm/io.h> 15 #include <i2c.h> 16 #include "pinmux-config-colibri_t30.h" 17 18 int arch_misc_init(void) 19 { 20 if (readl(NV_PA_BASE_SRAM + NVBOOTINFOTABLE_BOOTTYPE) == 21 NVBOOTTYPE_RECOVERY) 22 printf("USB recovery mode\n"); 23 24 return 0; 25 } 26 27 int checkboard(void) 28 { 29 puts("Model: Toradex Colibri T30 1GB\n"); 30 31 return 0; 32 } 33 34 /* 35 * Routine: pinmux_init 36 * Description: Do individual peripheral pinmux configs 37 */ 38 void pinmux_init(void) 39 { 40 pinmux_config_pingrp_table(tegra3_pinmux_common, 41 ARRAY_SIZE(tegra3_pinmux_common)); 42 43 pinmux_config_pingrp_table(unused_pins_lowpower, 44 ARRAY_SIZE(unused_pins_lowpower)); 45 46 /* Initialize any non-default pad configs (APB_MISC_GP regs) */ 47 pinmux_config_drvgrp_table(colibri_t30_padctrl, 48 ARRAY_SIZE(colibri_t30_padctrl)); 49 } 50 51 /* 52 * Enable AX88772B USB to LAN controller 53 */ 54 void pin_mux_usb(void) 55 { 56 /* Reset ASIX using LAN_RESET */ 57 gpio_request(TEGRA_GPIO(DD, 0), "LAN_RESET"); 58 gpio_direction_output(TEGRA_GPIO(DD, 0), 0); 59 udelay(5); 60 gpio_set_value(TEGRA_GPIO(DD, 0), 1); 61 } 62