linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rtc: add x86 support for rtc-efi
@ 2009-04-06 17:49 Brian Maly
  2009-04-06 19:31 ` dann frazier
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Brian Maly @ 2009-04-06 17:49 UTC (permalink / raw)
  To: linux-kernel, akpm; +Cc: dannf, ying.huang

[-- Attachment #1: Type: text/plain, Size: 581 bytes --]

This patch adds support for rtc-efi (RTC Class Driver for EFI-based 
systems) to x86.

This patch is based on dann frazier patch [add rtc platform driver for 
EFI -> http://lkml.org/lkml/2009/1/8/434], and also depends on dann's 
patch. Dann's patch was in the mm tree, though I think its been merged 
already.

This patch has been tested and works perfectly on every x86 EFI system I 
could find, though all have been EL64 systems. I would appreciate any 
testing feedback from EL32 systems from anyone that has one and can test.

Signed-off-by: Brian Maly <bmaly@redhat.com>





[-- Attachment #2: 2.6.29-add-x86-support-for-efi-rtc.patch --]
[-- Type: text/x-patch, Size: 1974 bytes --]

--- a/drivers/rtc/Kconfig	2009-03-28 04:25:33.000000000 -0400
+++ b/drivers/rtc/Kconfig	2009-03-26 12:53:59.000000000 -0400
@@ -442,7 +442,7 @@ config RTC_DRV_DS1742
 
 config RTC_DRV_EFI
 	tristate "EFI RTC"
-	depends on IA64
+	depends on IA64 || (X86 && EFI) || (X86_64 && EFI)
 	help
 	  If you say yes here you will get support for the EFI
 	  Real Time Clock.
--- a/arch/x86/kernel/time_32.c	2009-03-12 22:39:28.000000000 -0400
+++ b/arch/x86/kernel/time_32.c	2009-03-27 12:08:58.000000000 -0400
@@ -32,6 +32,7 @@
 #include <linux/interrupt.h>
 #include <linux/time.h>
 #include <linux/mca.h>
+#include <linux/platform_device.h>
 
 #include <asm/arch_hooks.h>
 #include <asm/hpet.h>
@@ -135,3 +136,24 @@ void __init time_init(void)
 	tsc_init();
 	late_time_init = choose_time_init();
 }
+
+#ifdef CONFIG_EFI
+extern int efi_enabled;
+
+static struct platform_device rtc_efi_dev = {
+	.name = "rtc-efi",
+	.id = -1,
+};
+
+static int __init rtc_init(void)
+{
+	if (efi_enabled) {
+		if (platform_device_register(&rtc_efi_dev) < 0)
+			printk(KERN_ERR "unable to register rtc device...\n");
+	}
+	/* not necessarily an error */
+	return 0;
+}
+module_init(rtc_init);
+#endif
+
--- a/arch/x86/kernel/time_64.c	2009-03-12 22:39:28.000000000 -0400
+++ b/arch/x86/kernel/time_64.c	2009-03-27 12:09:39.000000000 -0400
@@ -18,6 +18,7 @@
 #include <linux/time.h>
 #include <linux/mca.h>
 #include <linux/nmi.h>
+#include <linux/platform_device.h>
 
 #include <asm/i8253.h>
 #include <asm/hpet.h>
@@ -135,3 +136,24 @@ void __init time_init(void)
 
 	late_time_init = choose_time_init();
 }
+
+#ifdef CONFIG_EFI
+extern int efi_enabled;
+
+static struct platform_device rtc_efi_dev = {
+	.name = "rtc-efi",
+	.id = -1,
+};
+
+static int __init rtc_init(void)
+{
+	if (efi_enabled) {
+		if (platform_device_register(&rtc_efi_dev) < 0)
+			printk(KERN_ERR "unable to register rtc device...\n");
+	}
+	/* not necessarily an error */
+	return 0;
+}
+module_init(rtc_init);
+#endif
+

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2009-05-27 23:22 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-06 17:49 [PATCH] rtc: add x86 support for rtc-efi Brian Maly
2009-04-06 19:31 ` dann frazier
2009-04-06 22:26 ` H. Peter Anvin
2009-04-06 22:55   ` Brian Maly
2009-04-08 16:23     ` dann frazier
2009-04-09 23:18     ` Andrew Morton
2009-04-10 13:51       ` Ingo Molnar
2009-04-20 17:15         ` Brian Maly
2009-04-20 17:20           ` Ingo Molnar
2009-04-20 18:21             ` H. Peter Anvin
2009-05-19 20:10               ` Brian Maly
2009-05-25  5:49               ` Huang Ying
2009-05-25 16:28                 ` H. Peter Anvin
2009-05-27 23:21                   ` Ingo Molnar
2009-04-10  1:08 ` Huang Ying

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).