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]
Other format: [Raw text]

Re: PCI arbiter settings


"mohanlal jangir" <mohanlaljangir@hotmail.com> writes:

> [Thanks Jonathan and Nick for your prompt responses.]
> 
> > Take a look at the driver for your ethernet device and see if there
> > are any debug options. If so turn them on and see how far it gets. I
> > suspect you are just going to have to debug the device driver and find
> > out what is preventing it working.
> I enabled DEBUG option in ethernet driver and found that self test is
> failing. I am dumping output from ethernet driver at the end of mail. The
> message "device timed out" is coming because I have inserted one printf
> statement in function wait_for_cmd_done at following code
> if ( wait <= 0 ) {
>         // Then we timed out; reset the device and try again...
>         printf("device timed out\n");
>         OUTL(I82559_SELECTIVE_RESET, scb_ioaddr + SCBPort);
>

Using printf() here is a bad idea. Use diag_printf() instead. 


> Also I see BAR[0] contains 0 but sebsequent base address registers do not. I
> do see a code snippet in function cyg_pci_get_device_info as follows:
> // No reason to scan beyond first inactive BAR.
>      if (bar == 0) {
>   dev_info->num_bars = i;
>   break;
>      }
> This code does not care about sebsequent BARs if BAR[0] is zero and that is
> the case here. That leaves dev_info.base_map[] uninitialised which creates
> problem later. I don't know what exactly is problem. Kindly look at the
> dumped message and let me know where to find the problem.

I thought you had moved past this by temporarily commenting that test
out. I thought we were looking for a different problem.

However, that's not a permanent solution since the PCI spec says that
during configuration the end of the active BARs is marked by a zero
BAR. I'm not sure what the consequences of reading BARs beyond that
would be. 

> > The fact that RedBoot reports a MAC address suggests that the ethernet
> > device is being detected and initialized. So the problem may lie with
> > the PHY or some other piece of hardware. Can you check whether the
> > hardware is OK using Angel?
> Hardware means NIC card only or ARM Integrator board also. I have used the
> same NIC on another PC and it is able to send and receive pkts very well. So
> I can hope NIC is not a problem. If you meant ARM Integrator baord also then
> how do I go about it? I haven't worked with Angel but I know it is another
> kind of boot loader. Does loading Angle in falsh and getting boot loader
> prompt means ARM board is ok?

To be honest I don't know. I was hoping that you might have some ARM
tools around with which you could try it out. If not, then don't bother.


> Found device on bus 0, devfn 0x60:
>  Note that board is active. Probed sizes and CPU addresses invalid!
>  Vendor    0x8086
>  Device    0x1229
>  Command   0x0007, Status 0x2290
>  Class/Rev 0x0200000c
>  Header 0x00
>  SubVendor 0x8086, Sub ID 0x0040
>  BAR[0]    0x00000000 / probed size 0x00000000 / CPU addr 0x0000000a
>  BAR[1]    0x00004001 / probed size 0x000bd878 / CPU addr 0x000bd7f8
>  BAR[2]    0x00020000 / probed size 0x000bd7e4 / CPU addr 0x00000000
>  BAR[3]    0x00000000 / probed size 0x00048660 / CPU addr 0x00000000
>  BAR[4]    0x00000000 / probed size 0x000478d0 / CPU addr 0x00000000
>  BAR[5]    0x00000000 / probed size 0x00000030 / CPU addr 0x00000000
>  eth0 configured
>  memory address = 0x0000000a
>  I/O address = 0x000bd7f8

The main problem is that RedBoot has already initialized the device
and allocated base address zero in the PCI memory space. So when the
application comes along and tries again, it finds what appears to be a
zero BAR.

Try changing HAL_PCI_ALLOC_BASE_MEMORY in plf_io.h to 0x20000. Then
rebuild and reinstall RedBoot. The application will then see a
non-zero BAR during initialization.




-- 
Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com      The eCos and RedBoot experts


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


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