* [PATCH 0/0] Add Watchdog support for Samsung SMDK6410, S5P6440 and S5Pv210
@ 2010-05-20 7:21 Kukjin Kim
2010-05-20 7:21 ` [PATCH 1/5] ARM: SAMSUNG: Move WDT device definitions in plat-samsung Kukjin Kim
` (5 more replies)
0 siblings, 6 replies; 10+ messages in thread
From: Kukjin Kim @ 2010-05-20 7:21 UTC (permalink / raw)
To: linux-arm-kernel
This patches add Watchdog support for SMDK6410, S5P6440 and S5PV210.
- Add HAVE_S3C2410_WATCHDOG for selecting watchgog driver compile in each machine
- Add S3C_DEV_WDT for watchdog device definitions
- Fix freeing memory part when memory region could not be allocated s3c2410_wdt
- Add machine dependent part for watchdog support
[PATCH 1/5] ARM: SAMSUNG: Move WDT device definitions in plat-samsung
[PATCH 2/5] [WATCHDOG] s3c2410_wdt - Avoid freeing memory, if memory region could not be allocated
[PATCH 3/5] ARM: SMDK6410: Add Watchdog support for SMDK6410
[PATCH 4/5] ARM: S5P6440: Add Watchdog support for S5P6440
[PATCH 5/5] ARM: S5PV210: Add Watchdog support for S5PV210
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/5] ARM: SAMSUNG: Move WDT device definitions in plat-samsung
2010-05-20 7:21 [PATCH 0/0] Add Watchdog support for Samsung SMDK6410, S5P6440 and S5Pv210 Kukjin Kim
@ 2010-05-20 7:21 ` Kukjin Kim
2010-05-20 7:43 ` Ben Dooks
2010-05-20 7:21 ` [PATCH 2/5] [WATCHDOG] s3c2410_wdt - Avoid freeing memory, if memory region could not be allocated Kukjin Kim
` (4 subsequent siblings)
5 siblings, 1 reply; 10+ messages in thread
From: Kukjin Kim @ 2010-05-20 7:21 UTC (permalink / raw)
To: linux-arm-kernel
From: Banajit Goswami <banajit.g@samsung.com>
This patch moves the definitions of watchdog timer device from
plat-s3c24xx to plat-samsung. This will enable all Samsung S3C
and S5P series SoC's to use common WDT device definition.
And adds HAVE_S3C2410_WATCHDOG for selecting in each machine
without modifying Kconfig in drivers directory.
Signed-off-by: Banajit Goswami <banajit.g@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
arch/arm/Kconfig | 1 +
arch/arm/mach-s3c2410/include/mach/map.h | 1 +
arch/arm/plat-s3c24xx/devs.c | 26 -------------------
arch/arm/plat-samsung/Kconfig | 6 ++++
arch/arm/plat-samsung/Makefile | 1 +
arch/arm/plat-samsung/dev-wdt.c | 40 ++++++++++++++++++++++++++++++
drivers/watchdog/Kconfig | 10 ++++---
7 files changed, 55 insertions(+), 30 deletions(-)
create mode 100644 arch/arm/plat-samsung/dev-wdt.c
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 3f8718f..8e2bb6b 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -651,6 +651,7 @@ config ARCH_S3C2410
select GENERIC_GPIO
select ARCH_HAS_CPUFREQ
select HAVE_CLK
+ select HAVE_S3C2410_WATCHDOG
help
Samsung S3C2410X CPU based systems, such as the Simtec Electronics
BAST (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or
diff --git a/arch/arm/mach-s3c2410/include/mach/map.h b/arch/arm/mach-s3c2410/include/mach/map.h
index f07d680..16fbc3c 100644
--- a/arch/arm/mach-s3c2410/include/mach/map.h
+++ b/arch/arm/mach-s3c2410/include/mach/map.h
@@ -111,6 +111,7 @@
#define S3C_PA_USBHOST S3C2410_PA_USBHOST
#define S3C_PA_HSMMC0 S3C2443_PA_HSMMC
#define S3C_PA_HSMMC1 S3C2416_PA_HSMMC0
+#define S3C_PA_WDT S3C2410_PA_WATCHDOG
#define S3C_PA_NAND S3C24XX_PA_NAND
#endif /* __ASM_ARCH_MAP_H */
diff --git a/arch/arm/plat-s3c24xx/devs.c b/arch/arm/plat-s3c24xx/devs.c
index 5858373..452e184 100644
--- a/arch/arm/plat-s3c24xx/devs.c
+++ b/arch/arm/plat-s3c24xx/devs.c
@@ -234,32 +234,6 @@ void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *pd)
}
}
-
-/* Watchdog */
-
-static struct resource s3c_wdt_resource[] = {
- [0] = {
- .start = S3C24XX_PA_WATCHDOG,
- .end = S3C24XX_PA_WATCHDOG + S3C24XX_SZ_WATCHDOG - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = IRQ_WDT,
- .end = IRQ_WDT,
- .flags = IORESOURCE_IRQ,
- }
-
-};
-
-struct platform_device s3c_device_wdt = {
- .name = "s3c2410-wdt",
- .id = -1,
- .num_resources = ARRAY_SIZE(s3c_wdt_resource),
- .resource = s3c_wdt_resource,
-};
-
-EXPORT_SYMBOL(s3c_device_wdt);
-
/* IIS */
static struct resource s3c_iis_resource[] = {
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
index 287e6f7..72dae49 100644
--- a/arch/arm/plat-samsung/Kconfig
+++ b/arch/arm/plat-samsung/Kconfig
@@ -185,6 +185,12 @@ config S3C_DEV_USB_HSOTG
help
Compile in platform device definition for USB high-speed OtG
+config S3C_DEV_WDT
+ bool
+ default y if ARCH_S3C2410
+ help
+ Complie in platform device definition for Watchdog Timer
+
config S3C_DEV_NAND
bool
help
diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile
index 0ad820a..0a92369 100644
--- a/arch/arm/plat-samsung/Makefile
+++ b/arch/arm/plat-samsung/Makefile
@@ -40,6 +40,7 @@ obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o
obj-y += dev-uart.o
obj-$(CONFIG_S3C_DEV_USB_HOST) += dev-usb.o
obj-$(CONFIG_S3C_DEV_USB_HSOTG) += dev-usb-hsotg.o
+obj-$(CONFIG_S3C_DEV_WDT) += dev-wdt.o
obj-$(CONFIG_S3C_DEV_NAND) += dev-nand.o
# DMA support
diff --git a/arch/arm/plat-samsung/dev-wdt.c b/arch/arm/plat-samsung/dev-wdt.c
new file mode 100644
index 0000000..5efca87
--- /dev/null
+++ b/arch/arm/plat-samsung/dev-wdt.c
@@ -0,0 +1,40 @@
+/* linux/arch/arm/plat-samsung/dev-wdt.c
+ *
+ * Copyright (c) 2004 Simtec Electronics
+ * Ben Dooks <ben@simtec.co.uk>
+ *
+ * S3C series device definition for the watchdog timer
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+
+#include <mach/irqs.h>
+#include <mach/map.h>
+
+#include <plat/devs.h>
+
+static struct resource s3c_wdt_resource[] = {
+ [0] = {
+ .start = S3C_PA_WDT,
+ .end = S3C_PA_WDT + SZ_1M - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
+ .start = IRQ_WDT,
+ .end = IRQ_WDT,
+ .flags = IORESOURCE_IRQ,
+ }
+};
+
+struct platform_device s3c_device_wdt = {
+ .name = "s3c2410-wdt",
+ .id = -1,
+ .num_resources = ARRAY_SIZE(s3c_wdt_resource),
+ .resource = s3c_wdt_resource,
+};
+EXPORT_SYMBOL(s3c_device_wdt);
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 0bf5020..d52118f 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -145,13 +145,15 @@ config KS8695_WATCHDOG
Watchdog timer embedded into KS8695 processor. This will reboot your
system when the timeout is reached.
+config HAVE_S3C2410_WATCHDOG
+ bool
+
config S3C2410_WATCHDOG
tristate "S3C2410 Watchdog"
- depends on ARCH_S3C2410
+ depends on HAVE_S3C2410_WATCHDOG
help
- Watchdog timer block in the Samsung S3C2410 chips. This will
- reboot the system when the timer expires with the watchdog
- enabled.
+ Watchdog timer block in the Samsung SoCs. This will reboot
+ the system when the timer expires with the watchdog enabled.
The driver is limited by the speed of the system's PCLK
signal, so with reasonably fast systems (PCLK around 50-66MHz)
--
1.6.2.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/5] [WATCHDOG] s3c2410_wdt - Avoid freeing memory, if memory region could not be allocated
2010-05-20 7:21 [PATCH 0/0] Add Watchdog support for Samsung SMDK6410, S5P6440 and S5Pv210 Kukjin Kim
2010-05-20 7:21 ` [PATCH 1/5] ARM: SAMSUNG: Move WDT device definitions in plat-samsung Kukjin Kim
@ 2010-05-20 7:21 ` Kukjin Kim
2010-05-20 10:00 ` Sergei Shtylyov
2010-05-20 7:21 ` [PATCH 3/5] ARM: SMDK6410: Add Watchdog support for SMDK6410 Kukjin Kim
` (3 subsequent siblings)
5 siblings, 1 reply; 10+ messages in thread
From: Kukjin Kim @ 2010-05-20 7:21 UTC (permalink / raw)
To: linux-arm-kernel
From: Banajit Goswami <banajit.g@samsung.com>
In case the WDT device memory allocation fails, this patch modifies the
driver such that, it does not try to free the memory on exit.
Signed-off-by: Banajit Goswami <banajit.g@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
drivers/watchdog/s3c2410_wdt.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c
index e4cebef..d421258 100644
--- a/drivers/watchdog/s3c2410_wdt.c
+++ b/drivers/watchdog/s3c2410_wdt.c
@@ -426,8 +426,7 @@ static int __devinit s3c2410wdt_probe(struct platform_device *pdev)
wdt_mem = request_mem_region(res->start, size, pdev->name);
if (wdt_mem == NULL) {
dev_err(dev, "failed to get memory region\n");
- ret = -ENOENT;
- goto err_req;
+ return -ENOMEM;
}
wdt_base = ioremap(res->start, size);
--
1.6.2.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 3/5] ARM: SMDK6410: Add Watchdog support for SMDK6410
2010-05-20 7:21 [PATCH 0/0] Add Watchdog support for Samsung SMDK6410, S5P6440 and S5Pv210 Kukjin Kim
2010-05-20 7:21 ` [PATCH 1/5] ARM: SAMSUNG: Move WDT device definitions in plat-samsung Kukjin Kim
2010-05-20 7:21 ` [PATCH 2/5] [WATCHDOG] s3c2410_wdt - Avoid freeing memory, if memory region could not be allocated Kukjin Kim
@ 2010-05-20 7:21 ` Kukjin Kim
2010-05-20 7:21 ` [PATCH 4/5] ARM: S5P6440: Add Watchdog support for S5P6440 Kukjin Kim
` (2 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: Kukjin Kim @ 2010-05-20 7:21 UTC (permalink / raw)
To: linux-arm-kernel
From: Banajit Goswami <banajit.g@samsung.com>
This patch adds support for Watchdog timer for Samsung S3C6410
Signed-off-by: Banajit Goswami <banajit.g@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
arch/arm/mach-s3c64xx/Kconfig | 2 ++
arch/arm/mach-s3c64xx/include/mach/map.h | 1 +
arch/arm/mach-s3c64xx/mach-smdk6410.c | 1 +
3 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig
index 959df38..c3822fb 100644
--- a/arch/arm/mach-s3c64xx/Kconfig
+++ b/arch/arm/mach-s3c64xx/Kconfig
@@ -91,6 +91,8 @@ config MACH_SMDK6410
select S3C_DEV_FB
select S3C_DEV_USB_HOST
select S3C_DEV_USB_HSOTG
+ select S3C_DEV_WDT
+ select HAVE_S3C2410_WATCHDOG
select S3C64XX_SETUP_SDHCI
select S3C64XX_SETUP_I2C1
select S3C64XX_SETUP_FB_24BPP
diff --git a/arch/arm/mach-s3c64xx/include/mach/map.h b/arch/arm/mach-s3c64xx/include/mach/map.h
index 801c1c0..ab06afd 100644
--- a/arch/arm/mach-s3c64xx/include/mach/map.h
+++ b/arch/arm/mach-s3c64xx/include/mach/map.h
@@ -103,5 +103,6 @@
#define S3C_PA_USBHOST S3C64XX_PA_USBHOST
#define S3C_PA_USB_HSOTG S3C64XX_PA_USB_HSOTG
#define S3C_VA_USB_HSPHY S3C64XX_VA_USB_HSPHY
+#define S3C_PA_WDT S3C64XX_PA_WATCHDOG
#endif /* __ASM_ARCH_6400_MAP_H */
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c
index 10cf64a..d10e26d 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
@@ -264,6 +264,7 @@ static struct platform_device *smdk6410_devices[] __initdata = {
&smdk6410_lcd_powerdev,
&smdk6410_smsc911x,
+ &s3c_device_wdt,
};
#ifdef CONFIG_REGULATOR
--
1.6.2.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 4/5] ARM: S5P6440: Add Watchdog support for S5P6440
2010-05-20 7:21 [PATCH 0/0] Add Watchdog support for Samsung SMDK6410, S5P6440 and S5Pv210 Kukjin Kim
` (2 preceding siblings ...)
2010-05-20 7:21 ` [PATCH 3/5] ARM: SMDK6410: Add Watchdog support for SMDK6410 Kukjin Kim
@ 2010-05-20 7:21 ` Kukjin Kim
2010-05-20 7:21 ` [PATCH 5/5] ARM: S5PV210: Add Watchdog support for S5PV210 Kukjin Kim
2010-05-20 7:35 ` [PATCH 0/0] Add Watchdog support for Samsung SMDK6410, S5P6440 and S5Pv210 Ben Dooks
5 siblings, 0 replies; 10+ messages in thread
From: Kukjin Kim @ 2010-05-20 7:21 UTC (permalink / raw)
To: linux-arm-kernel
From: Banajit Goswami <banajit.g@samsung.com>
This patch adds support for Watchdog timer for Samsung S5P6440.
Signed-off-by: Banajit Goswami <banajit.g@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
arch/arm/mach-s5p6440/Kconfig | 2 ++
arch/arm/mach-s5p6440/include/mach/map.h | 1 +
arch/arm/mach-s5p6440/mach-smdk6440.c | 1 +
3 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-s5p6440/Kconfig b/arch/arm/mach-s5p6440/Kconfig
index 4c29ff8..0a0eb5b 100644
--- a/arch/arm/mach-s5p6440/Kconfig
+++ b/arch/arm/mach-s5p6440/Kconfig
@@ -15,6 +15,8 @@ config CPU_S5P6440
config MACH_SMDK6440
bool "SMDK6440"
select CPU_S5P6440
+ select S3C_DEV_WDT
+ select HAVE_S3C2410_WATCHDOG
help
Machine support for the Samsung SMDK6440
diff --git a/arch/arm/mach-s5p6440/include/mach/map.h b/arch/arm/mach-s5p6440/include/mach/map.h
index 8924e5a..c015de6 100644
--- a/arch/arm/mach-s5p6440/include/mach/map.h
+++ b/arch/arm/mach-s5p6440/include/mach/map.h
@@ -64,5 +64,6 @@
/* compatibiltiy defines. */
#define S3C_PA_UART S5P6440_PA_UART
#define S3C_PA_IIC S5P6440_PA_IIC0
+#define S3C_PA_WDT S5P6440_PA_WDT
#endif /* __ASM_ARCH_MAP_H */
diff --git a/arch/arm/mach-s5p6440/mach-smdk6440.c b/arch/arm/mach-s5p6440/mach-smdk6440.c
index 3ae88f2..ae50345 100644
--- a/arch/arm/mach-s5p6440/mach-smdk6440.c
+++ b/arch/arm/mach-s5p6440/mach-smdk6440.c
@@ -84,6 +84,7 @@ static struct s3c2410_uartcfg smdk6440_uartcfgs[] __initdata = {
};
static struct platform_device *smdk6440_devices[] __initdata = {
+ &s3c_device_wdt,
};
static void __init smdk6440_map_io(void)
--
1.6.2.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 5/5] ARM: S5PV210: Add Watchdog support for S5PV210
2010-05-20 7:21 [PATCH 0/0] Add Watchdog support for Samsung SMDK6410, S5P6440 and S5Pv210 Kukjin Kim
` (3 preceding siblings ...)
2010-05-20 7:21 ` [PATCH 4/5] ARM: S5P6440: Add Watchdog support for S5P6440 Kukjin Kim
@ 2010-05-20 7:21 ` Kukjin Kim
2010-05-20 7:35 ` [PATCH 0/0] Add Watchdog support for Samsung SMDK6410, S5P6440 and S5Pv210 Ben Dooks
5 siblings, 0 replies; 10+ messages in thread
From: Kukjin Kim @ 2010-05-20 7:21 UTC (permalink / raw)
To: linux-arm-kernel
From: Banajit Goswami <banajit.g@samsung.com>
This patch adds support for Watchdog timer for Samsung S5PV210.
Signed-off-by: Banajit Goswami <banajit.g@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
arch/arm/mach-s5pv210/Kconfig | 4 ++++
arch/arm/mach-s5pv210/include/mach/map.h | 3 +++
arch/arm/mach-s5pv210/mach-smdkc110.c | 1 +
arch/arm/mach-s5pv210/mach-smdkv210.c | 1 +
4 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index af33a1a..8931d8a 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -24,6 +24,8 @@ config MACH_SMDKV210
bool "SMDKV210"
select CPU_S5PV210
select ARCH_SPARSEMEM_ENABLE
+ select S3C_DEV_WDT
+ select HAVE_S3C2410_WATCHDOG
help
Machine support for Samsung SMDKV210
@@ -31,6 +33,8 @@ config MACH_SMDKC110
bool "SMDKC110"
select CPU_S5PV210
select ARCH_SPARSEMEM_ENABLE
+ select S3C_DEV_WDT
+ select HAVE_S3C2410_WATCHDOG
help
Machine support for Samsung SMDKC110
S5PC110(MCP) is one of package option of S5PV210
diff --git a/arch/arm/mach-s5pv210/include/mach/map.h b/arch/arm/mach-s5pv210/include/mach/map.h
index c22694c..c37f2c5 100644
--- a/arch/arm/mach-s5pv210/include/mach/map.h
+++ b/arch/arm/mach-s5pv210/include/mach/map.h
@@ -32,6 +32,8 @@
#define S5PV210_PA_SYSTIMER (0xE2600000)
+#define S5PV210_PA_WATCHDOG (0xE2700000)
+
#define S5PV210_PA_UART (0xE2900000)
#define S5P_PA_UART0 (S5PV210_PA_UART + 0x0)
@@ -61,5 +63,6 @@
/* compatibiltiy defines. */
#define S3C_PA_UART S5PV210_PA_UART
#define S3C_PA_IIC S5PV210_PA_IIC0
+#define S3C_PA_WDT S5PV210_PA_WATCHDOG
#endif /* __ASM_ARCH_MAP_H */
diff --git a/arch/arm/mach-s5pv210/mach-smdkc110.c b/arch/arm/mach-s5pv210/mach-smdkc110.c
index ab4869d..6af4ccf 100644
--- a/arch/arm/mach-s5pv210/mach-smdkc110.c
+++ b/arch/arm/mach-s5pv210/mach-smdkc110.c
@@ -72,6 +72,7 @@ static struct s3c2410_uartcfg smdkv210_uartcfgs[] __initdata = {
};
static struct platform_device *smdkc110_devices[] __initdata = {
+ &s3c_device_wdt,
};
static void __init smdkc110_map_io(void)
diff --git a/arch/arm/mach-s5pv210/mach-smdkv210.c b/arch/arm/mach-s5pv210/mach-smdkv210.c
index a278832..8ea203d 100644
--- a/arch/arm/mach-s5pv210/mach-smdkv210.c
+++ b/arch/arm/mach-s5pv210/mach-smdkv210.c
@@ -72,6 +72,7 @@ static struct s3c2410_uartcfg smdkv210_uartcfgs[] __initdata = {
};
static struct platform_device *smdkv210_devices[] __initdata = {
+ &s3c_device_wdt,
};
static void __init smdkv210_map_io(void)
--
1.6.2.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 0/0] Add Watchdog support for Samsung SMDK6410, S5P6440 and S5Pv210
2010-05-20 7:21 [PATCH 0/0] Add Watchdog support for Samsung SMDK6410, S5P6440 and S5Pv210 Kukjin Kim
` (4 preceding siblings ...)
2010-05-20 7:21 ` [PATCH 5/5] ARM: S5PV210: Add Watchdog support for S5PV210 Kukjin Kim
@ 2010-05-20 7:35 ` Ben Dooks
5 siblings, 0 replies; 10+ messages in thread
From: Ben Dooks @ 2010-05-20 7:35 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, May 20, 2010 at 04:21:27PM +0900, Kukjin Kim wrote:
> This patches add Watchdog support for SMDK6410, S5P6440 and S5PV210.
>
> - Add HAVE_S3C2410_WATCHDOG for selecting watchgog driver compile in each machine
> - Add S3C_DEV_WDT for watchdog device definitions
> - Fix freeing memory part when memory region could not be allocated s3c2410_wdt
> - Add machine dependent part for watchdog support
ok, the will look at merging the device side of this. Please orward
the drivers/watchdog patches to the relevant maintainer with
Acked-by: Ben Dooks <ben-linux@fluff.org>
> [PATCH 1/5] ARM: SAMSUNG: Move WDT device definitions in plat-samsung
> [PATCH 2/5] [WATCHDOG] s3c2410_wdt - Avoid freeing memory, if memory region could not be allocated
> [PATCH 3/5] ARM: SMDK6410: Add Watchdog support for SMDK6410
> [PATCH 4/5] ARM: S5P6440: Add Watchdog support for S5P6440
> [PATCH 5/5] ARM: S5PV210: Add Watchdog support for S5PV210
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
--
Ben
Q: What's a light-year?
A: One-third less calories than a regular year.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/5] ARM: SAMSUNG: Move WDT device definitions in plat-samsung
2010-05-20 7:21 ` [PATCH 1/5] ARM: SAMSUNG: Move WDT device definitions in plat-samsung Kukjin Kim
@ 2010-05-20 7:43 ` Ben Dooks
0 siblings, 0 replies; 10+ messages in thread
From: Ben Dooks @ 2010-05-20 7:43 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, May 20, 2010 at 04:21:28PM +0900, Kukjin Kim wrote:
> From: Banajit Goswami <banajit.g@samsung.com>
>
> This patch moves the definitions of watchdog timer device from
> plat-s3c24xx to plat-samsung. This will enable all Samsung S3C
> and S5P series SoC's to use common WDT device definition.
>
> And adds HAVE_S3C2410_WATCHDOG for selecting in each machine
> without modifying Kconfig in drivers directory.
>
> Signed-off-by: Banajit Goswami <banajit.g@samsung.com>
> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
> ---
> arch/arm/Kconfig | 1 +
> arch/arm/mach-s3c2410/include/mach/map.h | 1 +
> arch/arm/plat-s3c24xx/devs.c | 26 -------------------
> arch/arm/plat-samsung/Kconfig | 6 ++++
> arch/arm/plat-samsung/Makefile | 1 +
> arch/arm/plat-samsung/dev-wdt.c | 40 ++++++++++++++++++++++++++++++
> drivers/watchdog/Kconfig | 10 ++++---
actually, please split into drivers/watchdog/Kconfig and the rest. it
would make it easier and avoid a nasty crioss-tree merge.
> 7 files changed, 55 insertions(+), 30 deletions(-)
> create mode 100644 arch/arm/plat-samsung/dev-wdt.c
>
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 3f8718f..8e2bb6b 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -651,6 +651,7 @@ config ARCH_S3C2410
> select GENERIC_GPIO
> select ARCH_HAS_CPUFREQ
> select HAVE_CLK
> + select HAVE_S3C2410_WATCHDOG
> help
> Samsung S3C2410X CPU based systems, such as the Simtec Electronics
> BAST (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or
> diff --git a/arch/arm/mach-s3c2410/include/mach/map.h b/arch/arm/mach-s3c2410/include/mach/map.h
> index f07d680..16fbc3c 100644
> --- a/arch/arm/mach-s3c2410/include/mach/map.h
> +++ b/arch/arm/mach-s3c2410/include/mach/map.h
> @@ -111,6 +111,7 @@
> #define S3C_PA_USBHOST S3C2410_PA_USBHOST
> #define S3C_PA_HSMMC0 S3C2443_PA_HSMMC
> #define S3C_PA_HSMMC1 S3C2416_PA_HSMMC0
> +#define S3C_PA_WDT S3C2410_PA_WATCHDOG
> #define S3C_PA_NAND S3C24XX_PA_NAND
>
> #endif /* __ASM_ARCH_MAP_H */
> diff --git a/arch/arm/plat-s3c24xx/devs.c b/arch/arm/plat-s3c24xx/devs.c
> index 5858373..452e184 100644
> --- a/arch/arm/plat-s3c24xx/devs.c
> +++ b/arch/arm/plat-s3c24xx/devs.c
> @@ -234,32 +234,6 @@ void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *pd)
> }
> }
>
> -
> -/* Watchdog */
> -
> -static struct resource s3c_wdt_resource[] = {
> - [0] = {
> - .start = S3C24XX_PA_WATCHDOG,
> - .end = S3C24XX_PA_WATCHDOG + S3C24XX_SZ_WATCHDOG - 1,
> - .flags = IORESOURCE_MEM,
> - },
> - [1] = {
> - .start = IRQ_WDT,
> - .end = IRQ_WDT,
> - .flags = IORESOURCE_IRQ,
> - }
> -
> -};
> -
> -struct platform_device s3c_device_wdt = {
> - .name = "s3c2410-wdt",
> - .id = -1,
> - .num_resources = ARRAY_SIZE(s3c_wdt_resource),
> - .resource = s3c_wdt_resource,
> -};
> -
> -EXPORT_SYMBOL(s3c_device_wdt);
> -
> /* IIS */
>
> static struct resource s3c_iis_resource[] = {
> diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
> index 287e6f7..72dae49 100644
> --- a/arch/arm/plat-samsung/Kconfig
> +++ b/arch/arm/plat-samsung/Kconfig
> @@ -185,6 +185,12 @@ config S3C_DEV_USB_HSOTG
> help
> Compile in platform device definition for USB high-speed OtG
>
> +config S3C_DEV_WDT
> + bool
> + default y if ARCH_S3C2410
> + help
> + Complie in platform device definition for Watchdog Timer
> +
> config S3C_DEV_NAND
> bool
> help
> diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile
> index 0ad820a..0a92369 100644
> --- a/arch/arm/plat-samsung/Makefile
> +++ b/arch/arm/plat-samsung/Makefile
> @@ -40,6 +40,7 @@ obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o
> obj-y += dev-uart.o
> obj-$(CONFIG_S3C_DEV_USB_HOST) += dev-usb.o
> obj-$(CONFIG_S3C_DEV_USB_HSOTG) += dev-usb-hsotg.o
> +obj-$(CONFIG_S3C_DEV_WDT) += dev-wdt.o
> obj-$(CONFIG_S3C_DEV_NAND) += dev-nand.o
>
> # DMA support
> diff --git a/arch/arm/plat-samsung/dev-wdt.c b/arch/arm/plat-samsung/dev-wdt.c
> new file mode 100644
> index 0000000..5efca87
> --- /dev/null
> +++ b/arch/arm/plat-samsung/dev-wdt.c
> @@ -0,0 +1,40 @@
> +/* linux/arch/arm/plat-samsung/dev-wdt.c
> + *
> + * Copyright (c) 2004 Simtec Electronics
> + * Ben Dooks <ben@simtec.co.uk>
> + *
> + * S3C series device definition for the watchdog timer
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> +*/
> +
> +#include <linux/kernel.h>
> +#include <linux/platform_device.h>
> +
> +#include <mach/irqs.h>
> +#include <mach/map.h>
> +
> +#include <plat/devs.h>
> +
> +static struct resource s3c_wdt_resource[] = {
> + [0] = {
> + .start = S3C_PA_WDT,
> + .end = S3C_PA_WDT + SZ_1M - 1,
> + .flags = IORESOURCE_MEM,
> + },
> + [1] = {
> + .start = IRQ_WDT,
> + .end = IRQ_WDT,
> + .flags = IORESOURCE_IRQ,
> + }
> +};
> +
> +struct platform_device s3c_device_wdt = {
> + .name = "s3c2410-wdt",
> + .id = -1,
> + .num_resources = ARRAY_SIZE(s3c_wdt_resource),
> + .resource = s3c_wdt_resource,
> +};
> +EXPORT_SYMBOL(s3c_device_wdt);
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 0bf5020..d52118f 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -145,13 +145,15 @@ config KS8695_WATCHDOG
> Watchdog timer embedded into KS8695 processor. This will reboot your
> system when the timeout is reached.
>
> +config HAVE_S3C2410_WATCHDOG
> + bool
> +
a basic helptext here would be nice.
> config S3C2410_WATCHDOG
> tristate "S3C2410 Watchdog"
> - depends on ARCH_S3C2410
> + depends on HAVE_S3C2410_WATCHDOG
can we either leave ARCH_S3C2410 in the depends on line for the moment
so if we fail to merge part of the arch/arm updates then this still keeps
working.
> help
> - Watchdog timer block in the Samsung S3C2410 chips. This will
> - reboot the system when the timer expires with the watchdog
> - enabled.
> + Watchdog timer block in the Samsung SoCs. This will reboot
> + the system when the timer expires with the watchdog enabled.
>
> The driver is limited by the speed of the system's PCLK
> signal, so with reasonably fast systems (PCLK around 50-66MHz)
> --
> 1.6.2.5
>
--
--
Ben
Q: What's a light-year?
A: One-third less calories than a regular year.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/5] [WATCHDOG] s3c2410_wdt - Avoid freeing memory, if memory region could not be allocated
2010-05-20 7:21 ` [PATCH 2/5] [WATCHDOG] s3c2410_wdt - Avoid freeing memory, if memory region could not be allocated Kukjin Kim
@ 2010-05-20 10:00 ` Sergei Shtylyov
2010-05-20 10:32 ` Kukjin Kim
0 siblings, 1 reply; 10+ messages in thread
From: Sergei Shtylyov @ 2010-05-20 10:00 UTC (permalink / raw)
To: linux-arm-kernel
Hello.
Kukjin Kim wrote:
> From: Banajit Goswami <banajit.g@samsung.com>
> In case the WDT device memory allocation fails, this patch modifies the
This is not memory allocation.
> driver such that, it does not try to free the memory on exit.
> Signed-off-by: Banajit Goswami <banajit.g@samsung.com>
> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
> ---
> drivers/watchdog/s3c2410_wdt.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c
> index e4cebef..d421258 100644
> --- a/drivers/watchdog/s3c2410_wdt.c
> +++ b/drivers/watchdog/s3c2410_wdt.c
> @@ -426,8 +426,7 @@ static int __devinit s3c2410wdt_probe(struct platform_device *pdev)
> wdt_mem = request_mem_region(res->start, size, pdev->name);
> if (wdt_mem == NULL) {
> dev_err(dev, "failed to get memory region\n");
> - ret = -ENOENT;
> - goto err_req;
> + return -ENOMEM;
It should be EBUSY actually...
WBR, Sergei
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/5] [WATCHDOG] s3c2410_wdt - Avoid freeing memory, if memory region could not be allocated
2010-05-20 10:00 ` Sergei Shtylyov
@ 2010-05-20 10:32 ` Kukjin Kim
0 siblings, 0 replies; 10+ messages in thread
From: Kukjin Kim @ 2010-05-20 10:32 UTC (permalink / raw)
To: linux-arm-kernel
Sergei Shtylyov wrote:
>
> Hello.
>
> Kukjin Kim wrote:
>
> > From: Banajit Goswami <banajit.g@samsung.com>
>
> > In case the WDT device memory allocation fails, this patch modifies the
>
> This is not memory allocation.
Ok, will fix it.
>
> > driver such that, it does not try to free the memory on exit.
>
> > Signed-off-by: Banajit Goswami <banajit.g@samsung.com>
> > Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
> > ---
> > drivers/watchdog/s3c2410_wdt.c | 3 +--
> > 1 files changed, 1 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/watchdog/s3c2410_wdt.c
b/drivers/watchdog/s3c2410_wdt.c
> > index e4cebef..d421258 100644
> > --- a/drivers/watchdog/s3c2410_wdt.c
> > +++ b/drivers/watchdog/s3c2410_wdt.c
> > @@ -426,8 +426,7 @@ static int __devinit s3c2410wdt_probe(struct
> platform_device *pdev)
> > wdt_mem = request_mem_region(res->start, size, pdev->name);
> > if (wdt_mem == NULL) {
> > dev_err(dev, "failed to get memory region\n");
> > - ret = -ENOENT;
> > - goto err_req;
> > + return -ENOMEM;
>
> It should be EBUSY actually...
Ok, will fix it.
>
>
> WBR, Sergei
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2010-05-20 10:32 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-20 7:21 [PATCH 0/0] Add Watchdog support for Samsung SMDK6410, S5P6440 and S5Pv210 Kukjin Kim
2010-05-20 7:21 ` [PATCH 1/5] ARM: SAMSUNG: Move WDT device definitions in plat-samsung Kukjin Kim
2010-05-20 7:43 ` Ben Dooks
2010-05-20 7:21 ` [PATCH 2/5] [WATCHDOG] s3c2410_wdt - Avoid freeing memory, if memory region could not be allocated Kukjin Kim
2010-05-20 10:00 ` Sergei Shtylyov
2010-05-20 10:32 ` Kukjin Kim
2010-05-20 7:21 ` [PATCH 3/5] ARM: SMDK6410: Add Watchdog support for SMDK6410 Kukjin Kim
2010-05-20 7:21 ` [PATCH 4/5] ARM: S5P6440: Add Watchdog support for S5P6440 Kukjin Kim
2010-05-20 7:21 ` [PATCH 5/5] ARM: S5PV210: Add Watchdog support for S5PV210 Kukjin Kim
2010-05-20 7:35 ` [PATCH 0/0] Add Watchdog support for Samsung SMDK6410, S5P6440 and S5Pv210 Ben Dooks
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).