[U-Boot-Users] How to call rtc_init from arm boot sequence in uboot

Wolfgang Denk wd at denx.de
Wed Jul 16 12:04:08 CEST 2008


In message <5BF78BCE8D9BF14A83F836BD9E3916BA23C0BD at blrms.slti.sanyo.co.in> you wrote:
> 
> I am trying to write a driver for arm amba pl031 rtc module. i need to
> setup rtc controller to enable it. 
> I need to call it during boot sequence. But in lib_arm/board.c we do not
> have a call to rtc_init func.

This is intentional. U-Boot does not initialize all hardware on the
system, it initializes only such hardware which it needs for it's own
operation.

To initialize the RTC, the "date reset" command will be used; this
then includes the required init code.

> i checked blackfin boot up sequence and they have something like below
> in uboot-1.3.3/lib_blackfin/board.c @ line 315
> 
> 	checkboard();
> #if defined(CONFIG_RTC_BFIN) && defined(CONFIG_CMD_DATE)
> 	rtc_init();
> #endif
> 	timer_init();

This is bad. This code violates the U-Boot design principles and shall
be removed.


Mike, can you please take care to get rid of this code in the next
release? Thanks in advance.

> Shouldnt it be implemented for arm boot up sequence also.

No, definitely not.

> Can i implement the same and send the patch to uboot. something like
> below in uboot-1.3.3/lib_arm/board.c @ line 267

No, please don't. I will reject any such patches.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Without followers, evil cannot spread.
	-- Spock, "And The Children Shall Lead", stardate 5029.5




More information about the U-Boot mailing list