Skip to contentSkip to conversation

New version of the device tree aware EMAC driver

DISCUSSION David Gibson 2 participants 5 messages May 16, 2007 – May 21, 2007

lore
Share & tools
lore
#0 lore raw

I've made a few more tiny tweaks to BenH's rewritten device-tree based 4xx EMAC driver. The main change is that it now no longer requires 'device_type', just 'compatible' to be set in the ZMII and MAL device nodes when probing. This works better with current thinking on flattened device trees which discourages creating new device_type values unless there is a clear use for a new device class binding.

The patch can be obtained from:

http://ozlabs.org/~dgibson/home/emac/powerpc-emac-new-20070516.patch

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

I've made a few more tiny tweaks to BenH's rewritten device-tree based 4xx EMAC driver. The main change is that it now no longer requires 'device_type', just 'compatible' to be set in the ZMII and MAL device nodes when probing. This works better with current thinking on flattened device trees which discourages creating new device_type values unless there is a clear use for a new device class binding.

Quoted 5 lines

The patch can be obtained from:

http://ozlabs.org/~dgibson/home/emac/powerpc-emac-new-20070516.patch

Looks like EMAC_FTR_STACR_OC_INVERT is missed in the EMAC_FTRS_POSSIBLE (ibm_newemac/core.h)

Should be something like this:
EMAC_FTRS_POSSIBLE =
#ifdef CONFIG_IBM_NEW_EMAC_EMAC4
EMAC_FTR_EMAC4 | EMAC_FTR_HAS_AXON_STACR |
EMAC_FTR_STACR_OC_INVERT |
#endif
Thanks

#2 lore raw
In reply to David Gibson
Quoted 7 lines · David Gibson

I've made a few more tiny tweaks to BenH's rewritten device-tree based 4xx EMAC driver. The main change is that it now no longer requires 'device_type', just 'compatible' to be set in the ZMII and MAL device nodes when probing. This works better with current thinking on flattened device trees which discourages creating new device_type values unless there is a clear use for a new device class binding.

Quoted 5 lines

The patch can be obtained from:

http://ozlabs.org/~dgibson/home/emac/powerpc-emac-new-20070516.patch

In __emac_mdio_read and __emac_mdio_write functions:

+ if (!emac_has_feature(dev, EMAC_FTR_STACR_OC_INVERT))
+ r |= EMAC_STACR_OC;

should be

+ if (emac_has_feature(dev, EMAC_FTR_STACR_OC_INVERT))
+ r |= EMAC_STACR_OC;

Thanks.

#3 lore raw
Quoted 25 lines · Valentine Barshak
Quoted 7 lines · David Gibson

I've made a few more tiny tweaks to BenH's rewritten device-tree based 4xx EMAC driver. The main change is that it now no longer requires 'device_type', just 'compatible' to be set in the ZMII and MAL device nodes when probing. This works better with current thinking on flattened device trees which discourages creating new device_type values unless there is a clear use for a new device class binding.

Quoted 6 lines

The patch can be obtained from:

http://ozlabs.org/~dgibson/home/emac/powerpc-emac-new-20070516.patch

In __emac_mdio_read and __emac_mdio_write functions:

(quoted diff) +2 -0
+    if (!emac_has_feature(dev, EMAC_FTR_STACR_OC_INVERT))
+        r |= EMAC_STACR_OC;

should be

(quoted diff) +2 -0
+    if (emac_has_feature(dev, EMAC_FTR_STACR_OC_INVERT))
+        r |= EMAC_STACR_OC;
Quoted 6 lines

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

With the above 2 fixes (and Marvell 88E1111 Ethernet PHY support added) seems to work fine on Sequoia PPC440EPx, thanks.

#4 lore raw
Quoted 32 lines · Valentine Barshak
Quoted 25 lines · Valentine Barshak
Quoted 7 lines · David Gibson

I've made a few more tiny tweaks to BenH's rewritten device-tree based 4xx EMAC driver. The main change is that it now no longer requires 'device_type', just 'compatible' to be set in the ZMII and MAL device nodes when probing. This works better with current thinking on flattened device trees which discourages creating new device_type values unless there is a clear use for a new device class binding.

Quoted 6 lines

The patch can be obtained from:

http://ozlabs.org/~dgibson/home/emac/powerpc-emac-new-20070516.patch

In __emac_mdio_read and __emac_mdio_write functions:

(quoted diff) +2 -0
+    if (!emac_has_feature(dev, EMAC_FTR_STACR_OC_INVERT))
+        r |= EMAC_STACR_OC;

should be

(quoted diff) +2 -0
+    if (emac_has_feature(dev, EMAC_FTR_STACR_OC_INVERT))
+        r |= EMAC_STACR_OC;
Quoted 6 lines

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

Quoted 3 lines

With the above 2 fixes (and Marvell 88E1111 Ethernet PHY support added) seems to work fine on Sequoia PPC440EPx,
thanks.

Ok, I've merged those fixes. New version of the driver coming soon.

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