Implement Silicom card features #1

Merged
DataHoarder merged 12 commits from implement-silicom-card into master 2021-10-28 05:16:53 +00:00
2 changed files with 90 additions and 12 deletions
Showing only changes of commit 46cb10f2a4 - Show all commits

View file

@ -50,6 +50,12 @@ typedef enum
/** Bus to transceiver 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 */
FM_PLAT_BUS_PHY,

View file

@ -2471,7 +2471,7 @@ static fm_status LoadTlv(fm_byte *tlv)
if (hwCfg.numResId != 0)
{
CfgOrderErrorMsg(tlv, 0,
"must must be before hwResourceId.count config");
"must be before hwResourceId.count config");
return FM_ERR_INVALID_ARGUMENT;
}
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);
return FM_OK;
@ -4239,6 +4237,7 @@ fm_status fmPlatformLibSelectBus(fm_int sw,
fm_uint bitIdx;
fm_uint cnt;
fm_busSel *xcvrI2cBus;
fm_pcaMux *pcaMuxPtr;
fm_uint lastId;
fm_uint id;
@ -4297,7 +4296,78 @@ fm_status fmPlatformLibSelectBus(fm_int sw,
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;
muxIdx = hwCfg.pcaIo[idx].parentMuxIdx;
@ -4703,6 +4773,11 @@ fm_status fmPlatformLibGetPortXcvrState(fm_int sw,
else if (xcvrIo->intfType == INTF_TYPE_QSFP)
{
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))
{
byteIdx = offset / 8;
@ -4713,10 +4788,6 @@ fm_status fmPlatformLibGetPortXcvrState(fm_int sw,
xcvrState[cnt] |= FM_PLAT_XCVR_PRESENT;
}
}
else if (offset == UINT_NOT_USED)
{
xcvrState[cnt] |= FM_PLAT_XCVR_PRESENT;
}
offset = xcvrIo->u.qsfpPin.intrN;
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
(Vendor : TE Connectivity : PN 2231368-1).*/
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))
{
byteIdx = offset / 8;
@ -4744,10 +4820,6 @@ fm_status fmPlatformLibGetPortXcvrState(fm_int sw,
xcvrState[cnt] |= FM_PLAT_XCVR_LPMODE;
}
}
else if (offset == UINT_NOT_USED)
{
xcvrState[cnt] |= FM_PLAT_XCVR_LPMODE;
}
offset = xcvrIo->u.qsfpPin.resetN;
if ((offset != UINT_NOT_USED) && (offset < NUM_PCA_PINS))