Implement Silicom card features #1
2 changed files with 90 additions and 12 deletions
|
@ -50,6 +50,12 @@ typedef enum
|
||||||
/** Bus to transceiver state */
|
/** Bus to transceiver state */
|
||||||
FM_PLAT_BUS_XCVR_STATE,
|
FM_PLAT_BUS_XCVR_STATE,
|
||||||
|
|
||||||
|
FM_PLAT_BUS_UNKNOWN_4,
|
||||||
|
FM_PLAT_BUS_UNKNOWN_5,
|
||||||
|
FM_PLAT_BUS_UNKNOWN_6,
|
||||||
|
FM_PLAT_BUS_UNKNOWN_7,
|
||||||
|
FM_PLAT_BUS_UNKNOWN_8,
|
||||||
|
|
||||||
/** Bus to transceiver eeprom */
|
/** Bus to transceiver eeprom */
|
||||||
FM_PLAT_BUS_PHY,
|
FM_PLAT_BUS_PHY,
|
||||||
|
|
||||||
|
|
|
@ -2471,7 +2471,7 @@ static fm_status LoadTlv(fm_byte *tlv)
|
||||||
if (hwCfg.numResId != 0)
|
if (hwCfg.numResId != 0)
|
||||||
{
|
{
|
||||||
CfgOrderErrorMsg(tlv, 0,
|
CfgOrderErrorMsg(tlv, 0,
|
||||||
"must must be before hwResourceId.count config");
|
"must be before hwResourceId.count config");
|
||||||
return FM_ERR_INVALID_ARGUMENT;
|
return FM_ERR_INVALID_ARGUMENT;
|
||||||
}
|
}
|
||||||
hwCfg.defBusSelType = GetTlvInt(tlv + 3, 1);
|
hwCfg.defBusSelType = GetTlvInt(tlv + 3, 1);
|
||||||
|
@ -2841,8 +2841,6 @@ static fm_status LoadConfig(void)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Release lib config to free memory */
|
|
||||||
fmPlatformReleaseLibTlvCfg(swIdx);
|
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
return FM_OK;
|
return FM_OK;
|
||||||
|
@ -4239,6 +4237,7 @@ fm_status fmPlatformLibSelectBus(fm_int sw,
|
||||||
fm_uint bitIdx;
|
fm_uint bitIdx;
|
||||||
fm_uint cnt;
|
fm_uint cnt;
|
||||||
fm_busSel *xcvrI2cBus;
|
fm_busSel *xcvrI2cBus;
|
||||||
|
fm_pcaMux *pcaMuxPtr;
|
||||||
fm_uint lastId;
|
fm_uint lastId;
|
||||||
fm_uint id;
|
fm_uint id;
|
||||||
|
|
||||||
|
@ -4297,7 +4296,78 @@ fm_status fmPlatformLibSelectBus(fm_int sw,
|
||||||
|
|
||||||
muxIdx = UINT_NOT_USED;
|
muxIdx = UINT_NOT_USED;
|
||||||
|
|
||||||
if (busType == FM_PLAT_BUS_XCVR_STATE)
|
if (busType == FM_PLAT_BUS_UNKNOWN_4)
|
||||||
|
{
|
||||||
|
if (hwCfg.numPcaMux > 0)
|
||||||
|
{
|
||||||
|
for (muxValue = 0; muxValue < hwCfg.numPcaMux; ++muxValue)
|
||||||
|
{
|
||||||
|
if (hwCfg.pcaMux[muxValue].bus == sw)
|
||||||
|
{
|
||||||
|
status = SetupMuxPath(muxValue, 2);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (busType == FM_PLAT_BUS_UNKNOWN_5)
|
||||||
|
{
|
||||||
|
if (hwCfg.numPcaMux > 0)
|
||||||
|
{
|
||||||
|
for (muxValue = 0; muxValue < hwCfg.numPcaMux; ++muxValue)
|
||||||
|
{
|
||||||
|
if (hwCfg.pcaMux[muxValue].bus == sw)
|
||||||
|
{
|
||||||
|
status = SetupMuxPath(muxValue, 4);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (busType == FM_PLAT_BUS_UNKNOWN_6)
|
||||||
|
{
|
||||||
|
if (hwCfg.numPcaMux > 0)
|
||||||
|
{
|
||||||
|
for (muxValue = 0; muxValue < hwCfg.numPcaMux; ++muxValue)
|
||||||
|
{
|
||||||
|
if (hwCfg.pcaMux[muxValue].bus == sw)
|
||||||
|
{
|
||||||
|
status = SetupMuxPath(muxValue + 1, 1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (busType == FM_PLAT_BUS_UNKNOWN_7)
|
||||||
|
{
|
||||||
|
if (hwCfg.numPcaMux > 0)
|
||||||
|
{
|
||||||
|
for (muxValue = 0; muxValue < hwCfg.numPcaMux; ++muxValue)
|
||||||
|
{
|
||||||
|
if (hwCfg.pcaMux[muxValue].bus == sw)
|
||||||
|
{
|
||||||
|
status = SetupMuxPath(muxValue, 4);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (busType == FM_PLAT_BUS_UNKNOWN_8)
|
||||||
|
{
|
||||||
|
if (hwCfg.numPcaMux > 0)
|
||||||
|
{
|
||||||
|
for (muxValue = 0; muxValue < hwCfg.numPcaMux; ++muxValue)
|
||||||
|
{
|
||||||
|
if (hwCfg.pcaMux[muxValue].bus == sw)
|
||||||
|
{
|
||||||
|
status = SetupMuxPath(muxValue, 8);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (busType == FM_PLAT_BUS_XCVR_STATE)
|
||||||
{
|
{
|
||||||
idx = hwResId->xcvrStateIo.ioIdx;
|
idx = hwResId->xcvrStateIo.ioIdx;
|
||||||
muxIdx = hwCfg.pcaIo[idx].parentMuxIdx;
|
muxIdx = hwCfg.pcaIo[idx].parentMuxIdx;
|
||||||
|
@ -4703,6 +4773,11 @@ fm_status fmPlatformLibGetPortXcvrState(fm_int sw,
|
||||||
else if (xcvrIo->intfType == INTF_TYPE_QSFP)
|
else if (xcvrIo->intfType == INTF_TYPE_QSFP)
|
||||||
{
|
{
|
||||||
offset = xcvrIo->u.qsfpPin.modPresN;
|
offset = xcvrIo->u.qsfpPin.modPresN;
|
||||||
|
if (offset == UINT_NOT_USED)
|
||||||
|
{
|
||||||
|
xcvrState[cnt] |= FM_PLAT_XCVR_PRESENT;
|
||||||
|
}
|
||||||
|
|
||||||
if ((offset != UINT_NOT_USED) && (offset < NUM_PCA_PINS))
|
if ((offset != UINT_NOT_USED) && (offset < NUM_PCA_PINS))
|
||||||
{
|
{
|
||||||
byteIdx = offset / 8;
|
byteIdx = offset / 8;
|
||||||
|
@ -4713,10 +4788,6 @@ fm_status fmPlatformLibGetPortXcvrState(fm_int sw,
|
||||||
xcvrState[cnt] |= FM_PLAT_XCVR_PRESENT;
|
xcvrState[cnt] |= FM_PLAT_XCVR_PRESENT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (offset == UINT_NOT_USED)
|
|
||||||
{
|
|
||||||
xcvrState[cnt] |= FM_PLAT_XCVR_PRESENT;
|
|
||||||
}
|
|
||||||
|
|
||||||
offset = xcvrIo->u.qsfpPin.intrN;
|
offset = xcvrIo->u.qsfpPin.intrN;
|
||||||
if ((offset != UINT_NOT_USED) && (offset < NUM_PCA_PINS))
|
if ((offset != UINT_NOT_USED) && (offset < NUM_PCA_PINS))
|
||||||
|
@ -4734,6 +4805,11 @@ fm_status fmPlatformLibGetPortXcvrState(fm_int sw,
|
||||||
input/output mismatch seen with specific cables
|
input/output mismatch seen with specific cables
|
||||||
(Vendor : TE Connectivity : PN 2231368-1).*/
|
(Vendor : TE Connectivity : PN 2231368-1).*/
|
||||||
offset = xcvrIo->u.qsfpPin.lpMode;
|
offset = xcvrIo->u.qsfpPin.lpMode;
|
||||||
|
if (offset == UINT_NOT_USED)
|
||||||
|
{
|
||||||
|
xcvrState[cnt] |= FM_PLAT_XCVR_LPMODE;
|
||||||
|
}
|
||||||
|
|
||||||
if ((offset != UINT_NOT_USED) && (offset < NUM_PCA_PINS))
|
if ((offset != UINT_NOT_USED) && (offset < NUM_PCA_PINS))
|
||||||
{
|
{
|
||||||
byteIdx = offset / 8;
|
byteIdx = offset / 8;
|
||||||
|
@ -4744,10 +4820,6 @@ fm_status fmPlatformLibGetPortXcvrState(fm_int sw,
|
||||||
xcvrState[cnt] |= FM_PLAT_XCVR_LPMODE;
|
xcvrState[cnt] |= FM_PLAT_XCVR_LPMODE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (offset == UINT_NOT_USED)
|
|
||||||
{
|
|
||||||
xcvrState[cnt] |= FM_PLAT_XCVR_LPMODE;
|
|
||||||
}
|
|
||||||
|
|
||||||
offset = xcvrIo->u.qsfpPin.resetN;
|
offset = xcvrIo->u.qsfpPin.resetN;
|
||||||
if ((offset != UINT_NOT_USED) && (offset < NUM_PCA_PINS))
|
if ((offset != UINT_NOT_USED) && (offset < NUM_PCA_PINS))
|
||||||
|
|
Loading…
Reference in a new issue