Skip to content
Snippets Groups Projects
Select Git revision
  • master default protected
  • early-display
  • variant-emmc-nvme-boot
  • 2023-01-25
  • v3
  • variant-emmc-nvme-boot
  • 2020-06-01
7 results

pcf8563.c

Blame
  • Forked from Reform / reform-boundary-uboot
    34871 commits behind the upstream repository.
    • Benoît Thébaudeau's avatar
      df930e9b
      rtc: pcf8563: Make century compatible with Linux · df930e9b
      Benoît Thébaudeau authored
      
      This driver uses the century bit of this RTC in the opposite way Linux does.
      From Linux's rtc-pcf8563.c:
      	/*
      	 * The meaning of MO_C bit varies by the chip type.
      	 * From PCF8563 datasheet: this bit is toggled when the years
      	 * register overflows from 99 to 00
      	 *   0 indicates the century is 20xx
      	 *   1 indicates the century is 19xx
      	 * From RTC8564 datasheet: this bit indicates change of
      	 * century. When the year digit data overflows from 99 to 00,
      	 * this bit is set. By presetting it to 0 while still in the
      	 * 20th century, it will be set in year 2000, ...
      	 * There seems no reliable way to know how the system use this
      	 * bit.  So let's do it heuristically, assuming we are live in
      	 * 1970...2069.
      	 */
      
      As U-Boot's PCF8563 driver does not say it is supposed to support the RTC8564,
      make this driver compatible with Linux's by giving the opposite meaning to the
      century bit.
      
      Signed-off-by: default avatarBenoît Thébaudeau <benoit.thebaudeau@advansee.com>
      Cc: Wolfgang Denk <wd@denx.de>
      df930e9b
      History
      rtc: pcf8563: Make century compatible with Linux
      Benoît Thébaudeau authored
      
      This driver uses the century bit of this RTC in the opposite way Linux does.
      From Linux's rtc-pcf8563.c:
      	/*
      	 * The meaning of MO_C bit varies by the chip type.
      	 * From PCF8563 datasheet: this bit is toggled when the years
      	 * register overflows from 99 to 00
      	 *   0 indicates the century is 20xx
      	 *   1 indicates the century is 19xx
      	 * From RTC8564 datasheet: this bit indicates change of
      	 * century. When the year digit data overflows from 99 to 00,
      	 * this bit is set. By presetting it to 0 while still in the
      	 * 20th century, it will be set in year 2000, ...
      	 * There seems no reliable way to know how the system use this
      	 * bit.  So let's do it heuristically, assuming we are live in
      	 * 1970...2069.
      	 */
      
      As U-Boot's PCF8563 driver does not say it is supposed to support the RTC8564,
      make this driver compatible with Linux's by giving the opposite meaning to the
      century bit.
      
      Signed-off-by: default avatarBenoît Thébaudeau <benoit.thebaudeau@advansee.com>
      Cc: Wolfgang Denk <wd@denx.de>
    pcf8563.c 3.58 KiB