Loading Documentation/devicetree/bindings/arm/msm/msm_watchdog.txt +1 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ Required properties: - reg : offset and length of the register set for the watchdog block. - reg-names : names corresponding to each reg property value. "wdt-base" - physical base address of watchdog timer registers "wdt-absent-base" - physical base address of watchdog absent register - interrupts : should contain bark and bite irq numbers - qcom,pet-time : Non zero time interval at which watchdog should be pet in ms. - qcom,bark-time : Non zero timeout value for a watchdog bark in ms. Loading drivers/soc/qcom/watchdog_v2.c +24 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,8 @@ #define WDT0_BARK_TIME 0x10 #define WDT0_BITE_TIME 0x14 #define WDOG_ABSENT 0 #define MASK_SIZE 32 #define SCM_SET_REGSAVE_CMD 0x2 #define SCM_SVC_SEC_WDOG_DIS 0x7 Loading @@ -49,6 +51,7 @@ struct msm_watchdog_data { unsigned int __iomem phys_base; size_t size; void __iomem *base; void __iomem *wdog_absent_base; struct device *dev; unsigned int pet_time; unsigned int bark_time; Loading Loading @@ -455,6 +458,13 @@ static void init_watchdog_work(struct work_struct *work) u64 timeout; int ret; /* * Disable the watchdog for cluster 1 so that cluster 0 watchdog will * be mapped to the entire sub-system. */ if (wdog_dd->wdog_absent_base) __raw_writel(2, wdog_dd->wdog_absent_base + WDOG_ABSENT); if (wdog_dd->irq_ppi) { wdog_dd->wdog_cpu_dd = alloc_percpu(struct msm_watchdog_data *); if (!wdog_dd->wdog_cpu_dd) { Loading Loading @@ -547,6 +557,20 @@ static int msm_wdog_dt_to_pdata(struct platform_device *pdev, return -ENXIO; } res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "wdt-absent-base"); if (res) { pdata->wdog_absent_base = devm_ioremap(&pdev->dev, res->start, resource_size(res)); if (!pdata->wdog_absent_base) { dev_err(&pdev->dev, "cannot map wdog absent register space\n"); return -ENXIO; } } else { dev_info(&pdev->dev, "wdog absent resource not present\n"); } pdata->bark_irq = platform_get_irq(pdev, 0); pdata->bite_irq = platform_get_irq(pdev, 1); ret = of_property_read_u32(node, "qcom,bark-time", &pdata->bark_time); Loading Loading
Documentation/devicetree/bindings/arm/msm/msm_watchdog.txt +1 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ Required properties: - reg : offset and length of the register set for the watchdog block. - reg-names : names corresponding to each reg property value. "wdt-base" - physical base address of watchdog timer registers "wdt-absent-base" - physical base address of watchdog absent register - interrupts : should contain bark and bite irq numbers - qcom,pet-time : Non zero time interval at which watchdog should be pet in ms. - qcom,bark-time : Non zero timeout value for a watchdog bark in ms. Loading
drivers/soc/qcom/watchdog_v2.c +24 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,8 @@ #define WDT0_BARK_TIME 0x10 #define WDT0_BITE_TIME 0x14 #define WDOG_ABSENT 0 #define MASK_SIZE 32 #define SCM_SET_REGSAVE_CMD 0x2 #define SCM_SVC_SEC_WDOG_DIS 0x7 Loading @@ -49,6 +51,7 @@ struct msm_watchdog_data { unsigned int __iomem phys_base; size_t size; void __iomem *base; void __iomem *wdog_absent_base; struct device *dev; unsigned int pet_time; unsigned int bark_time; Loading Loading @@ -455,6 +458,13 @@ static void init_watchdog_work(struct work_struct *work) u64 timeout; int ret; /* * Disable the watchdog for cluster 1 so that cluster 0 watchdog will * be mapped to the entire sub-system. */ if (wdog_dd->wdog_absent_base) __raw_writel(2, wdog_dd->wdog_absent_base + WDOG_ABSENT); if (wdog_dd->irq_ppi) { wdog_dd->wdog_cpu_dd = alloc_percpu(struct msm_watchdog_data *); if (!wdog_dd->wdog_cpu_dd) { Loading Loading @@ -547,6 +557,20 @@ static int msm_wdog_dt_to_pdata(struct platform_device *pdev, return -ENXIO; } res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "wdt-absent-base"); if (res) { pdata->wdog_absent_base = devm_ioremap(&pdev->dev, res->start, resource_size(res)); if (!pdata->wdog_absent_base) { dev_err(&pdev->dev, "cannot map wdog absent register space\n"); return -ENXIO; } } else { dev_info(&pdev->dev, "wdog absent resource not present\n"); } pdata->bark_irq = platform_get_irq(pdev, 0); pdata->bite_irq = platform_get_irq(pdev, 1); ret = of_property_read_u32(node, "qcom,bark-time", &pdata->bark_time); Loading