Skip to contentSkip to conversation

Sungem with iMac Rev-B

DISCUSSION Aurel Wisse 6 participants 7 messages Apr 29, 2002 – Apr 30, 2002

lore
Share & tools
lore
#0 lore raw

Crossposted yellowdog-devel/linuxppc-devel, sorry but this is last ditch...

I have read several comments about the sungem driver being preferred to the bmac(+) driver.

Going through the sourcecode of the sungem, I am not sure however that it will work with older hardware like the iMac Rev-B's Uni-North and the LXT970.

I am trying to modify the bmac to force the PHY to abandon autonegotiation and to use 10Mb/s and half duplex. "Reverse engineering" the bmac code leads nowhere. The bmac_init_phy doesn't give a lot of info, except a couple of undocumented constants written via bmac_mif_write, and the mif_write writes to the MIFCSR register which is undocumented in the bmac.h file.

This is terribly frustrating as Apple is obviously able to do it with their Duplex tool hack. Hence, it *can* be done. Why can't they just send us their sourcecode for the Duplex tool? Does anybody have a direct line to Apple?

Aurel

Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

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

#1 lore raw

In talking to BenH there is currently no way to do this. Nor are there public documents from Apple explaining how to do this.

As I've said previously, the fastest way to do this, is spend 20 or so, or alot of time, because there is no easy answer to this programatically.

Kevyn
----- Original Message -----
From: "Aurel Wisse" <[email protected]>
To: <[email protected]>; "yddev" <[email protected]>
Sent: Sunday, April 28, 2002 5:49 PM
Subject: Sungem with iMac Rev-B

Quoted 24 lines

Crossposted yellowdog-devel/linuxppc-devel, sorry but this is last ditch...

I have read several comments about the sungem driver being preferred to the bmac(+) driver.

Going through the sourcecode of the sungem, I am not sure however that it will work with older hardware like the iMac Rev-B's Uni-North and the LXT970.

I am trying to modify the bmac to force the PHY to abandon autonegotiation and to use 10Mb/s and half duplex. "Reverse engineering" the bmac code leads nowhere. The bmac_init_phy doesn't give a lot of info, except a couple of undocumented constants written via bmac_mif_write, and the mif_write writes to the MIFCSR register which is undocumented in the bmac.h file.

This is terribly frustrating as Apple is obviously able to do it with their Duplex tool hack. Hence, it *can* be done. Why can't they just send us their sourcecode for the Duplex tool? Does anybody have a direct line to Apple?

Quoted 6 lines

Aurel

_______________________________________________
yellowdog-devel mailing list [email protected]
http://lists.terrasoftsolutions.com/mailman/listinfo/yellowdog-devel

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

#3 lore raw
In reply to Aurel Wisse
Quoted 8 lines · Aurel Wisse

I am trying to modify the bmac to force the PHY to abandon autonegotiation and to use 10Mb/s and half duplex. "Reverse engineering" the bmac code leads nowhere. The bmac_init_phy doesn't give a lot of info, except a couple of undocumented constants written via bmac_mif_write, and the mif_write writes to the MIFCSR register which is undocumented in the bmac.h file.

Quoted 5 lines

This is terribly frustrating as Apple is obviously able to do it with their Duplex tool hack. Hence, it *can* be done. Why can't they just send us their sourcecode for the Duplex tool? Does anybody have a direct line to Apple?

Looked at the Darwin sources lately? BMacEnet::miiInitializePHY appears to describe the "normal" setup in a way that should make it pretty obvious how to set it up in non-normal ways -- or perhaps not -- I've never dealt with the chip, personally -- but it's a good starting point, anyway.

Later,
David

---------------------------------------------------------------------
David A. Gatwood [email protected]
Developer Docs Writer [email protected]
Apple Computer [email protected]

Check out my weekly web comic:
http://www.techmagazine.org

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

#4 lore raw
In reply to Aurel Wisse
Quoted 10 lines

Crossposted yellowdog-devel/linuxppc-devel, sorry but this is last ditch...

I have read several comments about the sungem driver being preferred to the bmac(+) driver.

Going through the sourcecode of the sungem, I am not sure however that it will work with older hardware like the iMac Rev-B's Uni-North and the LXT970.

No, you mismatched bmac and gmac. The sungem driver obsoletes the gmac one, not the bmac one.

The bmac driver currently don't have PHY control. This could eventually be added, since I beleive we actually know how to tap the PHY registers when available. Though this need some work and I have no hardware to test on, so I'd rather see someone who has do the job ;)

What we need is to add some proper PHY polling infrastructure to the bmac driver (shouldn't be a big issue), then find out the list of known PHYs used on Macs (I beleive the darwin source code would be helpful here) and see how each of them can be configured. If they aren't too crappy, the register setting for enabling 10/100, half/full and autoneg are standard.

Ben.

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

#5 lore raw
Quoted 5 lines
Quoted 4 lines

Going through the sourcecode of the sungem, I am not sure however that it will work with older hardware like the iMac Rev-B's Uni-North and the LXT970.

Quoted 8 lines

No, you mismatched bmac and gmac. The sungem driver obsoletes the gmac one, not the bmac one.

The bmac driver currently don't have PHY control. This could eventually be added, since I beleive we actually know how to tap the PHY registers when available. Though this need some work and I have no hardware to test on, so I'd rather see someone who has do the job ;)

Throw some hints (what to write where, approximately) my way and I might give it a shot.

Michael

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

#6 lore raw
Quoted 5 lines
Quoted 5 lines

No, you mismatched bmac and gmac. The sungem driver obsoletes the gmac one, not the bmac one.

Quoted 8 lines
Quoted 5 lines

The bmac driver currently don't have PHY control. This could eventually be added, since I beleive we actually know how to tap the PHY registers when available. Though this need some work and I have no hardware to test on, so I'd rather see someone who has do the job ;)

Throw some hints (what to write where, approximately) my way and I might give it a shot.

Well, driver side, look at the ethtool ioctl implementation in sungem, and do something around those lines. You probably first need to properly detect the PHY type by reading the 2 PHY_ID registers, then act depending on the PHY.

sungem has a mecanism that tries to fallback to fixed settings when autoneg fails, you may want to skip that part though as it's a bit tricky.

Normally autoneg is enabled/disabled in the PHY control register, along with the forced 10/100 modes and duplex mode. Look at what darwin does here.

Note that all this is only valid if you have an MII PHY, I don't think the early bmac do that (bitbanging ?). You should probably make sure you have a bmac+ and skip all the code (return fixed speed from ethtool ioctls) on older bmac.

Ben.

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