Skip to contentSkip to conversation

RTC: rtc-cmos.c: fix warning for MIPS

PATCH In review Wu Zhangjin 4 participants 13 messages Nov 5, 2009 – Jan 26, 2010 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/3 RTC: rtc-cmos.c: fix warning for MIPS

This patch fixes the following warning with RTC_LIB on MIPS:

drivers/rtc/rtc-cmos.c:697:2: warning: #warning Assuming 128 bytes of RTC+NVRAM address space, not 64 bytes.

---
 drivers/rtc/rtc-cmos.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/rtc/rtc-cmos.c +2 -1
index f7a4701..21e48f7 100644
@@ -691,7 +691,8 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)
 	 */
 #if	defined(CONFIG_ATARI)
 	address_space = 64;
-#elif defined(__i386__) || defined(__x86_64__) || defined(__arm__) || defined(__sparc__)
+#elif defined(__i386__) || defined(__x86_64__) || defined(__arm__) \
+			|| defined(__sparc__) || defined(__mips__)
 	address_space = 128;
 #else
 #warning Assuming 128 bytes of RTC+NVRAM address space, not 64 bytes.
Signature · 1 line
1.6.2.1
#3 lore raw
Quoted 7 lines · Ralf Baechle
Quoted 5 lines · Wu Zhangjin

This patch fixes the following warning with RTC_LIB on MIPS:

drivers/rtc/rtc-cmos.c:697:2: warning: #warning Assuming 128 bytes of RTC+NVRAM address space, not 64 bytes.

Quoted 6 lines
Quoted 1 line

Ralf

Hi, Paul or Alessandro

Could you please apply this pathset?

thanks!

Regards,
Wu Zhangjin

#4 lore raw
In reply to Wu Zhangjin
Quoted 15 lines · Wu Zhangjin

This patch fixes the following warning with RTC_LIB on MIPS:

drivers/rtc/rtc-cmos.c:697:2: warning: #warning Assuming 128 bytes of RTC+NVRAM address space, not 64 bytes.

---
 drivers/rtc/rtc-cmos.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/rtc/rtc-cmos.c +0 -0
index f7a4701..21e48f7 100644

drivers/rtc/rtc-cmos.c cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq) · line 698

Quoted 9 lines
drivers/rtc/rtc-cmos.c +2 -1
@@ -691,7 +691,8 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)
 	 */
 #if	defined(CONFIG_ATARI)
 	address_space = 64;
-#elif defined(__i386__) || defined(__x86_64__) || defined(__arm__) || defined(__sparc__)
+#elif defined(__i386__) || defined(__x86_64__) || defined(__arm__) \
+			|| defined(__sparc__) || defined(__mips__)
 	address_space = 128;
 #else
 #warning Assuming 128 bytes of RTC+NVRAM address space, not 64 bytes.

Ping.

This patch is now nearly a month old and I haven't yet heared anything. This was actually meant to be 2.6.32 material.

Ralf

#5 lore raw
Quoted 4 lines · On Thu, 3 Dec 2009 15:56:04 +0000 Ralf Baechle <[email protected]> wrote:

Ping.

This patch is now nearly a month old and I haven't yet heared anything. This was actually meant to be 2.6.32 material.

I supposed MIPS things were handled by the MIPS tree. If there's urgency a submitter should specify the intended delivery path (trivial, mips, rtc, directly to Andrew) and kernel release.

Signature · 6 lines
 Best regards,

 Alessandro Zummo,
  Tower Technologies - Torino, Italy

  http://www.towertech.it
#6 lore raw
Quoted 5 lines · Alessandro Zummo
Quoted 2 lines · On Thu, 3 Dec 2009 15:56:04 +0000 Ralf Baechle <[email protected]> wrote:

Ping.

Quoted 8 lines
Quoted 2 lines

This patch is now nearly a month old and I haven't yet heared anything. This was actually meant to be 2.6.32 material.

I supposed MIPS things were handled by the MIPS tree. If there's urgency a submitter should specify the intended delivery path (trivial, mips, rtc, directly to Andrew) and kernel release.

Hi, Alessandro Zummo

Could you please review the left two(only patch 2/3 for rtc tree) for 2.6.33 in http://patchwork.linux-mips.org/bundle/ralf/rtc/ ?

[v1,2/3] RTC: rtc-cmos.c: enable RTC_DM_BINARY of RTC_LIB for fuloong2e and fuloong2f
[v1,3/3,loongson] RTC: Registration of Loongson RTC platform device

(Sorry, I can not find them in my Email client currently, so can not reply the old Email thread directly, If necessary, I will resend them, thanks!)

Best Regards,
Wu Zhangjin

#7 lore raw

PATCH 2/3 RTC: rtc-cmos.c: enable RTC_DM_BINARY of RTC_LIB for fuloong2e and fuloong2f

In reply to a message not in the archive

This patch enables the RTC_DM_BINARY support for RTC_LIB of fuloong2e and fuloong2f. without it, RTC_LIB not work on those machines.

The platform RTC device driver is coming in the next patch.

---
 drivers/rtc/rtc-cmos.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
drivers/rtc/rtc-cmos.c +2 -3
index 21e48f7..820bdad 100644
@@ -757,9 +757,8 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)
 	/* FIXME teach the alarm code how to handle binary mode;
 	 * <asm-generic/rtc.h> doesn't know 12-hour mode either.
 	 */
-	if (is_valid_irq(rtc_irq) &&
-	    (!(rtc_control & RTC_24H) || (rtc_control & (RTC_DM_BINARY)))) {
-		dev_dbg(dev, "only 24-hr BCD mode supported\n");
+	if (is_valid_irq(rtc_irq) && !(rtc_control & RTC_24H)) {
+		dev_dbg(dev, "only 24-hr supported\n");
 		retval = -ENXIO;
 		goto cleanup1;
 	}
Signature · 1 line
1.6.2.1
#8 lore raw

Re: [rtc-linux] [PATCH v1 2/3] RTC: rtc-cmos.c: enable RTC_DM_BINARY of RTC_LIB for fuloong2e and fuloong2f

drivers/rtc/rtc-cmos.c cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq) · line 761

Quoted 6 lines · On Thu, 5 Nov 2009 09:22:09 +0800 Wu Zhangjin <[email protected]> wrote:
drivers/rtc/rtc-cmos.c +2 -3
 	 */
-	if (is_valid_irq(rtc_irq) &&
-	    (!(rtc_control & RTC_24H) || (rtc_control & (RTC_DM_BINARY)))) {
-		dev_dbg(dev, "only 24-hr BCD mode supported\n");
+	if (is_valid_irq(rtc_irq) && !(rtc_control & RTC_24H)) {
+		dev_dbg(dev, "only 24-hr supported\n");

If this check was there it's probably because there are problems in some other parts of the driver. I'm not keen to add this without some feedback by the original author or porter.

Signature · 6 lines
 Best regards,

 Alessandro Zummo,
  Tower Technologies - Torino, Italy

  http://www.towertech.it
#9 lore raw

Re: [rtc-linux] [PATCH v1 2/3] RTC: rtc-cmos.c: enable RTC_DM_BINARY of RTC_LIB for fuloong2e and fuloong2f

Quoted 14 lines · Alessandro Zummo

drivers/rtc/rtc-cmos.c cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq) · line 761

Quoted 6 lines · On Thu, 5 Nov 2009 09:22:09 +0800 Wu Zhangjin <[email protected]> wrote:
drivers/rtc/rtc-cmos.c +2 -3
 	 */
-	if (is_valid_irq(rtc_irq) &&
-	    (!(rtc_control & RTC_24H) || (rtc_control & (RTC_DM_BINARY)))) {
-		dev_dbg(dev, "only 24-hr BCD mode supported\n");
+	if (is_valid_irq(rtc_irq) && !(rtc_control & RTC_24H)) {
+		dev_dbg(dev, "only 24-hr supported\n");

If this check was there it's probably because there are problems in some other parts of the driver. I'm not keen to add this without some feedback by the original author or porter.

Just found two authors or porters from the file: drivers/rtc/rtc-cmos.c

/*
* RTC class driver for "CMOS RTC": PCs, ACPI, etc
*
* Copyright (C) 1996 Paul Gortmaker (drivers/char/rtc.c)
* Copyright (C) 2006 David Brownell (convert to new framework)
[...]

and found out their names in MAINTAINERS and put them in the CC list ;)

Regards,
Wu Zhangjin

#10 lore raw

Re: [rtc-linux] [PATCH v1 2/3] RTC: rtc-cmos.c: enable RTC_DM_BINARY of RTC_LIB for fuloong2e and fuloong2f

Quoted 4 lines · Wu Zhangjin
Quoted 3 lines · Alessandro Zummo

On Thu, 5 Nov 2009 09:22:09 +0800
Wu Zhangjin <[email protected]> wrote:

Quoted 10 lines
Quoted 10 lines

drivers/rtc/rtc-cmos.c cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq) · line 761

Quoted 6 lines
drivers/rtc/rtc-cmos.c +2 -3
 	 */
-	if (is_valid_irq(rtc_irq) &&
-	    (!(rtc_control & RTC_24H) || (rtc_control & (RTC_DM_BINARY)))) {
-		dev_dbg(dev, "only 24-hr BCD mode supported\n");
+	if (is_valid_irq(rtc_irq) && !(rtc_control & RTC_24H)) {
+		dev_dbg(dev, "only 24-hr supported\n");

If this check was there it's probably because there are problems in some other parts of the driver. I'm not keen to add this without some feedback by the original author or porter.

As *already* noted in the code: <asm-generic/rtc.h> only handles BCD. And that's what's used to access most of those registers.

#11 lore raw

PATCH 3/3 RTC: Registration of Loongson RTC platform device

In reply to a message not in the archive

This patch add the RTC_LIB support for fuloong2e,fuloong2f.

To make hwclock work with it normally, please do:

kernel configuration:

Device Drivers --->
<*> Real Time Clock --->

	<*>   PC-style 'CMOS'

user-space configuration:

$ mknod /dev/rtc0 c 254 0

/dev/rtc0 is the default RTC device file.

Of course, if udevd installed, ignore the above user-space configuration.

---
 arch/mips/loongson/common/Makefile |    6 +++++
 arch/mips/loongson/common/rtc.c    |   43 ++++++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+), 0 deletions(-)
 create mode 100644 arch/mips/loongson/common/rtc.c
arch/mips/loongson/common/Makefile +6 -0
index d21d116..d1bd38c 100644
@@ -10,3 +10,9 @@ obj-y += setup.o init.o cmdline.o env.o time.o reset.o irq.o \
 #
 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
 obj-$(CONFIG_SERIAL_8250) += serial.o
+
+# Enable RTC Class support
+#
+# please enable CONFIG_RTC_DRV_CMOS
+#
+obj-$(CONFIG_RTC_DRV_CMOS) += rtc.o
arch/mips/loongson/common/rtc.c new file +43 -0

43 lines not on this page · raw message

Signature · 1 line
1.6.2.1
#12 lore raw

Re: [rtc-linux] [PATCH v1 3/3] [loongson] RTC: Registration of Loongson RTC platform device

Quoted 3 lines · On Thu, 5 Nov 2009 09:24:10 +0800 Wu Zhangjin <[email protected]> wrote:

user-space configuration:

$ mknod /dev/rtc0 c 254 0

That's not guaranteed.

Signature · 6 lines
 Best regards,

 Alessandro Zummo,
  Tower Technologies - Torino, Italy

  http://www.towertech.it
#13 lore raw

Re: [rtc-linux] [PATCH v1 3/3] [loongson] RTC: Registration of Loongson RTC platform device

Quoted 5 lines · Alessandro Zummo
Quoted 3 lines

user-space configuration:

$ mknod /dev/rtc0 c 254 0

That's not guaranteed.

Thanks, I've fixed that comment.

Ralf