summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2014-12-09 22:25:21 -0700
committerTom Warren <twarren@nvidia.com>2014-12-18 13:19:21 -0700
commit6e2fca94ff4f754024e46e7d986221a75be611f3 (patch)
tree795fb823649f94034ce2f32c2b7939a0d719512b /board
parent9c46e6cb454cc2ab81ca59f94944e7208d0cfb95 (diff)
downloadu-boot-imx-6e2fca94ff4f754024e46e7d986221a75be611f3.zip
u-boot-imx-6e2fca94ff4f754024e46e7d986221a75be611f3.tar.gz
u-boot-imx-6e2fca94ff4f754024e46e7d986221a75be611f3.tar.bz2
ARM: tegra: Enable PCIe on Jetson TK1
The Jetson TK1 has an ethernet NIC connected to the PCIe bus and routes the second root port to a miniPCIe slot. Enable the PCIe controller and the network driver to allow the device to boot over the network. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Warren <twarren@nvidia.com>
Diffstat (limited to 'board')
-rw-r--r--board/nvidia/jetson-tk1/jetson-tk1.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/board/nvidia/jetson-tk1/jetson-tk1.c b/board/nvidia/jetson-tk1/jetson-tk1.c
index 5d37718..daa74a4 100644
--- a/board/nvidia/jetson-tk1/jetson-tk1.c
+++ b/board/nvidia/jetson-tk1/jetson-tk1.c
@@ -6,10 +6,16 @@
*/
#include <common.h>
+#include <netdev.h>
+#include <power/as3722.h>
+
#include <asm/arch/gpio.h>
#include <asm/arch/pinmux.h>
+
#include "pinmux-config-jetson-tk1.h"
+DECLARE_GLOBAL_DATA_PTR;
+
/*
* Routine: pinmux_init
* Description: Do individual peripheral pinmux configs
@@ -27,3 +33,49 @@ void pinmux_init(void)
pinmux_config_drvgrp_table(jetson_tk1_drvgrps,
ARRAY_SIZE(jetson_tk1_drvgrps));
}
+
+#ifdef CONFIG_PCI_TEGRA
+int tegra_pcie_board_init(void)
+{
+ struct udevice *pmic;
+ int err;
+
+ err = as3722_init(&pmic);
+ if (err) {
+ error("failed to initialize AS3722 PMIC: %d\n", err);
+ return err;
+ }
+
+ err = as3722_sd_enable(pmic, 4);
+ if (err < 0) {
+ error("failed to enable SD4: %d\n", err);
+ return err;
+ }
+
+ err = as3722_sd_set_voltage(pmic, 4, 0x24);
+ if (err < 0) {
+ error("failed to set SD4 voltage: %d\n", err);
+ return err;
+ }
+
+ err = as3722_gpio_configure(pmic, 1, AS3722_GPIO_OUTPUT_VDDH |
+ AS3722_GPIO_INVERT);
+ if (err < 0) {
+ error("failed to configure GPIO#1 as output: %d\n", err);
+ return err;
+ }
+
+ err = as3722_gpio_direction_output(pmic, 2, 1);
+ if (err < 0) {
+ error("failed to set GPIO#2 high: %d\n", err);
+ return err;
+ }
+
+ return 0;
+}
+
+int board_eth_init(bd_t *bis)
+{
+ return pci_eth_init(bis);
+}
+#endif /* PCI */