linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 7/11] ibm_newemac: Skip EMACs that are marked unused by the firmware
  2007-11-30  5:40 [PATCH 0/11] ibm_newemac: Candidate patches for 2.6.25 Benjamin Herrenschmidt
@ 2007-11-30  5:40 ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2007-11-30  5:40 UTC (permalink / raw)
  To: jgarzik; +Cc: netdev, linuxppc-dev

From: Hugh Blemings <hugh@blemings.org>

Depending on how the 44x processors are wired, some EMAC cells
might not be useable (and not connected to a PHY). However, some
device-trees may choose to still expose them (since their registers
are present in the MMIO space) but with an "unused" property in them.

Signed-off-by: Hugh Blemings <hugh@blemings.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

 drivers/net/ibm_newemac/core.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: linux-work/drivers/net/ibm_newemac/core.c
===================================================================
--- linux-work.orig/drivers/net/ibm_newemac/core.c	2007-11-20 14:47:02.000000000 +1100
+++ linux-work/drivers/net/ibm_newemac/core.c	2007-11-20 14:47:05.000000000 +1100
@@ -2550,6 +2550,10 @@ static int __devinit emac_probe(struct o
 	struct device_node **blist = NULL;
 	int err, i;
 
+	/* Skip unused/unwired EMACS */
+	if (of_get_property(np, "unused", NULL))
+		return -ENODEV;
+
 	/* Find ourselves in the bootlist if we are there */
 	for (i = 0; i < EMAC_BOOT_LIST_SIZE; i++)
 		if (emac_boot_list[i] == np)

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

* [PATCH 7/11] ibm_newemac: Skip EMACs that are marked unused by the firmware
@ 2007-12-05  0:14 Benjamin Herrenschmidt
  2007-12-05  3:53 ` David Gibson
  0 siblings, 1 reply; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2007-12-05  0:14 UTC (permalink / raw)
  To: jgarzik; +Cc: netdev, linuxppc-dev

From: Hugh Blemings <hugh@blemings.org>

Depending on how the 44x processors are wired, some EMAC cells
might not be useable (and not connected to a PHY). However, some
device-trees may choose to still expose them (since their registers
are present in the MMIO space) but with an "unused" property in them.

Signed-off-by: Hugh Blemings <hugh@blemings.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

 drivers/net/ibm_newemac/core.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: linux-work/drivers/net/ibm_newemac/core.c
===================================================================
--- linux-work.orig/drivers/net/ibm_newemac/core.c	2007-11-20 14:47:02.000000000 +1100
+++ linux-work/drivers/net/ibm_newemac/core.c	2007-11-20 14:47:05.000000000 +1100
@@ -2550,6 +2550,10 @@ static int __devinit emac_probe(struct o
 	struct device_node **blist = NULL;
 	int err, i;
 
+	/* Skip unused/unwired EMACS */
+	if (of_get_property(np, "unused", NULL))
+		return -ENODEV;
+
 	/* Find ourselves in the bootlist if we are there */
 	for (i = 0; i < EMAC_BOOT_LIST_SIZE; i++)
 		if (emac_boot_list[i] == np)

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

* Re: [PATCH 7/11] ibm_newemac: Skip EMACs that are marked unused by the firmware
  2007-12-05  0:14 [PATCH 7/11] ibm_newemac: Skip EMACs that are marked unused by the firmware Benjamin Herrenschmidt
@ 2007-12-05  3:53 ` David Gibson
  2007-12-05  4:18   ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 6+ messages in thread
From: David Gibson @ 2007-12-05  3:53 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: netdev, jgarzik, linuxppc-dev

On Wed, Dec 05, 2007 at 11:14:30AM +1100, Benjamin Herrenschmidt wrote:
> From: Hugh Blemings <hugh@blemings.org>
> 
> Depending on how the 44x processors are wired, some EMAC cells
> might not be useable (and not connected to a PHY). However, some
> device-trees may choose to still expose them (since their registers
> are present in the MMIO space) but with an "unused" property in
> them.

It occurred to me the other day.  Instead of using a new "unused"
property for this, should we be using the OF standard "status"
property.

-- 
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

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

* Re: [PATCH 7/11] ibm_newemac: Skip EMACs that are marked unused by the firmware
  2007-12-05  3:53 ` David Gibson
@ 2007-12-05  4:18   ` Benjamin Herrenschmidt
  2007-12-05  4:21     ` David Gibson
  0 siblings, 1 reply; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2007-12-05  4:18 UTC (permalink / raw)
  To: David Gibson; +Cc: netdev, jgarzik, linuxppc-dev


On Wed, 2007-12-05 at 14:53 +1100, David Gibson wrote:
> It occurred to me the other day.  Instead of using a new "unused"
> property for this, should we be using the OF standard "status"
> property.

Dunno... it's really not wired. Probably not even clocked.

Ben.

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

* Re: [PATCH 7/11] ibm_newemac: Skip EMACs that are marked unused by the firmware
  2007-12-05  4:18   ` Benjamin Herrenschmidt
@ 2007-12-05  4:21     ` David Gibson
  2007-12-05  4:34       ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 6+ messages in thread
From: David Gibson @ 2007-12-05  4:21 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: netdev, jgarzik, linuxppc-dev

On Wed, Dec 05, 2007 at 03:18:49PM +1100, Benjamin Herrenschmidt wrote:
> 
> On Wed, 2007-12-05 at 14:53 +1100, David Gibson wrote:
> > It occurred to me the other day.  Instead of using a new "unused"
> > property for this, should we be using the OF standard "status"
> > property.
> 
> Dunno... it's really not wired. Probably not even clocked.

status = "fail-notconnected"; ?

-- 
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

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

* Re: [PATCH 7/11] ibm_newemac: Skip EMACs that are marked unused by the firmware
  2007-12-05  4:21     ` David Gibson
@ 2007-12-05  4:34       ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2007-12-05  4:34 UTC (permalink / raw)
  To: David Gibson; +Cc: netdev, jgarzik, linuxppc-dev


On Wed, 2007-12-05 at 15:21 +1100, David Gibson wrote:
> On Wed, Dec 05, 2007 at 03:18:49PM +1100, Benjamin Herrenschmidt wrote:
> > 
> > On Wed, 2007-12-05 at 14:53 +1100, David Gibson wrote:
> > > It occurred to me the other day.  Instead of using a new "unused"
> > > property for this, should we be using the OF standard "status"
> > > property.
> > 
> > Dunno... it's really not wired. Probably not even clocked.
> 
> status = "fail-notconnected"; ?

Bah, that's fugly.. jeff, don't hold the patches, we may sort that out
later.

Ben.

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

end of thread, other threads:[~2007-12-05  4:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-05  0:14 [PATCH 7/11] ibm_newemac: Skip EMACs that are marked unused by the firmware Benjamin Herrenschmidt
2007-12-05  3:53 ` David Gibson
2007-12-05  4:18   ` Benjamin Herrenschmidt
2007-12-05  4:21     ` David Gibson
2007-12-05  4:34       ` Benjamin Herrenschmidt
  -- strict thread matches above, loose matches on Subject: below --
2007-11-30  5:40 [PATCH 0/11] ibm_newemac: Candidate patches for 2.6.25 Benjamin Herrenschmidt
2007-11-30  5:40 ` [PATCH 7/11] ibm_newemac: Skip EMACs that are marked unused by the firmware Benjamin Herrenschmidt

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).