Skip to contentSkip to conversation

powerpc: mpc8xxx MDS board RTC fixes

PATCH Applied Kim Phillips 5 participants 7 messages Nov 8, 2007 – Nov 20, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: mpc8xxx MDS board RTC fixes

Now the rtc class ds1374 driver has been added, remove the old rtc driver hookup code, add rtc node to device trees, and turn on the new driver in the defconfigs.

---
 arch/powerpc/boot/dts/mpc832x_mds.dts      |    7 ++++
 arch/powerpc/boot/dts/mpc834x_mds.dts      |    9 +++++
 arch/powerpc/boot/dts/mpc836x_mds.dts      |    9 +++++
 arch/powerpc/configs/mpc832x_mds_defconfig |   48 +++++++++++++++++++++++++++-
 arch/powerpc/configs/mpc834x_mds_defconfig |   48 +++++++++++++++++++++++++++-
 arch/powerpc/configs/mpc836x_mds_defconfig |   48 +++++++++++++++++++++++++++-
 arch/powerpc/configs/mpc8568mds_defconfig  |   48 +++++++++++++++++++++++++++-
 arch/powerpc/platforms/83xx/mpc832x_mds.c  |   24 --------------
 arch/powerpc/platforms/83xx/mpc834x_mds.c  |   24 --------------
 arch/powerpc/platforms/83xx/mpc836x_mds.c  |   24 --------------
 10 files changed, 213 insertions(+), 76 deletions(-)
arch/powerpc/boot/dts/mpc832x_mds.dts +7 -0
index fcd333c..650a50c 100644
@@ -57,12 +57,19 @@
 		};
 
 		i2c@3000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
 			device_type = "i2c";
 			compatible = "fsl-i2c";
 			reg = <3000 100>;
 			interrupts = <e 8>;
 			interrupt-parent = < &ipic >;
 			dfsrr;
+
+			rtc@68 {
+				compatible = "dallas,ds1374";
+				reg = <68>;
+			};
 		};
 
 		serial@4500 {
arch/powerpc/boot/dts/mpc834x_mds.dts +9 -0
index e5a84ef..49363f8 100644
@@ -57,15 +57,24 @@
 		};
 
 		i2c@3000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
 			device_type = "i2c";
 			compatible = "fsl-i2c";
 			reg = <3000 100>;
 			interrupts = <e 8>;
 			interrupt-parent = < &ipic >;
 			dfsrr;
+
+			rtc@68 {
+				compatible = "dallas,ds1374";
+				reg = <68>;
+			};
 		};
 
 		i2c@3100 {
+			#address-cells = <1>;
+			#size-cells = <0>;
 			device_type = "i2c";
 			compatible = "fsl-i2c";
 			reg = <3100 100>;
arch/powerpc/boot/dts/mpc836x_mds.dts +9 -0
index fbd1573..0b2d2b5 100644
@@ -62,15 +62,24 @@
 		};
 
 		i2c@3000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
 			device_type = "i2c";
 			compatible = "fsl-i2c";
 			reg = <3000 100>;
 			interrupts = <e 8>;
 			interrupt-parent = < &ipic >;
 			dfsrr;
+
+			rtc@68 {
+				compatible = "dallas,ds1374";
+				reg = <68>;
+			};
 		};
 
 		i2c@3100 {
+			#address-cells = <1>;
+			#size-cells = <0>;
 			device_type = "i2c";
 			compatible = "fsl-i2c";
 			reg = <3100 100>;
arch/powerpc/configs/mpc832x_mds_defconfig +47 -1

54 lines not on this page · raw message

arch/powerpc/configs/mpc834x_mds_defconfig +47 -1

54 lines not on this page · raw message

arch/powerpc/configs/mpc836x_mds_defconfig +47 -1

54 lines not on this page · raw message

arch/powerpc/configs/mpc8568mds_defconfig +47 -1

54 lines not on this page · raw message

arch/powerpc/platforms/83xx/mpc832x_mds.c +0 -24
index 972fa85..66382df 100644
@@ -145,30 +145,6 @@ static void __init mpc832x_sys_init_IRQ(void)
 #endif				/* CONFIG_QUICC_ENGINE */
 }
 
-#if defined(CONFIG_I2C_MPC) && defined(CONFIG_SENSORS_DS1374)
-extern ulong ds1374_get_rtc_time(void);
-extern int ds1374_set_rtc_time(ulong);
-
-static int __init mpc832x_rtc_hookup(void)
-{
-	struct timespec tv;
-
-	if (!machine_is(mpc832x_mds))
-		return 0;
-
-	ppc_md.get_rtc_time = ds1374_get_rtc_time;
-	ppc_md.set_rtc_time = ds1374_set_rtc_time;
-
-	tv.tv_nsec = 0;
-	tv.tv_sec = (ppc_md.get_rtc_time) ();
-	do_settimeofday(&tv);
-
-	return 0;
-}
-
-late_initcall(mpc832x_rtc_hookup);
-#endif
-
 /*
  * Called very early, MMU is off, device-tree isn't unflattened
  */
arch/powerpc/platforms/83xx/mpc834x_mds.c +0 -24
index 00aed7c..a81bb3c 100644
@@ -106,30 +106,6 @@ static void __init mpc834x_mds_init_IRQ(void)
 	ipic_set_default_priority();
 }
 
-#if defined(CONFIG_I2C_MPC) && defined(CONFIG_SENSORS_DS1374)
-extern ulong ds1374_get_rtc_time(void);
-extern int ds1374_set_rtc_time(ulong);
-
-static int __init mpc834x_rtc_hookup(void)
-{
-	struct timespec tv;
-
-	if (!machine_is(mpc834x_mds))
-		return 0;
-
-	ppc_md.get_rtc_time = ds1374_get_rtc_time;
-	ppc_md.set_rtc_time = ds1374_set_rtc_time;
-
-	tv.tv_nsec = 0;
-	tv.tv_sec = (ppc_md.get_rtc_time) ();
-	do_settimeofday(&tv);
-
-	return 0;
-}
-
-late_initcall(mpc834x_rtc_hookup);
-#endif
-
 /*
  * Called very early, MMU is off, device-tree isn't unflattened
  */
arch/powerpc/platforms/83xx/mpc836x_mds.c +0 -24
index 0f3855c..8d87b9c 100644
@@ -152,30 +152,6 @@ static void __init mpc836x_mds_init_IRQ(void)
 #endif				/* CONFIG_QUICC_ENGINE */
 }
 
-#if defined(CONFIG_I2C_MPC) && defined(CONFIG_SENSORS_DS1374)
-extern ulong ds1374_get_rtc_time(void);
-extern int ds1374_set_rtc_time(ulong);
-
-static int __init mpc8360_rtc_hookup(void)
-{
-	struct timespec tv;
-
-	if (!machine_is(mpc836x_mds))
-		return 0;
-
-	ppc_md.get_rtc_time = ds1374_get_rtc_time;
-	ppc_md.set_rtc_time = ds1374_set_rtc_time;
-
-	tv.tv_nsec = 0;
-	tv.tv_sec = (ppc_md.get_rtc_time) ();
-	do_settimeofday(&tv);
-
-	return 0;
-}
-
-late_initcall(mpc8360_rtc_hookup);
-#endif
-
 /*
  * Called very early, MMU is off, device-tree isn't unflattened
  */
Signature · 1 line
1.5.2.2
#1 lore raw
Quoted 5 lines · Kim Phillips

Now the rtc class ds1374 driver has been added, remove the old rtc driver hookup code, add rtc node to device trees, and turn on the new driver in the defconfigs.

Quoted 16 lines
---
 arch/powerpc/boot/dts/mpc832x_mds.dts      |    7 ++++
 arch/powerpc/boot/dts/mpc834x_mds.dts      |    9 +++++
 arch/powerpc/boot/dts/mpc836x_mds.dts      |    9 +++++
 arch/powerpc/configs/mpc832x_mds_defconfig |   48 +++++++++++++++++ 
++++++++++-
 arch/powerpc/configs/mpc834x_mds_defconfig |   48 +++++++++++++++++ 
++++++++++-
 arch/powerpc/configs/mpc836x_mds_defconfig |   48 +++++++++++++++++ 
++++++++++-
 arch/powerpc/configs/mpc8568mds_defconfig  |   48 +++++++++++++++++ 
++++++++++-
 arch/powerpc/platforms/83xx/mpc832x_mds.c  |   24 --------------
 arch/powerpc/platforms/83xx/mpc834x_mds.c  |   24 --------------
 arch/powerpc/platforms/83xx/mpc836x_mds.c  |   24 --------------
 10 files changed, 213 insertions(+), 76 deletions(-)

should the mpc8568mds.dts be updated?

Also, what code is parsing the device tree for the rtc node?

- k

#2 lore raw
Quoted 1 line · Kumar Gala

should the mpc8568mds.dts be updated?

It already has been.

Quoted 1 line

Also, what code is parsing the device tree for the rtc node?

There's code in fsl_soc.c (which should be made more generic).

-Scott

#4 lore raw
In reply to Kumar Gala

Yes, 8568mds dts should be updated. And I tested this ds1374 driver on 8568mds board a couple of months ago, it worked fine. Code to parse device tree should be in fsl_soc.c.

Haiying

________________________________

From: [email protected] on behalf of Kumar Gala
Sent: Thu 11/8/2007 12:57 PM
To: Phillips Kim
Cc: [email protected]
Subject: Re: [PATCH] powerpc: mpc8xxx MDS board RTC fixes

Quoted 5 lines · Kim Phillips

Now the rtc class ds1374 driver has been added, remove the old rtc driver hookup code, add rtc node to device trees, and turn on the new driver in the defconfigs.

Quoted 16 lines
---
 arch/powerpc/boot/dts/mpc832x_mds.dts      |    7 ++++
 arch/powerpc/boot/dts/mpc834x_mds.dts      |    9 +++++
 arch/powerpc/boot/dts/mpc836x_mds.dts      |    9 +++++
 arch/powerpc/configs/mpc832x_mds_defconfig |   48 +++++++++++++++++
++++++++++-
 arch/powerpc/configs/mpc834x_mds_defconfig |   48 +++++++++++++++++
++++++++++-
 arch/powerpc/configs/mpc836x_mds_defconfig |   48 +++++++++++++++++
++++++++++-
 arch/powerpc/configs/mpc8568mds_defconfig  |   48 +++++++++++++++++
++++++++++-
 arch/powerpc/platforms/83xx/mpc832x_mds.c  |   24 --------------
 arch/powerpc/platforms/83xx/mpc834x_mds.c  |   24 --------------
 arch/powerpc/platforms/83xx/mpc836x_mds.c  |   24 --------------
 10 files changed, 213 insertions(+), 76 deletions(-)

should the mpc8568mds.dts be updated?

Also, what code is parsing the device tree for the rtc node?

- k

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev

#5 lore raw
In reply to Kumar Gala
Quoted 25 lines · On Thu, 8 Nov 2007 13:57:59 -0600 Kumar Gala <[email protected]> wrote:
Quoted 5 lines · Kim Phillips

Now the rtc class ds1374 driver has been added, remove the old rtc driver hookup code, add rtc node to device trees, and turn on the new driver in the defconfigs.

Quoted 16 lines
---
 arch/powerpc/boot/dts/mpc832x_mds.dts      |    7 ++++
 arch/powerpc/boot/dts/mpc834x_mds.dts      |    9 +++++
 arch/powerpc/boot/dts/mpc836x_mds.dts      |    9 +++++
 arch/powerpc/configs/mpc832x_mds_defconfig |   48 +++++++++++++++++ 
++++++++++-
 arch/powerpc/configs/mpc834x_mds_defconfig |   48 +++++++++++++++++ 
++++++++++-
 arch/powerpc/configs/mpc836x_mds_defconfig |   48 +++++++++++++++++ 
++++++++++-
 arch/powerpc/configs/mpc8568mds_defconfig  |   48 +++++++++++++++++ 
++++++++++-
 arch/powerpc/platforms/83xx/mpc832x_mds.c  |   24 --------------
 arch/powerpc/platforms/83xx/mpc834x_mds.c  |   24 --------------
 arch/powerpc/platforms/83xx/mpc836x_mds.c  |   24 --------------
 10 files changed, 213 insertions(+), 76 deletions(-)
Quoted 1 line

should the mpc8568mds.dts be updated?

it already has the rtc node.

Quoted 2 lines

Also, what code is parsing the device tree for the rtc node?

the i2c code in fsl_soc.c.

Kim

#3 lore raw
In reply to Scott Wood
Quoted 8 lines · Scott Wood
Quoted 1 line · Kumar Gala

should the mpc8568mds.dts be updated?

It already has been.

Quoted 1 line

Also, what code is parsing the device tree for the rtc node?

There's code in fsl_soc.c (which should be made more generic).

Indeed. I guess we're going to want a library function which any device tree aware i2c-bridge driver can use to instantiate the right i2c-layer data structures for all the bridge's subnodes.

Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
Applied
#6 lore raw
In reply to Kim Phillips
Quoted 5 lines · Kim Phillips

Now the rtc class ds1374 driver has been added, remove the old rtc driver hookup code, add rtc node to device trees, and turn on the new driver in the defconfigs.

Quoted 12 lines
---
 arch/powerpc/boot/dts/mpc832x_mds.dts      |    7 ++++
 arch/powerpc/boot/dts/mpc834x_mds.dts      |    9 +++++
 arch/powerpc/boot/dts/mpc836x_mds.dts      |    9 +++++
 arch/powerpc/configs/mpc832x_mds_defconfig |   48 +++++++++++++++++++++++++++-
 arch/powerpc/configs/mpc834x_mds_defconfig |   48 +++++++++++++++++++++++++++-
 arch/powerpc/configs/mpc836x_mds_defconfig |   48 +++++++++++++++++++++++++++-
 arch/powerpc/configs/mpc8568mds_defconfig  |   48 +++++++++++++++++++++++++++-
 arch/powerpc/platforms/83xx/mpc832x_mds.c  |   24 --------------
 arch/powerpc/platforms/83xx/mpc834x_mds.c  |   24 --------------
 arch/powerpc/platforms/83xx/mpc836x_mds.c  |   24 --------------
 10 files changed, 213 insertions(+), 76 deletions(-)

applied.

- k