mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [help] PHY driver : Unable to find a PHY (unknown ID?)
@ 2013-01-04  9:09 Mylene Josserand
  2013-01-04 10:18 ` Thomas Petazzoni
  0 siblings, 1 reply; 7+ messages in thread
From: Mylene Josserand @ 2013-01-04  9:09 UTC (permalink / raw)
  To: barebox mailist

Hi everyone !


I am new in compiling Barebox (with OE-core) and I need your help.

I am using the master branch (maybe I need to checkout a tag ?). The 
ethernet of my board is a SMSC LAN8700 and the microchip is iMX27.

I have configured the new source of barebox to use the Phylib and MII 
drivers. When my barebox starts, I have an error about the PHY driver :

"
Unable to find a PHY (unknown ID?)
dhcp failed: I/O error
dhcp: I/O error
"

My devinfo :

"
barebox:/ devinfo
devices:
`---- platform
    `---- imx_iim0
    `---- imx27-ccm0
    `---- imx1-gpt0
    `---- imx1-gpio0
    `---- imx1-gpio1
    `---- imx1-gpio2
    `---- imx1-gpio3
    `---- imx1-gpio4
    `---- imx1-gpio5
    `---- imx21-wdt0
    `---- imx27-esdctl0
    `---- imx21-uart0
       `---- cs0
    `---- mem0
       `---- 0x00000000-0x07ffffff: /dev/ram0
    `---- mem1
       `---- 0x00000000-0xfffffffe: /dev/mem
    `---- cfi_flash0
       `---- 0x00000000-0x01ffffff: /dev/nor0
       `---- 0x00000000-0x0003ffff: /dev/self0
       `---- 0x00040000-0x0005ffff: /dev/env0
       `---- 0x00000000-0x0003ffff: /dev/nor0.barebox
       `---- 0x00040000-0x0005ffff: /dev/nor0.bareboxenv
       `---- 0x00060000-0x002bffff: /dev/nor0.kernel
       `---- 0x002c0000-0x01ffffff: /dev/nor0.root
    `---- cfi_flash1
       `---- 0x00000000-0x01ffffff: /dev/nor1
    `---- imx_nand
       `---- nand0
       `---- 0x00000000-0x1fffffff: /dev/nand0
       `---- 0x00000000-0x00ffffff: /dev/nand_oob0
    `---- i2c-fsl0
       `---- i2c0
          `---- lp39720
             `---- 0x00000000-0x000000ff: /dev/lp3972
          `---- ds133x0
             `---- 0x00000000-0x000000ff: /dev/ds133x
          `---- pca95350
             `---- 0x00000000-0x000000ff: /dev/pca9535
    `---- i2c-fsl1
       `---- i2c1
    `---- imxfb
    `---- imx27-fec
       `---- miibus0
       `---- eth0
`---- mdio_bus
`---- i2c
`---- fb
    `---- fb0
       `---- 0x00000000-0x000bb7ff: /dev/fb0
`---- fs
    `---- ramfs0
    `---- devfs0
`---- net
`---- global

drivers:
imx27-ccm
imx_serial
imx-esdctl
ramfs
devfs
tftp
imx-gpt
imx-gpio
SMSC LAN83C185
SMSC LAN8187
SMSC LAN8700
SMSC LAN911x Internal PHY
SMSC LAN8710/LAN8720
fec_imx
Generic PHY
imx_nand
cfi_flash
i2c-gpio
i2c-fsl
fb
imxfb
lp3972
ds133x
pca9535
imx-watchdog
mem
"

The SMSC LAN8700 is here but I can not make it work !

I have added some prints on the phy.c and the problem is in the fonction 
"mdiobus_scan" :

if (!edev->phydev) {
	if (addr >= 0) {
		dev = mdiobus_scan(bus, addr);
		if (!dev) {                     << Failed here
			ret = -EIO;
			goto fail;
		}

Did I miss something ?
Did I have to specify something in the board info ?
Is it correct to use the master branch ? I tried the v2012.12.1 tag but 
I get some errors before starting barebox ("no stack data available" and 
other errors).


Thank you in advance for any help and happy new year !


-- 
Mylène JOSSERAND

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [help] PHY driver : Unable to find a PHY (unknown ID?)
  2013-01-04  9:09 [help] PHY driver : Unable to find a PHY (unknown ID?) Mylene Josserand
@ 2013-01-04 10:18 ` Thomas Petazzoni
  2013-01-04 11:03   ` Mylene Josserand
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2013-01-04 10:18 UTC (permalink / raw)
  To: Mylene Josserand; +Cc: barebox mailist

Dear Mylene Josserand,

Good to see some developers from Toulouse using Barebox! I'm close, in
Colomiers.

On Fri, 4 Jan 2013 10:09:05 +0100, Mylene Josserand wrote:

> I am using the master branch (maybe I need to checkout a tag ?). The 
> ethernet of my board is a SMSC LAN8700 and the microchip is iMX27.
> 
> I have configured the new source of barebox to use the Phylib and MII 
> drivers. When my barebox starts, I have an error about the PHY driver :

Which board are you targeting?

> The SMSC LAN8700 is here but I can not make it work !
> 
> I have added some prints on the phy.c and the problem is in the fonction 
> "mdiobus_scan" :
> 
> if (!edev->phydev) {
> 	if (addr >= 0) {
> 		dev = mdiobus_scan(bus, addr);
> 		if (!dev) {                     << Failed here
> 			ret = -EIO;
> 			goto fail;
> 		}
> 
> Did I miss something ?

Do you have a correct PHY address in the fec_platform_data structure in
your board file?

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [help] PHY driver : Unable to find a PHY (unknown ID?)
  2013-01-04 10:18 ` Thomas Petazzoni
@ 2013-01-04 11:03   ` Mylene Josserand
  2013-01-04 11:23     ` Thomas Petazzoni
  0 siblings, 1 reply; 7+ messages in thread
From: Mylene Josserand @ 2013-01-04 11:03 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: barebox mailist

Dear Thomas,


Thank you for your quick answer !


Le 04/01/2013 11:18, Thomas Petazzoni a écrit :
> Dear Mylene Josserand,
>
> Good to see some developers from Toulouse using Barebox! I'm close, in
> Colomiers.

Yes ! We are neighbour :)
Free Electrons, I know you by name. And the kernel sources on your web 
site help me a lot !

>
> On Fri, 4 Jan 2013 10:09:05 +0100, Mylene Josserand wrote:
>
>> I am using the master branch (maybe I need to checkout a tag ?). The
>> ethernet of my board is a SMSC LAN8700 and the microchip is iMX27.
>>
>> I have configured the new source of barebox to use the Phylib and MII
>> drivers. When my barebox starts, I have an error about the PHY driver :
>
> Which board are you targeting?

It is a "home-made" board with a iMX27.

>
>> The SMSC LAN8700 is here but I can not make it work !
>>
>> I have added some prints on the phy.c and the problem is in the fonction
>> "mdiobus_scan" :
>>
>> if (!edev->phydev) {
>> 	if (addr>= 0) {
>> 		dev = mdiobus_scan(bus, addr);
>> 		if (!dev) {<<  Failed here
>> 			ret = -EIO;
>> 			goto fail;
>> 		}
>>
>> Did I miss something ?
>
> Do you have a correct PHY address in the fec_platform_data structure in
> your board file?

Hum, I did not configured it myself. I used a previous configuration of 
the board which was :
"
static struct fec_platform_data fec_info = {
	.xcv_type = MII100,
	.phy_addr = 1,
};"

How can I know which address I need to put ?

Sorry for, maybe, "newbie" question but I am self-taught in kernel 
development.

>
> Best regards,
>
> Thomas

Best regards,

-- 
Mylène JOSSERAND

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [help] PHY driver : Unable to find a PHY (unknown ID?)
  2013-01-04 11:03   ` Mylene Josserand
@ 2013-01-04 11:23     ` Thomas Petazzoni
  2013-01-04 12:46       ` Mylene Josserand
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2013-01-04 11:23 UTC (permalink / raw)
  To: Mylene Josserand; +Cc: barebox mailist

Dear Mylene Josserand,

On Fri, 4 Jan 2013 12:03:17 +0100, Mylene Josserand wrote:

> > Good to see some developers from Toulouse using Barebox! I'm close, in
> > Colomiers.
> 
> Yes ! We are neighbour :)

Indeed :)

> Free Electrons, I know you by name. And the kernel sources on your web 
> site help me a lot !

Good to know this is useful.

> > Which board are you targeting?
> 
> It is a "home-made" board with a iMX27.

Ok.

> Hum, I did not configured it myself. I used a previous configuration of 
> the board which was :
> "
> static struct fec_platform_data fec_info = {
> 	.xcv_type = MII100,
> 	.phy_addr = 1,
> };"
> 
> How can I know which address I need to put ?

Look at chapter "4.11 PHY Address strapping and LED Output Polarity
Selection" of the LAN8700 manual. It says the PHY address is selected
according to the value on pins PHYAD[0:4] during PHY reset. So you
should check your board schematics and see how these pins are wired to
find out what is the PHY address.

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [help] PHY driver : Unable to find a PHY (unknown ID?)
  2013-01-04 11:23     ` Thomas Petazzoni
@ 2013-01-04 12:46       ` Mylene Josserand
  2013-01-04 13:28         ` Eric Bénard
  0 siblings, 1 reply; 7+ messages in thread
From: Mylene Josserand @ 2013-01-04 12:46 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: barebox mailist

Dear Thomas,


Le 04/01/2013 12:23, Thomas Petazzoni a écrit :
> Dear Mylene Josserand,
>
> On Fri, 4 Jan 2013 12:03:17 +0100, Mylene Josserand wrote:
>
>>> Good to see some developers from Toulouse using Barebox! I'm close, in
>>> Colomiers.
>>
>> Yes ! We are neighbour :)
>
> Indeed :)
>
>> Free Electrons, I know you by name. And the kernel sources on your web
>> site help me a lot !
>
> Good to know this is useful.
>
>>> Which board are you targeting?
>>
>> It is a "home-made" board with a iMX27.
>
> Ok.
>
>> Hum, I did not configured it myself. I used a previous configuration of
>> the board which was :
>> "
>> static struct fec_platform_data fec_info = {
>> 	.xcv_type = MII100,
>> 	.phy_addr = 1,
>> };"
>>
>> How can I know which address I need to put ?
>
> Look at chapter "4.11 PHY Address strapping and LED Output Polarity
> Selection" of the LAN8700 manual. It says the PHY address is selected
> according to the value on pins PHYAD[0:4] during PHY reset. So you
> should check your board schematics and see how these pins are wired to
> find out what is the PHY address.

Ok, thank you for the explanation.
I have checked and it is the good phy address.

I will search deeper in the code the possible problem but if you have an 
idea of it, do not hesitate !

>
> Best regards,
>
> Thomas

Best regards,

-- 
Mylène JOSSERAND

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [help] PHY driver : Unable to find a PHY (unknown ID?)
  2013-01-04 12:46       ` Mylene Josserand
@ 2013-01-04 13:28         ` Eric Bénard
  2013-01-07 13:56           ` Mylene Josserand
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Bénard @ 2013-01-04 13:28 UTC (permalink / raw)
  To: Mylene Josserand; +Cc: barebox mailist

Hi Mylène,

Le Fri, 4 Jan 2013 13:46:15 +0100,
"Mylene Josserand" <Mylene.Josserand@navocap.com> a écrit :
> I will search deeper in the code the possible problem but if you have an 
> idea of it, do not hesitate !
> 
did you check :
- the pin mux is properly configured for MII operations (on the right
  pins connected to the PHY of course),
- the reset pin is deasserted before probing the PHY,
- the FEC's clock is enabled,

Last thing, if you set phy_addr = -1, then IIRC the PHY address will be
probed automatically.

Best regards,
Eric

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [help] PHY driver : Unable to find a PHY (unknown ID?)
  2013-01-04 13:28         ` Eric Bénard
@ 2013-01-07 13:56           ` Mylene Josserand
  0 siblings, 0 replies; 7+ messages in thread
From: Mylene Josserand @ 2013-01-07 13:56 UTC (permalink / raw)
  To: Eric Bénard; +Cc: barebox mailist

Hi Eric Bénard,


Thank you very much for your answer and your help !


Le 04/01/2013 14:28, Eric Bénard a écrit :
> Hi Mylène,
>
> Le Fri, 4 Jan 2013 13:46:15 +0100,
> "Mylene Josserand"<Mylene.Josserand@navocap.com>  a écrit :
>> I will search deeper in the code the possible problem but if you have an
>> idea of it, do not hesitate !
>>
> did you check :
> - the pin mux is properly configured for MII operations (on the right
>    pins connected to the PHY of course),

I will check that !

> - the reset pin is deasserted before probing the PHY,
> - the FEC's clock is enabled,


I checked and the clock is enabled.

>
> Last thing, if you set phy_addr = -1, then IIRC the PHY address will be
> probed automatically.

I tried it and it fixes the problem ! Maybe the phy_adress was not 1 as 
Thomas Petazonni indicated but according to LAN8700 documentation, it 
should. I will search which phy_address is currently the good one.

Anyway, thank you Thomas Petazonni and Eric Bénard for your help !

>
> Best regards,
> Eric

Best regards,

-- 
Mylène JOSSERAND
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2013-01-07 13:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-04  9:09 [help] PHY driver : Unable to find a PHY (unknown ID?) Mylene Josserand
2013-01-04 10:18 ` Thomas Petazzoni
2013-01-04 11:03   ` Mylene Josserand
2013-01-04 11:23     ` Thomas Petazzoni
2013-01-04 12:46       ` Mylene Josserand
2013-01-04 13:28         ` Eric Bénard
2013-01-07 13:56           ` Mylene Josserand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox