LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   help writing watchdog timer driver (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/help-writing-watchdog-timer-driver-4175471811/)

sallu.salmankhalid 08-02-2013 12:46 AM

help writing watchdog timer driver
 
Hi,

After successfuly learning how to crosscompile linux kernel and application for embedded devices I am learning device driver development and I want to write watchdog driver for my pandaboard running linux but I have no idea where to start. I have written linux kernel modules so I know how to write a basic character driver but I am not able to find any reference material for writing watchdog timer device driver for omap4. Please point me in the right direction and if possible give me links to concerned reference material.

Regards

onebuck 08-03-2013 07:25 AM

Member Response
 
Hi,

Linux does provide a watchdog timer.
The following is dated but can be used for references. Look at the kernel version you are wishing to work with to get better detail.

Look at http://www.mjmwired.net/kernel/Docum...tchdog/wdt.txt & watchdog-api.txt
Quote:

The Linux Watchdog driver API.
5
6 Copyright 2002 Christer Weingel <wingel@nano-system.com>
7
8 Some parts of this document are copied verbatim from the sbc60xxwdt
9 driver which is (c) Copyright 2000 Jakob Oestergaard <jakob@ostenfeld.dk>
10
11 This document describes the state of the Linux 2.4.18 kernel.
12
13 Introduction:
14
15 A Watchdog Timer (WDT) is a hardware circuit that can reset the
16 computer system in case of a software fault. You probably knew that
17 already.
18
19 Usually a userspace daemon will notify the kernel watchdog driver via the
20 /dev/watchdog special device file that userspace is still alive, at
21 regular intervals. When such a notification occurs, the driver will
22 usually tell the hardware watchdog that everything is in order, and
23 that the watchdog should wait for yet another little while to reset
24 the system. If userspace fails (RAM error, kernel bug, whatever), the
25 notifications cease to occur, and the hardware watchdog will reset the
26 system (causing a reboot) after the timeout occurs..
These two links should be of help;
http://www.mjmwired.net/kernel/Docum...kernel-api.txt
http://www.mjmwired.net/kernel/Docum...parameters.txt

Hope this helps.

sallu.salmankhalid 08-05-2013 12:51 AM

Thanks alot for replying

I am learning how to write my own device driver from scratch. I have reference manual for omap4 watchdog timer but I dont know how to start writing my own device driver. The reference manual has a lot of register that need to be configured to make watchdog driver operational but I have no idea how to do that. The file watchdog-apt.txt & watchdog-simple.c discuss the userspace application, not how to write your own device driver. The "The Linux WatchDog Timer Driver Core kernel API" was quite helpfull but I am still lost. If you could point me in the right direction that will be very helpful.

Regards


All times are GMT -5. The time now is 01:05 PM.