* PPC: set default date on PPC without RTC
@ 2013-09-11 9:39 Wladislav Wiebe
2013-09-11 17:53 ` Wladislav Wiebe
0 siblings, 1 reply; 2+ messages in thread
From: Wladislav Wiebe @ 2013-09-11 9:39 UTC (permalink / raw)
To: linuxppc-dev
Hello guys,
would like to ask if there is a proper possibility on PPC to
set default date (basically the year). The board has no RTC chip,
and I would need instead of 1970 another year.
For some reason does e.g:
--- a/linux/arch/powerpc/kernel/time.c
+++ b/linux/arch/powerpc/kernel/time.c
@@ -1099,7 +1099,7 @@ void __init time_init(void)
#define FEBRUARY 2
-#define STARTOFTIME 1970
+#define STARTOFTIME 2013
#define SECDAY 86400L
#define SECYR (SECDAY * 365)
#define leapyear(year) ((year) % 4 == 0 && \
not work to me. Is there also another place which should be changed?
(I know it can be changed from userspace also, but I would need it before userspace)
Thanks and BR,
Wladislav Wiebe
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: PPC: set default date on PPC without RTC
2013-09-11 9:39 PPC: set default date on PPC without RTC Wladislav Wiebe
@ 2013-09-11 17:53 ` Wladislav Wiebe
0 siblings, 0 replies; 2+ messages in thread
From: Wladislav Wiebe @ 2013-09-11 17:53 UTC (permalink / raw)
To: linuxppc-dev
Hi,
no matter anymore - got it:
--- a/linux/arch/powerpc/kernel/time.c
+++ b/linux/arch/powerpc/kernel/time.c
@@ -832,7 +832,7 @@ static void __read_persistent_clock(struct timespec *ts)
}
}
if (!ppc_md.get_rtc_time) {
- ts->tv_sec = 0;
+ ts->tv_sec = mktime(2011, 1, 1, 0, 0, 0);
return;
}
ppc_md.get_rtc_time(&tm);
On 11/09/13 11:39, Wladislav Wiebe wrote:
> Hello guys,
>
> would like to ask if there is a proper possibility on PPC to
> set default date (basically the year). The board has no RTC chip,
> and I would need instead of 1970 another year.
>
> For some reason does e.g:
> --- a/linux/arch/powerpc/kernel/time.c
> +++ b/linux/arch/powerpc/kernel/time.c
> @@ -1099,7 +1099,7 @@ void __init time_init(void)
>
>
> #define FEBRUARY 2
> -#define STARTOFTIME 1970
> +#define STARTOFTIME 2013
> #define SECDAY 86400L
> #define SECYR (SECDAY * 365)
> #define leapyear(year) ((year) % 4 == 0 && \
>
>
> not work to me. Is there also another place which should be changed?
> (I know it can be changed from userspace also, but I would need it before userspace)
>
>
> Thanks and BR,
> Wladislav Wiebe
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-09-11 17:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-11 9:39 PPC: set default date on PPC without RTC Wladislav Wiebe
2013-09-11 17:53 ` Wladislav Wiebe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).