Stefan Agner | 60bae8c | 2014-08-05 23:27:30 +0200 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2014 |
| 3 | * Stefan Agner <stefan@agner.ch> |
| 4 | * |
| 5 | * SPDX-License-Identifier: GPL-2.0+ |
| 6 | */ |
| 7 | |
| 8 | #include <common.h> |
Stefan Agner | 60bae8c | 2014-08-05 23:27:30 +0200 | [diff] [blame] | 9 | #include <asm/arch/gp_padctrl.h> |
Marcel Ziswiler | 764d412 | 2015-08-06 00:47:10 +0200 | [diff] [blame^] | 10 | #include <asm/arch/pinmux.h> |
Marcel Ziswiler | dd899d0 | 2015-08-06 00:47:00 +0200 | [diff] [blame] | 11 | #include <asm/arch-tegra/ap.h> |
| 12 | #include <asm/arch-tegra/tegra.h> |
Marcel Ziswiler | 764d412 | 2015-08-06 00:47:10 +0200 | [diff] [blame^] | 13 | #include <asm/gpio.h> |
Marcel Ziswiler | dd899d0 | 2015-08-06 00:47:00 +0200 | [diff] [blame] | 14 | #include <asm/io.h> |
Stefan Agner | 60bae8c | 2014-08-05 23:27:30 +0200 | [diff] [blame] | 15 | #include <i2c.h> |
Marcel Ziswiler | 764d412 | 2015-08-06 00:47:10 +0200 | [diff] [blame^] | 16 | #include "pinmux-config-colibri_t30.h" |
Stefan Agner | 60bae8c | 2014-08-05 23:27:30 +0200 | [diff] [blame] | 17 | |
Marcel Ziswiler | dd899d0 | 2015-08-06 00:47:00 +0200 | [diff] [blame] | 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 | |
Stefan Agner | 60bae8c | 2014-08-05 23:27:30 +0200 | [diff] [blame] | 27 | /* |
| 28 | * Routine: pinmux_init |
| 29 | * Description: Do individual peripheral pinmux configs |
| 30 | */ |
| 31 | void pinmux_init(void) |
| 32 | { |
| 33 | pinmux_config_pingrp_table(tegra3_pinmux_common, |
| 34 | ARRAY_SIZE(tegra3_pinmux_common)); |
| 35 | |
| 36 | pinmux_config_pingrp_table(unused_pins_lowpower, |
| 37 | ARRAY_SIZE(unused_pins_lowpower)); |
| 38 | |
| 39 | /* Initialize any non-default pad configs (APB_MISC_GP regs) */ |
| 40 | pinmux_config_drvgrp_table(colibri_t30_padctrl, |
| 41 | ARRAY_SIZE(colibri_t30_padctrl)); |
| 42 | } |
| 43 | |
| 44 | /* |
| 45 | * Enable AX88772B USB to LAN controller |
| 46 | */ |
| 47 | void pin_mux_usb(void) |
| 48 | { |
| 49 | /* Reset ASIX using LAN_RESET */ |
Marcel Ziswiler | 6b8f6e1 | 2014-10-10 17:04:49 +0200 | [diff] [blame] | 50 | gpio_request(GPIO_PDD0, "LAN_RESET"); |
Stefan Agner | 60bae8c | 2014-08-05 23:27:30 +0200 | [diff] [blame] | 51 | gpio_direction_output(GPIO_PDD0, 0); |
| 52 | udelay(5); |
| 53 | gpio_set_value(GPIO_PDD0, 1); |
| 54 | } |