All of lore.kernel.org
 help / color / mirror / Atom feed
* I can not get my MII working on MPC8247 with Linux 2.6.32.6
@ 2010-03-31  1:46 Peter Pan
       [not found] ` <4BB2BB24.6080003@conspiracy.net>
  2010-03-31 15:48 ` Scott Wood
  0 siblings, 2 replies; 5+ messages in thread
From: Peter Pan @ 2010-03-31  1:46 UTC (permalink / raw)
  To: linuxppc-dev

Recently, I'm porting Linux 2.6.32.6 to our customized MPC8247 based
board. Everything is fine out except my ethernets. I uses
cpm2-scc-enet and cpm2-fcc-enet drivers.
My ethernet works fine in U-Boot with the same setting, and our
previous Linux 2.6.22 is also working, so there should be nothing
wrong with the hardware.
The boot log of the MII part is:

CPM2 Bitbanged MII: probed
mdio_bus f0010d00: error probing PHY at address 0
mdio_bus f0010d00: error probing PHY at address 1

I add some print, and find out that the MII bus can not be get the
turn around bit, and can not get the PHYIDs. That makes the PHY probe
failed.
Maybe it's because my wrongly typed dts file? My ethernet part of my
dts file is:
My MDIO pin is using PA23, MDC pin is using PA22.

	soc@f0000000 {
		#address-cells = <1>;
		#size-cells = <1>;
		device_type = "soc";
		compatible = "fsl,mpc8247-immr", "fsl,pq2-soc";
		ranges = <0x0 0xf0000000 0x53000>;
                bus-frequency = <0>; /* Filled in by U-Boot */

		cpm@119c0 {
			#address-cells = <1>;
			#size-cells = <1>;
			#interrupt-cells = <2>;
			compatible = "fsl,mpc8247-cpm", "fsl,cpm2";
			reg = <0x119c0 0x30>;
			ranges;
			muram {
				compatible = "fsl,cpm-muram";
				#address-cells = <1>;
				#size-cells = <1>;
				ranges = <0 0 0x10000>;

				data@0 {
					compatible = "fsl,cpm-muram-data";
					reg = <0x80 0x1f80 0x9800 0x800>;
				};
			};
            mdio@10d00 {
                device_type = "mdio";
                compatible =  "fsl,cpm2-mdio-bitbang";
                reg = <0x10d00 0x14>;
                #address-cells = <1>;
                #size-cells = <0>;
                fsl,mdio-pin = <23>;
                fsl,mdc-pin = <22>;

                PHY0: ethernet-phy@0 {
                    interrupt-parent = <&PIC>;
                    interrupts = <22 8>;
                    reg = <0>;
                    device_type = "ethernet-phy";
                };

		PHY1: ethernet-phy@1 {
			interrupt-parent = <&PIC>;
			interrupts = <22 8>;
			reg = <1>;
			device_type = "ethernet-phy";
		};

            };
            eth0: ethernet@11300 {
                device_type = "network";
                compatible = "fsl,mpc8247-fcc-enet",
                             "fsl,cpm2-fcc-enet";
                reg = <0x11300 0x20 0x8400 0x100 0x11390 0x1>;
                local-mac-address = [ 00 00 00 00 00 00 ];
                interrupts = <32 8>;
                interrupt-parent = <&PIC>;
                phy-handle = <&PHY0>;
                linux,network-index = <0>;
                fsl,cpm-command = <0x12000300>;
                fsl,cpm-txclk = <9>;
                fsl,cpm-rxclk = <10>;
            };
	    eth1: ethernet@11320 {
		device_type = "network";
		compatible = "fsl,mpc8247-fcc-enet",
		             "fsl,cpm2-fcc-enet";
		reg = <0x11320 0x20 0x8500 0x100 0x113b0 0x1>;
		local-mac-address = [ 00 00 00 00 00 00 ];
		interrupts = <33 8>;
		interrupt-parent = <&PIC>;
		phy-handle = <&PHY1>;
		linux,network-index = <1>;
		fsl,cpm-command = <0x16200300>;
                fsl,cpm-txclk = <15>;
                fsl,cpm-rxclk = <16>;
	    };
            eth2: ethernet@11a40 {
                device_type = "network";
                compatible = "fsl,mpc8247-scc-enet",
                             "fsl,cpm2-scc-enet";
                reg = <0x11a40 0x20 0x8200 0x100 0x11390 1>;
                local-mac-address = [00 00 00 00 00 00];
                interrupts = <42 8>;
                interrupt-parent = <&PIC>;
                linux,network-index = <2>;
                fsl,cpm-command = <0x8c00000>;
                fsl,cpm-txclk = <8>;
                fsl,cpm-rxclk = <5>;
            };
            eth3: ethernet@11a60 {
                device_type = "network";
                compatible = "fsl,mpc8247-scc-enet",
                             "fsl,cpm2-scc-enet";
                reg = <0x11a60 0x20 0x8300 0x100 0x11390 1>;
                local-mac-address = [00 00 00 00 00 00];
                interrupts = <43 8>;
                interrupt-parent = <&PIC>;
                linux,network-index = <3>;
                fsl,cpm-command = <0xce00000>;
                fsl,cpm-txclk = <7>;
                fsl,cpm-rxclk = <6>;
            };
        };
    };

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

* Re: I can not get my MII working on MPC8247 with Linux 2.6.32.6
       [not found] ` <4BB2BB24.6080003@conspiracy.net>
@ 2010-03-31  3:15   ` Peter Pan
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Pan @ 2010-03-31  3:15 UTC (permalink / raw)
  To: paul@conspiracy.net; +Cc: linuxppc-dev

I tried to skip the turn around bit check in source, but the mii bus
still get the 0xffffffff PHYIDs.
I will check if there is any pull ups on mdio line.
Thank you.

2010/3/31 paul@conspiracy.net <paulfax@conspiracy.net>:
> I had the same issue on a board. =A0The original was config was a 8247
> with 2.6.27 and changed the CPU card in the system to 8567 & 2.6.32.
> The old code did not check the turn around bit. =A0Can't remember the
> exact fix but as I remember if there are no pull ups on the mdio line
> the turn around bit will not be in the correct state (it just opens the
> line not not driving it to 1). =A0Will try to ask the hw guy if he
> remembers when he comes in tomorrow.
> Paul
>
> On 3/30/2010 8:46 PM, Peter Pan wrote:
>> Recently, I'm porting Linux 2.6.32.6 to our customized MPC8247 based
>> board. Everything is fine out except my ethernets. I uses
>> cpm2-scc-enet and cpm2-fcc-enet drivers.
>> My ethernet works fine in U-Boot with the same setting, and our
>> previous Linux 2.6.22 is also working, so there should be nothing
>> wrong with the hardware.
>> The boot log of the MII part is:
>>
>> CPM2 Bitbanged MII: probed
>> mdio_bus f0010d00: error probing PHY at address 0
>> mdio_bus f0010d00: error probing PHY at address 1
>>
>> I add some print, and find out that the MII bus can not be get the
>> turn around bit, and can not get the PHYIDs. That makes the PHY probe
>> failed.
>> Maybe it's because my wrongly typed dts file? My ethernet part of my
>> dts file is:
>> My MDIO pin is using PA23, MDC pin is using PA22.

>> _______________________________________________
>> Linuxppc-dev mailing list
>> Linuxppc-dev@lists.ozlabs.org
>> https://lists.ozlabs.org/listinfo/linuxppc-dev
>>
>
>

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

* Re: I can not get my MII working on MPC8247 with Linux 2.6.32.6
  2010-03-31  1:46 I can not get my MII working on MPC8247 with Linux 2.6.32.6 Peter Pan
       [not found] ` <4BB2BB24.6080003@conspiracy.net>
@ 2010-03-31 15:48 ` Scott Wood
  2010-04-01  0:56   ` Peter Pan
  1 sibling, 1 reply; 5+ messages in thread
From: Scott Wood @ 2010-03-31 15:48 UTC (permalink / raw)
  To: Peter Pan; +Cc: linuxppc-dev

Peter Pan wrote:
> Recently, I'm porting Linux 2.6.32.6 to our customized MPC8247 based
> board. Everything is fine out except my ethernets. I uses
> cpm2-scc-enet and cpm2-fcc-enet drivers.
> My ethernet works fine in U-Boot with the same setting, and our
> previous Linux 2.6.22 is also working, so there should be nothing
> wrong with the hardware.
> The boot log of the MII part is:
> 
> CPM2 Bitbanged MII: probed
> mdio_bus f0010d00: error probing PHY at address 0
> mdio_bus f0010d00: error probing PHY at address 1

Are 0 and 1 the addresses you're expecting the PHYs to be at?

If that's not it, I'd try to examine the specific register accesses that 
2.6.22 is doing and see what's different.

-Scott

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

* Re: I can not get my MII working on MPC8247 with Linux 2.6.32.6
  2010-03-31 15:48 ` Scott Wood
@ 2010-04-01  0:56   ` Peter Pan
       [not found]     ` <4BB60975.2010606@conspiracy.net>
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Pan @ 2010-04-01  0:56 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev

Yes, the PHY address is correct, I've checked the schematics, and
2.6.22 is also using this PHY address.
The different between 2.6.22 and 2.6.32.6 is that:
In 2.6.22, we use arch/ppc/8260_io/fcc_enet.c as the driver. IMMR
address 0xf0000000 is directly used.
In 2.6.32.6, cpm2-fcc-enet driver is used. In that driver, the
register address is ioremaped and used. The others are the same.
I've tried to use the dir and data register address directly in
mii-bitbang.c, but that leads to kernel oops.
I've wrote a low level gpio driver for our processor MPC8247, and I
used that for our external hardware watchdog, it works fine. Then I
use the low level driver in the mii-bitbang.c, it still works
incorrect, all I get from MDIO is 1.
I'm really confused.


2010/3/31 Scott Wood <scottwood@freescale.com>:
> Peter Pan wrote:
>>
>> Recently, I'm porting Linux 2.6.32.6 to our customized MPC8247 based
>> board. Everything is fine out except my ethernets. I uses
>> cpm2-scc-enet and cpm2-fcc-enet drivers.
>> My ethernet works fine in U-Boot with the same setting, and our
>> previous Linux 2.6.22 is also working, so there should be nothing
>> wrong with the hardware.
>> The boot log of the MII part is:
>>
>> CPM2 Bitbanged MII: probed
>> mdio_bus f0010d00: error probing PHY at address 0
>> mdio_bus f0010d00: error probing PHY at address 1
>
> Are 0 and 1 the addresses you're expecting the PHYs to be at?
>
> If that's not it, I'd try to examine the specific register accesses that
> 2.6.22 is doing and see what's different.
>
> -Scott
>

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

* Re: I can not get my MII working on MPC8247 with Linux 2.6.32.6
       [not found]     ` <4BB60975.2010606@conspiracy.net>
@ 2010-04-06  0:29       ` Peter Pan
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Pan @ 2010-04-06  0:29 UTC (permalink / raw)
  To: paul@conspiracy.net; +Cc: linuxppc-dev

I've checked the TA bit. The TA bit is 11 which means the TA bit is not cor=
rect.
I changed the code to not verify the TA bit, It still returns all
ones. Then I printed out all the values get. All that I get is 1. I'm
going to check the MDIO with a oscilloscope.
Thanks paul, you give me another way of thinking the unworkable PHYs.

2010/4/2 paul@conspiracy.net <paulfax@conspiracy.net>:
> Actually remembered the issue on our 8247 (now 8567) systems when we
> went to the later kernels/u-boot. =A0We were using a Broadcom PHY and the
> power on reset did not meet the minimum specifications. =A0At times the
> PHY's would work properly, many times they were inconsistent, but the
> often the indication was that the turn around bit was invalid (so driver
> returned all one's). =A0A CPLD change on our side fixed this. =A0It may b=
e
> that it was not working correctly at all times with the old kernel, but
> since the TA bit as not checked we never knew.
> Not sure if this is applicable but might be worth verifying.
> Paul
>
>
> On 3/31/2010 7:56 PM, Peter Pan wrote:
>> Yes, the PHY address is correct, I've checked the schematics, and
>> 2.6.22 is also using this PHY address.
>> The different between 2.6.22 and 2.6.32.6 is that:
>> In 2.6.22, we use arch/ppc/8260_io/fcc_enet.c as the driver. IMMR
>> address 0xf0000000 is directly used.
>> In 2.6.32.6, cpm2-fcc-enet driver is used. In that driver, the
>> register address is ioremaped and used. The others are the same.
>> I've tried to use the dir and data register address directly in
>> mii-bitbang.c, but that leads to kernel oops.
>> I've wrote a low level gpio driver for our processor MPC8247, and I
>> used that for our external hardware watchdog, it works fine. Then I
>> use the low level driver in the mii-bitbang.c, it still works
>> incorrect, all I get from MDIO is 1.
>> I'm really confused.
>>
>>
>> 2010/3/31 Scott Wood <scottwood@freescale.com>:
>>
>>> Peter Pan wrote:
>>>
>>>> Recently, I'm porting Linux 2.6.32.6 to our customized MPC8247 based
>>>> board. Everything is fine out except my ethernets. I uses
>>>> cpm2-scc-enet and cpm2-fcc-enet drivers.
>>>> My ethernet works fine in U-Boot with the same setting, and our
>>>> previous Linux 2.6.22 is also working, so there should be nothing
>>>> wrong with the hardware.
>>>> The boot log of the MII part is:
>>>>
>>>> CPM2 Bitbanged MII: probed
>>>> mdio_bus f0010d00: error probing PHY at address 0
>>>> mdio_bus f0010d00: error probing PHY at address 1
>>>>
>>> Are 0 and 1 the addresses you're expecting the PHYs to be at?
>>>
>>> If that's not it, I'd try to examine the specific register accesses tha=
t
>>> 2.6.22 is doing and see what's different.
>>>
>>> -Scott
>>>
>>>
>> _______________________________________________
>> Linuxppc-dev mailing list
>> Linuxppc-dev@lists.ozlabs.org
>> https://lists.ozlabs.org/listinfo/linuxppc-dev
>>
>
>

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

end of thread, other threads:[~2010-04-06  0:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-31  1:46 I can not get my MII working on MPC8247 with Linux 2.6.32.6 Peter Pan
     [not found] ` <4BB2BB24.6080003@conspiracy.net>
2010-03-31  3:15   ` Peter Pan
2010-03-31 15:48 ` Scott Wood
2010-04-01  0:56   ` Peter Pan
     [not found]     ` <4BB60975.2010606@conspiracy.net>
2010-04-06  0:29       ` Peter Pan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.