using the 2nd Race++ channel between Echotek AD 812 and Midas M3220SR2.

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Hello,nice people:

we are now using Echotek AD 812 ,Midas M3220SR2,and VMFC 4310 to
transfer data from AD to vmfc's buffer,but we could only use one
channel of the Race++.Now we want to use the two race channels
simultaneously .And I do the  following function calling:

1st:if((rc = pxb_drv_init(0, NULL)) != PXB_SUCCESS)
        pxb_err_info("pxb_drv_init",rc);
2nd:if((rc =
pxb_smb_attach(RACE_ADDR,RACE_ROUTE,0,RACE_SIZE,0,&my_smb))
       != PXB_SUCCESS)
        pxb_err_info("pxb_smb_attach",rc);
3rd:if((rc = pxb_race2pci_win_set(PXB_ID_PRIMARY, RACE2PCI_WIN_MEM,
                                  0x08000000, RACE_SIZE)) != OK)
        pxb_err_info("pxb_race2pci_win_set",rc);
4th:if((rc=pxb_race2pci_win_set(PXB_ID_SECONDARY,RACE2PCI_WIN_MEM,0x08000000,RACE_SIZE))!=
OK)
        pxb_err_info("pxb_race2pci_win_set_secondary",  rc);

but unfortunately the 4th function returns error,and results message as
follows:
!!!!!!!!!!
PXB_NO_ACCESS
!!!!!!!!!!

some extra message that may be helpful is that we had successfully used
one channel of the two race++ channel.

So,my question is :Should I do some other configuration work in bsp or
some other file?How could I add the second window for the second
PXB?After that ,Should I try some other route code accordingly?

Thank you very much for you valuable help!
With Best Regards!

Yours,Sincerely
Mei Guodong

the raceInit codes may be helpful as well.
//*race_midas.cpp*//
#include "stdio.h"
#include "race_drv.h"

#include "../Common/CommonDef.h"

#define RACE2PCI_WIN_MEM 0
#define RACE2PCI_WIN_MIO 1
#define RACE2PCI_WIN_IO  2

#define RACE_ADDR   (0x00000000)
#define RACE_ROUTE  (0x00000000)
#define RACE_SIZE   (128 * 1024 * 1024)

typedef void* PXB_handle;
typedef void* PXB_device;

/* functions in lib race_drv.o */

/*
extern int sys_pxb_mgr_get_handle(PXB_ID,PXB_handle*,PXB_device*);
extern int sys_pxb_race2pci_win_get
(PXB_handle,int,uint32_t*,uint32_t*);
extern int sys_pxb_race2pci_win_set (PXB_handle,int,uint32_t,uint32_t);
*/

int pxb_race2pci_win_set(PXB_ID,int,uint32_t,uint32_t);
int pxb_race2pci_win_get(PXB_ID,int type,uint32_t *pci_base,uint32_t*);

static int pxb_err_info(char *info,int rc)
{
    mPrint("ERROR: \"%s\" returned error 0x%x (%s), %s\n",
           info,rc,pxb_drv_errstr(rc,0),pxb_drv_errstr(rc,1));
    return rc;
}

void initRace()
{
    int                   rc;
    int                   count;
    SMB_handle            my_smb = NULL;
    unsigned long         smb_addr;
    unsigned long         smb_route;
    unsigned long         smb_ret_route;
    unsigned long         nbytes;



    /***** Initialize driver interface *****/
    if((rc = pxb_drv_init(0, NULL)) != PXB_SUCCESS)
        pxb_err_info("pxb_drv_init",rc);


if((rc=pxb_ioctl(PXB_ID_SECONDARY,PXB_IOCTL_ACCEPT_ACCESS,0))!=OK)
        pxb_err_info("pxb_ioctl :PXB_IOCTL_ACCEPT_ACCESS",rc);

    /***** Set window for traffic from RACEway to PCI *****/
    /* BSP 1.2/1.1 */

    if((rc = pxb_race2pci_win_set(PXB_ID_PRIMARY, RACE2PCI_WIN_MEM,
                                  0xc0000000, RACE_SIZE)) != OK)
        pxb_err_info("pxb_race2pci_win_set",rc);

//new added  by mgd

    if((rc=pxb_race2pci_win_set

(PXB_ID_SECONDARY,RACE2PCI_WIN_MEM,0xc8000000,RACE_SIZE))!= OK)
        pxb_err_info("pxb_race2pci_win_set_secondary",  rc);

//new added by mgd

    mPrint("\nRACE++ mapped to 0x%lx\n", 0xc0000000);

    return;}

int pxb_race2pci_win_set (
                         PXB_ID         pxbId,
                         int            type,
                         uint32_t       pci_base,
                         uint32_t       pci_size
                         )
{
    PXB_handle handle=0;
    PXB_device device=0;
    int rc;

    rc=sys_pxb_mgr_get_handle(pxbId,&handle,&device);
    if(rc==0)
        rc=sys_pxb_race2pci_win_set(handle,type,pci_base,pci_size);
    return rc;
}

int pxb_race2pci_win_get (
                         PXB_ID         pxbId,
                         int            type,
                         uint32_t      *pci_base,
                         uint32_t      *pci_size
                         )
{
    PXB_handle handle=0;
    PXB_device device=0;
    int rc;

    rc=sys_pxb_mgr_get_handle(pxbId,&handle,&device);
    if(rc==0)
rc=sys_pxb_race2pci_win_get(handle,type,pci_base,pci_size);
    return rc;
}


Site Timeline