Skip to contentSkip to conversation

RTC Question

U-Boot-Users Robin Getz 1 participant 1 message Oct 8, 2004

lore
Share & tools
lore

Robin Getz

author
#0 lore raw
Quoted 1 line · Wolfgang Denk

How could you fix this?

As you suggested - just a simple offset (exactly the same will need to go into the Linux kernel). If the overflow occurs - (if you see a date less then 18Sept1974, assume roll over has occurred, add 4 years, 9 months, and 17 days). This will set things to the same day of the week structure as the roll over date (19Sep2058 is a Thursday, and so is 19Sept1974). This also should handle the leap years calculations properly.

After this it is a simple matter of just adding 84 years to the return value or display of the function.

Quoted 2 lines

U-Boot will probably not even be running when the rollover happens, so it has zero chance to notice.

U-boot may not have to be alive when rollover occurs to have an issue - for a contrived example that has less chance of actually happening than me willing the lotto, if you set U-Boot up to check a network connection monthly for updates, after 2058 it stops checking, because U-boot believes that Oct2058 never occurs.

However, by doing the above, all than happens is delaying things until 2087, and then you run into the same problem. But since I plan on being dead by then, I am OK with that. (I'd like to be around in 50 years, but not 80).

-Robin