msm: Add watchdog support in fsm9xxx targets
FSM9xxx targets are compatible with existing msm_watchdog
driver. This change defines and initializes the platform_device
for msm_watchdog in FSM9xxx targets.
Change-Id: I8872debda9e79cb943c125ba333e754fe1637d2c
Acked-by: Kaushik Sikdar <ksikdar@qualcomm.com>
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
diff --git a/arch/arm/mach-msm/Kconfig b/arch/arm/mach-msm/Kconfig
index 57452b9..3c2d47a 100644
--- a/arch/arm/mach-msm/Kconfig
+++ b/arch/arm/mach-msm/Kconfig
@@ -1966,7 +1966,7 @@
config MSM_WATCHDOG
bool "MSM Watchdog Support"
- depends on ARCH_MSM8X60 || ARCH_MSM8960 || ARCH_MSM9615
+ depends on ARCH_MSM8X60 || ARCH_MSM8960 || ARCH_MSM9615 || ARCH_FSM9XXX
help
This enables the watchdog as is present on 8x60. Currently we use
core 0's watchdog, and reset the entire SoC if it times out. It does
diff --git a/arch/arm/mach-msm/board-fsm9xxx.c b/arch/arm/mach-msm/board-fsm9xxx.c
index 87fea3f..ce6bf35 100644
--- a/arch/arm/mach-msm/board-fsm9xxx.c
+++ b/arch/arm/mach-msm/board-fsm9xxx.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+/* Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -835,6 +835,7 @@
&qcedev_device,
&ota_qcrypto_device,
&fsm_xo_device,
+ &fsm9xxx_device_watchdog,
};
static void __init fsm9xxx_init_irq(void)
diff --git a/arch/arm/mach-msm/devices-fsm9xxx.c b/arch/arm/mach-msm/devices-fsm9xxx.c
index d46e4d6..777b6d6 100644
--- a/arch/arm/mach-msm/devices-fsm9xxx.c
+++ b/arch/arm/mach-msm/devices-fsm9xxx.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -22,6 +22,7 @@
#include "devices.h"
#include "smd_private.h"
#include "clock-local.h"
+#include "msm_watchdog.h"
#include <asm/mach/flash.h>
#include <asm/mach/mmc.h>
@@ -389,3 +390,22 @@
.id = -1,
};
+/*
+ * Watchdog
+ */
+
+static struct msm_watchdog_pdata fsm_watchdog_pdata = {
+ .pet_time = 10000,
+ .bark_time = 11000,
+ .has_secure = false,
+ .has_vic = true,
+};
+
+struct platform_device fsm9xxx_device_watchdog = {
+ .name = "msm_watchdog",
+ .id = -1,
+ .dev = {
+ .platform_data = &fsm_watchdog_pdata,
+ },
+};
+
diff --git a/arch/arm/mach-msm/devices.h b/arch/arm/mach-msm/devices.h
index 7738c05..ac9feee 100644
--- a/arch/arm/mach-msm/devices.h
+++ b/arch/arm/mach-msm/devices.h
@@ -316,6 +316,7 @@
extern struct platform_device msm8660_device_watchdog;
extern struct platform_device msm8064_device_watchdog;
extern struct platform_device msm9615_device_watchdog;
+extern struct platform_device fsm9xxx_device_watchdog;
extern struct platform_device msm_etb_device;
extern struct platform_device msm_tpiu_device;
diff --git a/arch/arm/mach-msm/include/mach/irqs-fsm9xxx.h b/arch/arm/mach-msm/include/mach/irqs-fsm9xxx.h
index a0ec244..721db1d 100644
--- a/arch/arm/mach-msm/include/mach/irqs-fsm9xxx.h
+++ b/arch/arm/mach-msm/include/mach/irqs-fsm9xxx.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+/* Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -86,6 +86,7 @@
#define INT_ADSP_A11 INT_Q6_SW_IRQ_0
#define INT_ADSP_A11_SMSM INT_ADSP_A11
#define INT_SIRC_0 INT_PERPH_SUPSS_IRQ
+#define WDT0_ACCSCSSNBARK_INT INT_WDT0_ACCSCSSBARK
#define NR_MSM_IRQS 128
#define NR_GPIO_IRQS 0