Problem - configuring device on PCI bus - VxWorks

This is a discussion on Problem - configuring device on PCI bus - VxWorks ; I am using MBX860 board, power-pc processor (PPC860) .Previously we used Vxworks 5.4. and now we are in a situation to migrate to Vxworks 5.5. As part of migration, I converted the existing (Vxworks 5.4) project file .wpj to higher ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Problem - configuring device on PCI bus

  1. Problem - configuring device on PCI bus

    I am using MBX860 board, power-pc processor (PPC860) .Previously we
    used Vxworks 5.4. and now we are in a situation to migrate to Vxworks
    5.5.

    As part of migration, I converted the existing (Vxworks 5.4) project
    file .wpj to higher version using tool provided by windriver. I
    didn't change my bootrom. I am using the same bootrom compiled using
    Vxworks 5.4 .And I compiled my application code with older BSP folder
    in new version (5.5). i mean to say i just recompiled my application in
    vxworks 5.5. Compilation succeeded. When I load the compiled Vxworks
    image, it crashed while configuring PCI controller (QL5064). I traced
    out that when I tried to use pci address it is crashing. See the
    following for your reference


    usrappint-> initpci->pciConfigDevice(configuring QL5064)
    ->pciConfigOutLong

    Pciconfig.h


    #define QL5064 0x88000000
    #define QL5064_PCI_ADDR 0x88000098
    #define QL5064_LOW 0x880000A0
    #define QL5064_HIGH 0x880000A4
    #define QL5064_COMMAND 0x88000024
    #define QL5064_CONTROL94 0x88000094


    Pciconfiglib.c

    #include "pciconfig.h"
    "
    "
    "
    "
    UINT32 *pciAddress = (UINT32*)QL5064_PCI_ADDR;
    UINT32 *pciLow = (UINT32*)QL5064_LOW;
    UINT32 *pciHigh = (UINT32*)QL5064_HIGH;
    UINT32 *pciCommand = (UINT32*)QL5064_COMMAND;
    UINT8 *pciControl94 = (UINT8*)QL5064_CONTROL94;

    [When I try to use anyone of the above address, it crashes]

    STATUS pciConfigOutLong
    (
    int busNo, /* bus number */
    int deviceNo, /* device number */
    int funcNo, /* function number */
    int offset, /* offset into the configuration space */
    UINT32 data /* data written to the offset */
    )
    {
    int key;

    UINT32 dataOut;

    key = intLock (); /* mutual exclusion start */

    dataOut = Swap( pciConfigBdfPack (busNo, deviceNo, funcNo) |
    (0xFFFFFFF8&offset) ) ;
    *pciAddress = dataOut; [crashed.. and got data access exception ]

    if ( offset & 0x4 ) {
    *pciHigh = Swap(data);
    *pciCommand = Swap(QL_START | QL_CONFIG_WRITE | QL_HIGH_32 );
    } else {
    *pciLow = Swap(data);
    *pciCommand = Swap(QL_START | QL_CONFIG_WRITE | QL_LOW_32 );
    }

    intUnlock (key); /* mutual exclusion stop */

    return (OK);

    }


    can anybody tell me what is that causing problem.


  2. Re: Problem - configuring device on PCI bus

    Hi:

    I don't you board or who sets up the pci, but normall vxWorks will
    auto-configure the pci in sysHwInit or in the startup rom code. Maybe
    what you are doing is redundant with what's already set up.

    What does sysPciShow show? It sounds almost like the bridge is set up
    and a differnet address that what your #defines show.

    Might be some issues with the different versions of the bootrom and
    kernel. Were the build from the same BSP revs?

    Good luck,
    lc


  3. Re: Problem - configuring device on PCI bus

    hi Larry,

    >>but normall vxWorks will

    auto-configure the pci in sysHwInit or in the startup rom code. Maybe

    what you are doing is redundant with what's already set up.
    we are using QL5064 PCI controller which is 64bit controller .
    vxworks doesnt have support for autoconfiguring 64bit pci controller.

    >>Might be some issues with the different versions of the bootrom and

    kernel. Were the build from the same BSP revs?

    put some more lights regarding this. i am using the old boot rom
    and BSP files in Tornado 2.2

    with thanks
    V.


  4. Re: Problem - configuring device on PCI bus

    Hi:

    It looks like your bridge chip is either not at the address your header
    file points to or it's just not working. The QL5064 is some sort of
    programmable logic bridge? Is is set up and loaded before you start
    accessing it? If you just upgraded BSP and Tornado, you may have
    clobbered some vendor-specific code with some plain vanilla vxWorks
    stuff - maybe compare your old and new sysLib.c to start and see if any
    calls are missing.

    Updating BSPs in place and changing versions of Tornado can be
    problematic if you used the same tree - directories move around and
    multiple copies of source and headers can exist, causing confusion if
    your code pulls in header file with hard paths.

    When have these kids of problems, I put in a clean copy of Tornado onto
    my PC in a new directory -say c:/Torn_221 (no spaces ever in Tornado
    paths!), then add the BSP, configure vxWorks (you never mentioned when
    you migrated if you set your pci_autoconfig the same), and build a
    kernel and try it. Remember to set your WIND_BASE to c:/Torn_221 when
    you change the Tornado tree you are using. At some point, it's going
    to to work. Then build your app in the same tree with the same
    WIND_BASE.

    Good luck,
    lc


+ Reply to Thread