diff options
author | Arnaud Patard <apatard@mandriva.com> | 2010-06-01 18:39:54 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2010-07-05 12:17:32 -0400 |
commit | 5df74352876c0835d2b41b53858c9ee779e0f12f (patch) | |
tree | 5c6dded0090a897483a286c48b178f8df6049fbd /arch/mips | |
parent | 17c04139fd2aeaef30fda380bb91b32de7b41a8f (diff) |
MIPS: Loongson: Define rtc device on MC146818-equipped systems
This patch declare the rtc device present on systems with clock compatible
with the mc146818 and handled by rtc-cmos. Introduce a new Kconfig entry
because there are some systems without rtc_cmos compatible clock.
Signed-off-by: Arnaud Patard <apatard@mandriva.com>
To: linux-mips@linux-mips.org
Cc: aba@not.so.argh.org
Patchwork: http://patchwork.linux-mips.org/patch/1320/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/loongson/Kconfig | 6 | ||||
-rw-r--r-- | arch/mips/loongson/common/Makefile | 1 | ||||
-rw-r--r-- | arch/mips/loongson/common/rtc.c | 43 |
3 files changed, 50 insertions, 0 deletions
diff --git a/arch/mips/loongson/Kconfig b/arch/mips/loongson/Kconfig index 3df1967dea08..c97ca69b94e0 100644 --- a/arch/mips/loongson/Kconfig +++ b/arch/mips/loongson/Kconfig | |||
@@ -23,6 +23,7 @@ config LEMOTE_FULOONG2E | |||
23 | select GENERIC_HARDIRQS_NO__DO_IRQ | 23 | select GENERIC_HARDIRQS_NO__DO_IRQ |
24 | select GENERIC_ISA_DMA_SUPPORT_BROKEN | 24 | select GENERIC_ISA_DMA_SUPPORT_BROKEN |
25 | select CPU_HAS_WB | 25 | select CPU_HAS_WB |
26 | select LOONGSON_MC146818 | ||
26 | help | 27 | help |
27 | Lemote Fuloong(2e) mini-PC board based on the Chinese Loongson-2E CPU and | 28 | Lemote Fuloong(2e) mini-PC board based on the Chinese Loongson-2E CPU and |
28 | an FPGA northbridge | 29 | an FPGA northbridge |
@@ -51,6 +52,7 @@ config LEMOTE_MACH2F | |||
51 | select SYS_SUPPORTS_64BIT_KERNEL | 52 | select SYS_SUPPORTS_64BIT_KERNEL |
52 | select SYS_SUPPORTS_HIGHMEM | 53 | select SYS_SUPPORTS_HIGHMEM |
53 | select SYS_SUPPORTS_LITTLE_ENDIAN | 54 | select SYS_SUPPORTS_LITTLE_ENDIAN |
55 | select LOONGSON_MC146818 | ||
54 | help | 56 | help |
55 | Lemote Loongson 2F family machines utilize the 2F revision of | 57 | Lemote Loongson 2F family machines utilize the 2F revision of |
56 | Loongson processor and the AMD CS5536 south bridge. | 58 | Loongson processor and the AMD CS5536 south bridge. |
@@ -83,3 +85,7 @@ config LOONGSON_UART_BASE | |||
83 | bool | 85 | bool |
84 | default y | 86 | default y |
85 | depends on EARLY_PRINTK || SERIAL_8250 | 87 | depends on EARLY_PRINTK || SERIAL_8250 |
88 | |||
89 | config LOONGSON_MC146818 | ||
90 | bool | ||
91 | default n | ||
diff --git a/arch/mips/loongson/common/Makefile b/arch/mips/loongson/common/Makefile index cdd2e812ba1a..e526488df655 100644 --- a/arch/mips/loongson/common/Makefile +++ b/arch/mips/loongson/common/Makefile | |||
@@ -12,6 +12,7 @@ obj-$(CONFIG_GENERIC_GPIO) += gpio.o | |||
12 | obj-$(CONFIG_EARLY_PRINTK) += early_printk.o | 12 | obj-$(CONFIG_EARLY_PRINTK) += early_printk.o |
13 | obj-$(CONFIG_SERIAL_8250) += serial.o | 13 | obj-$(CONFIG_SERIAL_8250) += serial.o |
14 | obj-$(CONFIG_LOONGSON_UART_BASE) += uart_base.o | 14 | obj-$(CONFIG_LOONGSON_UART_BASE) += uart_base.o |
15 | obj-$(CONFIG_LOONGSON_MC146818) += rtc.o | ||
15 | 16 | ||
16 | # | 17 | # |
17 | # Enable CS5536 Virtual Support Module(VSM) to virtulize the PCI configure | 18 | # Enable CS5536 Virtual Support Module(VSM) to virtulize the PCI configure |
diff --git a/arch/mips/loongson/common/rtc.c b/arch/mips/loongson/common/rtc.c new file mode 100644 index 000000000000..a90d87c01555 --- /dev/null +++ b/arch/mips/loongson/common/rtc.c | |||
@@ -0,0 +1,43 @@ | |||
1 | /* | ||
2 | * Lemote Fuloong platform support | ||
3 | * | ||
4 | * Copyright(c) 2010 Arnaud Patard <apatard@mandriva.com> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #include <linux/init.h> | ||
13 | #include <linux/kernel.h> | ||
14 | #include <linux/platform_device.h> | ||
15 | #include <linux/mc146818rtc.h> | ||
16 | |||
17 | struct resource loongson_rtc_resources[] = { | ||
18 | { | ||
19 | .start = RTC_PORT(0), | ||
20 | .end = RTC_PORT(1), | ||
21 | .flags = IORESOURCE_IO, | ||
22 | }, { | ||
23 | .start = RTC_IRQ, | ||
24 | .end = RTC_IRQ, | ||
25 | .flags = IORESOURCE_IRQ, | ||
26 | } | ||
27 | }; | ||
28 | |||
29 | static struct platform_device loongson_rtc_device = { | ||
30 | .name = "rtc_cmos", | ||
31 | .id = -1, | ||
32 | .resource = loongson_rtc_resources, | ||
33 | .num_resources = ARRAY_SIZE(loongson_rtc_resources), | ||
34 | }; | ||
35 | |||
36 | |||
37 | static int __init loongson_rtc_platform_init(void) | ||
38 | { | ||
39 | platform_device_register(&loongson_rtc_device); | ||
40 | return 0; | ||
41 | } | ||
42 | |||
43 | device_initcall(loongson_rtc_platform_init); | ||