[U-Boot] a couple drivers/rtc/* drivers now superfluous?

Robert P. J. Day rpjday at crashcourse.ca
Mon May 16 11:29:15 CEST 2016


  from mario's reply about unused files yesterday, it seems that
drivers/rtc/ds1302.c is no longer referenced anywhere in the tree:


$ grep -ir ds1302 *
drivers/rtc/Makefile:obj-$(CONFIG_RTC_DS1302) += ds1302.o
drivers/rtc/ds1302.c: * ds1302.c - Support for the Dallas Semiconductor DS1302 Timekeeping Chip
drivers/rtc/ds1302.c:#  define DPRINTF(x,args...)	printf("ds1302: " x , ##args)
drivers/rtc/ds1302.c:/* time data format for DS1302 */
drivers/rtc/ds1302.c:struct ds1302_st
drivers/rtc/ds1302.c:static int ds1302_initted=0;
drivers/rtc/ds1302.c:	struct ds1302_st bbclk;
drivers/rtc/ds1302.c:		printf("ds1302: Clock was halted, starting clock\n");
drivers/rtc/ds1302.c:		printf("ds1302: Clock was in 12 hour mode, fixing\n");
drivers/rtc/ds1302.c:		printf("ds1302: Year was corrupted, fixing\n");
drivers/rtc/ds1302.c:	ds1302_initted=1;
drivers/rtc/ds1302.c:	if(!ds1302_initted) rtc_init();
drivers/rtc/ds1302.c:	struct ds1302_st bbclk;
drivers/rtc/ds1302.c:	if(!ds1302_initted) rtc_init();
drivers/rtc/ds1302.c:		printf("ds1302: rtc_get: Clock was halted, clock probably "
drivers/rtc/ds1302.c:	struct ds1302_st bbclk;
drivers/rtc/ds1302.c:	if(!ds1302_initted) rtc_init();
$

  it appears the same can be said about ds1306.c:


drivers/rtc/ds1306.c: * Date & Time support for DS1306 RTC using SPI:
drivers/rtc/ds1306.c:/* read clock time from DS1306 and return it in *tmp */
drivers/rtc/ds1306.c:	/* Now we can enable the DS1306 RTC */
drivers/rtc/ds1306.c:	/* Now we can disable the DS1306 RTC */
drivers/rtc/ds1306.c:	immap->im_cpm.cp_pbdat &= ~PB_SPI_CE;	/* Disable DS1306 Chip */
drivers/rtc/ds1306.c:/* set clock time in DS1306 RTC and in MPC8xx RTC */
drivers/rtc/ds1306.c:	/* Now we can enable the DS1306 RTC */
drivers/rtc/ds1306.c:	immap->im_cpm.cp_pbdat |= PB_SPI_CE;	/* Enable DS1306 Chip */
drivers/rtc/ds1306.c:	/* Now disable the DS1306 to terminate the write */
drivers/rtc/ds1306.c:	/* Now enable the DS1306 to initiate a new write */
drivers/rtc/ds1306.c:	immap->im_cpm.cp_pbdat &= ~PB_SPI_CE;	/* Disable DS1306 Chip */
drivers/rtc/ds1306.c:	immap->im_cpm.cp_pbdat |= PB_SPI_CE;	/* Enable DS1306 Chip */
drivers/rtc/ds1306.c:	/* Now disable the DS1306 */
drivers/rtc/ds1306.c:	immap->im_cpm.cp_pbdat &= ~PB_SPI_CE;	/*  Disable DS1306 Chip */
drivers/rtc/ds1306.c:	 * see the time even if it doesn't have a DS1306 clock driver.
drivers/rtc/ds1306.c:/* read clock time from DS1306 and return it in *tmp */
drivers/rtc/ds1306.c:/* set clock time from *tmp in DS1306 RTC */
drivers/rtc/ds1306.c:/* reset the DS1306 */
drivers/rtc/Makefile:obj-$(CONFIG_RTC_DS1306) += ds1306.o


  mario pointed out that ds1302.c clearly has no value since it uses a
dead macro GTREGREAD. the same can't be said about ds1306.c so maybe
it still has value but certainly nothing refers to it.

  thoughts on clearing out either or both?

rday

p.s.  the top-level README file mentions neither of these:

- Real-Time Clock:

                When CONFIG_CMD_DATE is selected, the type of the RTC
                has to be selected, too. Define exactly one of the
                following options:

                CONFIG_RTC_MPC8xx       - use internal RTC of MPC8xx
                CONFIG_RTC_PCF8563      - use Philips PCF8563 RTC
                CONFIG_RTC_MC13XXX      - use MC13783 or MC13892 RTC
                CONFIG_RTC_MC146818     - use MC146818 RTC
                CONFIG_RTC_DS1307       - use Maxim, Inc. DS1307 RTC
		... snip ...

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================



More information about the U-Boot mailing list