Skip to contentSkip to conversation

ibm_newemac: Skip EMACs that are marked unused by the firmware

PATCH In review Benjamin Herrenschmidt 2 participants 5 messages Dec 5, 2007

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

PATCH 7/11 ibm_newemac: Skip EMACs that are marked unused by the firmware

From: Hugh Blemings <[email protected]>

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.

---

 drivers/net/ibm_newemac/core.c |    4 ++++
 1 file changed, 4 insertions(+)
drivers/net/ibm_newemac/core.c +4 -0
Index: linux-work/drivers/net/ibm_newemac/core.c
===================================================================
@@ -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)
#1 lore raw
Quoted 7 lines · Benjamin Herrenschmidt

From: Hugh Blemings <[email protected]>

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.

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
#2 lore raw
Quoted 3 lines · David Gibson

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.

#3 lore raw
Quoted 7 lines · Benjamin Herrenschmidt
Quoted 3 lines · David Gibson

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"; ?

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
#4 lore raw
Quoted 10 lines · David Gibson
Quoted 7 lines · Benjamin Herrenschmidt
Quoted 3 lines · David Gibson

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.