diff mbox

i.MX31: Fixing cs89x0 network building to i.MX31ADS

Message ID 37367b3a0903310636x3c8d8eban4310018c3d1b40b@mail.gmail.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Alan Carvalho de Assis March 31, 2009, 1:36 p.m. UTC
This is a fix to get cs89x0 network driver working on i.MX31ADS

Signed-off-by: Alan Carvalho de Assis <acassis@gmail.com>
---
 drivers/net/cs89x0.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

 static unsigned int netcard_portlist[] __used __initdata = {
 	PBC_BASE_ADDRESS + PBC_CS8900A_IOBASE + 0x300, 0

Comments

Sajith P V April 1, 2009, 11:54 a.m. UTC | #1
Hi Alan,

On Tue, Mar 31, 2009 at 7:06 PM, Alan Carvalho de Assis
<acassis@gmail.com> wrote:
> This is a fix to get cs89x0 network driver working on i.MX31ADS
> diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c
> index ff64976..8ccc8f7 100644
> --- a/drivers/net/cs89x0.c
> +++ b/drivers/net/cs89x0.c
> @@ -190,6 +190,7 @@ static unsigned int cs8900_irq_map[] =
> {IRQ_IXDP2X01_CS8900, 0, 0, 0};
>  static unsigned int netcard_portlist[] __used __initdata =
> {CIRRUS_DEFAULT_BASE, 0};
>  static unsigned int cs8900_irq_map[] = {CIRRUS_DEFAULT_IRQ, 0, 0, 0};
>  #elif defined(CONFIG_MACH_MX31ADS)
> +#include <mach/hardware.h>
>  #include <mach/board-mx31ads.h>
>  static unsigned int netcard_portlist[] __used __initdata = {
>        PBC_BASE_ADDRESS + PBC_CS8900A_IOBASE + 0x300, 0
>

I tried this change on a different Freescale board but using the same
ethernet controller. The probe worked as shown in the console dump
below:

cs89x0:cs89x0_probe(0x0)
cs89x0.c: v2.4.3-pre1 Russell Nelson <nelson@crynwr.com>, Andrew
Morton <andrewm@uow.edu.au>
eth0: cs8900 rev K found at 0xf0000300
cs89x0: Extended EEPROM checksum bad and no Cirrus EEPROM, relying on
command line
cs89x0 media  IRQ 61, programmed I/O, MAC 00:00:00:00:00:00
cs89x0_probe1() successful
cs89x0:cs89x0_probe(0x0)
cs89x0: request_region(0xf0000300, 0x10) failed
cs89x0: no cs8900 or cs8920 detected.  Be sure to disable PnP with SETUP

But going further the network device configuration failed:
IP-Config: Failed to open eth0
IP-Config: No network devices available.

Should we not also enable interrupts for the ethernet controller to
make it work?

Regards,
Saijth
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Alan Carvalho de Assis April 1, 2009, 2:04 p.m. UTC | #2
Hi Sajith,

On 4/1/09, Sajith P V <sajithpv@gmail.com> wrote:
> Hi Alan,
>
> On Tue, Mar 31, 2009 at 7:06 PM, Alan Carvalho de Assis
> <acassis@gmail.com> wrote:
>> This is a fix to get cs89x0 network driver working on i.MX31ADS
>> diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c
>> index ff64976..8ccc8f7 100644
>> --- a/drivers/net/cs89x0.c
>> +++ b/drivers/net/cs89x0.c
>> @@ -190,6 +190,7 @@ static unsigned int cs8900_irq_map[] =
>> {IRQ_IXDP2X01_CS8900, 0, 0, 0};
>>  static unsigned int netcard_portlist[] __used __initdata =
>> {CIRRUS_DEFAULT_BASE, 0};
>>  static unsigned int cs8900_irq_map[] = {CIRRUS_DEFAULT_IRQ, 0, 0, 0};
>>  #elif defined(CONFIG_MACH_MX31ADS)
>> +#include <mach/hardware.h>
>>  #include <mach/board-mx31ads.h>
>>  static unsigned int netcard_portlist[] __used __initdata = {
>>        PBC_BASE_ADDRESS + PBC_CS8900A_IOBASE + 0x300, 0
>>
>
> I tried this change on a different Freescale board but using the same
> ethernet controller. The probe worked as shown in the console dump
> below:
>
> cs89x0:cs89x0_probe(0x0)
> cs89x0.c: v2.4.3-pre1 Russell Nelson <nelson@crynwr.com>, Andrew
> Morton <andrewm@uow.edu.au>
> eth0: cs8900 rev K found at 0xf0000300
> cs89x0: Extended EEPROM checksum bad and no Cirrus EEPROM, relying on
> command line
> cs89x0 media  IRQ 61, programmed I/O, MAC 00:00:00:00:00:00
> cs89x0_probe1() successful
> cs89x0:cs89x0_probe(0x0)
> cs89x0: request_region(0xf0000300, 0x10) failed
> cs89x0: no cs8900 or cs8920 detected.  Be sure to disable PnP with SETUP
>
> But going further the network device configuration failed:
> IP-Config: Failed to open eth0
> IP-Config: No network devices available.
>

It is strange, here I got a similar message:
cs89x0:cs89x0_probe(0x0)
cs89x0.c: v2.4.3-pre1 Russell Nelson <nelson@crynwr.com>, Andrew Morton
eth0: cs8900 rev K found at 0xf4020300 [Cirrus EEPROM]
cs89x0 media RJ-45, IRQ 168, programmed I/O, MAC 00:04:9f:00:41:87
cs89x0_probe1() successful
cs89x0:cs89x0_probe(0x0)
cs89x0: request_region(0xf4020300, 0x10) failed
cs89x0: no cs8900 or cs8920 detected.  Be sure to disable PnP with SETUP

But network works fine:
$ ping 10.29.240.182
PING 10.29.240.182 (10.29.240.182): 56 data bytes
64 bytes from 10.29.240.182: seq=0 ttl=63 time=0.6 ms
64 bytes from 10.29.240.182: seq=1 ttl=63 time=0.6 ms

> Should we not also enable interrupts for the ethernet controller to
> make it work?
>

On iMX31ADS there is a CPLD which receive interruptions network controller.

> Regards,
> Saijth
>

Regards,

Alan
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Russell King - ARM Linux April 2, 2009, 9:10 a.m. UTC | #3
On Wed, Apr 01, 2009 at 05:24:27PM +0530, Sajith P V wrote:
> Hi Alan,
> 
> On Tue, Mar 31, 2009 at 7:06 PM, Alan Carvalho de Assis
> <acassis@gmail.com> wrote:
> > This is a fix to get cs89x0 network driver working on i.MX31ADS
> > diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c
> > index ff64976..8ccc8f7 100644
> > --- a/drivers/net/cs89x0.c
> > +++ b/drivers/net/cs89x0.c
> > @@ -190,6 +190,7 @@ static unsigned int cs8900_irq_map[] =
> > {IRQ_IXDP2X01_CS8900, 0, 0, 0};
> >  static unsigned int netcard_portlist[] __used __initdata =
> > {CIRRUS_DEFAULT_BASE, 0};
> >  static unsigned int cs8900_irq_map[] = {CIRRUS_DEFAULT_IRQ, 0, 0, 0};
> >  #elif defined(CONFIG_MACH_MX31ADS)
> > +#include <mach/hardware.h>
> >  #include <mach/board-mx31ads.h>
> >  static unsigned int netcard_portlist[] __used __initdata = {
> >        PBC_BASE_ADDRESS + PBC_CS8900A_IOBASE + 0x300, 0
> >
> 
> I tried this change on a different Freescale board but using the same
> ethernet controller. The probe worked as shown in the console dump
> below:

It didn't - you didn't read all the messages.

> cs89x0:cs89x0_probe(0x0)
> cs89x0.c: v2.4.3-pre1 Russell Nelson <nelson@crynwr.com>, Andrew
> Morton <andrewm@uow.edu.au>
> eth0: cs8900 rev K found at 0xf0000300
> cs89x0: Extended EEPROM checksum bad and no Cirrus EEPROM, relying on
> command line
> cs89x0 media  IRQ 61, programmed I/O, MAC 00:00:00:00:00:00
> cs89x0_probe1() successful
> cs89x0:cs89x0_probe(0x0)
> cs89x0: request_region(0xf0000300, 0x10) failed
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

> cs89x0: no cs8900 or cs8920 detected.  Be sure to disable PnP with SETUP
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The IO region was not available for whatever reason.  Check what's in
/proc/ioports and also check your setting for IO_SPACE_LIMIT.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Russell King - ARM Linux April 2, 2009, 9:11 a.m. UTC | #4
On Wed, Apr 01, 2009 at 05:24:27PM +0530, Sajith P V wrote:
> cs89x0 media  IRQ 61, programmed I/O, MAC 00:00:00:00:00:00

Also note that this MAC address is invalid, so you'll need to use ifconfig
to set a valid MAC address before trying to bring the interface up.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Gilles Chanteperdrix April 2, 2009, 9:23 a.m. UTC | #5
Russell King - ARM Linux wrote:
> On Wed, Apr 01, 2009 at 05:24:27PM +0530, Sajith P V wrote:
>> Hi Alan,
>>
>> On Tue, Mar 31, 2009 at 7:06 PM, Alan Carvalho de Assis
>> <acassis@gmail.com> wrote:
>>> This is a fix to get cs89x0 network driver working on i.MX31ADS
>>> diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c
>>> index ff64976..8ccc8f7 100644
>>> --- a/drivers/net/cs89x0.c
>>> +++ b/drivers/net/cs89x0.c
>>> @@ -190,6 +190,7 @@ static unsigned int cs8900_irq_map[] =
>>> {IRQ_IXDP2X01_CS8900, 0, 0, 0};
>>>  static unsigned int netcard_portlist[] __used __initdata =
>>> {CIRRUS_DEFAULT_BASE, 0};
>>>  static unsigned int cs8900_irq_map[] = {CIRRUS_DEFAULT_IRQ, 0, 0, 0};
>>>  #elif defined(CONFIG_MACH_MX31ADS)
>>> +#include <mach/hardware.h>
>>>  #include <mach/board-mx31ads.h>
>>>  static unsigned int netcard_portlist[] __used __initdata = {
>>>        PBC_BASE_ADDRESS + PBC_CS8900A_IOBASE + 0x300, 0
>>>
>> I tried this change on a different Freescale board but using the same
>> ethernet controller. The probe worked as shown in the console dump
>> below:
> 
> It didn't - you didn't read all the messages.
> 
>> cs89x0:cs89x0_probe(0x0)
>> cs89x0.c: v2.4.3-pre1 Russell Nelson <nelson@crynwr.com>, Andrew
>> Morton <andrewm@uow.edu.au>
>> eth0: cs8900 rev K found at 0xf0000300
>> cs89x0: Extended EEPROM checksum bad and no Cirrus EEPROM, relying on
>> command line
>> cs89x0 media  IRQ 61, programmed I/O, MAC 00:00:00:00:00:00
>> cs89x0_probe1() successful
>> cs89x0:cs89x0_probe(0x0)
>> cs89x0: request_region(0xf0000300, 0x10) failed
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
>> cs89x0: no cs8900 or cs8920 detected.  Be sure to disable PnP with SETUP
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> The IO region was not available for whatever reason.  Check what's in
> /proc/ioports and also check your setting for IO_SPACE_LIMIT.

That is the expected behaviour of this driver:
http://lists.arm.linux.org.uk/lurker/message/20080917.154011.4631d62b.en.html

I guess the real issue is the failing eeprom and the missing mac address.
Russell King - ARM Linux April 2, 2009, 9:39 a.m. UTC | #6
On Thu, Apr 02, 2009 at 11:23:19AM +0200, Gilles Chanteperdrix wrote:
> Russell King - ARM Linux wrote:
> > On Wed, Apr 01, 2009 at 05:24:27PM +0530, Sajith P V wrote:
> >> Hi Alan,
> >>
> >> On Tue, Mar 31, 2009 at 7:06 PM, Alan Carvalho de Assis
> >> <acassis@gmail.com> wrote:
> >>> This is a fix to get cs89x0 network driver working on i.MX31ADS
> >>> diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c
> >>> index ff64976..8ccc8f7 100644
> >>> --- a/drivers/net/cs89x0.c
> >>> +++ b/drivers/net/cs89x0.c
> >>> @@ -190,6 +190,7 @@ static unsigned int cs8900_irq_map[] =
> >>> {IRQ_IXDP2X01_CS8900, 0, 0, 0};
> >>>  static unsigned int netcard_portlist[] __used __initdata =
> >>> {CIRRUS_DEFAULT_BASE, 0};
> >>>  static unsigned int cs8900_irq_map[] = {CIRRUS_DEFAULT_IRQ, 0, 0, 0};
> >>>  #elif defined(CONFIG_MACH_MX31ADS)
> >>> +#include <mach/hardware.h>
> >>>  #include <mach/board-mx31ads.h>
> >>>  static unsigned int netcard_portlist[] __used __initdata = {
> >>>        PBC_BASE_ADDRESS + PBC_CS8900A_IOBASE + 0x300, 0
> >>>
> >> I tried this change on a different Freescale board but using the same
> >> ethernet controller. The probe worked as shown in the console dump
> >> below:
> > 
> > It didn't - you didn't read all the messages.
> > 
> >> cs89x0:cs89x0_probe(0x0)
> >> cs89x0.c: v2.4.3-pre1 Russell Nelson <nelson@crynwr.com>, Andrew
> >> Morton <andrewm@uow.edu.au>
> >> eth0: cs8900 rev K found at 0xf0000300
> >> cs89x0: Extended EEPROM checksum bad and no Cirrus EEPROM, relying on
> >> command line
> >> cs89x0 media  IRQ 61, programmed I/O, MAC 00:00:00:00:00:00
> >> cs89x0_probe1() successful
> >> cs89x0:cs89x0_probe(0x0)
> >> cs89x0: request_region(0xf0000300, 0x10) failed
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > 
> >> cs89x0: no cs8900 or cs8920 detected.  Be sure to disable PnP with SETUP
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > 
> > The IO region was not available for whatever reason.  Check what's in
> > /proc/ioports and also check your setting for IO_SPACE_LIMIT.
> 
> That is the expected behaviour of this driver:
> http://lists.arm.linux.org.uk/lurker/message/20080917.154011.4631d62b.en.html
> 
> I guess the real issue is the failing eeprom and the missing mac address.

Maybe the driver needs that message cleaning up for our platforms so that
we don't have more people misled by it?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sajith P V April 2, 2009, 12:06 p.m. UTC | #7
Hi Russell,

On Thu, Apr 2, 2009 at 2:41 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Wed, Apr 01, 2009 at 05:24:27PM +0530, Sajith P V wrote:
>> cs89x0 media  IRQ 61, programmed I/O, MAC 00:00:00:00:00:00
>
> Also note that this MAC address is invalid, so you'll need to use ifconfig
> to set a valid MAC address before trying to bring the interface up.
>

Thanks. I will check this once my console is up.

Regards,
Sajith
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sajith P V April 2, 2009, 12:08 p.m. UTC | #8
Hi Alan

On Wed, Apr 1, 2009 at 7:34 PM, Alan Carvalho de Assis
<acassis@gmail.com> wrote:
> It is strange, here I got a similar message:
> cs89x0:cs89x0_probe(0x0)
> cs89x0.c: v2.4.3-pre1 Russell Nelson <nelson@crynwr.com>, Andrew Morton
> eth0: cs8900 rev K found at 0xf4020300 [Cirrus EEPROM]
> cs89x0 media RJ-45, IRQ 168, programmed I/O, MAC 00:04:9f:00:41:87
> cs89x0_probe1() successful
> cs89x0:cs89x0_probe(0x0)
> cs89x0: request_region(0xf4020300, 0x10) failed
> cs89x0: no cs8900 or cs8920 detected.  Be sure to disable PnP with SETUP
>
> But network works fine:
> $ ping 10.29.240.182
> PING 10.29.240.182 (10.29.240.182): 56 data bytes
> 64 bytes from 10.29.240.182: seq=0 ttl=63 time=0.6 ms
> 64 bytes from 10.29.240.182: seq=1 ttl=63 time=0.6 ms
>

What is cs8900_irq_map set to with this patch or am I missing some thing?

Regards,
Sajith
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Alan Carvalho de Assis April 7, 2009, 1:52 p.m. UTC | #9
Hi Sajith,

On 4/2/09, Sajith P V <sajithpv@gmail.com> wrote:
> Hi Alan
>
> On Wed, Apr 1, 2009 at 7:34 PM, Alan Carvalho de Assis
> <acassis@gmail.com> wrote:
>> It is strange, here I got a similar message:
>> cs89x0:cs89x0_probe(0x0)
>> cs89x0.c: v2.4.3-pre1 Russell Nelson <nelson@crynwr.com>, Andrew Morton
>> eth0: cs8900 rev K found at 0xf4020300 [Cirrus EEPROM]
>> cs89x0 media RJ-45, IRQ 168, programmed I/O, MAC 00:04:9f:00:41:87
>> cs89x0_probe1() successful
>> cs89x0:cs89x0_probe(0x0)
>> cs89x0: request_region(0xf4020300, 0x10) failed
>> cs89x0: no cs8900 or cs8920 detected.  Be sure to disable PnP with SETUP
>>
>> But network works fine:
>> $ ping 10.29.240.182
>> PING 10.29.240.182 (10.29.240.182): 56 data bytes
>> 64 bytes from 10.29.240.182: seq=0 ttl=63 time=0.6 ms
>> 64 bytes from 10.29.240.182: seq=1 ttl=63 time=0.6 ms
>>
>
> What is cs8900_irq_map set to with this patch or am I missing some thing?
>

Sorry my delay.

Please find definition below:

unsigned int cs8900_irq_map[] = { CS8900AIRQ, 0, 0, 0 };

/*! This is System IRQ used by CS8900A for interrupt generation taken
from platform.h */
#define CS8900AIRQ              EXPIO_INT_ENET_INT

#define EXPIO_INT_ENET_INT      (MXC_EXP_IO_BASE + 8)

> Regards,
> Sajith
>

Best Regards,

Alan
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c
index ff64976..8ccc8f7 100644
--- a/drivers/net/cs89x0.c
+++ b/drivers/net/cs89x0.c
@@ -190,6 +190,7 @@  static unsigned int cs8900_irq_map[] =
{IRQ_IXDP2X01_CS8900, 0, 0, 0};
 static unsigned int netcard_portlist[] __used __initdata =
{CIRRUS_DEFAULT_BASE, 0};
 static unsigned int cs8900_irq_map[] = {CIRRUS_DEFAULT_IRQ, 0, 0, 0};
 #elif defined(CONFIG_MACH_MX31ADS)
+#include <mach/hardware.h>
 #include <mach/board-mx31ads.h>