public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] FW: PPC405EP ethernet problems
@ 2006-06-20  6:10 Stalder, Reto
  2006-06-20  7:04 ` Wolfgang Denk
  2006-06-20  7:05 ` Wolfgang Denk
  0 siblings, 2 replies; 5+ messages in thread
From: Stalder, Reto @ 2006-06-20  6:10 UTC (permalink / raw)
  To: u-boot

Hi,

I've introduced some printf statements into the U-Boot code to track the
program flow. It turns out, that the cpu executes a loop, where there is
none present in the source code. Below are some excerpts of the source
code and the output of U-Boot. The only explanation I have so far is,
that the compiler breaks something. I'm using powerpc-405-linux-gnu-gcc
version 3.4.4 for cross compilation on an i386 debian system. Has
anybody experienced similar behaviour? Are there any known problems or
pitfalls when using this version of gcc?

Thank you very much in advance for your help!

Best regards,
Reto


cpu/ppc4xx/4xx_enet.c:
---
int eth_init (bd_t *bis)
{
    int tmp;

    printf("eth_init: calling ppc_4xx_eth_initialize()\n");
	ppc_4xx_eth_initialize(bis);
    printf("eth_init: returned from ppc_4xx_eth_initialize()\n");
	if (emac0_dev) {
        printf("eth_init: calling ppc_4xx_eth_init()\n");
        tmp = ppc_4xx_eth_init(emac0_dev, bis);
        printf("eth_init: returned from  ppc_4xx_eth_init()\n");
		return tmp;
	} else {
		printf("ERROR: ethaddr not set!\n");
		return -1;
	}
}
---

net/net.c, function NetLoop:
---
    printf("NetLoop: calling eth_halt()\n");
	eth_halt();
    printf("NetLoop: returned from eth_halt()\n");
#ifdef CONFIG_NET_MULTI   // CONFIG_NET_MULTI is not defined
	eth_set_current();
#endif
    printf("NetLoop: calling eth_init()\n");
	if (eth_init(bd) < 0) {
        printf("NetLoop: returned from eth_init() with neg. value\n");
		eth_halt();
		return(-1);
	}
    printf("NetLoop: returned from eth_init() with pos. value\n");
---

U-Boot output:
---
=>ping 1.2.3.4
NetLoop: calling eth_halt()
NetLoop: returned from eth_halt()
NetLoop: calling eth_init()
eth_init: calling ppc_4xx_eth_initialize()
eth_init: calling ppc_4xx_eth_initialize()  <-- this happens after the
first call to 
                                                irq_install_handler
(VECNUM_MS,...) in
                                                ppc_4xx_eth_initialize()
miiphy_register: non unique device name 'ppc_4xx_eth0'
eth_init: returned from ppc_4xx_eth_initialize()
eth_init: calling ppc_4xx_eth_init()
ENET Speed is 100 Mbps - FULL duplex connection
eth_init: returned from  ppc_4xx_eth_init()
eth_init: calling ppc_4xx_eth_initialize()
miiphy_register: non unique device name 'ppc_4xx_eth0'
eth_init: returned from ppc_4xx_eth_initialize()
eth_init: calling ppc_4xx_eth_init()
ENET Speed is 100 Mbps - FULL duplex connection
eth_init: returned from  ppc_4xx_eth_init()
eth_init: calling ppc_4xx_eth_initialize()
miiphy_register: non unique device name 'ppc_4xx_eth0'
eth_init: returned from ppc_4xx_eth_initialize()
eth_init: calling ppc_4xx_eth_init()
ENET Speed is 100 Mbps - FULL duplex connection
---

-----Original Message-----
From: u-boot-users-bounces@lists.sourceforge.net
[mailto:u-boot-users-bounces at lists.sourceforge.net] On Behalf Of
Stalder, Reto
Sent: Montag, 19. Juni 2006 09:58
To: Matthias Fuchs
Cc: u-boot-users@lists.sourceforge.net
Subject: Re: [U-Boot-Users] [heur] Re: PPC405EP ethernet problems


Hi,

hmm... actually there is no network related stuff in my board specific
code, only early init code. I assumed that - because I'm using a
PPC405EP cpu - the networking should already be handled by U-Boot
itself, e.g. in 'common/miiphyutil.c'. Am I wrong?

Here is, what the 'mii' command returns:

==> mii device
MII devices: 'ppc_4xx_eth0'
Current device: 'ppc_4xx_eth0'
==> mii info 0x0c
PHY_PHYIDR2 @ 0xc = 0x1619
PHY_PHYIDR[1,2] @ 0xc = 0x00221619
PHY 0x0C: OUI = 0x0885, Model = 0x21, Rev = 0x09, 100baseT, FDX 

Reto


> -----Original Message-----
> From: Matthias Fuchs [mailto:matthias.fuchs at esd-electronics.com]
> Sent: Freitag, 16. Juni 2006 17:26
> To: Stalder, Reto
> Cc: u-boot-users at lists.sourceforge.net
> Subject: Re: [heur] Re: [U-Boot-Users] PPC405EP ethernet problems
>
>
> Hi,
>
> is it possible that you use miiphy_read/write() somewhere in your
board 
> specific code? If so, in which function? Which board is it?
>
> Can you post the code from your board setup that does any network 
> related stuff?
> 
> Matthias
>
>> Stalder, Reto schrieb:
>> Hi Matthias
>> 
>> Thank you for your quick response! I've tried out your suggestion. 
>> Unfortunately U-Boot stops while booting, without reaching the
command 
>> prompt. The output is:
>> 
>> ...
>> U-Boot 1.1.4 (Jun 16 2006 - 16:45:43)
>> 
>> CPU:   AMCC PowerPC 405EP Rev. B at 266.666 MHz (PLB=133, OPB=66,
EBC=33
>> MHz)
>>        I2C boot EEPROM disabled
>>        16 kB I-Cache 16 kB D-Cache
>> DRAM:   8 MB
>> FLASH: 16 MB
>> In:    serial
>> Out:   serial
>> Err:   serial
>> Net:   
>> ...
>> 
>> Enabled debug outputs (with defined DEBUG and ET_DEBUG constants) do 
>> not tell me anything more. What else could I try?
>> 
>> Best regards,
>> Reto


_______________________________________________
U-Boot-Users mailing list
U-Boot-Users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users

^ permalink raw reply	[flat|nested] 5+ messages in thread
* [U-Boot-Users] FW: PPC405EP ethernet problems
@ 2006-06-20  9:19 Stalder, Reto
  0 siblings, 0 replies; 5+ messages in thread
From: Stalder, Reto @ 2006-06-20  9:19 UTC (permalink / raw)
  To: u-boot

Hi,

<snip1>
> Forgot this one: Debian also tends to use some beta versions  of  the 
> "make"  tool  which  are obviously very broken. Make sure to use only 
> stable versions.
</snip1>

<snip2>
> Is it possible that there is any chace that you get an enetInt just 
> after the first irq_install_handler? Can you put a printf at the 
> beginning of the entInt?
</snip2>

First of all a big thank you to Matthias and Wolfgang for their answers!

I've put some printf statements into enetInt and associated functions
and tested the code with CONFIG_NET_MULTI enabled and disabled. As
Matthias suspected an enetInt is fired just after the first
irq_install_handler. The console output of both configurations is
inserted below. 

For both configurations:
- The 'mtdcr (uicer, mfdcr (uicer) | (0x80000000 >> i)' statement in
irq_install_handler is the last instruction, before enetInt is entered.
- As soon as enetInt returns, it re-enters.

But:
- For CONFIG_NET_MULTI defined the problem occurs already while
starting. In contrast I get the U-Boot prompt, if it is not defined.  
- For CONFIG_NET_MULTI defined, there is _NO_ printf output in
enet_init, which seems very strange to me (see console output below).

Do the console output and my observations ring any bells? Do you have
ideas where the problem could lie and what else I could try to solve it?

Thank you very much,
Reto


Without CONFIG_NET_MULTI configured:
------------------------------------

=> ping 1.2.3.4
NetLoop: calling eth_halt()
NetLoop: returned from eth_halt()
NetLoop: calling eth_init()
 eth_init: calling ppc_4xx_eth_initialize()
  ppc_4xx_eth_initialize: calling irq_install_handler(MS...)
   irq_install_handler: executing mtdcr (uicer, mfdcr (uicer) |
(0x80000000 >> i));
        <-- here should come a "irq_install_handler: mtdcr done"
printout

    enetInt: entered function
    enetInt: calling mal_err
 
     MAL error occured.... ISR = 0 UIC = = 200000    MAL_DEF = 2e0000
MAL_ERR= 260000
     mal_err: calling eth_init again
      eth_init: calling ppc_4xx_eth_initialize()
       ppc_4xx_eth_initialize: calling irq_install_handler(MS...)
        irq_install_handler: executing mtdcr (uicer, mfdcr (uicer) |
(0x80000000 >> i));
        irq_install_handler: mtdcr... done
        Install interrupt for vector 10 ==> 007e55ec
       ppc_4xx_eth_initialize: returned from irq_install_handler(MS...)
       ppc_4xx_eth_initialize: calling irq_install_handler(MTE...)
        irq_install_handler: executing mtdcr (uicer, mfdcr (uicer) |
(0x80000000 >> i));
        irq_install_handler: mtdcr... done
        Install interrupt for vector 11 ==> 007e55ec
       ppc_4xx_eth_initialize: returned from irq_install_handler(MTE...)
       ppc_4xx_eth_initialize: calling irq_install_handler(MRE...)
        irq_install_handler: executing mtdcr (uicer, mfdcr (uicer) |
(0x80000000 >> i));
        irq_install_handler: mtdcr... done
        Install interrupt for vector 12 ==> 007e55ec
       ppc_4xx_eth_initialize: returned from irq_install_handler(MRE...)
       ppc_4xx_eth_initialize: calling irq_install_handler(TXDE...)
        irq_install_handler: executing mtdcr (uicer, mfdcr (uicer) |
(0x80000000 >> i));
        irq_install_handler: mtdcr... done
        Install interrupt for vector 13 ==> 007e55ec
       ppc_4xx_eth_initialize: returned from
irq_install_handler(TXDE...)
       ppc_4xx_eth_initialize: calling irq_install_handler(RXDE...)
        irq_install_handler: executing mtdcr (uicer, mfdcr (uicer) |
(0x80000000 >> i));
        irq_install_handler: mtdcr... done
        Install interrupt for vector 14 ==> 007e55ec
       ppc_4xx_eth_initialize: returned from
irq_install_handler(RXDE...)
       ppc_4xx_eth_initialize: calling miiphy_register()
        miiphy_register: non unique device name 'ppc_4xx_eth0'
       ppc_4xx_eth_initialize: returned from miiphy_register()
      eth_init: returned from ppc_4xx_eth_initialize()
      eth_init: calling _STATIC_ ppc_4xx_eth_init()
       About preceeding transfer (eth0):
       - Sent packet number 0
       - Received packet number 0
       - Handled packet number 0
       ENET Speed is 100 Mbps - FULL duplex connection
        irq_install_handler: executing mtdcr (uicer, mfdcr (uicer) |
(0x80000000 >> i));
        irq_install_handler: mtdcr... done
        Install interrupt for vector 15 ==> 007e55ec
      eth_init: returned from  ppc_4xx_eth_init()
     mal_err: returned from eth_init
    enetInt: returned from mal_err
    
    enetInt: entered function
    enetInt: calling mal_err

     MAL error occured.... ISR = c0100010 UIC = = 150000     MAL_DEF =
2e0000  MAL_ERR= 260000
     mal_err: calling eth_init again
      eth_init: calling ppc_4xx_eth_initialize()
       ppc_4xx_eth_initialize: calling miiphy_register()
        miiphy_register: non unique device name 'ppc_4xx_eth0'
       ppc_4xx_eth_initialize: returned from miiphy_register()
      eth_init: returned from ppc_4xx_eth_initialize()
      eth_init: calling ppc_4xx_eth_init()
       About preceeding transfer (eth0):
       - Sent packet number 0
       - Received packet number 0
       - Handled packet number 0
       ENET Speed is 100 Mbps - FULL duplex connection
        irq_install_handler: executing mtdcr (uicer, mfdcr (uicer) |
(0x80000000 >> i));
        irq_install_handler: mtdcr... done
        Install interrupt for vector 15 ==> 007e55ec
      eth_init: returned from  ppc_4xx_eth_init()
     mal_err: returned from eth_init
   enetInt: returned from mal_err
   
   enetInt: entered function
   enetInt: calling mal_err
    
    MAL error occured.... ISR = c0100010 UIC = = 150000     MAL_DEF =
2e0000  MAL_ERR= 260000
    mal_err: calling eth_init again
     eth_init: calling ppc_4xx_eth_initialize()
      ppc_4xx_eth_initialize: calling miiphy_register()
       miiphy_register: non unique device name 'ppc_4xx_eth0'
      ppc_4xx_eth_initialize: returned from miiphy_register()
     eth_init: returned from ppc_4xx_eth_initialize()
     eth_init: calling ppc_4xx_eth_init()
      About preceeding transfer (eth0):
      - Sent packet number 0
      - Received packet number 0
      - Handled packet number 0
      ENET Speed is 100 Mbps - FULL duplex connection
       irq_install_handler: executing mtdcr (uicer, mfdcr (uicer) |
(0x80000000 >> i));
       irq_install_handler: mtdcr... done
       Install interrupt for vector 15 ==> 007e55ec
     eth_init: returned from  ppc_4xx_eth_init()
    mal_err: returned from eth_init
   enetInt: returned from mal_err
   
   enetInt: entered function
   enetInt: calling mal_err


With CONFIG_NET_MULTI configured:
---------------------------------

U-Boot 1.1.4 (Jun 20 2006 - 10:06:31)

CPU:   AMCC PowerPC 405EP Rev. B at 133.333 MHz (PLB=133, OPB=66, EBC=33
MHz)
       I2C boot EEPROM disabled
       16 kB I-Cache 16 kB D-Cache
DRAM:   8 MB
FLASH: 16 MB
In:    serial
Out:   serial
Err:   serial
Net:   
ppc_4xx_eth_initialize: calling irq_install_handler(MS...)
 irq_install_handler: executing mtdcr (uicer, mfdcr (uicer) |
(0x80000000 >> i));
                <-- here should come a "irq_install_handler: mtdcr done"
printout
 enetInt: entered function
  enetInt: calling mal_err

   MAL error occured.... ISR = 0 UIC = = 200000    MAL_DEF = 2e0000
MAL_ERR= 260000
   mal_err: calling eth_init again
       <-- where is all the printf output from eth_init?
   mal_err: returned from eth_init
  enetInt: returned from mal_err

  enetInt: entered function
  enetInt: calling mal_err

   MAL error occured.... ISR = 0 UIC = = 200000    MAL_DEF = 2e0000
MAL_ERR= 260000
   mal_err: calling eth_init again
       <-- where is all the printf output from eth_init?
   mal_err: returned from eth_init
  enetInt: returned from mal_err
  enetInt: entered function
  
  enetInt: calling mal_err

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

end of thread, other threads:[~2006-06-20  9:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-20  6:10 [U-Boot-Users] FW: PPC405EP ethernet problems Stalder, Reto
2006-06-20  7:04 ` Wolfgang Denk
2006-06-20  7:05 ` Wolfgang Denk
2006-06-20  7:43   ` Matthias Fuchs
  -- strict thread matches above, loose matches on Subject: below --
2006-06-20  9:19 Stalder, Reto

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