AnsweredAssumed Answered

Questions about MPC8303 PCIE driver @ Vxworks-6.9.4.

Question asked by Heqinlong He on Apr 16, 2019
Latest reply on Apr 21, 2019 by alexander.yakovlev

Questions about MPC8303 PCIE driver @ Vxworks-6.9.4.

The MPC8308 has only one PCIE controller.

In the function m83xxPciExMethodDevCfgRead,When the busNo=0,deviceNo =0 the code return the "retValLong = CSR_READ_4(pInst, deviceOffset);"

but when the deviceNo is 0x1, the driver can't return the config space.(retValLong = CFG_READ_4(pInst, deviceOffset);)

 

So. the bus scan is fail.

how to fix it? 

 

thanks~

if ((deviceNo != 0) ||
(busNo >= ((struct m83xxPciExDrvCtrl *)(pInst->pDrvCtrl))->pciMaxBus))
{
switch(width)
{
case 1:
*(UINT8*)pData = 0xff;
break;
case 2:
*(UINT16*)pData = 0xffff;
break;
case 4:
*(UINT32*)pData = 0xffffffff;
break;
default:
break;
}
return(ERROR);
}

 

deviceOffset = (busNo << PCIE_BUS_SHIFT) |
(deviceNo << PCIE_DEV_SHIFT)|
(funcNo << PCIE_FUNC_SHIFT);
deviceOffset += (offset & 0xffc);

key = intCpuLock();

if ((busNo == 0 ) && (deviceNo == 0) && (funcNo == 0))
retValLong = CSR_READ_4(pInst, deviceOffset);
else
retValLong = CFG_READ_4(pInst, deviceOffset);

Outcomes