This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

u-boot-2012.10-psp05.06.00.00 (latest) bug report.

Module: common/miiphyutil.c

Function: mdio_register(struct mii_dev *bus)

Code (at or around line 186): 


list_add_tail(&bus->link, &mii_devs);


may crash because mii_devs list was not initialized: mii_phy_init() was never called.

Reason:

CONFIG_MII and CONFIG_CMD_MII were undefined.

Workaround:

if ( NULL == miidevs.next )

return ( -1 );



I'm guessing this forum is probably an incorrect place to post bug reports. If yes, please advise a better place (sorry).

Thanks.

  • In am335x_evm.h we have CONFIG_MII set already.  Is this on a custom port then?  If so. are you sure you shouldn't be setting CONFIG_MII (if you're using the CPSW ethernet then you should be setting it).  Thanks!

  • Hi Tom,

    Frankly I did not account on any feedback, just wanted to have this bug known to anybody interested.

    Anywhere,

    1) I use RMII and (therefore, probably incorrect) commented the MII out.

    2) Yes, this is my (custom, private - call it a yellow pig or whatever you like, I'll be happy) board.

    3) Yes, after 8 hours spending on bug tracking I learned that using RMII I still have to have CONGIG_MII defined. I want that maybe somebody else will not have to anymore.

    Thank you very much for your time. If you will happen to return here, please advise me a better place for bug reporting. I respect this forum & want to keep myself in good shape with it's traditions.

    Regards,

    Sergei.

  • sviss said:

    Hi Tom,

    Frankly I did not account on any feedback, just wanted to have this bug known to anybody interested.

    Anywhere,

    1) I use RMII and (therefore, probably incorrect) commented the MII out.

    2) Yes, this is my (custom, private - call it a yellow pig or whatever you like, I'll be happy) board.

    3) Yes, after 8 hours spending on bug tracking I learned that using RMII I still have to have CONGIG_MII defined. I want that maybe somebody else will not have to anymore.

    Thank you very much for your time. If you will happen to return here, please advise me a better place for bug reporting. I respect this forum & want to keep myself in good shape with it's traditions.

    Regards,

    Sergei.

    First, since you started with the TI tree, rather than mainline, this is the correct place to start (the community will generally ask you to reproduce the problem in mainline before looking harder).  And second, after reading the code more, and your explanation, I think the code in question is slightly buggy and should be checking for CONFIG_PHYLIB as well as CONFIG_MII or CONFIG_CMD_MII.  Can you confirm that your board works if you unset CONFIG_MII but do continue setting CONFIG_PHYLIB and add '|| defined(CONFIG_PHYLIB)' to test around miiphy_init in net/eth.c::eth_initalize() ?  If so, can I post a patch vs mainline and give you a Reported-by credit?  Thanks!

  • Hi Tom,

    not exactly so, I had undefined CONFIG_CMD_MII and CONFIG_MII (not a CONFIG_PHYLIB, I mean).

    At that done, I confirm, that the compilation was successful (easily reproducible), and if run, resulted in code crash, registers dump, etc.


    I studied options and to my humble belief it is not always correct to check the #defines at compile time. Therefore I suggested a run-time solution.

    It is hard to say exaclty, if the board works when the code crashes... After I defined CONFIG_MII back it (the board) - yes, works. But it uses RMII ..


    Cheers,


  • Can you post the crash/dump data?

    Also, did you modify gmii_sel in to control module to RMII? Bits 1:0 set to 01b. Also, you must use an external clock so bit 6 must also be set. Finally, did you set pim mux to RMII?

    Steve K.

  • It's gone, sorry. I can post the code fragment in question:

    (module u-boot.xxxx/net/eth.c, - the Texas Instruments original, of course - at or around line #300)


    #if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
    miiphy_init();
    #endif


    It is obvious the if having both undefined, the list will skip from being initialized.

    This result in a crash (what else?).

    The rest, ..., I did it all - thanks. My board works. :)