Skip to contentSkip to conversation

watchdog/denali: Adding DesignWare watchdog driver support

PATCH Superseded Chin Liang See 2 participants 4 messages Feb 21, 2014 – Feb 28, 2014 Watchdog device drivers

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/2 watchdog/denali: Adding DesignWare watchdog driver support

To add the DesignWare watchdog driver support. It required information such as register base address and clock info from configuration header file within include/configs folder.

Cc Anatolij Gustschin <[email protected]>
Cc Albert Aribaud <[email protected]>
Cc Heiko Schocher <[email protected]>
Cc Tom Rini <[email protected]>

---
Changes for v3
- Split to 2 series patch
Changes for v2
- Enable this driver at socfpga_cyclone5 board

---
 drivers/watchdog/Makefile         |    1 +
 drivers/watchdog/designware_wdt.c |   73 +++++++++++++++++++++++++++++++++++++
 2 files changed, 74 insertions(+)
 create mode 100644 drivers/watchdog/designware_wdt.c
drivers/watchdog/Makefile +1 -0
index 06ced10..0276a10 100644
@@ -15,3 +15,4 @@ obj-$(CONFIG_S5P)               += s5p_wdt.o
 obj-$(CONFIG_XILINX_TB_WATCHDOG) += xilinx_tb_wdt.o
 obj-$(CONFIG_BFIN_WATCHDOG)  += bfin_wdt.o
 obj-$(CONFIG_OMAP_WATCHDOG) += omap_wdt.o
+obj-$(CONFIG_DESIGNWARE_WATCHDOG) += designware_wdt.o
drivers/watchdog/designware_wdt.c new file +73 -0

73 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v3 1/2 watchdog/denali: Adding DesignWare watchdog driver support

Quoted 14 lines · Chin Liang See

To add the DesignWare watchdog driver support. It required information such as register base address and clock info from configuration header file within include/configs folder.

Cc Anatolij Gustschin <[email protected]>
Cc Albert Aribaud <[email protected]>
Cc Heiko Schocher <[email protected]>
Cc Tom Rini <[email protected]>

---
Changes for v3
- Split to 2 series patch
Changes for v2
- Enable this driver at socfpga_cyclone5 board

Quoted 6 lines
---
 drivers/watchdog/Makefile         |    1 +
 drivers/watchdog/designware_wdt.c |   73 +++++++++++++++++++++++++++++++++++++
 2 files changed, 74 insertions(+)
 create mode 100644 drivers/watchdog/designware_wdt.c

Checkpatch.
total: 0 errors, 1 warnings, 1 checks, 77 lines checked

Quoted 15 lines
drivers/watchdog/Makefile +1 -0
index 06ced10..0276a10 100644
@@ -15,3 +15,4 @@ obj-$(CONFIG_S5P)               += s5p_wdt.o
 obj-$(CONFIG_XILINX_TB_WATCHDOG) += xilinx_tb_wdt.o
 obj-$(CONFIG_BFIN_WATCHDOG)  += bfin_wdt.o
 obj-$(CONFIG_OMAP_WATCHDOG) += omap_wdt.o
+obj-$(CONFIG_DESIGNWARE_WATCHDOG) += designware_wdt.o
drivers/watchdog/designware_wdt.c new file +0 -0
new file mode 100644
index 0000000..cb88844

drivers/watchdog/designware_wdt.c line 2

Quoted 2 lines
drivers/watchdog/designware_wdt.c new file +2 -0
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2013 Altera Corporation <www.altera.com>

2014?

Quoted 15 lines
drivers/watchdog/designware_wdt.c new file +15 -0
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <watchdog.h>
+#include <asm/io.h>
+#include <asm/utils.h>
+
+#define DW_WDT_CR	0x00
+#define DW_WDT_TORR	0x04
+#define DW_WDT_CRR	0x0C
+
+#define DW_WDT_CR_EN_OFFSET	0x00
+#define DW_WDT_CR_RMOD_OFFSET	0x01

drivers/watchdog/designware_wdt.c line 27

Quoted 10 lines
drivers/watchdog/designware_wdt.c new file +10 -0
+#define DW_WDT_CR_RMOD_VAL	0x00
+#define DW_WDT_CRR_RESTART_VAL	0x76
+
+/*
+ * Set the watchdog time interval.
+ * Counter is 32 bit.
+ */
+int designware_wdt_settimeout(unsigned int timeout)
+{
+	signed int i;

you should separate variables from code.

Thanks,
Michal

Signature · 14 lines
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 263 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140224/10f94877/attachment.pgp>
#2 lore raw

PATCH v3 1/2 watchdog/denali: Adding DesignWare watchdog driver support

Hi Michal,

Quoted 22 lines · Michal Simek
Quoted 14 lines · Chin Liang See

To add the DesignWare watchdog driver support. It required information such as register base address and clock info from configuration header file within include/configs folder.

Cc Anatolij Gustschin <[email protected]>
Cc Albert Aribaud <[email protected]>
Cc Heiko Schocher <[email protected]>
Cc Tom Rini <[email protected]>

---
Changes for v3
- Split to 2 series patch
Changes for v2
- Enable this driver at socfpga_cyclone5 board

Quoted 6 lines
---
 drivers/watchdog/Makefile         |    1 +
 drivers/watchdog/designware_wdt.c |   73 +++++++++++++++++++++++++++++++++++++
 2 files changed, 74 insertions(+)
 create mode 100644 drivers/watchdog/designware_wdt.c
Quoted 2 lines

Checkpatch.
total: 0 errors, 1 warnings, 1 checks, 77 lines checked

Fixed

Quoted 13 lines
Quoted 13 lines
drivers/watchdog/Makefile +1 -0
index 06ced10..0276a10 100644
@@ -15,3 +15,4 @@ obj-$(CONFIG_S5P)               += s5p_wdt.o
 obj-$(CONFIG_XILINX_TB_WATCHDOG) += xilinx_tb_wdt.o
 obj-$(CONFIG_BFIN_WATCHDOG)  += bfin_wdt.o
 obj-$(CONFIG_OMAP_WATCHDOG) += omap_wdt.o
+obj-$(CONFIG_DESIGNWARE_WATCHDOG) += designware_wdt.o
drivers/watchdog/designware_wdt.c new file +0 -0
new file mode 100644
Quoted 8 lines

drivers/watchdog/designware_wdt.c line 2

Quoted 6 lines

index 0000000..cb88844

drivers/watchdog/designware_wdt.c new file +2 -0
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2013 Altera Corporation <www.altera.com>

2014?

Oops, good catch. Fixed

Quoted 21 lines
Quoted 21 lines
drivers/watchdog/designware_wdt.c new file +19 -0
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <watchdog.h>
+#include <asm/io.h>
+#include <asm/utils.h>
+
+#define DW_WDT_CR	0x00
+#define DW_WDT_TORR	0x04
+#define DW_WDT_CRR	0x0C
+
+#define DW_WDT_CR_EN_OFFSET	0x00
+#define DW_WDT_CR_RMOD_OFFSET	0x01
+#define DW_WDT_CR_RMOD_VAL	0x00
+#define DW_WDT_CRR_RESTART_VAL	0x76
+
+/*
Quoted 8 lines

drivers/watchdog/designware_wdt.c line 27

Quoted 6 lines
drivers/watchdog/designware_wdt.c new file +6 -0
+ * Set the watchdog time interval.
+ * Counter is 32 bit.
+ */
+int designware_wdt_settimeout(unsigned int timeout)
+{
+	signed int i;

you should separate variables from code.

Actually I am trying to avoid to create a new header as its just few simple defines.

Thanks
Chin Liang

Quoted 4 lines

Thanks,
Michal

#3 lore raw

PATCH v3 1/2 watchdog/denali: Adding DesignWare watchdog driver support

Quoted 84 lines · Chin Liang See

Hi Michal,

Quoted 22 lines · Michal Simek
Quoted 14 lines · Chin Liang See

To add the DesignWare watchdog driver support. It required information such as register base address and clock info from configuration header file within include/configs folder.

Cc Anatolij Gustschin <[email protected]>
Cc Albert Aribaud <[email protected]>
Cc Heiko Schocher <[email protected]>
Cc Tom Rini <[email protected]>

---
Changes for v3
- Split to 2 series patch
Changes for v2
- Enable this driver at socfpga_cyclone5 board

Quoted 6 lines
---
 drivers/watchdog/Makefile         |    1 +
 drivers/watchdog/designware_wdt.c |   73 +++++++++++++++++++++++++++++++++++++
 2 files changed, 74 insertions(+)
 create mode 100644 drivers/watchdog/designware_wdt.c
Quoted 2 lines

Checkpatch.
total: 0 errors, 1 warnings, 1 checks, 77 lines checked

Fixed

Quoted 13 lines
Quoted 13 lines
drivers/watchdog/Makefile +1 -0
index 06ced10..0276a10 100644
@@ -15,3 +15,4 @@ obj-$(CONFIG_S5P)               += s5p_wdt.o
 obj-$(CONFIG_XILINX_TB_WATCHDOG) += xilinx_tb_wdt.o
 obj-$(CONFIG_BFIN_WATCHDOG)  += bfin_wdt.o
 obj-$(CONFIG_OMAP_WATCHDOG) += omap_wdt.o
+obj-$(CONFIG_DESIGNWARE_WATCHDOG) += designware_wdt.o
drivers/watchdog/designware_wdt.c new file +0 -0
new file mode 100644
Quoted 8 lines

drivers/watchdog/designware_wdt.c line 2

Quoted 6 lines

index 0000000..cb88844

drivers/watchdog/designware_wdt.c new file +2 -0
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2013 Altera Corporation <www.altera.com>

2014?

Oops, good catch. Fixed

Quoted 21 lines
Quoted 21 lines
drivers/watchdog/designware_wdt.c new file +19 -0
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <watchdog.h>
+#include <asm/io.h>
+#include <asm/utils.h>
+
+#define DW_WDT_CR	0x00
+#define DW_WDT_TORR	0x04
+#define DW_WDT_CRR	0x0C
+
+#define DW_WDT_CR_EN_OFFSET	0x00
+#define DW_WDT_CR_RMOD_OFFSET	0x01
+#define DW_WDT_CR_RMOD_VAL	0x00
+#define DW_WDT_CRR_RESTART_VAL	0x76
+
+/*
Quoted 8 lines

drivers/watchdog/designware_wdt.c line 27

Quoted 6 lines
drivers/watchdog/designware_wdt.c new file +6 -0
+ * Set the watchdog time interval.
+ * Counter is 32 bit.
+ */
+int designware_wdt_settimeout(unsigned int timeout)
+{
+	signed int i;

you should separate variables from code.

Quoted 2 lines

Actually I am trying to avoid to create a new header as its just few simple defines.

don't get you. I just thought to add one more blank line below this line.

Thanks,
Michal

Signature · 14 lines
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 263 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140228/88b8df8b/attachment.pgp>