Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 14393
b: refs/heads/master
c: 49e16b7
h: refs/heads/master
i:
  14391: 865045e
v: v3
  • Loading branch information
Paul Mackerras committed Nov 18, 2005
1 parent 5e8c950 commit cfe68ba
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6146eed1e972a7de93ce2e36adc5812de81e879c
refs/heads/master: 49e16b7becd6320bde51aa238c11815708f836d9
6 changes: 3 additions & 3 deletions trunk/arch/powerpc/kernel/rtas-rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ unsigned long __init rtas_get_boot_time(void)
{
int ret[8];
int error, wait_time;
unsigned long max_wait_tb;
u64 max_wait_tb;

max_wait_tb = get_tb() + tb_ticks_per_usec * 1000 * MAX_RTC_WAIT;
do {
Expand Down Expand Up @@ -45,7 +45,7 @@ void rtas_get_rtc_time(struct rtc_time *rtc_tm)
{
int ret[8];
int error, wait_time;
unsigned long max_wait_tb;
u64 max_wait_tb;

max_wait_tb = get_tb() + tb_ticks_per_usec * 1000 * MAX_RTC_WAIT;
do {
Expand Down Expand Up @@ -80,7 +80,7 @@ void rtas_get_rtc_time(struct rtc_time *rtc_tm)
int rtas_set_rtc_time(struct rtc_time *tm)
{
int error, wait_time;
unsigned long max_wait_tb;
u64 max_wait_tb;

max_wait_tb = get_tb() + tb_ticks_per_usec * 1000 * MAX_RTC_WAIT;
do {
Expand Down
11 changes: 10 additions & 1 deletion trunk/arch/powerpc/platforms/chrp/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,13 @@ void __init chrp_setup_arch(void)
if (rtas_token("display-character") >= 0)
ppc_md.progress = rtas_progress;

/* use RTAS time-of-day routines if available */
if (rtas_token("get-time-of-day") != RTAS_UNKNOWN_SERVICE) {
ppc_md.get_boot_time = rtas_get_boot_time;
ppc_md.get_rtc_time = rtas_get_rtc_time;
ppc_md.set_rtc_time = rtas_set_rtc_time;
}

#ifdef CONFIG_BOOTX_TEXT
if (ppc_md.progress == NULL && boot_text_mapped)
ppc_md.progress = btext_progress;
Expand Down Expand Up @@ -505,9 +512,11 @@ void __init chrp_init(void)
ppc_md.halt = rtas_halt;

ppc_md.time_init = chrp_time_init;
ppc_md.calibrate_decr = chrp_calibrate_decr;

/* this may get overridden with rtas routines later... */
ppc_md.set_rtc_time = chrp_set_rtc_time;
ppc_md.get_rtc_time = chrp_get_rtc_time;
ppc_md.calibrate_decr = chrp_calibrate_decr;

#ifdef CONFIG_SMP
smp_ops = &chrp_smp_ops;
Expand Down
3 changes: 1 addition & 2 deletions trunk/arch/powerpc/platforms/chrp/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ int chrp_set_rtc_time(struct rtc_time *tmarg)

chrp_cmos_clock_write((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT);

tm.tm_year -= 1900;
if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
BIN_TO_BCD(tm.tm_sec);
BIN_TO_BCD(tm.tm_min);
Expand Down Expand Up @@ -156,7 +155,7 @@ void chrp_get_rtc_time(struct rtc_time *tm)
BCD_TO_BIN(mon);
BCD_TO_BIN(year);
}
if ((year += 1900) < 1970)
if (year < 70)
year += 100;
tm->tm_sec = sec;
tm->tm_min = min;
Expand Down

0 comments on commit cfe68ba

Please sign in to comment.