diff options
Diffstat (limited to 'arch/ppc')
-rw-r--r-- | arch/ppc/Kconfig | 4 | ||||
-rw-r--r-- | arch/ppc/kernel/ppc_htab.c | 2 | ||||
-rw-r--r-- | arch/ppc/platforms/chrp_time.c | 42 | ||||
-rw-r--r-- | arch/ppc/platforms/prep_setup.c | 2 |
4 files changed, 19 insertions, 31 deletions
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig index 54a0a9bb12dd..3a3e302b4ea2 100644 --- a/arch/ppc/Kconfig +++ b/arch/ppc/Kconfig | |||
@@ -19,6 +19,10 @@ config RWSEM_XCHGADD_ALGORITHM | |||
19 | bool | 19 | bool |
20 | default y | 20 | default y |
21 | 21 | ||
22 | config GENERIC_HWEIGHT | ||
23 | bool | ||
24 | default y | ||
25 | |||
22 | config GENERIC_CALIBRATE_DELAY | 26 | config GENERIC_CALIBRATE_DELAY |
23 | bool | 27 | bool |
24 | default y | 28 | default y |
diff --git a/arch/ppc/kernel/ppc_htab.c b/arch/ppc/kernel/ppc_htab.c index 2f5c7650274f..9b84bffdefce 100644 --- a/arch/ppc/kernel/ppc_htab.c +++ b/arch/ppc/kernel/ppc_htab.c | |||
@@ -52,7 +52,7 @@ static int ppc_htab_open(struct inode *inode, struct file *file) | |||
52 | return single_open(file, ppc_htab_show, NULL); | 52 | return single_open(file, ppc_htab_show, NULL); |
53 | } | 53 | } |
54 | 54 | ||
55 | struct file_operations ppc_htab_operations = { | 55 | const struct file_operations ppc_htab_operations = { |
56 | .open = ppc_htab_open, | 56 | .open = ppc_htab_open, |
57 | .read = seq_read, | 57 | .read = seq_read, |
58 | .llseek = seq_lseek, | 58 | .llseek = seq_lseek, |
diff --git a/arch/ppc/platforms/chrp_time.c b/arch/ppc/platforms/chrp_time.c index c8627770af13..51e06ad66168 100644 --- a/arch/ppc/platforms/chrp_time.c +++ b/arch/ppc/platforms/chrp_time.c | |||
@@ -119,44 +119,28 @@ int chrp_set_rtc_time(unsigned long nowtime) | |||
119 | unsigned long chrp_get_rtc_time(void) | 119 | unsigned long chrp_get_rtc_time(void) |
120 | { | 120 | { |
121 | unsigned int year, mon, day, hour, min, sec; | 121 | unsigned int year, mon, day, hour, min, sec; |
122 | int uip, i; | ||
123 | 122 | ||
124 | /* The Linux interpretation of the CMOS clock register contents: | 123 | do { |
125 | * When the Update-In-Progress (UIP) flag goes from 1 to 0, the | ||
126 | * RTC registers show the second which has precisely just started. | ||
127 | * Let's hope other operating systems interpret the RTC the same way. | ||
128 | */ | ||
129 | |||
130 | /* Since the UIP flag is set for about 2.2 ms and the clock | ||
131 | * is typically written with a precision of 1 jiffy, trying | ||
132 | * to obtain a precision better than a few milliseconds is | ||
133 | * an illusion. Only consistency is interesting, this also | ||
134 | * allows to use the routine for /dev/rtc without a potential | ||
135 | * 1 second kernel busy loop triggered by any reader of /dev/rtc. | ||
136 | */ | ||
137 | |||
138 | for ( i = 0; i<1000000; i++) { | ||
139 | uip = chrp_cmos_clock_read(RTC_FREQ_SELECT); | ||
140 | sec = chrp_cmos_clock_read(RTC_SECONDS); | 124 | sec = chrp_cmos_clock_read(RTC_SECONDS); |
141 | min = chrp_cmos_clock_read(RTC_MINUTES); | 125 | min = chrp_cmos_clock_read(RTC_MINUTES); |
142 | hour = chrp_cmos_clock_read(RTC_HOURS); | 126 | hour = chrp_cmos_clock_read(RTC_HOURS); |
143 | day = chrp_cmos_clock_read(RTC_DAY_OF_MONTH); | 127 | day = chrp_cmos_clock_read(RTC_DAY_OF_MONTH); |
144 | mon = chrp_cmos_clock_read(RTC_MONTH); | 128 | mon = chrp_cmos_clock_read(RTC_MONTH); |
145 | year = chrp_cmos_clock_read(RTC_YEAR); | 129 | year = chrp_cmos_clock_read(RTC_YEAR); |
146 | uip |= chrp_cmos_clock_read(RTC_FREQ_SELECT); | 130 | } while (sec != chrp_cmos_clock_read(RTC_SECONDS)); |
147 | if ((uip & RTC_UIP)==0) break; | 131 | |
132 | if (!(chrp_cmos_clock_read(RTC_CONTROL) & RTC_DM_BINARY) | ||
133 | || RTC_ALWAYS_BCD) { | ||
134 | BCD_TO_BIN(sec); | ||
135 | BCD_TO_BIN(min); | ||
136 | BCD_TO_BIN(hour); | ||
137 | BCD_TO_BIN(day); | ||
138 | BCD_TO_BIN(mon); | ||
139 | BCD_TO_BIN(year); | ||
148 | } | 140 | } |
149 | 141 | ||
150 | if (!(chrp_cmos_clock_read(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD) | 142 | year += 1900; |
151 | { | 143 | if (year < 1970) |
152 | BCD_TO_BIN(sec); | ||
153 | BCD_TO_BIN(min); | ||
154 | BCD_TO_BIN(hour); | ||
155 | BCD_TO_BIN(day); | ||
156 | BCD_TO_BIN(mon); | ||
157 | BCD_TO_BIN(year); | ||
158 | } | ||
159 | if ((year += 1900) < 1970) | ||
160 | year += 100; | 144 | year += 100; |
161 | return mktime(year, mon, day, hour, min, sec); | 145 | return mktime(year, mon, day, hour, min, sec); |
162 | } | 146 | } |
diff --git a/arch/ppc/platforms/prep_setup.c b/arch/ppc/platforms/prep_setup.c index a0fc628ffb1e..d95c05d9824d 100644 --- a/arch/ppc/platforms/prep_setup.c +++ b/arch/ppc/platforms/prep_setup.c | |||
@@ -736,7 +736,7 @@ ibm_statusled_progress(char *s, unsigned short hex) | |||
736 | hex = 0xfff; | 736 | hex = 0xfff; |
737 | if (!notifier_installed) { | 737 | if (!notifier_installed) { |
738 | ++notifier_installed; | 738 | ++notifier_installed; |
739 | notifier_chain_register(&panic_notifier_list, | 739 | atomic_notifier_chain_register(&panic_notifier_list, |
740 | &ibm_statusled_block); | 740 | &ibm_statusled_block); |
741 | } | 741 | } |
742 | } | 742 | } |