aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc64/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ppc64/kernel')
-rw-r--r--arch/ppc64/kernel/idle.c8
-rw-r--r--arch/ppc64/kernel/maple_setup.c2
-rw-r--r--arch/ppc64/kernel/maple_time.c7
-rw-r--r--arch/ppc64/kernel/pmac.h2
-rw-r--r--arch/ppc64/kernel/pmac_nvram.c4
-rw-r--r--arch/ppc64/kernel/pmac_time.c21
-rw-r--r--arch/ppc64/kernel/rtas-proc.c1
-rw-r--r--arch/ppc64/kernel/rtc.c11
8 files changed, 20 insertions, 36 deletions
diff --git a/arch/ppc64/kernel/idle.c b/arch/ppc64/kernel/idle.c
index 954395d..8abd2ad 100644
--- a/arch/ppc64/kernel/idle.c
+++ b/arch/ppc64/kernel/idle.c
@@ -31,7 +31,7 @@
extern void power4_idle(void);
-int default_idle(void)
+void default_idle(void)
{
long oldval;
unsigned int cpu = smp_processor_id();
@@ -64,11 +64,9 @@ int default_idle(void)
if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING)
cpu_die();
}
-
- return 0;
}
-int native_idle(void)
+void native_idle(void)
{
while (1) {
ppc64_runlatch_off();
@@ -85,8 +83,6 @@ int native_idle(void)
system_state == SYSTEM_RUNNING)
cpu_die();
}
-
- return 0;
}
void cpu_idle(void)
diff --git a/arch/ppc64/kernel/maple_setup.c b/arch/ppc64/kernel/maple_setup.c
index 2298767..a107ed6 100644
--- a/arch/ppc64/kernel/maple_setup.c
+++ b/arch/ppc64/kernel/maple_setup.c
@@ -70,7 +70,7 @@
extern int maple_set_rtc_time(struct rtc_time *tm);
extern void maple_get_rtc_time(struct rtc_time *tm);
-extern void maple_get_boot_time(struct rtc_time *tm);
+extern unsigned long maple_get_boot_time(void);
extern void maple_calibrate_decr(void);
extern void maple_pci_init(void);
extern void maple_pcibios_fixup(void);
diff --git a/arch/ppc64/kernel/maple_time.c b/arch/ppc64/kernel/maple_time.c
index d65210a..cf51863 100644
--- a/arch/ppc64/kernel/maple_time.c
+++ b/arch/ppc64/kernel/maple_time.c
@@ -156,8 +156,9 @@ int maple_set_rtc_time(struct rtc_time *tm)
return 0;
}
-void __init maple_get_boot_time(struct rtc_time *tm)
+unsigned long __init maple_get_boot_time(void)
{
+ struct rtc_time tm;
struct device_node *rtcs;
rtcs = find_compatible_devices("rtc", "pnpPNP,b00");
@@ -170,6 +171,8 @@ void __init maple_get_boot_time(struct rtc_time *tm)
"legacy address (0x%x)\n", maple_rtc_addr);
}
- maple_get_rtc_time(tm);
+ maple_get_rtc_time(&tm);
+ return mktime(time->tm_year+1900, time->tm_mon+1, time->tm_mday,
+ time->tm_hour, time->tm_min, time->tm_sec);
}
diff --git a/arch/ppc64/kernel/pmac.h b/arch/ppc64/kernel/pmac.h
index 40e1c50..fa59f2a 100644
--- a/arch/ppc64/kernel/pmac.h
+++ b/arch/ppc64/kernel/pmac.h
@@ -9,7 +9,7 @@
* pmac_* files. Mostly for use by pmac_setup
*/
-extern void pmac_get_boot_time(struct rtc_time *tm);
+extern unsigned long pmac_get_boot_time(void);
extern void pmac_get_rtc_time(struct rtc_time *tm);
extern int pmac_set_rtc_time(struct rtc_time *tm);
extern void pmac_read_rtc_time(void);
diff --git a/arch/ppc64/kernel/pmac_nvram.c b/arch/ppc64/kernel/pmac_nvram.c
index 11586d5..5fe9785 100644
--- a/arch/ppc64/kernel/pmac_nvram.c
+++ b/arch/ppc64/kernel/pmac_nvram.c
@@ -341,7 +341,7 @@ static int amd_write_bank(int bank, u8* datas)
}
-static int core99_nvram_sync(void)
+static void core99_nvram_sync(void)
{
struct core99_header* hdr99;
unsigned long flags;
@@ -369,8 +369,6 @@ static int core99_nvram_sync(void)
printk("nvram: Error writing bank %d\n", core99_bank);
bail:
spin_unlock_irqrestore(&nv_lock, flags);
-
- return 0;
}
int __init pmac_nvram_init(void)
diff --git a/arch/ppc64/kernel/pmac_time.c b/arch/ppc64/kernel/pmac_time.c
index 9d8c97d..c89bfef 100644
--- a/arch/ppc64/kernel/pmac_time.c
+++ b/arch/ppc64/kernel/pmac_time.c
@@ -21,6 +21,7 @@
#include <linux/adb.h>
#include <linux/pmu.h>
#include <linux/interrupt.h>
+#include <linux/rtc.h>
#include <asm/sections.h>
#include <asm/prom.h>
@@ -135,23 +136,13 @@ int pmac_set_rtc_time(struct rtc_time *tm)
}
}
-void __init pmac_get_boot_time(struct rtc_time *tm)
+unsigned long __init pmac_get_boot_time(void)
{
- pmac_get_rtc_time(tm);
+ struct rtc_time tm;
-#ifdef disabled__CONFIG_NVRAM
- s32 delta = 0;
- int dst;
-
- delta = ((s32)pmac_xpram_read(PMAC_XPRAM_MACHINE_LOC + 0x9)) << 16;
- delta |= ((s32)pmac_xpram_read(PMAC_XPRAM_MACHINE_LOC + 0xa)) << 8;
- delta |= pmac_xpram_read(PMAC_XPRAM_MACHINE_LOC + 0xb);
- if (delta & 0x00800000UL)
- delta |= 0xFF000000UL;
- dst = ((pmac_xpram_read(PMAC_XPRAM_MACHINE_LOC + 0x8) & 0x80) != 0);
- printk("GMT Delta read from XPRAM: %d minutes, DST: %s\n", delta/60,
- dst ? "on" : "off");
-#endif
+ pmac_get_rtc_time(&tm);
+ return mktime(tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday,
+ tm.tm_hour, tm.tm_min, tm.tm_sec);
}
/*
diff --git a/arch/ppc64/kernel/rtas-proc.c b/arch/ppc64/kernel/rtas-proc.c
index 1f3ff86..5bdd5b0 100644
--- a/arch/ppc64/kernel/rtas-proc.c
+++ b/arch/ppc64/kernel/rtas-proc.c
@@ -23,6 +23,7 @@
#include <linux/init.h>
#include <linux/seq_file.h>
#include <linux/bitops.h>
+#include <linux/rtc.h>
#include <asm/uaccess.h>
#include <asm/processor.h>
diff --git a/arch/ppc64/kernel/rtc.c b/arch/ppc64/kernel/rtc.c
index 88ae13f..79e7ed2 100644
--- a/arch/ppc64/kernel/rtc.c
+++ b/arch/ppc64/kernel/rtc.c
@@ -265,7 +265,7 @@ static int rtc_read_proc(char *page, char **start, off_t off,
#ifdef CONFIG_PPC_RTAS
#define MAX_RTC_WAIT 5000 /* 5 sec */
#define RTAS_CLOCK_BUSY (-2)
-void rtas_get_boot_time(struct rtc_time *rtc_tm)
+unsigned long rtas_get_boot_time(void)
{
int ret[8];
int error, wait_time;
@@ -285,15 +285,10 @@ void rtas_get_boot_time(struct rtc_time *rtc_tm)
if (error != 0 && printk_ratelimit()) {
printk(KERN_WARNING "error: reading the clock failed (%d)\n",
error);
- return;
+ return 0;
}
- rtc_tm->tm_sec = ret[5];
- rtc_tm->tm_min = ret[4];
- rtc_tm->tm_hour = ret[3];
- rtc_tm->tm_mday = ret[2];
- rtc_tm->tm_mon = ret[1] - 1;
- rtc_tm->tm_year = ret[0] - 1900;
+ return mktime(ret[0], ret[1], ret[2], ret[3], ret[4], ret[5]);
}
/* NOTE: get_rtc_time will get an error if executed in interrupt context