[RFC/Patch] ppc4xx_pm.c

5 messages, 2 authors, 2002-07-27 · open the first message on its own page

[RFC/Patch] ppc4xx_pm.c

From: akuster <hidden>
Date: 2002-07-23 22:30:27

I am in the process of fixing the init of the pm for 4xx in ppc4xx_pm.c
so that it can be used and I and others have discussed having the
drivers enable/disable their own power managment bits at init & exit times.

So what I would like to do is have each core header define a default set
of what is required to be powered on and then have each driver enable
them selves.  These changes would be done in two stages

1) fix ppc4xx_pm.c init and have the default pm bitmap set to all ocp
drivers on.

2) update ocp drivers to enable/disable their pm settings and remove
their enable bits from the default bitmap in the core headers.

armin


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

Re: [RFC/Patch] ppc4xx_pm.c

From: akuster <hidden>
Date: 2002-07-25 23:55:16

akuster wrote:
I am in the process of fixing the init of the pm for 4xx in ppc4xx_pm.c
so that it can be used and I and others have discussed having the
drivers enable/disable their own power managment bits at init & exit times.

So what I would like to do is have each core header define a default set
of what is required to be powered on and then have each driver enable
them selves.  These changes would be done in two stages

1) fix ppc4xx_pm.c init and have the default pm bitmap set to all ocp
drivers on.
These patches are the changes to the core header files and for ppc4xx_pm.c.

  Please _note_ that if you enable the Power Managment in the config
that most kernels might hang if you use an ocp device since the drivers
are not updated yet. :)

If no one has an objection, then I will get it submitted

armin


Re: [RFC/Patch] ppc4xx_pm.c

From: akuster <hidden>
Date: 2002-07-26 23:35:16

akuster wrote:
I am in the process of fixing the init of the pm for 4xx in ppc4xx_pm.c
so that it can be used and I and others have discussed having the
drivers enable/disable their own power managment bits at init & exit times.
2) update ocp drivers to enable/disable their pm settings and remove
their enable bits from the default bitmap in the core headers.
Here are the ocp driver changes to help support enabling/disabling the
device clock.  currently these wount work on the 440 until a soon to
follow on 440 patch is checked in

armin

Re: [RFC/Patch] ppc4xx_pm.c

From: Todd Poynor <hidden>
Date: 2002-07-27 00:04:24

 > +++ b/drivers/net/ibm_ocp/ibm_ocp_enet.c
 >
quoted hunk
 	for (curr_emac = 0; curr_emac < emac_max; curr_emac++) {
+		if(ocp_get_pm(EMAC, curr_emac)){
+			mtdcr(DCRN_CPMFR,
+			      mfdcr(DCRN_CPMFR) & ~IBM_CPM_EMAC(ocp_get_pm(EMAC, curr_emac)));
+		}
 		ocp_enet_probe(curr_emac);
 	}
@@ -1193,6 +1199,17 @@
 static void __exit
 exit_ppc405_enet(void)
 {
+	int i;
+	struct ocp_dev *emac_dev;
+
+	for (i = 0; i < ocp_get_max(EMAC); i++) {
+		emac_dev = ocp_get_dev(EMAC, i);
+		if(ocp_get_pm(EMAC, i)){
+			mtdcr(DCRN_CPMFR, mfdcr(DCRN_CPMFR) | IBM_CPM_EMAC(ocp_get_pm(EMAC, i)));
+			ocp_unregister(emac_dev);
+		}
+	}
+
(1) Also do CPM on/off at open/close hooks, so that closed EMACs are
powered down and powered back up when re-opened?

(2) Move ocp_unregister() call outside "if(ocp_get_pm()" test.


--
Todd


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

Re: [RFC/Patch] ppc4xx_pm.c

From: akuster <hidden>
Date: 2002-07-27 17:00:33

Todd Poynor wrote:
 > +++ b/drivers/net/ibm_ocp/ibm_ocp_enet.c
 >
quoted
     for (curr_emac = 0; curr_emac < emac_max; curr_emac++) {
+        if(ocp_get_pm(EMAC, curr_emac)){
+            mtdcr(DCRN_CPMFR,
+                  mfdcr(DCRN_CPMFR) & ~IBM_CPM_EMAC(ocp_get_pm(EMAC,
curr_emac)));
+        }
         ocp_enet_probe(curr_emac);
     }
@@ -1193,6 +1199,17 @@
 static void __exit
 exit_ppc405_enet(void)
 {
+    int i;
+    struct ocp_dev *emac_dev;
+
+    for (i = 0; i < ocp_get_max(EMAC); i++) {
+        emac_dev = ocp_get_dev(EMAC, i);
+        if(ocp_get_pm(EMAC, i)){
+            mtdcr(DCRN_CPMFR, mfdcr(DCRN_CPMFR) |
IBM_CPM_EMAC(ocp_get_pm(EMAC, i)));
+            ocp_unregister(emac_dev);
+        }
+    }
+

(1) Also do CPM on/off at open/close hooks, so that closed EMACs are
powered down and powered back up when re-opened?
This idea should be applied to all ocp drivers.  I am not sure if
forcing (CPMFR) it the best method @ open/close or requesting/enabling
power down (CPMER).  mmm... gota think about :)
(2) Move ocp_unregister() call outside "if(ocp_get_pm()" test.
Thanks

Armin


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help