aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-06-09 15:52:05 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-06-09 15:52:05 -0400
commit5ebe5500fb808c9079ec81a7841482c72d30de56 (patch)
tree5f8cd4d2a983348bf3633edff456f716f970d6f9 /arch
parent29cf519ee086686e5f0fc91cbb2d601dd1190f9c (diff)
parent62b62c5c29468412cadd39dfb1113d3f0a323cfe (diff)
Merge branch 'unicore32' of git://git.kernel.org/pub/scm/linux/kernel/git/epip/linux-2.6-unicore32
* 'unicore32' of git://git.kernel.org/pub/scm/linux/kernel/git/epip/linux-2.6-unicore32: unicore32: using generic-y format for one line asm-generic files unicore32: change PERCPU to PERCPU_SECTION unicore32: add KBUILD_DEFCONFIG with unicore32_defconfig (old debug_defconfig) unicore32: change zImage physical address, though it's PIC codes unicore32: move rtc-puv3.c to drivers/rtc directory
Diffstat (limited to 'arch')
-rw-r--r--arch/unicore32/Kconfig4
-rw-r--r--arch/unicore32/Makefile38
-rw-r--r--arch/unicore32/boot/compressed/Makefile2
-rw-r--r--arch/unicore32/configs/unicore32_defconfig (renamed from arch/unicore32/configs/debug_defconfig)8
-rw-r--r--arch/unicore32/include/asm/Kbuild59
-rw-r--r--arch/unicore32/kernel/Makefile1
-rw-r--r--arch/unicore32/kernel/rtc.c371
-rw-r--r--arch/unicore32/kernel/vmlinux.lds.S2
8 files changed, 67 insertions, 418 deletions
diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig
index d3a303246c9f..e57dcce9bfda 100644
--- a/arch/unicore32/Kconfig
+++ b/arch/unicore32/Kconfig
@@ -231,10 +231,6 @@ config PUV3_PWM
231 help 231 help
232 Enable support for NB0916 PWM controllers 232 Enable support for NB0916 PWM controllers
233 233
234config PUV3_RTC
235 tristate "PKUnity v3 RTC Support"
236 depends on !ARCH_FPGA
237
238if PUV3_NB0916 234if PUV3_NB0916
239 235
240menu "PKUnity NetBook-0916 Features" 236menu "PKUnity NetBook-0916 Features"
diff --git a/arch/unicore32/Makefile b/arch/unicore32/Makefile
index 76a8beec7d03..6af4bc415f2b 100644
--- a/arch/unicore32/Makefile
+++ b/arch/unicore32/Makefile
@@ -40,42 +40,10 @@ core-y += arch/unicore32/mm/
40 40
41libs-y += arch/unicore32/lib/ 41libs-y += arch/unicore32/lib/
42 42
43ASM_GENERATED_DIR := $(srctree)/arch/unicore32/include/generated
44LINUXINCLUDE += -I$(ASM_GENERATED_DIR)
45
46ASM_GENERIC_HEADERS := atomic.h auxvec.h
47ASM_GENERIC_HEADERS += bitsperlong.h bug.h bugs.h
48ASM_GENERIC_HEADERS += cputime.h current.h
49ASM_GENERIC_HEADERS += device.h div64.h
50ASM_GENERIC_HEADERS += emergency-restart.h errno.h
51ASM_GENERIC_HEADERS += fb.h fcntl.h ftrace.h futex.h
52ASM_GENERIC_HEADERS += hardirq.h hw_irq.h
53ASM_GENERIC_HEADERS += ioctl.h ioctls.h ipcbuf.h irq_regs.h
54ASM_GENERIC_HEADERS += kdebug.h kmap_types.h
55ASM_GENERIC_HEADERS += local.h
56ASM_GENERIC_HEADERS += mman.h module.h msgbuf.h
57ASM_GENERIC_HEADERS += param.h parport.h percpu.h poll.h posix_types.h
58ASM_GENERIC_HEADERS += resource.h
59ASM_GENERIC_HEADERS += scatterlist.h sections.h segment.h sembuf.h serial.h
60ASM_GENERIC_HEADERS += setup.h shmbuf.h shmparam.h
61ASM_GENERIC_HEADERS += siginfo.h signal.h sizes.h
62ASM_GENERIC_HEADERS += socket.h sockios.h stat.h statfs.h swab.h syscalls.h
63ASM_GENERIC_HEADERS += termbits.h termios.h topology.h types.h
64ASM_GENERIC_HEADERS += ucontext.h unaligned.h user.h
65ASM_GENERIC_HEADERS += vga.h
66ASM_GENERIC_HEADERS += xor.h
67
68archprepare:
69ifneq ($(ASM_GENERATED_DIR), $(wildcard $(ASM_GENERATED_DIR)))
70 $(Q)mkdir -p $(ASM_GENERATED_DIR)/asm
71 $(Q)$(foreach a, $(ASM_GENERIC_HEADERS), \
72 echo '#include <asm-generic/$a>' \
73 > $(ASM_GENERATED_DIR)/asm/$a; )
74endif
75
76boot := arch/unicore32/boot 43boot := arch/unicore32/boot
77 44
78# Default target when executing plain make 45# Default defconfig and target when executing plain make
46KBUILD_DEFCONFIG := $(ARCH)_defconfig
79KBUILD_IMAGE := zImage 47KBUILD_IMAGE := zImage
80 48
81all: $(KBUILD_IMAGE) 49all: $(KBUILD_IMAGE)
@@ -83,8 +51,6 @@ all: $(KBUILD_IMAGE)
83zImage Image uImage: vmlinux 51zImage Image uImage: vmlinux
84 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ 52 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
85 53
86MRPROPER_DIRS += $(ASM_GENERATED_DIR)
87
88archclean: 54archclean:
89 $(Q)$(MAKE) $(clean)=$(boot) 55 $(Q)$(MAKE) $(clean)=$(boot)
90 56
diff --git a/arch/unicore32/boot/compressed/Makefile b/arch/unicore32/boot/compressed/Makefile
index 95373428cb3d..b0954a2d23cf 100644
--- a/arch/unicore32/boot/compressed/Makefile
+++ b/arch/unicore32/boot/compressed/Makefile
@@ -59,7 +59,7 @@ $(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/head.o $(obj)/piggy.o \
59# We now have a PIC decompressor implementation. Decompressors running 59# We now have a PIC decompressor implementation. Decompressors running
60# from RAM should not define ZTEXTADDR. Decompressors running directly 60# from RAM should not define ZTEXTADDR. Decompressors running directly
61# from ROM or Flash must define ZTEXTADDR (preferably via the config) 61# from ROM or Flash must define ZTEXTADDR (preferably via the config)
62ZTEXTADDR := 0 62ZTEXTADDR := 0x03000000
63ZBSSADDR := ALIGN(4) 63ZBSSADDR := ALIGN(4)
64 64
65SEDFLAGS_lds = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/ 65SEDFLAGS_lds = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/
diff --git a/arch/unicore32/configs/debug_defconfig b/arch/unicore32/configs/unicore32_defconfig
index b5fbde9f1cb2..c9dd3198b6f7 100644
--- a/arch/unicore32/configs/debug_defconfig
+++ b/arch/unicore32/configs/unicore32_defconfig
@@ -1,6 +1,6 @@
1### General setup 1### General setup
2CONFIG_EXPERIMENTAL=y 2CONFIG_EXPERIMENTAL=y
3CONFIG_LOCALVERSION="-debug" 3CONFIG_LOCALVERSION="-unicore32"
4CONFIG_SWAP=y 4CONFIG_SWAP=y
5CONFIG_SYSVIPC=y 5CONFIG_SYSVIPC=y
6CONFIG_POSIX_MQUEUE=y 6CONFIG_POSIX_MQUEUE=y
@@ -64,7 +64,6 @@ CONFIG_I2C_BATTERY_BQ27200=n
64CONFIG_I2C_EEPROM_AT24=n 64CONFIG_I2C_EEPROM_AT24=n
65CONFIG_LCD_BACKLIGHT=n 65CONFIG_LCD_BACKLIGHT=n
66 66
67CONFIG_PUV3_RTC=y
68CONFIG_PUV3_UMAL=y 67CONFIG_PUV3_UMAL=y
69CONFIG_PUV3_MUSB=n 68CONFIG_PUV3_MUSB=n
70CONFIG_PUV3_AC97=n 69CONFIG_PUV3_AC97=n
@@ -167,8 +166,9 @@ CONFIG_LEDS_TRIGGER_IDE_DISK=y
167CONFIG_LEDS_TRIGGER_HEARTBEAT=y 166CONFIG_LEDS_TRIGGER_HEARTBEAT=y
168 167
169# Real Time Clock 168# Real Time Clock
170CONFIG_RTC_LIB=m 169CONFIG_RTC_LIB=y
171CONFIG_RTC_CLASS=m 170CONFIG_RTC_CLASS=y
171CONFIG_RTC_DRV_PUV3=y
172 172
173### File systems 173### File systems
174CONFIG_EXT2_FS=m 174CONFIG_EXT2_FS=m
diff --git a/arch/unicore32/include/asm/Kbuild b/arch/unicore32/include/asm/Kbuild
index b200fdaca44d..ca113d6999c5 100644
--- a/arch/unicore32/include/asm/Kbuild
+++ b/arch/unicore32/include/asm/Kbuild
@@ -1,2 +1,61 @@
1include include/asm-generic/Kbuild.asm 1include include/asm-generic/Kbuild.asm
2 2
3generic-y += atomic.h
4generic-y += auxvec.h
5generic-y += bitsperlong.h
6generic-y += bug.h
7generic-y += bugs.h
8generic-y += cputime.h
9generic-y += current.h
10generic-y += device.h
11generic-y += div64.h
12generic-y += emergency-restart.h
13generic-y += errno.h
14generic-y += fb.h
15generic-y += fcntl.h
16generic-y += ftrace.h
17generic-y += futex.h
18generic-y += hardirq.h
19generic-y += hw_irq.h
20generic-y += ioctl.h
21generic-y += ioctls.h
22generic-y += ipcbuf.h
23generic-y += irq_regs.h
24generic-y += kdebug.h
25generic-y += kmap_types.h
26generic-y += local.h
27generic-y += mman.h
28generic-y += module.h
29generic-y += msgbuf.h
30generic-y += param.h
31generic-y += parport.h
32generic-y += percpu.h
33generic-y += poll.h
34generic-y += posix_types.h
35generic-y += resource.h
36generic-y += scatterlist.h
37generic-y += sections.h
38generic-y += segment.h
39generic-y += sembuf.h
40generic-y += serial.h
41generic-y += setup.h
42generic-y += shmbuf.h
43generic-y += shmparam.h
44generic-y += siginfo.h
45generic-y += signal.h
46generic-y += sizes.h
47generic-y += socket.h
48generic-y += sockios.h
49generic-y += stat.h
50generic-y += statfs.h
51generic-y += swab.h
52generic-y += syscalls.h
53generic-y += termbits.h
54generic-y += termios.h
55generic-y += topology.h
56generic-y += types.h
57generic-y += ucontext.h
58generic-y += unaligned.h
59generic-y += user.h
60generic-y += vga.h
61generic-y += xor.h
diff --git a/arch/unicore32/kernel/Makefile b/arch/unicore32/kernel/Makefile
index ec23a2fb2f50..aeb0f181568e 100644
--- a/arch/unicore32/kernel/Makefile
+++ b/arch/unicore32/kernel/Makefile
@@ -16,7 +16,6 @@ obj-$(CONFIG_UNICORE_FPU_F64) += fpu-ucf64.o
16obj-$(CONFIG_ARCH_PUV3) += clock.o irq.o time.o 16obj-$(CONFIG_ARCH_PUV3) += clock.o irq.o time.o
17 17
18obj-$(CONFIG_PUV3_GPIO) += gpio.o 18obj-$(CONFIG_PUV3_GPIO) += gpio.o
19obj-$(CONFIG_PUV3_RTC) += rtc.o
20obj-$(CONFIG_PUV3_PWM) += pwm.o 19obj-$(CONFIG_PUV3_PWM) += pwm.o
21obj-$(CONFIG_PUV3_PM) += pm.o sleep.o 20obj-$(CONFIG_PUV3_PM) += pm.o sleep.o
22obj-$(CONFIG_HIBERNATION) += hibernate.o hibernate_asm.o 21obj-$(CONFIG_HIBERNATION) += hibernate.o hibernate_asm.o
diff --git a/arch/unicore32/kernel/rtc.c b/arch/unicore32/kernel/rtc.c
deleted file mode 100644
index 8cad70b3302c..000000000000
--- a/arch/unicore32/kernel/rtc.c
+++ /dev/null
@@ -1,371 +0,0 @@
1/*
2 * linux/arch/unicore32/kernel/rtc.c
3 *
4 * Code specific to PKUnity SoC and UniCore ISA
5 *
6 * Maintained by GUAN Xue-tao <gxt@mprc.pku.edu.cn>
7 * Copyright (C) 2001-2010 Guan Xuetao
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#include <linux/module.h>
15#include <linux/fs.h>
16#include <linux/string.h>
17#include <linux/init.h>
18#include <linux/platform_device.h>
19#include <linux/interrupt.h>
20#include <linux/rtc.h>
21#include <linux/bcd.h>
22#include <linux/clk.h>
23#include <linux/log2.h>
24#include <linux/slab.h>
25#include <linux/uaccess.h>
26#include <linux/io.h>
27
28#include <asm/irq.h>
29#include <mach/hardware.h>
30
31static struct resource *puv3_rtc_mem;
32
33static int puv3_rtc_alarmno = IRQ_RTCAlarm;
34static int puv3_rtc_tickno = IRQ_RTC;
35
36static DEFINE_SPINLOCK(puv3_rtc_pie_lock);
37
38/* IRQ Handlers */
39
40static irqreturn_t puv3_rtc_alarmirq(int irq, void *id)
41{
42 struct rtc_device *rdev = id;
43
44 writel(readl(RTC_RTSR) | RTC_RTSR_AL, RTC_RTSR);
45 rtc_update_irq(rdev, 1, RTC_AF | RTC_IRQF);
46 return IRQ_HANDLED;
47}
48
49static irqreturn_t puv3_rtc_tickirq(int irq, void *id)
50{
51 struct rtc_device *rdev = id;
52
53 writel(readl(RTC_RTSR) | RTC_RTSR_HZ, RTC_RTSR);
54 rtc_update_irq(rdev, 1, RTC_PF | RTC_IRQF);
55 return IRQ_HANDLED;
56}
57
58/* Update control registers */
59static void puv3_rtc_setaie(int to)
60{
61 unsigned int tmp;
62
63 pr_debug("%s: aie=%d\n", __func__, to);
64
65 tmp = readl(RTC_RTSR) & ~RTC_RTSR_ALE;
66
67 if (to)
68 tmp |= RTC_RTSR_ALE;
69
70 writel(tmp, RTC_RTSR);
71}
72
73static int puv3_rtc_setpie(struct device *dev, int enabled)
74{
75 unsigned int tmp;
76
77 pr_debug("%s: pie=%d\n", __func__, enabled);
78
79 spin_lock_irq(&puv3_rtc_pie_lock);
80 tmp = readl(RTC_RTSR) & ~RTC_RTSR_HZE;
81
82 if (enabled)
83 tmp |= RTC_RTSR_HZE;
84
85 writel(tmp, RTC_RTSR);
86 spin_unlock_irq(&puv3_rtc_pie_lock);
87
88 return 0;
89}
90
91/* Time read/write */
92
93static int puv3_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm)
94{
95 rtc_time_to_tm(readl(RTC_RCNR), rtc_tm);
96
97 pr_debug("read time %02x.%02x.%02x %02x/%02x/%02x\n",
98 rtc_tm->tm_year, rtc_tm->tm_mon, rtc_tm->tm_mday,
99 rtc_tm->tm_hour, rtc_tm->tm_min, rtc_tm->tm_sec);
100
101 return 0;
102}
103
104static int puv3_rtc_settime(struct device *dev, struct rtc_time *tm)
105{
106 unsigned long rtc_count = 0;
107
108 pr_debug("set time %02d.%02d.%02d %02d/%02d/%02d\n",
109 tm->tm_year, tm->tm_mon, tm->tm_mday,
110 tm->tm_hour, tm->tm_min, tm->tm_sec);
111
112 rtc_tm_to_time(tm, &rtc_count);
113 writel(rtc_count, RTC_RCNR);
114
115 return 0;
116}
117
118static int puv3_rtc_getalarm(struct device *dev, struct rtc_wkalrm *alrm)
119{
120 struct rtc_time *alm_tm = &alrm->time;
121
122 rtc_time_to_tm(readl(RTC_RTAR), alm_tm);
123
124 alrm->enabled = readl(RTC_RTSR) & RTC_RTSR_ALE;
125
126 pr_debug("read alarm %02x %02x.%02x.%02x %02x/%02x/%02x\n",
127 alrm->enabled,
128 alm_tm->tm_year, alm_tm->tm_mon, alm_tm->tm_mday,
129 alm_tm->tm_hour, alm_tm->tm_min, alm_tm->tm_sec);
130
131 return 0;
132}
133
134static int puv3_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm)
135{
136 struct rtc_time *tm = &alrm->time;
137 unsigned long rtcalarm_count = 0;
138
139 pr_debug("puv3_rtc_setalarm: %d, %02x/%02x/%02x %02x.%02x.%02x\n",
140 alrm->enabled,
141 tm->tm_mday & 0xff, tm->tm_mon & 0xff, tm->tm_year & 0xff,
142 tm->tm_hour & 0xff, tm->tm_min & 0xff, tm->tm_sec);
143
144 rtc_tm_to_time(tm, &rtcalarm_count);
145 writel(rtcalarm_count, RTC_RTAR);
146
147 puv3_rtc_setaie(alrm->enabled);
148
149 if (alrm->enabled)
150 enable_irq_wake(puv3_rtc_alarmno);
151 else
152 disable_irq_wake(puv3_rtc_alarmno);
153
154 return 0;
155}
156
157static int puv3_rtc_proc(struct device *dev, struct seq_file *seq)
158{
159 seq_printf(seq, "periodic_IRQ\t: %s\n",
160 (readl(RTC_RTSR) & RTC_RTSR_HZE) ? "yes" : "no");
161 return 0;
162}
163
164static int puv3_rtc_open(struct device *dev)
165{
166 struct platform_device *pdev = to_platform_device(dev);
167 struct rtc_device *rtc_dev = platform_get_drvdata(pdev);
168 int ret;
169
170 ret = request_irq(puv3_rtc_alarmno, puv3_rtc_alarmirq,
171 IRQF_DISABLED, "pkunity-rtc alarm", rtc_dev);
172
173 if (ret) {
174 dev_err(dev, "IRQ%d error %d\n", puv3_rtc_alarmno, ret);
175 return ret;
176 }
177
178 ret = request_irq(puv3_rtc_tickno, puv3_rtc_tickirq,
179 IRQF_DISABLED, "pkunity-rtc tick", rtc_dev);
180
181 if (ret) {
182 dev_err(dev, "IRQ%d error %d\n", puv3_rtc_tickno, ret);
183 goto tick_err;
184 }
185
186 return ret;
187
188 tick_err:
189 free_irq(puv3_rtc_alarmno, rtc_dev);
190 return ret;
191}
192
193static void puv3_rtc_release(struct device *dev)
194{
195 struct platform_device *pdev = to_platform_device(dev);
196 struct rtc_device *rtc_dev = platform_get_drvdata(pdev);
197
198 /* do not clear AIE here, it may be needed for wake */
199
200 puv3_rtc_setpie(dev, 0);
201 free_irq(puv3_rtc_alarmno, rtc_dev);
202 free_irq(puv3_rtc_tickno, rtc_dev);
203}
204
205static const struct rtc_class_ops puv3_rtcops = {
206 .open = puv3_rtc_open,
207 .release = puv3_rtc_release,
208 .read_time = puv3_rtc_gettime,
209 .set_time = puv3_rtc_settime,
210 .read_alarm = puv3_rtc_getalarm,
211 .set_alarm = puv3_rtc_setalarm,
212 .proc = puv3_rtc_proc,
213};
214
215static void puv3_rtc_enable(struct platform_device *pdev, int en)
216{
217 if (!en) {
218 writel(readl(RTC_RTSR) & ~RTC_RTSR_HZE, RTC_RTSR);
219 } else {
220 /* re-enable the device, and check it is ok */
221
222 if ((readl(RTC_RTSR) & RTC_RTSR_HZE) == 0) {
223 dev_info(&pdev->dev, "rtc disabled, re-enabling\n");
224 writel(readl(RTC_RTSR) | RTC_RTSR_HZE, RTC_RTSR);
225 }
226 }
227}
228
229static int puv3_rtc_remove(struct platform_device *dev)
230{
231 struct rtc_device *rtc = platform_get_drvdata(dev);
232
233 platform_set_drvdata(dev, NULL);
234 rtc_device_unregister(rtc);
235
236 puv3_rtc_setpie(&dev->dev, 0);
237 puv3_rtc_setaie(0);
238
239 release_resource(puv3_rtc_mem);
240 kfree(puv3_rtc_mem);
241
242 return 0;
243}
244
245static int puv3_rtc_probe(struct platform_device *pdev)
246{
247 struct rtc_device *rtc;
248 struct resource *res;
249 int ret;
250
251 pr_debug("%s: probe=%p\n", __func__, pdev);
252
253 /* find the IRQs */
254
255 puv3_rtc_tickno = platform_get_irq(pdev, 1);
256 if (puv3_rtc_tickno < 0) {
257 dev_err(&pdev->dev, "no irq for rtc tick\n");
258 return -ENOENT;
259 }
260
261 puv3_rtc_alarmno = platform_get_irq(pdev, 0);
262 if (puv3_rtc_alarmno < 0) {
263 dev_err(&pdev->dev, "no irq for alarm\n");
264 return -ENOENT;
265 }
266
267 pr_debug("PKUnity_rtc: tick irq %d, alarm irq %d\n",
268 puv3_rtc_tickno, puv3_rtc_alarmno);
269
270 /* get the memory region */
271
272 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
273 if (res == NULL) {
274 dev_err(&pdev->dev, "failed to get memory region resource\n");
275 return -ENOENT;
276 }
277
278 puv3_rtc_mem = request_mem_region(res->start,
279 res->end-res->start+1,
280 pdev->name);
281
282 if (puv3_rtc_mem == NULL) {
283 dev_err(&pdev->dev, "failed to reserve memory region\n");
284 ret = -ENOENT;
285 goto err_nores;
286 }
287
288 puv3_rtc_enable(pdev, 1);
289
290 /* register RTC and exit */
291
292 rtc = rtc_device_register("pkunity", &pdev->dev, &puv3_rtcops,
293 THIS_MODULE);
294
295 if (IS_ERR(rtc)) {
296 dev_err(&pdev->dev, "cannot attach rtc\n");
297 ret = PTR_ERR(rtc);
298 goto err_nortc;
299 }
300
301 /* platform setup code should have handled this; sigh */
302 if (!device_can_wakeup(&pdev->dev))
303 device_init_wakeup(&pdev->dev, 1);
304
305 platform_set_drvdata(pdev, rtc);
306 return 0;
307
308 err_nortc:
309 puv3_rtc_enable(pdev, 0);
310 release_resource(puv3_rtc_mem);
311
312 err_nores:
313 return ret;
314}
315
316#ifdef CONFIG_PM
317
318/* RTC Power management control */
319
320static int ticnt_save;
321
322static int puv3_rtc_suspend(struct platform_device *pdev, pm_message_t state)
323{
324 /* save RTAR for anyone using periodic interrupts */
325 ticnt_save = readl(RTC_RTAR);
326 puv3_rtc_enable(pdev, 0);
327 return 0;
328}
329
330static int puv3_rtc_resume(struct platform_device *pdev)
331{
332 puv3_rtc_enable(pdev, 1);
333 writel(ticnt_save, RTC_RTAR);
334 return 0;
335}
336#else
337#define puv3_rtc_suspend NULL
338#define puv3_rtc_resume NULL
339#endif
340
341static struct platform_driver puv3_rtcdrv = {
342 .probe = puv3_rtc_probe,
343 .remove = __devexit_p(puv3_rtc_remove),
344 .suspend = puv3_rtc_suspend,
345 .resume = puv3_rtc_resume,
346 .driver = {
347 .name = "PKUnity-v3-RTC",
348 .owner = THIS_MODULE,
349 }
350};
351
352static char __initdata banner[] = "PKUnity-v3 RTC, (c) 2009 PKUnity Co.\n";
353
354static int __init puv3_rtc_init(void)
355{
356 printk(banner);
357 return platform_driver_register(&puv3_rtcdrv);
358}
359
360static void __exit puv3_rtc_exit(void)
361{
362 platform_driver_unregister(&puv3_rtcdrv);
363}
364
365module_init(puv3_rtc_init);
366module_exit(puv3_rtc_exit);
367
368MODULE_DESCRIPTION("RTC Driver for the PKUnity v3 chip");
369MODULE_AUTHOR("Hu Dongliang");
370MODULE_LICENSE("GPL v2");
371
diff --git a/arch/unicore32/kernel/vmlinux.lds.S b/arch/unicore32/kernel/vmlinux.lds.S
index 9bf7f7af52c5..77e407e49a63 100644
--- a/arch/unicore32/kernel/vmlinux.lds.S
+++ b/arch/unicore32/kernel/vmlinux.lds.S
@@ -30,7 +30,7 @@ SECTIONS
30 HEAD_TEXT_SECTION 30 HEAD_TEXT_SECTION
31 INIT_TEXT_SECTION(PAGE_SIZE) 31 INIT_TEXT_SECTION(PAGE_SIZE)
32 INIT_DATA_SECTION(16) 32 INIT_DATA_SECTION(16)
33 PERCPU(L1_CACHE_BYTES, PAGE_SIZE) 33 PERCPU_SECTION(L1_CACHE_BYTES)
34 __init_end = .; 34 __init_end = .;
35 35
36 _stext = .; 36 _stext = .;