summaryrefslogtreecommitdiff
path: root/board/nvidia/common/board.c
diff options
context:
space:
mode:
authorWei Ni <wni@nvidia.com>2012-04-02 13:18:58 +0000
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2012-05-15 08:31:38 +0200
commit5aff021c61fffa9f6a58038db98e8dc29598813b (patch)
tree47ba09a16fd2f39a91943a6bb429fc35315a0da4 /board/nvidia/common/board.c
parent67ac5797adb1fad3b027058100cd6fa58c5b6cb6 (diff)
downloadu-boot-imx-5aff021c61fffa9f6a58038db98e8dc29598813b.zip
u-boot-imx-5aff021c61fffa9f6a58038db98e8dc29598813b.tar.gz
u-boot-imx-5aff021c61fffa9f6a58038db98e8dc29598813b.tar.bz2
tegra: Turn off power detect in board init
Tegra core power rail has leakage voltage around 0.2V while system in suspend mode. The source of the leakage should be coming from PMC power detect logic for IO rails power detection. That can be disabled by writing a '0' to PWR_DET_LATCH followed by writing '0' to PWR_DET (APBDEV_PMC_PWR_DET_0). Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Warren <twarren@nvidia.com>
Diffstat (limited to 'board/nvidia/common/board.c')
-rw-r--r--board/nvidia/common/board.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index b82e61a..1d6b002 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -62,6 +62,21 @@ void __pin_mux_usb(void)
void pin_mux_usb(void) __attribute__((weak, alias("__pin_mux_usb")));
/*
+ * Routine: power_det_init
+ * Description: turn off power detects
+ */
+static void power_det_init(void)
+{
+#if defined(CONFIG_TEGRA2)
+ struct pmc_ctlr *const pmc = (struct pmc_ctlr *)TEGRA2_PMC_BASE;
+
+ /* turn off power detects */
+ writel(0, &pmc->pmc_pwr_det_latch);
+ writel(0, &pmc->pmc_pwr_det);
+#endif
+}
+
+/*
* Routine: board_init
* Description: Early hardware init.
*/
@@ -79,6 +94,9 @@ int board_init(void)
#endif
/* boot param addr */
gd->bd->bi_boot_params = (NV_PA_SDRAM_BASE + 0x100);
+
+ power_det_init();
+
#ifdef CONFIG_TEGRA_I2C
#ifndef CONFIG_SYS_I2C_INIT_BOARD
#error "You must define CONFIG_SYS_I2C_INIT_BOARD to use i2c on Nvidia boards"