Add ability to use raw PCIe mapped resource4 (BAR4) (#2)
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This allows using raw PCIe mapped BAR4 resources for management. MSI interrupts are not supported. Even when using a module that does not support UIO, management engine can still be used. Usage example under _fm_platform_attributes.cfg_ ``` api.platform.config.switch.0.resource4DevName text /sys/bus/pci/devices/0000:84:00.0/resource4 ``` Should work under containers and links, given the actual device is the target and not the resource. Co-authored-by: WeebDataHoarder <57538841+weebdatahoarder@users.noreply.github.com> Reviewed-on: Sillycom/IES#2 Co-authored-by: DataHoarder <weebdatahoarder@noreply.gammaspectra.live> Co-committed-by: DataHoarder <weebdatahoarder@noreply.gammaspectra.live>
This commit is contained in:
parent
5a54208178
commit
93e8b23145
|
@ -34,7 +34,7 @@
|
|||
#ifndef __FM_HOST_DRV_H
|
||||
#define __FM_HOST_DRV_H
|
||||
|
||||
#define FM_UIO_MAX_NAME_SIZE 64
|
||||
#define FM_UIO_MAX_NAME_SIZE 256
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
@ -47,10 +47,21 @@ typedef struct
|
|||
|
||||
} fm_uioDriverInfo;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
fm_char device[FM_UIO_MAX_NAME_SIZE];
|
||||
fm_char name[FM_UIO_MAX_NAME_SIZE];
|
||||
fm_char version[FM_UIO_MAX_NAME_SIZE];
|
||||
fm_int size;
|
||||
fm_int offset;
|
||||
|
||||
} fm_resource4DriverInfo;
|
||||
|
||||
fm_status fmPlatformHostDrvOpen(fm_int sw,
|
||||
fm_int mgmtPep,
|
||||
fm_text netDevName,
|
||||
fm_text uioDevName,
|
||||
fm_text uioDevName,
|
||||
fm_text resource4DevName,
|
||||
void * desiredMemmapAddr);
|
||||
|
||||
fm_status fmPlatformHostDrvClose(fm_int sw);
|
||||
|
|
|
@ -1243,6 +1243,17 @@
|
|||
#define FM_AAT_API_PLATFORM_UIO_DEV_NAME FM_API_ATTR_TEXT
|
||||
#define FM_AAD_API_PLATFORM_UIO_DEV_NAME "no_uioDevName"
|
||||
|
||||
|
||||
/*
|
||||
* (Optional) The resource4 device name associated to the switch.
|
||||
* \lb\lb
|
||||
* For example: /sys/bus/pci/devices/0000:84:00.0/resource4
|
||||
* \lb\lb
|
||||
*/
|
||||
#define FM_AAK_API_PLATFORM_RESOURCE4_DEV_NAME "api.platform.config.switch.%d.resource4DevName"
|
||||
#define FM_AAT_API_PLATFORM_RESOURCE4_DEV_NAME FM_API_ATTR_TEXT
|
||||
#define FM_AAD_API_PLATFORM_RESOURCE4_DEV_NAME "no_resource4DevName"
|
||||
|
||||
/*
|
||||
* (Optional) Defines the number of interrupt timeouts prior declaring
|
||||
* UIO interrupt issue with the host driver.
|
||||
|
|
|
@ -189,7 +189,7 @@ typedef enum
|
|||
} fm_platPhyModel;
|
||||
|
||||
|
||||
#define FM_PLAT_MAX_CFG_STR_LEN 32
|
||||
#define FM_PLAT_MAX_CFG_STR_LEN 256
|
||||
|
||||
#define FM_PLAT_NUM_SW fmRootPlatform->cfg.numSwitches
|
||||
#define FM_PLAT_GET_CFG (&fmRootPlatform->cfg)
|
||||
|
@ -499,6 +499,9 @@ typedef struct
|
|||
/* UIO device name */
|
||||
fm_char uioDevName[FM_PLAT_MAX_CFG_STR_LEN];
|
||||
|
||||
/* raw BAR4 device name */
|
||||
fm_char resource4DevName[FM_PLAT_MAX_CFG_STR_LEN];
|
||||
|
||||
/* Number of PHYs/retimers connected to the switch */
|
||||
fm_int numPhys;
|
||||
|
||||
|
|
|
@ -227,6 +227,11 @@ typedef struct
|
|||
/* UIO device information */
|
||||
fm_uioDriverInfo uioInfo;
|
||||
|
||||
/* resource4 device information */
|
||||
fm_resource4DriverInfo resource4Info;
|
||||
|
||||
fm_bool useResource4;
|
||||
|
||||
/* Thread handle for interrupt listener */
|
||||
fm_thread intrListener;
|
||||
|
||||
|
|
|
@ -332,7 +332,7 @@
|
|||
#define FM_TLV_PLAT_CPU_PORT 0x4009
|
||||
#define FM_TLV_PLAT_INTR_POLL_PER 0x400a
|
||||
#define FM_TLV_PLAT_PHY_EN_DEEMPHASIS 0x400b
|
||||
|
||||
#define FM_TLV_PLAT_RESOURCE4_DEVNAME 0x400c
|
||||
|
||||
/* Shared library properties */
|
||||
#define FM_TLV_PLAT_LIB_I2C_DEVNAME 0x5000
|
||||
|
|
|
@ -596,6 +596,105 @@ static fm_status GetUioDevInfo(fm_int num, fm_uioDriverInfo *info)
|
|||
|
||||
} /* end GetUioDevInfo */
|
||||
|
||||
static fm_status GetResource4DriverName(fm_text path, fm_char *name)
|
||||
{
|
||||
fm_char filename[FM_UIO_MAX_NAME_SIZE];
|
||||
fm_char buf[FM_UIO_MAX_NAME_SIZE];
|
||||
fm_uint idx;
|
||||
|
||||
FM_SNPRINTF_S(filename, sizeof(filename), "%s/driver", path);
|
||||
|
||||
name[0] = '\0';
|
||||
if(readlink(filename, buf, FM_UIO_MAX_NAME_SIZE - 1))
|
||||
{
|
||||
for (idx = strlen(buf) - 1; idx > 0; --idx)
|
||||
{
|
||||
if (buf[idx] == '/')
|
||||
{
|
||||
strcpy(name, &buf[idx + 1]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return FM_OK;
|
||||
}
|
||||
|
||||
return FM_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
static fm_status GetResource4DriverVersion(fm_text path, fm_char *version)
|
||||
{
|
||||
fm_char filename[FM_UIO_MAX_NAME_SIZE];
|
||||
|
||||
FM_SNPRINTF_S(filename, sizeof(filename), "%s/driver/module/version", path);
|
||||
|
||||
return ReadLineFromFile(filename, version);
|
||||
|
||||
}
|
||||
|
||||
fm_status GetResource4MemSize(fm_text resource4Path, fm_int memMapNr, fm_int *size)
|
||||
{
|
||||
struct stat buf;
|
||||
if(stat(resource4Path, &buf) != FM_OK)
|
||||
{
|
||||
return FM_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
*size = buf.st_size;
|
||||
|
||||
return FM_OK;
|
||||
}
|
||||
|
||||
static fm_status GetResource4DevInfo(fm_text path, fm_resource4DriverInfo *info)
|
||||
{
|
||||
fm_status err;
|
||||
fm_int memMapNr;
|
||||
|
||||
/* Get the driver name */
|
||||
err = GetResource4DriverName(path, info->name);
|
||||
if (err != FM_OK)
|
||||
{
|
||||
FM_LOG_ERROR(FM_LOG_CAT_PLATFORM,
|
||||
"Unable to read resource4 driver name\n");
|
||||
return err;
|
||||
}
|
||||
FM_LOG_DEBUG(FM_LOG_CAT_PLATFORM, "Driver name: %s\n", info->name);
|
||||
|
||||
memMapNr = 0;
|
||||
|
||||
/* Get the driver version number */
|
||||
err = GetResource4DriverVersion(path, info->version);
|
||||
if (err != FM_OK)
|
||||
{
|
||||
FM_LOG_ERROR(FM_LOG_CAT_PLATFORM,
|
||||
"Unable to read resource4 driver version\n");
|
||||
return err;
|
||||
}
|
||||
FM_LOG_DEBUG(FM_LOG_CAT_PLATFORM, "Driver version: %s\n", info->version);
|
||||
|
||||
/* Get the driver memory size */
|
||||
err = GetResource4MemSize(info->device, memMapNr, &info->size);
|
||||
if (err != FM_OK)
|
||||
{
|
||||
FM_LOG_ERROR(FM_LOG_CAT_PLATFORM,
|
||||
"Unable to read resource4 mem size\n");
|
||||
return err;
|
||||
}
|
||||
FM_LOG_DEBUG(FM_LOG_CAT_PLATFORM, "Driver memsize: 0x%x\n", info->size);
|
||||
|
||||
/* Get the driver memory offset */
|
||||
err = GetUioMemOffset(memMapNr, &info->offset);
|
||||
if (err != FM_OK)
|
||||
{
|
||||
FM_LOG_ERROR(FM_LOG_CAT_PLATFORM,
|
||||
"Unable to get resource4 memory offset\n");
|
||||
return err;
|
||||
}
|
||||
FM_LOG_DEBUG(FM_LOG_CAT_PLATFORM, "Driver memory offset: 0x%x\n",
|
||||
info->offset);
|
||||
|
||||
return FM_OK;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -1305,7 +1404,62 @@ ABORT:
|
|||
|
||||
} /* end GetNetDevFromUio */
|
||||
|
||||
static fm_status GetNetDevFromResource4(fm_text resource4Path,
|
||||
fm_text netDevName,
|
||||
fm_int netDevNameLength)
|
||||
{
|
||||
struct dirent **namelist;
|
||||
fm_int n;
|
||||
fm_bool found;
|
||||
fm_status err;
|
||||
fm_char filename[FM_UIO_MAX_NAME_SIZE];
|
||||
|
||||
if (netDevName == NULL)
|
||||
{
|
||||
return FM_ERR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
FM_SNPRINTF_S(filename,
|
||||
sizeof(filename),
|
||||
"%s/net",
|
||||
resource4Path);
|
||||
|
||||
/* Iterate directory and find a net
|
||||
* device corresponding to the management PEP */
|
||||
n = scandir(filename,
|
||||
&namelist,
|
||||
FilterOutLocalAndParentDirectories,
|
||||
alphasort);
|
||||
if (n < 0)
|
||||
{
|
||||
err = FM_ERR_NOT_FOUND;
|
||||
goto ABORT;
|
||||
}
|
||||
|
||||
found = FALSE;
|
||||
|
||||
while(n--)
|
||||
{
|
||||
if (!found)
|
||||
{
|
||||
FM_STRNCPY_S(netDevName,
|
||||
netDevNameLength,
|
||||
namelist[n]->d_name,
|
||||
netDevNameLength);
|
||||
found = TRUE;
|
||||
}
|
||||
|
||||
free(namelist[n]);
|
||||
|
||||
}
|
||||
free(namelist);
|
||||
|
||||
err = (found == TRUE) ? FM_OK : FM_ERR_NOT_FOUND;
|
||||
|
||||
ABORT:
|
||||
return err;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -1674,7 +1828,33 @@ static fm_int OpenUioDevice(fm_int num, fm_text devName)
|
|||
|
||||
} /* end OpenUioDevice */
|
||||
|
||||
static fm_int OpenResource4Device(fm_text devName)
|
||||
{
|
||||
fm_int fd;
|
||||
fm_char strErrBuf[FM_STRERROR_BUF_SIZE];
|
||||
errno_t strErrNum;
|
||||
|
||||
/* Open the UIO device. */
|
||||
fd = open(devName, O_RDWR);
|
||||
|
||||
if (fd < 0)
|
||||
{
|
||||
strErrNum = FM_STRERROR_S(strErrBuf,
|
||||
FM_STRERROR_BUF_SIZE,
|
||||
errno);
|
||||
if (strErrNum)
|
||||
{
|
||||
FM_SNPRINTF_S(strErrBuf, FM_STRERROR_BUF_SIZE, "%d", errno);
|
||||
}
|
||||
FM_LOG_ERROR(FM_LOG_CAT_PLATFORM,
|
||||
"Unable to open '%s' - '%s'\n",
|
||||
devName,
|
||||
strErrBuf);
|
||||
}
|
||||
|
||||
return fd;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
|
@ -1709,11 +1889,13 @@ static fm_int OpenUioDevice(fm_int num, fm_text devName)
|
|||
fm_status fmPlatformHostDrvOpen(fm_int sw,
|
||||
fm_int mgmtPep,
|
||||
fm_text netDevName,
|
||||
fm_text uioDevName,
|
||||
fm_text uioDevName,
|
||||
fm_text resource4DevName,
|
||||
void * desiredMemmapAddr)
|
||||
{
|
||||
fm_platformProcessState *pp;
|
||||
fm_uioDriverInfo * info;
|
||||
fm_resource4DriverInfo *resource4DriverInfo;
|
||||
fm_status err;
|
||||
void * addr;
|
||||
fm_char localNetDevName[FM_NETDEV_MAX_NAME_SIZE];
|
||||
|
@ -1721,17 +1903,20 @@ fm_status fmPlatformHostDrvOpen(fm_int sw,
|
|||
errno_t strErrNum;
|
||||
fm_platformCfgSwitch * swCfg;
|
||||
fm_char * startUioName;
|
||||
fm_char startResource4Name[FM_NETDEV_MAX_NAME_SIZE];
|
||||
fm_text pktIface;
|
||||
fm_int netDevSw;
|
||||
fm_int netDevPep;
|
||||
fm_int portIdx;
|
||||
fm_uint idx;
|
||||
|
||||
FM_LOG_ENTRY(FM_LOG_CAT_PLATFORM,
|
||||
"sw = %d mgmtPep = %d netDevName = %s uioDevName = %s memmapAddr = %p\n",
|
||||
"sw = %d mgmtPep = %d netDevName = %s uioDevName = %s resource4DevName = %s memmapAddr = %p\n",
|
||||
sw,
|
||||
mgmtPep,
|
||||
netDevName,
|
||||
uioDevName,
|
||||
resource4DevName,
|
||||
(void *)desiredMemmapAddr);
|
||||
|
||||
pp = GET_PLAT_PROC_STATE(sw);
|
||||
|
@ -1743,9 +1928,83 @@ fm_status fmPlatformHostDrvOpen(fm_int sw,
|
|||
FM_LOG_EXIT(FM_LOG_CAT_PLATFORM, FM_OK);
|
||||
}
|
||||
|
||||
pp->useResource4 = FALSE;
|
||||
|
||||
info = &pp->uioInfo;
|
||||
|
||||
if (uioDevName != NULL)
|
||||
resource4DriverInfo = &pp->resource4Info;
|
||||
|
||||
if (resource4DevName != NULL)
|
||||
{
|
||||
/* Use the provide device name */
|
||||
FM_LOG_DEBUG(FM_LOG_CAT_PLATFORM,
|
||||
"Using %s device\n",
|
||||
resource4DevName);
|
||||
|
||||
/* Get PCIe device */
|
||||
startResource4Name[0] = '\0';
|
||||
for (idx = strlen(resource4DevName) - 1; idx > 0; --idx)
|
||||
{
|
||||
if (resource4DevName[idx] == '/')
|
||||
{
|
||||
strncpy(startResource4Name, resource4DevName, idx);
|
||||
startResource4Name[idx] = '\0';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(!strlen(startResource4Name))
|
||||
{
|
||||
FM_LOG_ERROR(FM_LOG_CAT_PLATFORM,
|
||||
"Unable to localize resource4 parent folder for resource4 device: %s\n",
|
||||
uioDevName);
|
||||
FM_LOG_EXIT(FM_LOG_CAT_PLATFORM, FM_FAIL);
|
||||
}
|
||||
|
||||
|
||||
/* Get information for uio device */
|
||||
strcpy(resource4DriverInfo->device, resource4DevName);
|
||||
if ( (err = GetResource4DevInfo(startResource4Name, resource4DriverInfo)) != FM_OK )
|
||||
{
|
||||
FM_LOG_ERROR(FM_LOG_CAT_PLATFORM,
|
||||
"Unable to get info for resource4 device: %s\n",
|
||||
resource4DevName);
|
||||
FM_LOG_EXIT(FM_LOG_CAT_PLATFORM, err);
|
||||
}
|
||||
pp->useResource4 = TRUE;
|
||||
swCfg->msiEnabled = FALSE;
|
||||
|
||||
FM_LOG_PRINT("Connect to host driver using %s\n", resource4DevName);
|
||||
err = FM_OK;
|
||||
|
||||
pktIface = fmGetTextApiProperty(FM_AAK_API_PLATFORM_PKT_INTERFACE,
|
||||
FM_AAD_API_PLATFORM_PKT_INTERFACE);
|
||||
|
||||
if ( (netDevName == NULL) && (strcmp(pktIface, "pti") != 0) )
|
||||
{
|
||||
err = GetNetDevFromResource4(startResource4Name,
|
||||
localNetDevName,
|
||||
FM_NETDEV_MAX_NAME_SIZE);
|
||||
if (err != FM_OK)
|
||||
{
|
||||
FM_LOG_ERROR(FM_LOG_CAT_PLATFORM,
|
||||
"Unable to get netdev for resource4 device: %s\n",
|
||||
uioDevName);
|
||||
FM_LOG_EXIT(FM_LOG_CAT_PLATFORM, err);
|
||||
}
|
||||
|
||||
/* Update the netdev field with the device found */
|
||||
FM_STRNCPY_S(swCfg->netDevName,
|
||||
sizeof(swCfg->netDevName),
|
||||
localNetDevName,
|
||||
sizeof(swCfg->netDevName));
|
||||
|
||||
FM_LOG_PRINT("Found netdev %s (derived from resource4 device %s)\n",
|
||||
localNetDevName,
|
||||
resource4DevName);
|
||||
}
|
||||
}
|
||||
else if (uioDevName != NULL)
|
||||
{
|
||||
/* Use the provide device name */
|
||||
FM_LOG_DEBUG(FM_LOG_CAT_PLATFORM,
|
||||
|
@ -1879,8 +2138,16 @@ fm_status fmPlatformHostDrvOpen(fm_int sw,
|
|||
}
|
||||
}
|
||||
|
||||
/* Open the UIO device */
|
||||
pp->fd = OpenUioDevice(info->uioNum, uioDevName);
|
||||
if(pp->useResource4)
|
||||
{
|
||||
/* Open the resource4 device */
|
||||
pp->fd = OpenResource4Device(resource4DriverInfo->device);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Open the UIO device */
|
||||
pp->fd = OpenUioDevice(info->uioNum, uioDevName);
|
||||
}
|
||||
|
||||
if (pp->fd < 0)
|
||||
{
|
||||
|
@ -1892,11 +2159,11 @@ fm_status fmPlatformHostDrvOpen(fm_int sw,
|
|||
|
||||
/* Memory map the switch memory */
|
||||
addr = mmap(desiredMemmapAddr,
|
||||
info->size,
|
||||
pp->useResource4 ? resource4DriverInfo->size : info->size,
|
||||
PROT_READ | PROT_WRITE,
|
||||
MAP_SHARED,
|
||||
pp->fd,
|
||||
info->offset);
|
||||
pp->useResource4 ? resource4DriverInfo->offset : info->offset);
|
||||
|
||||
if (addr == MAP_FAILED)
|
||||
{
|
||||
|
@ -1958,7 +2225,7 @@ fm_status fmPlatformHostDrvClose(fm_int sw)
|
|||
if (pp->fd >= 0)
|
||||
{
|
||||
/* Memory unmap for the switch memory */
|
||||
munmap((void *)GET_PLAT_STATE(sw)->switchMem, pp->uioInfo.size);
|
||||
munmap((void *)GET_PLAT_STATE(sw)->switchMem, pp->useResource4 ? pp->resource4Info.size : pp->uioInfo.size);
|
||||
|
||||
/* Close connection */
|
||||
close(pp->fd);
|
||||
|
|
|
@ -339,6 +339,7 @@ static fm_status ConnectToHostDriver(fm_int sw)
|
|||
fm_platformCfgSwitch *swCfg;
|
||||
fm_status status;
|
||||
fm_text uioDevName;
|
||||
fm_text resource4DevName;
|
||||
fm_text netDevName;
|
||||
|
||||
FM_LOG_ENTRY(FM_LOG_CAT_PLATFORM, "sw = %d\n", sw);
|
||||
|
@ -354,6 +355,15 @@ static fm_status ConnectToHostDriver(fm_int sw)
|
|||
uioDevName = NULL;
|
||||
}
|
||||
|
||||
if (strcmp(swCfg->resource4DevName, FM_AAD_API_PLATFORM_RESOURCE4_DEV_NAME) != 0)
|
||||
{
|
||||
resource4DevName = swCfg->resource4DevName;
|
||||
}
|
||||
else
|
||||
{
|
||||
resource4DevName = NULL;
|
||||
}
|
||||
|
||||
if (strcmp(swCfg->netDevName, FM_AAD_API_PLATFORM_NETDEV_NAME) != 0)
|
||||
{
|
||||
netDevName = swCfg->netDevName;
|
||||
|
@ -366,7 +376,8 @@ static fm_status ConnectToHostDriver(fm_int sw)
|
|||
status = fmPlatformHostDrvOpen(sw,
|
||||
swCfg->mgmtPep,
|
||||
netDevName,
|
||||
uioDevName,
|
||||
uioDevName,
|
||||
resource4DevName,
|
||||
desiredMemmapAddr[sw]);
|
||||
|
||||
FM_LOG_EXIT(FM_LOG_CAT_PLATFORM, status);
|
||||
|
|
|
@ -675,6 +675,7 @@ void fmPlatformCfgDump(void)
|
|||
PRINT_VALUE(" xcvrPollPeriodMsec", swCfg->xcvrPollPeriodMsec);
|
||||
PRINT_VALUE(" intrPollPeriodMsec", swCfg->intrPollPeriodMsec);
|
||||
PRINT_STRING(" uioDevName", swCfg->uioDevName);
|
||||
PRINT_STRING(" resource4DevName", swCfg->resource4DevName);
|
||||
PRINT_STRING(" netDevName", swCfg->netDevName);
|
||||
PRINT_STRING(" devMemOffset", swCfg->devMemOffset);
|
||||
PRINT_VALUE(" gpioPortIntr", swCfg->gpioPortIntr);
|
||||
|
|
|
@ -1336,6 +1336,10 @@ fm_status fmPlatformLoadLTCfgTlv(fm_byte *tlv)
|
|||
FM_PLAT_MAX_CFG_STR_LEN,
|
||||
FM_AAD_API_PLATFORM_UIO_DEV_NAME,
|
||||
FM_PLAT_MAX_CFG_STR_LEN);
|
||||
FM_STRNCPY_S(swCfg->resource4DevName,
|
||||
FM_PLAT_MAX_CFG_STR_LEN,
|
||||
FM_AAD_API_PLATFORM_RESOURCE4_DEV_NAME,
|
||||
FM_PLAT_MAX_CFG_STR_LEN);
|
||||
swCfg->gpioPortIntr = FM_PLAT_UNDEFINED;
|
||||
swCfg->gpioI2cReset = FM_PLAT_UNDEFINED;
|
||||
swCfg->gpioFlashWP = FM_PLAT_UNDEFINED;
|
||||
|
@ -2512,6 +2516,19 @@ fm_status fmPlatformLoadLTCfgTlv(fm_byte *tlv)
|
|||
tlv + 4,
|
||||
tlvLen - 1);
|
||||
break;
|
||||
case FM_TLV_PLAT_RESOURCE4_DEVNAME:
|
||||
swIdx = GetTlvInt(tlv + 3, 1);
|
||||
if (swIdx >= platCfg->numSwitches)
|
||||
{
|
||||
SwIdxErrorMsg(swIdx, platCfg->numSwitches, tlv);
|
||||
return FM_ERR_INVALID_SWITCH;
|
||||
}
|
||||
swCfg = FM_PLAT_GET_SWITCH_CFG(swIdx);
|
||||
CopyTlvStr(swCfg->resource4DevName,
|
||||
FM_PLAT_MAX_CFG_STR_LEN,
|
||||
tlv + 4,
|
||||
tlvLen - 1);
|
||||
break;
|
||||
case FM_TLV_PLAT_INTR_TIMEOUT_CNT:
|
||||
swIdx = GetTlvInt(tlv + 3, 1);
|
||||
if (swIdx >= platCfg->numSwitches)
|
||||
|
|
|
@ -915,6 +915,7 @@ static fm_utilPropMap platConfigSw[] = {
|
|||
PROP_TEXT, FM_TLV_PLAT_DEV_MEM_OFF, 8, EnDecodeDevMemOff, 0, 0},
|
||||
{"netDevName", PROP_TEXT, FM_TLV_PLAT_NET_DEVNAME, 0, NULL, 0, 0},
|
||||
{"uioDevName", PROP_TEXT, FM_TLV_PLAT_UIO_DEVNAME, 0, NULL, 0, 0},
|
||||
{"resource4DevName", PROP_TEXT, FM_TLV_PLAT_RESOURCE4_DEVNAME, 0, NULL, 0, 0},
|
||||
{"intrTimeoutCnt", PROP_UINT, FM_TLV_PLAT_INTR_TIMEOUT_CNT, 2, NULL, 0, 0},
|
||||
{"bootMode", PROP_TEXT, FM_TLV_PLAT_BOOT_MODE, 1,
|
||||
EnDecodeByMap, (fm_intptr)bootModeMap, FM_NENTRIES(bootModeMap)},
|
||||
|
|
Loading…
Reference in a new issue