2008-04-24 11:04:52     problems with using net driver CS8900

Document created by Aaronwu Employee on Sep 17, 2013
Version 1Show Document
  • View in full screen mode

2008-04-24 11:04:52     problems with using net driver CS8900

Pafone Lee (CHINA)

Message: 54871    first I'd like to thank Mike very much.with his help i made my uboot work on my custom board few days ago.

Now I want to add NET to my board.

 

I have configured it in myboard.h file

#define CONFIG_DRIVER_CS8900

#define CS8900_BUS16

#define CS8900_BASE 0x203D4000

 

errors indicated that undefined board_get_enetaddr() in board.c , line 413

 

and i found the function "void cs8900_get_enetaddr (uchar * addr)" in driver/cs8900.c , line 117

while other net drivers such as smc91111.c had the function " int board_get_enetaddr(uchar *mac_addr)" , line 1532

 

should I change the "void cs8900_get_enetaddr (uchar * addr)" to "int board_get_enetaddr(uchar *mac_addr)"?

or any other methods can help.

TranslateQuoteReplyEditDelete

 

 

2008-04-24 11:34:58     Re: problems with using net driver CS8900

Robin Getz (UNITED STATES)

Message: 54874    Pafone:

 

This is the function that is required to get your MAC address into the MAC.

 

On some boards it is different - so it is up to you how this is done. (Some have separate EEPROMs, some put it in flash, some leave it in the U-Boot env - it is all different).

 

-robin

QuoteReplyEditDelete

 

 

2008-04-24 15:45:36     Re: problems with using net driver CS8900

Mike Frysinger (UNITED STATES)

Message: 54893    in your board code you can add "board_get_enetaddr" that merely returns/passes arguments to cs8900_get_enetaddr

QuoteReplyEditDelete

 

 

2008-04-27 02:31:31     Re: problems with using net driver CS8900

Pafone Lee (CHINA)

Message: 55035    thank you both.

I see.

another question:

in which file that the EBIU_AMBCTL1 is first initialized ?

TranslateQuoteReplyEditDelete

 

 

2008-04-27 03:24:18     Re: problems with using net driver CS8900

Pafone Lee (CHINA)

Message: 55036    i found it in initcode.c , and it is called in start.S

found in initcode.c    line305

    /* Program the async banks controller. */

    bfin_write_EBIU_AMBCTL0(CONFIG_EBIU_AMBCTL0_VAL);

    bfin_write_EBIU_AMBCTL1(CONFIG_EBIU_AMBCTL1_VAL);

    bfin_write_EBIU_AMGCTL(CONFIG_EBIU_AMGCTL_VAL);

 

called in  start.S

    r3 = 0x0;

    r3.h = 0x2000;

    cc = r0 < r3 (iu);

    if cc jump .Lproc_initialized;

    serial_early_puts("Program Clocks");

    call _initcode;         //called here

    /* Since we reprogrammed SCLK, we need to update the serial divisor */

    serial_early_set_baud

.Lproc_initialized:

...

 

but it seems that the _initcode ()  would not be called because the program runs with the address > 0x20000000,so where does the EBIU_AMBCTL would be initialized ?

TranslateQuoteReplyEditDelete

 

 

2008-04-27 04:41:35     Re: problems with using net driver CS8900

Mike Frysinger (UNITED STATES)

Message: 55044    your analysis is incorrect ... you've interpreted the test to be the opposite of how it actually works

 

if you're interested in the booting process, please read the documentation:

http://docs.blackfin.uclinux.org/doku.php?id=bootloaders:u-boot:debugging

QuoteReplyEditDelete

 

 

2008-04-27 04:58:43     Re: problems with using net driver CS8900

Mike Frysinger (UNITED STATES)

Message: 55045    in fact, it's like you just ignored the comment block right above the lines you quoted where it explains the purpose of the code

QuoteReplyEditDelete

 

 

2008-04-27 06:39:12     Re: problems with using net driver CS8900

Pafone Lee (CHINA)

Message: 55047    oh,sorry

I just ran it in SDRAM with the command go 1000000 , so it did not work .i burn it to flash and run it in flash then it worked all right.my careless due to the incorrect analyze ,:D

 

i must pull the CS8900 reset pin high through CPLD control , and it should be done before board_get_enetaddr() which may be called in the step "Relocate saved environment from flash (or wherever configured)", if i add the CPLD control to "board_reset" as the doc

http://docs.blackfin.uclinux.org/doku.php?id=bootloaders:u-boot:porting&do=backlink refer to,

but it seems that there is not  any board_reset call in the booting process showed in http://docs.blackfin.uclinux.org/doku.php?id=bootloaders:u-boot:debugging

 

where should i make the board_reset call?

 

by the way , the doc http://docs.blackfin.uclinux.org/doku.php?id=bootloaders:u-boot:debugging

help a lot , thank you .

TranslateQuoteReplyEditDelete

 

 

2008-04-27 17:36:29     Re: problems with using net driver CS8900

Mike Frysinger (UNITED STATES)

Message: 55059    if you need to do setup before the call to board_get_enetaddr(), then you should be doing it in checkboard()

 

why do you think board_reset() should be called during the booting process ?  the function (and the description on the page you refer to) clearly indicate that it's only used while *resetting* (which is the opposite of booting).

 

also, the porting document you refer to already says where the board_reset() function should be located.

QuoteReplyEditDelete

 

 

2008-04-28 05:28:02     回复: Re: problems with using net driver CS8900

Pafone Lee (CHINA)

Message: 55111   

 

thanks,Mike

 

I  misunderstood what the doc describe about the reset_board.

 

now I have resovled this problem , thanks

 

but the cs8900 does not work yet, it needs debugging.

Attachments

    Outcomes