From: Erik M. <J.A...@it...> - 2002-04-17 10:13:11
|
On Mon, Apr 15, 2002 at 04:04:57PM +0200, Abraham vd Merwe wrote: > I have a watchdog on my board which needs to be strobed at least every > 500ms, otherwise it resets the board. Therefore I need to use a timer > interrupt. I have a couple of questions to ask though: > > 1) Interrupts are disabled in blob at the moment right? So I won't be > interfering with something else if I setup an interrupt handler? No. Might be tricky, though. Best way is to modify the irq/firq entries in start.S to jump to a known location in trampoline.S, which on its turn can do the dirty work and call a C interrupt handling function. > 2) If I setup an interrupt handler, then I obviously need to uninstall the > interrupt handler (or at least disable interrupts) before I load the kernel > (or anything else for that matter). Where is the best/least intrusive place > to do that in blob? As for the best place to do it: look at how the icache gets disabled: code is in lib/icache.c, and in blob/initcalls.c the functions enable_icache() and disable_icache() are registered in the init and exitlist. I *hope* that the kernel boots fast enough before the watchdog kicks in. However, I wonder if you really need to keep the watchdog busy in blob. All watchdog devices I know have an option that they aren't enabled at boot time, but only start working after you first use them. So for as long as you don't touch the watchdog in blob, you also won't need any driver for it in blob. If you are affraid about a broken blob, think twice: the normal way of operation is that blob initialises the system and immediately boots the kernel. This even works with an unattended system. It can be tested in the lab that a normal unattended boot always succeeds, and the path through the blob code is completely repeatable every time. If there goes something wrong in blob, it's most probable that it is because something has been overwriting the flash. If that happens and there is no watchdog, blob will just crash and the system will be unusable. With a watchdog, the system will be rebooted, blob will crash again, the watchdog will kick in again, the system will be rebooted ... (ad nauseam). Anyway, in both cases it will result in a broken system that needs manual intervention, and no watchdog is more intelligent than a human being. So unless you have a brain damaged watchdog that simply needs to be kept happy, I don't think we need a watchdog driver in blob. It's not that I am against adding features in blob, it's just that I don't see a point in adding useless features. Erik -- J.A.K. (Erik) Mouw, Information and Communication Theory Group, Faculty of Information Technology and Systems, Delft University of Technology, PO BOX 5031, 2600 GA Delft, The Netherlands Phone: +31-15-2783635 Fax: +31-15-2781843 Email: J.A...@it... WWW: http://www-ict.its.tudelft.nl/~erik/ |