platform: tegra: pmc: add API to do system reset
Laxman Dewangan [Fri, 6 Nov 2015 14:17:11 +0000 (19:17 +0530)]
Add APIs to do system reset through PMC.

bug 200146310

Change-Id: If89a68f29f85140e1d046c3f8a39da2293a3f0c7
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/829397
GVS: Gerrit_Virtual_Submit

drivers/platform/tegra/pmc.c
include/linux/tegra-pmc.h

index 02d3c48..b28c2c1 100644 (file)
@@ -313,6 +313,16 @@ void tegra_pmc_write_bootrom_command(u32 command_offset, unsigned long val)
 }
 EXPORT_SYMBOL(tegra_pmc_write_bootrom_command);
 
+void tegra_pmc_reset_system(void)
+{
+       u32 val;
+
+       val = readl_relaxed(tegra_pmc_base);
+       val |= 0x10;
+       writel_relaxed(val, tegra_pmc_base);
+}
+EXPORT_SYMBOL(tegra_pmc_reset_system);
+
 void tegra_pmc_pwr_detect_update(unsigned long mask, unsigned long val)
 {
        unsigned long flags;
index ad0ce04..e422d47 100644 (file)
@@ -49,6 +49,8 @@ extern void tegra_pmc_iopower_enable(int reg, u32 bit_mask);
 extern void tegra_pmc_iopower_disable(int reg, u32 bit_mask);
 extern int tegra_pmc_iopower_get_status(int reg, u32 bit_mask);
 
+extern void tegra_pmc_reset_system(void);
+
 extern bool tegra_is_dpd_mode;
 
 struct pmc_pm_data {