1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2014-2016
4 * Stefan Agner <stefan@agner.ch>
10 #include <asm/arch/gp_padctrl.h>
11 #include <asm/arch/pinmux.h>
12 #include <asm/arch-tegra/ap.h>
13 #include <asm/arch-tegra/tegra.h>
16 #include <fdt_support.h>
18 #include <linux/delay.h>
19 #include "pinmux-config-colibri_t30.h"
20 #include "../common/tdx-common.h"
22 int arch_misc_init(void)
24 if (readl(NV_PA_BASE_SRAM + NVBOOTINFOTABLE_BOOTTYPE) ==
26 printf("USB recovery mode\n");
33 puts("Model: Toradex Colibri T30 1GB\n");
38 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
39 int ft_board_setup(void *blob, struct bd_info *bd)
44 if (eth_env_get_enetaddr("ethaddr", enetaddr)) {
45 int err = fdt_find_and_setprop(blob,
46 "/usb@7d004000/ethernet@1",
47 "local-mac-address", enetaddr, 6, 0);
49 /* Older device trees might have used a different node name */
51 err = fdt_find_and_setprop(blob,
52 "/usb@7d004000/asix@1",
53 "local-mac-address", enetaddr, 6, 0);
56 puts(" MAC address updated...\n");
59 return ft_common_board_setup(blob, bd);
64 * Routine: pinmux_init
65 * Description: Do individual peripheral pinmux configs
67 void pinmux_init(void)
69 pinmux_config_pingrp_table(tegra3_pinmux_common,
70 ARRAY_SIZE(tegra3_pinmux_common));
72 pinmux_config_pingrp_table(unused_pins_lowpower,
73 ARRAY_SIZE(unused_pins_lowpower));
75 /* Initialize any non-default pad configs (APB_MISC_GP regs) */
76 pinmux_config_drvgrp_table(colibri_t30_padctrl,
77 ARRAY_SIZE(colibri_t30_padctrl));
81 * Disable RS232 serial transceiver ForceOFF# pins on Iris
83 void gpio_early_init_uart(void)
85 gpio_request(TEGRA_GPIO(X, 6), "Force OFF# X13");
86 gpio_direction_output(TEGRA_GPIO(X, 6), 1);
87 gpio_request(TEGRA_GPIO(X, 7), "Force OFF# X14");
88 gpio_direction_output(TEGRA_GPIO(X, 7), 1);
92 * Enable AX88772B USB to LAN controller
94 void pin_mux_usb(void)
96 /* Reset ASIX using LAN_RESET */
97 gpio_request(TEGRA_GPIO(DD, 0), "LAN_RESET");
98 gpio_direction_output(TEGRA_GPIO(DD, 0), 0);
100 gpio_set_value(TEGRA_GPIO(DD, 0), 1);
104 * Backlight off before OS handover
106 void board_preboot_os(void)
108 gpio_request(TEGRA_GPIO(V, 2), "BL_ON");
109 gpio_direction_output(TEGRA_GPIO(V, 2), 0);