Skip to contentSkip to conversation

DS1374 watchdog capabilities

U-Boot-Users llandre 3 participants 6 messages Aug 28, 2006 – Aug 31, 2006

lore
Share & tools
lore

llandre

author
#0 lore raw

Hi,

I'd like to use DS1374 watchdog capabilities. Is it correct to put the new stuff in the existing RTC driver (rtc/ds1374.c)? I was thinking about something like this:

#if (defined(CONFIG_RTC_DS1374)) &&

#if (CONFIG_COMMANDS & CFG_CMD_DATE)
existing stuff
#endif

#if (CONFIG_WATCHDOG)
new stuff
#endif

#endif

If it is not acceptable, where should I put the new stuff?

TIA,
llandre

DAVE Electronics System House - R&D Department

web:   http://www.dave-tech.it
email: r&d2 at dave-tech.it
#1 lore raw
Quoted 10 lines

I'd like to use DS1374 watchdog capabilities. Is it correct to put the new stuff in the existing RTC driver (rtc/ds1374.c)? I was thinking about something like this:

#if (defined(CONFIG_RTC_DS1374)) &&

#if (CONFIG_COMMANDS & CFG_CMD_DATE)
existing stuff
#endif

Quoted 7 lines

#if (CONFIG_WATCHDOG)
new stuff
#endif

#endif

If it is not acceptable, where should I put the new stuff?

I remember the u-boot of git support DS1374 RTC function.

-DAve

#2 lore raw
In reply to llandre
Quoted 3 lines · In message <[email protected]> you wrote:

I'd like to use DS1374 watchdog capabilities. Is it correct to put the new stuff in the existing RTC driver (rtc/ds1374.c)? I was thinking

I don't like this idea. Nobody will search there when looking for watchdog code.

Quoted 3 lines

#if (CONFIG_WATCHDOG)
new stuff
#endif

How much of such "new stuff" code will be needed? I guess it's just some intialization, and eventually the trigger routine?

Quoted 1 line

If it is not acceptable, where should I put the new stuff?

drivers/watchdog/ds1374.c ?

Best regards,

Wolfgang Denk

Signature · 4 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A meeting is an event at which the minutes are kept and the hours are
lost.
author
#3 lore raw
Quoted 5 lines
Quoted 2 lines

I'd like to use DS1374 watchdog capabilities. Is it correct to put the new stuff in the existing RTC driver (rtc/ds1374.c)? I was thinking

I don't like this idea. Nobody will search there when looking for watchdog code.

I see.

Quoted 2 lines

How much of such "new stuff" code will be needed? I guess it's just some intialization, and eventually the trigger routine?

Yes, something like that.

Quoted 3 lines
Quoted 1 line

If it is not acceptable, where should I put the new stuff?

drivers/watchdog/ds1374.c ?

Ok.
What about the common stuff (registers definitions for example) in order to avoid code duplication? Is it ok to add include/ds1374.h and to make and to make functions rtc_read and rtc_write_raw non-static?

Signature · 5 lines
llandre

DAVE Electronics System House - R&D Department
web:   http://www.dave-tech.it
email: r&d2 at dave-tech.it
author
#4 lore raw
Quoted 3 lines

What about the common stuff (registers definitions for example) in order to avoid code duplication? Is it ok to add include/ds1374.h and to make functions rtc_read and rtc_write_raw non-static?

What about this proposal?

Signature · 5 lines
llandre

DAVE Electronics System House - R&D Department
web:   http://www.dave-tech.it
email: r&d2 at dave-tech.it
#5 lore raw
Quoted 2 lines · In message <[email protected]> you wrote:
Quoted 2 lines

What about the common stuff (registers definitions for example) in order to avoid code duplication? Is it ok to add include/ds1374.h

Sounds ok to me.

Quoted 1 line
Quoted 1 line

and to make functions rtc_read and rtc_write_raw non-static?

Then the functions should probably be renamed, too.

Best regards,

Wolfgang Denk

Signature · 4 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
One does not thank logic.
	-- Sarek, "Journey to Babel", stardate 3842.4