Pratik Patel | e08204d | 2013-03-12 17:43:56 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. |
Pushkar Joshi | 0fc7346 | 2012-09-26 17:59:31 -0700 | [diff] [blame] | 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | */ |
| 12 | |
Pushkar Joshi | 0fc7346 | 2012-09-26 17:59:31 -0700 | [diff] [blame] | 13 | #include <linux/kernel.h> |
Pratik Patel | e08204d | 2013-03-12 17:43:56 -0700 | [diff] [blame] | 14 | #include <linux/module.h> |
Pushkar Joshi | 0fc7346 | 2012-09-26 17:59:31 -0700 | [diff] [blame] | 15 | #include <mach/scm.h> |
Pushkar Joshi | 0fc7346 | 2012-09-26 17:59:31 -0700 | [diff] [blame] | 16 | |
Pratik Patel | e08204d | 2013-03-12 17:43:56 -0700 | [diff] [blame] | 17 | #define SCM_WDOG_DEBUG_BOOT_PART 0x9 |
| 18 | #define BOOT_PART_EN_VAL 0x5D1 |
Pushkar Joshi | 0fc7346 | 2012-09-26 17:59:31 -0700 | [diff] [blame] | 19 | |
| 20 | void msm_enable_wdog_debug(void) |
| 21 | { |
Pratik Patel | e08204d | 2013-03-12 17:43:56 -0700 | [diff] [blame] | 22 | int ret; |
Pushkar Joshi | 0fc7346 | 2012-09-26 17:59:31 -0700 | [diff] [blame] | 23 | |
Pratik Patel | e08204d | 2013-03-12 17:43:56 -0700 | [diff] [blame] | 24 | ret = scm_call_atomic2(SCM_SVC_BOOT, |
| 25 | SCM_WDOG_DEBUG_BOOT_PART, 0, BOOT_PART_EN_VAL); |
| 26 | if (ret) |
Syed Rameez Mustafa | 41bb9ee | 2013-04-12 14:45:13 -0700 | [diff] [blame] | 27 | pr_err("failed to enable wdog debug: %d\n", ret); |
Pushkar Joshi | 0fc7346 | 2012-09-26 17:59:31 -0700 | [diff] [blame] | 28 | } |
| 29 | EXPORT_SYMBOL(msm_enable_wdog_debug); |
| 30 | |
Pratik Patel | e08204d | 2013-03-12 17:43:56 -0700 | [diff] [blame] | 31 | void msm_disable_wdog_debug(void) |
Pushkar Joshi | 0fc7346 | 2012-09-26 17:59:31 -0700 | [diff] [blame] | 32 | { |
| 33 | int ret; |
Pratik Patel | e08204d | 2013-03-12 17:43:56 -0700 | [diff] [blame] | 34 | |
| 35 | ret = scm_call_atomic2(SCM_SVC_BOOT, |
| 36 | SCM_WDOG_DEBUG_BOOT_PART, 1, 0); |
Pushkar Joshi | 0fc7346 | 2012-09-26 17:59:31 -0700 | [diff] [blame] | 37 | if (ret) |
Syed Rameez Mustafa | 41bb9ee | 2013-04-12 14:45:13 -0700 | [diff] [blame] | 38 | pr_err("failed to disable wdog debug: %d\n", ret); |
Pushkar Joshi | 0fc7346 | 2012-09-26 17:59:31 -0700 | [diff] [blame] | 39 | } |
Pratik Patel | e08204d | 2013-03-12 17:43:56 -0700 | [diff] [blame] | 40 | EXPORT_SYMBOL(msm_disable_wdog_debug); |