Author Topic: Precompiled Demo for M52259 - Can you use with other PHYs?  (Read 6772 times)

Offline sam512bb

  • Newbie
  • *
  • Posts: 7
    • View Profile
Precompiled Demo for M52259 - Can you use with other PHYs?
« on: January 22, 2011, 01:49:43 AM »
Good day Mark,

I was curious if the precompiled demos for the M52259's have specific PHY and/or hardware initialization routines?  I ask, as your precompiled demo works perfectly (Ethernet/USB) on the M52259DEMO hardware, but Ethernet does not (USB works fine) on our own 52259 hardware that is very close to the M52259DEMO board.  Our PHY is the same as used on the M52259DEMO board (KSZ8041), except that it is a different package (TL as opposed to NL).  I know that our PHY / Ethernet works, as the Freescale Ethernet demos work fine.  Only your demo does not (Ethernet) and was curious if there is some special initialization you are doing within those demos?  For example, if I execute a "ping" command from your console interface (via USB), the demo does not respond and appears to hang.  All of the "ipstats" show zero, etc and so it appears that the PHY/Ethernet is not working.  Any suggestions?

Thanks in advance!

Cheers,

Sam

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: Precompiled Demo for M52259 - Can you use with other PHYs?
« Reply #1 on: January 22, 2011, 04:00:43 PM »
Hi Sam

The demo code does expect to find the correct PHY (it's ID is checked). The demo board configuration includes the following:

    #define PHY_ADDRESS            0x01                                  // address of external PHY on board
    #define PHY_INTERRUPT          1                                     // IRQ1 is used as PHY interrupt input
    #define PHY_IDENTIFIER         0x00221512                            // MICREL KSZ8041NL identifier
    #define FNRESETPHY()           RESET_RCR |= FRCRSTOUT; fnDelayLoop(11000); RESET_RCR &= ~FRCRSTOUT; fnDelayLoop(200); // > 10ms reset asserted and > 100us before using MIIM
    #define MII_MANAGEMENT_CLOCK_SPEED    2500000                        // standard speed


If the PHY is not correctly detected the Ethernet controller is not initialised and so Ethernet will not work.

This suggests that there is a (small) difference between the demo board and your board. The Freescale demo code tends to not be very critical and may not actually configure the PHY (it will normally basically work from its boot-strap settings). If the ID check is ignored also the demo would probably allow Ethernet operation - it just expects to find the correct PHY ID...

Regards

Mark


Offline sam512bb

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Precompiled Demo for M52259 - Can you use with other PHYs?
« Reply #2 on: January 22, 2011, 08:24:46 PM »
Good day Mark,

Thanks for the prompt response and the information!  Indeed, the checking of the PHY's ID is probably what it is.  Further, you are correct that in previous Freescale demo's they rarely checked or changed the PHY's settings in their sample programs. 

In my case, I just wanted to see if I could run your demo on our hardware and nothing more.  Hopefully, my time will free up soon so that I can devote some continuous time to properly review your O/S.  However, from what I have seen and played with so far, it is very nice and quite impressive!

Cheers,

Sam