]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - board/ti/dra7xx/evm.c
Merge branch 'rmobile' of git://git.denx.de/u-boot-sh
[karo-tx-uboot.git] / board / ti / dra7xx / evm.c
index 955c16fe74f0820680f56036432a8021e8b61005..65222419ebbdb9b0e3a2c120fa27b56a9138a779 100644 (file)
@@ -13,6 +13,8 @@
 #include <common.h>
 #include <palmas.h>
 #include <sata.h>
+#include <asm/gpio.h>
+#include <asm/arch/gpio.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/mmc_host_def.h>
 #include <asm/arch/sata.h>
@@ -26,6 +28,9 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+/* GPIO 7_11 */
+#define GPIO_DDR_VTT_EN 203
+
 const struct omap_sysinfo sysinfo = {
        "Board: DRA7xx\n"
 };
@@ -82,19 +87,12 @@ int board_init(void)
 
 int board_late_init(void)
 {
-       init_sata(0);
-       return 0;
-}
-
-/**
- * @brief misc_init_r - Configure EVM board specific configurations
- * such as power configurations, ethernet initialization as phase2 of
- * boot sequence
- *
- * @return 0
- */
-int misc_init_r(void)
-{
+#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+       if (omap_revision() == DRA722_ES1_0)
+               setenv("board_name", "dra72x");
+       else
+               setenv("board_name", "dra7xx");
+#endif
        return 0;
 }
 
@@ -266,3 +264,29 @@ int board_eth_init(bd_t *bis)
        return ret;
 }
 #endif
+
+#ifdef CONFIG_BOARD_EARLY_INIT_F
+/* VTT regulator enable */
+static inline void vtt_regulator_enable(void)
+{
+       if (omap_hw_init_context() == OMAP_INIT_CONTEXT_UBOOT_AFTER_SPL)
+               return;
+
+       /* Do not enable VTT for DRA722 */
+       if (omap_revision() == DRA722_ES1_0)
+               return;
+
+       /*
+        * EVM Rev G and later use gpio7_11 for DDR3 termination.
+        * This is safe enough to do on older revs.
+        */
+       gpio_request(GPIO_DDR_VTT_EN, "ddr_vtt_en");
+       gpio_direction_output(GPIO_DDR_VTT_EN, 1);
+}
+
+int board_early_init_f(void)
+{
+       vtt_regulator_enable();
+       return 0;
+}
+#endif