This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Bug (I think) in ethernet driver for XScale 80310


Hello,

If you're using networking with the XScale 80310 board, this may be of 
particular interest to you. It is worth noting to mention that I'm not 
working off from any particular release of eCos - I am working from the tip 
of tree so you should check the files I talk about here to see if it effects 
you as well.  It may not.


I think I've found a bug with the ethernet driver (for the I82559) for the 
XScale 80310.  I don't know if this should be classified a "driver" bug or a 
more general one, but it would seem only to affect the 80310 eval board.  I 
also mentioned this bug on the list last week and though I made a mistake 
about identifying it.  Now I'm fairly certain that it was indeed a bug.

The file 
${ECOS_REPOSITORY}devs/eth/arm/iq80310/current/include/iq80310_info.h defines 
MAX_RX_DESCRIPTORS and MAX_RX_DESCRIPTORS both to 128 when eCos is compiled 
for the target=iq80310 template=net.  However, the amount of memory that is 
reserved total for these descriptors appears to only be 16KB regardless of 
the number of descriptors defined in iq80310_info.h

In the file ${ECOS_REPOSITORY}/devs/eth/arm/iq80310/current/src/if_iq80310.c 
within function pci_init_find_82559s() the global variable i82559_heap_size 
is set to 16*1024.  This variable controls how much heap can be allocated 
with the function pciwindow_mem_alloc().

The file ${ECOS_REPOSITORY}/devs/eth/arm/iq80310/current/src/if_shmem.S 
defines the variable cyg_io_iq80310_i82559_shmem which is the heap used for 
the descriptors.  This variable always reserves 16K (the comments say it only 
reserves 4K though - my ARM assembly is a bit rustly) regardless of what 
MAX_RX_DESCRIPTORS or MAX_RX_DESCRIPTORS is defined to.

The result is that the number of rx and tx descriptors must be set to a very 
small value (like 4) in iq80310_info.h to get the networking going under the 
XScale.  Furthermore, a value of 4 makes throughput very low.

The solution I concoted was to increase the amount of memory reserved in 
if_shmem.S by cyg_io_iq80310_i82559_shmem and to likewise increase the value 
of variable i82559_heap_size to agree with cyg_io_iq80310_i82559_shmem.  This 
of course creates a problem with compiling redboot which only needs 4 or so 
descriptors.  Since I don't often compile redboot this doesn't affect me, 
although it is certain to affect others that do compile redboot.

Thanks,
-Rich


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]