blob: b68d3cacc561e57fbbfefb3d8be44bf90d096340 [file] [log] [blame]
Stefan Agner60bae8c2014-08-05 23:27:30 +02001/*
Marcel Ziswilerd92dee52016-11-16 17:49:23 +01002 * (C) Copyright 2014-2016
Stefan Agner60bae8c2014-08-05 23:27:30 +02003 * Stefan Agner <stefan@agner.ch>
4 *
5 * SPDX-License-Identifier: GPL-2.0+
6 */
7
8#include <common.h>
Stefan Agner60bae8c2014-08-05 23:27:30 +02009#include <asm/arch/gp_padctrl.h>
Marcel Ziswiler764d4122015-08-06 00:47:10 +020010#include <asm/arch/pinmux.h>
Marcel Ziswilerdd899d02015-08-06 00:47:00 +020011#include <asm/arch-tegra/ap.h>
12#include <asm/arch-tegra/tegra.h>
Marcel Ziswiler764d4122015-08-06 00:47:10 +020013#include <asm/gpio.h>
Marcel Ziswilerdd899d02015-08-06 00:47:00 +020014#include <asm/io.h>
Stefan Agner60bae8c2014-08-05 23:27:30 +020015#include <i2c.h>
Marcel Ziswiler764d4122015-08-06 00:47:10 +020016#include "pinmux-config-colibri_t30.h"
Stefan Agner98ffd0f2016-11-30 13:41:53 -080017#include "../common/tdx-common.h"
Stefan Agner60bae8c2014-08-05 23:27:30 +020018
Marcel Ziswilerdd899d02015-08-06 00:47:00 +020019int arch_misc_init(void)
20{
21 if (readl(NV_PA_BASE_SRAM + NVBOOTINFOTABLE_BOOTTYPE) ==
22 NVBOOTTYPE_RECOVERY)
23 printf("USB recovery mode\n");
24
25 return 0;
26}
27
Marcel Ziswilerd92dee52016-11-16 17:49:23 +010028int checkboard(void)
29{
30 puts("Model: Toradex Colibri T30 1GB\n");
31
32 return 0;
33}
34
Stefan Agner98ffd0f2016-11-30 13:41:53 -080035#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
36int ft_board_setup(void *blob, bd_t *bd)
37{
38 return ft_common_board_setup(blob, bd);
39}
40#endif
41
Stefan Agner60bae8c2014-08-05 23:27:30 +020042/*
43 * Routine: pinmux_init
44 * Description: Do individual peripheral pinmux configs
45 */
46void pinmux_init(void)
47{
48 pinmux_config_pingrp_table(tegra3_pinmux_common,
49 ARRAY_SIZE(tegra3_pinmux_common));
50
51 pinmux_config_pingrp_table(unused_pins_lowpower,
52 ARRAY_SIZE(unused_pins_lowpower));
53
54 /* Initialize any non-default pad configs (APB_MISC_GP regs) */
55 pinmux_config_drvgrp_table(colibri_t30_padctrl,
56 ARRAY_SIZE(colibri_t30_padctrl));
57}
58
59/*
60 * Enable AX88772B USB to LAN controller
61 */
62void pin_mux_usb(void)
63{
64 /* Reset ASIX using LAN_RESET */
Stephen Warren7f20bb22016-05-12 12:07:39 -060065 gpio_request(TEGRA_GPIO(DD, 0), "LAN_RESET");
66 gpio_direction_output(TEGRA_GPIO(DD, 0), 0);
Stefan Agner60bae8c2014-08-05 23:27:30 +020067 udelay(5);
Stephen Warren7f20bb22016-05-12 12:07:39 -060068 gpio_set_value(TEGRA_GPIO(DD, 0), 1);
Stefan Agner60bae8c2014-08-05 23:27:30 +020069}