[PATCH 4/5] Add RTC CMOS support for the MPC8641 HPCN

Wade Farnsworth wfarnsworth at mvista.com
Wed May 16 02:36:03 EST 2007


This enables the new RTC CMOS driver to be used on the MPC8641 HPCN.

Signed-off-by: Wade Farnsworth <wfarnsworth at mvista.com>

---

 arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |   27 +++++++++++++++++++
 1 file changed, 27 insertions(+)


Index: powerpc-8641/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
===================================================================
--- powerpc-8641.orig/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ powerpc-8641/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -18,6 +18,7 @@
 #include <linux/kdev_t.h>
 #include <linux/delay.h>
 #include <linux/seq_file.h>
+#include <linux/mc146818rtc.h>
 
 #include <asm/system.h>
 #include <asm/time.h>
@@ -368,6 +369,32 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_A
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5288, quirk_uli5288);
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5229, quirk_uli5229);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AL, 0x5249, early_uli5249);
+
+#ifdef CONFIG_RTC_DRV_CMOS
+struct resource rtc_platform_resource = {
+	.flags		= IORESOURCE_IO,
+	.start		= RTC_PORT(0),
+	.end		= RTC_PORT(1),
+};
+
+static int  __init mpc8641_hpcn_add_rtc(void)
+{
+	struct platform_device *pd;
+
+	pd = platform_device_register_simple("rtc_cmos", -1,
+					     &rtc_platform_resource, 1);
+	if (IS_ERR(pd))
+		return PTR_ERR(pd);
+
+	/* rtc-cmos only supports 24-hr mode */
+	CMOS_WRITE(CMOS_READ(RTC_CONTROL) | RTC_24H, RTC_CONTROL);
+
+	return 0;
+}
+arch_initcall(mpc8641_hpcn_add_rtc);
+
+#endif /* CONFIG_RTC_DRV_CMOS */
+
 #endif /* CONFIG_PCI */
 
 





More information about the Linuxppc-dev mailing list