Added IES initialization, config write
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
DataHoarder 2021-11-02 07:03:54 +01:00
parent 7b102363f7
commit bf6fa754b5
11 changed files with 154 additions and 88 deletions

3
.gitignore vendored
View file

@ -1,3 +1,4 @@
/cmake-build-debug
/build
.idea
.idea
/deps/IES/build

2
.gitmodules vendored
View file

@ -1,3 +1,3 @@
[submodule "deps/IES"]
path = deps/IES
url = https://git.gammaspectra.live/Sillycom/IES
url = https://git.gammaspectra.live/FM10K/IES

View file

@ -3,8 +3,8 @@ project(fsm)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_FM_ARCH_64 -DFM_SUPPORT_FM10000 -D_GNU_SOURCE")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FM_ARCH_64 -DFM_SUPPORT_FM10000 -D_GNU_SOURCE")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-exceptions -frtti -D_FM_ARCH_64 -DFM_SUPPORT_FM10000 -D_GNU_SOURCE")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -frtti -D_FM_ARCH_64 -DFM_SUPPORT_FM10000 -D_GNU_SOURCE")
set(CMAKE_LD_FLAGS "${CMAKE_LD_FLAGS} -Wl,--no-as-needed")
include_directories(src)
@ -20,11 +20,6 @@ include_directories(deps/IES/build/include/platforms/libertyTrail)
find_library(libFocalpointSDK NAMES FocalpointSDK PATHS ${PROJECT_SOURCE_DIR}/deps/IES/build/lib NO_DEFAULT_PATH REQUIRED)
find_library(libLTStdPlatform NAMES LTStdPlatform PATHS ${PROJECT_SOURCE_DIR}/deps/IES/build/lib NO_DEFAULT_PATH REQUIRED)
add_library(libFocalPointSDK SHARED IMPORTED)
add_library(libLTStdPlatform SHARED IMPORTED)
set_target_properties(libFocalPointSDK PROPERTIES IMPORTED_LOCATION deps/IES/build/lib/libFocalpointSDK.la)
set_target_properties(libLTStdPlatform PROPERTIES IMPORTED_LOCATION deps/IES/build/lib/libLTStdPlatform.la)
add_executable(fsmd src/fsmd.cpp src/device/PCIEDevice.cpp src/fm10k/FM10K.cpp src/fm10k/Functions.cpp src/fm10k/Port.cpp src/fm10k/IES.cpp)
add_executable(fsm src/fsm.cpp)

2
deps/IES vendored

@ -1 +1 @@
Subproject commit 5fa6e3b8bff15be7edea55eea8bee7c17d28b5ca
Subproject commit 3776b9148f56c026c834476a9990a398b4c64cdb

View file

@ -77,6 +77,7 @@ std::vector<PCIEDevice::DeviceEntry> PCIEDevice::DeviceEntry::find() {
if (access((basePath + "/resource4").c_str(), F_OK) == 0) {
auto vpd = get_file_contents(basePath + "/vpd");
//auto uevent = get_file_contents(basePath + "/uevent");
entries.emplace_back(basePath + "/resource4", vendor, _class, vpd);
}
}

View file

@ -1,5 +1,7 @@
#include "FM10K.h"
#include "registers/Register.h"
#include "IES.h"
#include "device/PCIEDevice.h"
#include <chrono>
#include <thread>
@ -70,6 +72,7 @@ std::string FM10K::FM10K::getHardwareInformationString() const {
return s;
}
/*
bool FM10K::FM10K::initializationSequence() const {
if(mapRegister<registers::MGMT::SOFT_RESET>()->fields.ColdReset){
//Not yet initialized from cold reset
@ -225,46 +228,6 @@ bool FM10K::FM10K::initializationSequence() const {
//5.4.3.5 Initialization of Scheduler Polling Schedule
// The TX and RX schedule must be initialized according to the relative speed of each port.
/*
// The example below is 45x10 GbE (36x10 GbE for Ethernet, 5x10 GbE for PEPs (bifurcation mode off), 2 for Tunneling Engines, 1xFIBM and 1x10 GbE for idle).
// Logical ports 0..35 are physical ports 0..35 (Ethernet)
for (i=0;i<36;i++)
{
SCHED_RX_SCHEDULE[i].Port = i;
SCHED_RX_SCHEDULE[i].PhysPort = i;
SCHED_RX_SCHEDULE[i].Quad = 0;
SCHED_RX_SCHEDULE[i].Idle = 0;
// Repeat for TX
SCHED_TX_SCHEDULE[i].Port = i;
SCHED_TX_SCHEDULE[i].PhysPort = i;
SCHED_TX_SCHEDULE[i].Quad = 0;
SCHED_TX_SCHEDULE[i].Idle = 0;
}
// Logical ports 36..41,46,47 are 5xPEPs and 2xTE and 1xFIBM (bifurcation ON)
// (last logical port is mapped to PEP[8]
int xLogPort[8] = { 36, 37, 38, 39, 40, 41, 46, 47 };
int xPhysPort[8] = { 36, 40, 44, 48, 52, 56, 60, 63 };
int xQuad[8] = { 1, 1, 1, 1, 1, 1, 0, 0 };
for (i=0;i<8;i++)
{
SCHED_RX_SCHEDULE[i+36].Port = xLogPort[i];
SCHED_RX_SCHEDULE[i+36].PhysPort = xPhysPort[i];
SCHED_RX_SCHEDULE[i+36].Quad = xQuad[i];
SCHED_RX_SCHEDULE[i+36].Idle = 0;
// Repeat for TX
SCHED_TX_SCHEDULE[i+36].Port = xLogPort[i];
SCHED_TX_SCHEDULE[i+36].PhysPort = xPhysPort[i];
SCHED_TX_SCHEDULE[i+36].Quad = xQuad[i];
SCHED_TX_SCHEDULE[i+36].Idle = 0;
}
// Start Scheduler
SCHED_SCHEDULE_CTRL.RxPage = 0;
SCHED_SCHEDULE_CTRL.RxMaxIndex = 43;
SCHED_SCHEDULE_CTRL.RxEnable = 1;
SCHED_SCHEDULE_CTRL.TxPage = 0;
SCHED_SCHEDULE_CTRL.TxMaxIndex = 43;
SCHED_SCHEDULE_CTRL.TxEnable = 1;
*/
@ -299,6 +262,7 @@ bool FM10K::FM10K::initializationSequence() const {
return true;
}
*/
bool FM10K::FM10K::isPEPEnabled(uint8_t pep) const {
return (mapRegister<registers::MGMT::DEVICE_CFG>()->fields.PCIeEnable & (1 << pep)) > 0;
@ -311,3 +275,21 @@ void FM10K::FM10K::wait(uint32_t microseconds) {
void FM10K::FM10K::wait_ns(uint32_t nanoseconds) {
std::this_thread::sleep_for(std::chrono::nanoseconds (nanoseconds));
}
bool FM10K::FM10K::initialize() const {
auto& ies = IES::getInstance();
if(!ies.loadKnownConfiguration(getHardwareInformationString() + "_AUTO_100G")){
return false;
}
auto pcieDevice = dynamic_cast<PCIEDevice*>(m_device.get());
if(pcieDevice != nullptr){
ies.replaceConfigEntry("api.platform.config.switch.0.uioDevName", IES::TlvType::Null, "");
ies.replaceConfigEntry("api.platform.config.switch.0.resource4DevName", IES::TlvType::Text, pcieDevice->getDeviceEntry().getDevicePath());
}else{
return false;
}
//TODO UIO support
return ies.init();
}

View file

@ -114,7 +114,7 @@ namespace FM10K{
return portIndex < m_ports.size() ? &m_ports.back() : nullptr;
}
bool initializationSequence() const;
bool initialize() const;
bool isPEPEnabled(uint8_t pep) const;
@ -124,7 +124,6 @@ namespace FM10K{
std::unique_ptr<Device> m_device;
HardwareInformation m_hwInfo{};
std::vector<Port> m_ports;
void* m_ies = nullptr;
};
}

View file

@ -1,6 +1,8 @@
#include "IES.h"
#include <unordered_map>
#include <sys/param.h>
#include <fstream>
#include "IES_SDK.h"
@ -8,20 +10,17 @@
namespace FM10K{
namespace IES_Static{
static bool IES_INITIALIZED = false;
static fm_semaphore semaphore;
static fm_int sw = 0;
using TlvType = FM10K::IES::TlvType;
}
}
std::unique_ptr<FM10K::IES> FM10K::IES::instance = nullptr;
bool FM10K::IES::init() {
if(IES_Static::IES_INITIALIZED){
if(m_initialized){ //TODO: override
return true;
}
@ -33,6 +32,28 @@ bool FM10K::IES::init() {
std::abort();
}*/
if(!writePlatformConfiguration()){
std::abort();
}
//Override platform configuration for fmInitialize()
//set FM_LIBERTY_TRAIL_CONFIG_FILE to NVM_NAME ("NVM") to load config from Non-Volatile Memory of FM10K
//can also set FM_API_ATTR_FILE to override, local_attributes.cfg
//other env FM_API_SHM_KEY, INSTRUMENT_LOG_FILE
//it also loads "fm_api_attributes.cfg" by default for current working directory
if(setenv("FM_LIBERTY_TRAIL_CONFIG_FILE", getPlatformConfigurationPath().c_str(), true) != 0){
std::abort();
}
//Temporarily switch cwd
char tempcwd[MAXPATHLEN];
if(getcwd(tempcwd, sizeof(tempcwd)) == nullptr){
std::abort();
}
if(chdir(getTempPath().c_str()) != 0){
std::abort();
}
fmCreateSemaphore("seq", FM_SEM_BINARY, &IES_Static::semaphore, 0);
if(fmInitialize(eventHandler) != FM_OK){
@ -47,7 +68,13 @@ bool FM10K::IES::init() {
std::abort();
}
IES_Static::IES_INITIALIZED = true;
//Restore cwd
if(chdir(tempcwd) != 0){
std::abort();
}
m_initialized = true;
return true;
}
@ -184,4 +211,43 @@ bool FM10K::IES::loadKnownConfiguration(const std::string &key) {
return true;
}
FM10K::IES::~IES() {
if(!m_tempPath.empty()){
remove((m_tempPath + "/fm_platform_attributes.cfg").c_str());
rmdir(m_tempPath.c_str());
m_tempPath.clear();
}
}
const std::string &FM10K::IES::getTempPath() {
if(m_tempPath.empty()){
const char * const tmplt = "/tmp/fsmd_XXXXXX";
char buffer[MAXPATHLEN] = {0};
strncpy(buffer, tmplt, strlen(tmplt));
if(mkdtemp(buffer) == nullptr){
std::abort();
}
m_tempPath = buffer;
}
return m_tempPath;
}
bool FM10K::IES::writePlatformConfiguration() {
std::ofstream f;
f.open(getPlatformConfigurationPath(), std::ios::out | std::ios::binary | std::ios::trunc);
if(f.fail()){
return false;
}
f << getPlatformConfiguration();
f.close();
return f.fail();
}
std::string FM10K::IES::getPlatformConfigurationPath() {
return getTempPath() + "/fm_platform_attributes.cfg";
}
FM10K::IES::IES() = default;

View file

@ -12,6 +12,7 @@ namespace FM10K {
class IES {
public:
static IES& getInstance();
~IES();
bool isInitialized() const{
return m_initialized;
@ -40,15 +41,22 @@ namespace FM10K {
std::string getPlatformConfiguration() const;
bool writePlatformConfiguration();
const std::string& getTempPath();
std::string getPlatformConfigurationPath();
bool init();
private:
IES();
std::map<std::string, std::pair<TlvType, std::string>> m_configuration{};
bool m_initialized = false;
std::string m_tempPath;
static std::unique_ptr<IES> instance;
static bool init();
void handleSwitchInsertedEvent(int sw);
void handlePortEvent(int sw, struct _fm_eventPort&);

View file

@ -46,7 +46,7 @@ namespace FM10K {
{"api.platform.config.switch.0.cpuPort", {TlvType::Integer, "6"}},
{"api.platform.config.switch.0.bootCfg.mgmtPep", {TlvType::Integer, "6"}},
{"api.platform.config.switch.0.bootCfg.mgmtPep", {TlvType::Integer, "-1"}},
{"api.platform.config.switch.0.bootCfg.pep.0.mode", {TlvType::Boolean, "0"}},
{"api.platform.config.switch.0.bootCfg.pep.2.mode", {TlvType::Boolean, "0"}},
{"api.platform.config.switch.0.bootCfg.pep.4.mode", {TlvType::Boolean, "0"}},
@ -58,30 +58,25 @@ namespace FM10K {
{"api.platform.config.switch.0.bootCfg.pep.6.enable", {TlvType::Boolean, "1"}},
{"api.platform.config.switch.0.bootCfg.pep.8.enable", {TlvType::Boolean, "0"}},
{"api.platform.config.switch.0.bootCfg.pep.0.bar4Allowed", {TlvType::Boolean, "1"}},
{"api.platform.config.switch.0.bootCfg.pep.2.bar4Allowed", {TlvType::Boolean, "1"}},
{"api.platform.config.switch.0.bootCfg.pep.4.bar4Allowed", {TlvType::Boolean, "1"}},
{"api.platform.config.switch.0.bootCfg.pep.6.bar4Allowed", {TlvType::Boolean, "1"}},
{"api.platform.config.switch.0.portIndex.0.portMapping", {TlvType::Text, "\"LOG = 0 PCIE=8\""}},
{"api.platform.config.switch.0.portIndex.1.lane.0.portMapping",
{TlvType::Text, "\"LOG=1 EPL=1 LANE=0\""}},
{"api.platform.config.switch.0.portIndex.1.lane.1.portMapping",
{TlvType::Text, "\"LOG=1 EPL=1 LANE=1\""}},
{"api.platform.config.switch.0.portIndex.1.lane.2.portMapping",
{TlvType::Text, "\"LOG=1 EPL=1 LANE=2\""}},
{"api.platform.config.switch.0.portIndex.1.lane.3.portMapping",
{TlvType::Text, "\"LOG=1 EPL=1 LANE=3\""}},
{"api.platform.config.switch.0.portIndex.1.lane.0.portMapping", {TlvType::Text, "\"LOG=1 EPL=1 LANE=0\""}},
{"api.platform.config.switch.0.portIndex.1.lane.1.portMapping", {TlvType::Text, "\"LOG=1 EPL=1 LANE=1\""}},
{"api.platform.config.switch.0.portIndex.1.lane.2.portMapping", {TlvType::Text, "\"LOG=1 EPL=1 LANE=2\""}},
{"api.platform.config.switch.0.portIndex.1.lane.3.portMapping", {TlvType::Text, "\"LOG=1 EPL=1 LANE=3\""}},
{"api.platform.config.switch.0.portIndex.2.lane.0.portMapping",
{TlvType::Text, "\"LOG=2 EPL=7 LANE=0\""}},
{"api.platform.config.switch.0.portIndex.2.lane.1.portMapping",
{TlvType::Text, "\"LOG=2 EPL=7 LANE=1\""}},
{"api.platform.config.switch.0.portIndex.2.lane.2.portMapping",
{TlvType::Text, "\"LOG=2 EPL=7 LANE=2\""}},
{"api.platform.config.switch.0.portIndex.2.lane.3.portMapping",
{TlvType::Text, "\"LOG=2 EPL=7 LANE=3\""}},
{"api.platform.config.switch.0.portIndex.2.lane.0.portMapping", {TlvType::Text, "\"LOG=2 EPL=7 LANE=0\""}},
{"api.platform.config.switch.0.portIndex.2.lane.1.portMapping", {TlvType::Text, "\"LOG=2 EPL=7 LANE=1\""}},
{"api.platform.config.switch.0.portIndex.2.lane.2.portMapping", {TlvType::Text, "\"LOG=2 EPL=7 LANE=2\""}},
{"api.platform.config.switch.0.portIndex.2.lane.3.portMapping", {TlvType::Text, "\"LOG=2 EPL=7 LANE=3\""}},
{"api.platform.config.switch.0.portIndex.3.portMapping", {TlvType::Text, "\"LOG=3 PCIE=0\""}},
@ -96,15 +91,17 @@ namespace FM10K {
{"api.platform.config.switch.0.portIndex.2.interfaceType", {TlvType::Text, "QSFP_LANE0"}},
{"api.platform.config.switch.0.portIndex.1.speed", {TlvType::Integer, SPEED_100G}},
{"api.platform.config.switch.0.portIndex.0.speed", {TlvType::Integer, SPEED_10G}},
{"api.platform.config.switch.0.portIndex.1.speed", {TlvType::Integer, SPEED_100G}},
{"api.platform.config.switch.0.portIndex.2.speed", {TlvType::Integer, SPEED_100G}},
{"api.platform.config.switch.0.portIndex.3.speed", {TlvType::Integer, SPEED_50G}},
{"api.platform.config.switch.0.portIndex.4.speed", {TlvType::Integer, SPEED_50G}},
{"api.platform.config.switch.0.portIndex.5.speed", {TlvType::Integer, SPEED_50G}},
{"api.platform.config.switch.0.portIndex.6.speed", {TlvType::Integer, SPEED_50G}},
{"api.platform.config.switch.0.portIndex.5.speed", {TlvType::Integer, SPEED_50G}}, //? second PCIe group
{"api.platform.config.switch.0.portIndex.6.speed", {TlvType::Integer, SPEED_50G}}, //? second PCIe group
{"api.platform.config.switch.0.portIndex.2.speed", {TlvType::Integer, SPEED_100G}},
{"api.platform.config.switch.0.port.default.ethernetMode", {TlvType::Text, "DISABLED"}},
@ -115,11 +112,8 @@ namespace FM10K {
{"api.platform.config.switch.0.port.default.capability", {TlvType::Text, "NONE"}},
{"api.platform.config.switch.0.portIndex.1.capability",
{TlvType::Text, "LAG,ROUTE,10G,25G,40G,100G,SW_LED"}},
{"api.platform.config.switch.0.portIndex.2.capability",
{TlvType::Text, "LAG,ROUTE,10G,25G,40G,100G,SW_LED"}},
{"api.platform.config.switch.0.portIndex.1.capability",{TlvType::Text, "LAG,ROUTE,10G,25G,40G,100G,SW_LED"}},
{"api.platform.config.switch.0.portIndex.2.capability", {TlvType::Text, "LAG,ROUTE,10G,25G,40G,100G,SW_LED"}},
{"api.platform.config.switch.0.port.default.lanePolarity", {TlvType::Text, "INVERT_NONE"}},
@ -131,8 +125,7 @@ namespace FM10K {
{"api.platform.config.switch.0.sharedLibraryName", {TlvType::Text, "libLTStdPlatform.so"}},
{"api.platform.config.switch.0.sharedLibrary.disable",
{TlvType::Text, "GetPortIntrPending,EnablePortIntr"}},
{"api.platform.config.switch.0.sharedLibrary.disable", {TlvType::Text, "GetPortIntrPending,EnablePortIntr"}},
{"api.platform.lib.config.bus0.i2cDevName", {TlvType::Text, "switchI2C"}},
@ -197,34 +190,43 @@ namespace FM10K {
{"api.platform.lib.config.hwResourceId.0.portLed.0.type", {TlvType::Text, "PCA"}},
{"api.platform.lib.config.hwResourceId.0.portLed.0.pcaIo.index", {TlvType::Integer, "2"}},
{"api.platform.lib.config.hwResourceId.0.portLed.0.0.pcaIo.pin", {TlvType::Integer, "0"}},
{"api.platform.lib.config.hwResourceId.0.portLed.0.0.pcaIo.usage", {TlvType::Text, "LINK,10G"}},
{"api.platform.lib.config.hwResourceId.0.portLed.0.1.pcaIo.pin", {TlvType::Integer, "1"}},
{"api.platform.lib.config.hwResourceId.0.portLed.0.1.pcaIo.usage", {TlvType::Text, "LINK,40G"}},
{"api.platform.lib.config.hwResourceId.0.portLed.0.2.pcaIo.pin", {TlvType::Integer, "2"}},
{"api.platform.lib.config.hwResourceId.0.portLed.0.2.pcaIo.usage", {TlvType::Text, "LINK,25G"}},
{"api.platform.lib.config.hwResourceId.0.portLed.0.3.pcaIo.pin", {TlvType::Integer, "3"}},
{"api.platform.lib.config.hwResourceId.0.portLed.0.3.pcaIo.usage",
{TlvType::Text, "LINK,100G"}},
{"api.platform.lib.config.hwResourceId.0.portLed.0.3.pcaIo.usage",{TlvType::Text, "LINK,100G"}},
{"api.platform.lib.config.hwResourceId.0.portLed.1.type", {TlvType::Text, "PCA"}},
{"api.platform.lib.config.hwResourceId.0.portLed.1.pcaIo.index", {TlvType::Integer, "2"}},
{"api.platform.lib.config.hwResourceId.0.portLed.1.0.pcaIo.pin", {TlvType::Integer, "4"}},
{"api.platform.lib.config.hwResourceId.0.portLed.1.0.pcaIo.usage", {TlvType::Text, "LINK,10G"}},
{"api.platform.lib.config.hwResourceId.0.portLed.1.1.pcaIo.pin", {TlvType::Integer, "5"}},
{"api.platform.lib.config.hwResourceId.0.portLed.1.1.pcaIo.usage", {TlvType::Text, "LINK,25G"}},
{"api.platform.lib.config.hwResourceId.0.portLed.2.type", {TlvType::Text, "PCA"}},
{"api.platform.lib.config.hwResourceId.0.portLed.2.pcaIo.index", {TlvType::Integer, "2"}},
{"api.platform.lib.config.hwResourceId.0.portLed.2.0.pcaIo.pin", {TlvType::Integer, "6"}},
{"api.platform.lib.config.hwResourceId.0.portLed.2.0.pcaIo.usage", {TlvType::Text, "LINK,10G"}},
{"api.platform.lib.config.hwResourceId.0.portLed.2.1.pcaIo.pin", {TlvType::Integer, "7"}},
{"api.platform.lib.config.hwResourceId.0.portLed.2.1.pcaIo.usage", {TlvType::Text, "LINK,25G"}},
{"api.platform.lib.config.hwResourceId.0.portLed.3.type", {TlvType::Text, "PCA"}},
{"api.platform.lib.config.hwResourceId.0.portLed.3.pcaIo.index", {TlvType::Integer, "4"}},
{"api.platform.lib.config.hwResourceId.0.portLed.3.0.pcaIo.pin", {TlvType::Integer, "0"}},
{"api.platform.lib.config.hwResourceId.0.portLed.3.0.pcaIo.usage", {TlvType::Text, "LINK,10G"}},
{"api.platform.lib.config.hwResourceId.0.portLed.3.1.pcaIo.pin", {TlvType::Integer, "1"}},
{"api.platform.lib.config.hwResourceId.0.portLed.3.1.pcaIo.usage", {TlvType::Text, "LINK,25G"}},
@ -245,33 +247,43 @@ namespace FM10K {
{"api.platform.lib.config.hwResourceId.1.portLed.0.type", {TlvType::Text, "PCA"}},
{"api.platform.lib.config.hwResourceId.1.portLed.0.pcaIo.index", {TlvType::Integer, "5"}},
{"api.platform.lib.config.hwResourceId.1.portLed.0.0.pcaIo.pin", {TlvType::Integer, "0"}},
{"api.platform.lib.config.hwResourceId.1.portLed.0.0.pcaIo.usage", {TlvType::Text, "LINK,10G"}},
{"api.platform.lib.config.hwResourceId.1.portLed.0.1.pcaIo.pin", {TlvType::Integer, "1"}},
{"api.platform.lib.config.hwResourceId.1.portLed.0.1.pcaIo.usage", {TlvType::Text, "LINK,40G"}},
{"api.platform.lib.config.hwResourceId.1.portLed.0.2.pcaIo.pin", {TlvType::Integer, "2"}},
{"api.platform.lib.config.hwResourceId.1.portLed.0.2.pcaIo.usage", {TlvType::Text, "LINK,25G"}},
{"api.platform.lib.config.hwResourceId.1.portLed.0.3.pcaIo.pin", {TlvType::Integer, "3"}},
{"api.platform.lib.config.hwResourceId.1.portLed.0.3.pcaIo.usage", {TlvType::Text, "LINK,100G"}},
{"api.platform.lib.config.hwResourceId.1.portLed.1.type", {TlvType::Text, "PCA"}},
{"api.platform.lib.config.hwResourceId.1.portLed.1.pcaIo.index", {TlvType::Integer, "5"}},
{"api.platform.lib.config.hwResourceId.1.portLed.1.0.pcaIo.pin", {TlvType::Integer, "4"}},
{"api.platform.lib.config.hwResourceId.1.portLed.1.0.pcaIo.usage", {TlvType::Text, "LINK,10G"}},
{"api.platform.lib.config.hwResourceId.1.portLed.1.1.pcaIo.pin", {TlvType::Integer, "5"}},
{"api.platform.lib.config.hwResourceId.1.portLed.1.1.pcaIo.usage", {TlvType::Text, "LINK,25G"}},
{"api.platform.lib.config.hwResourceId.1.portLed.2.type", {TlvType::Text, "PCA"}},
{"api.platform.lib.config.hwResourceId.1.portLed.2.pcaIo.index", {TlvType::Integer, "5"}},
{"api.platform.lib.config.hwResourceId.1.portLed.2.0.pcaIo.pin", {TlvType::Integer, "6"}},
{"api.platform.lib.config.hwResourceId.1.portLed.2.0.pcaIo.usage", {TlvType::Text, "LINK,10G"}},
{"api.platform.lib.config.hwResourceId.1.portLed.2.1.pcaIo.pin", {TlvType::Integer, "7"}},
{"api.platform.lib.config.hwResourceId.1.portLed.2.1.pcaIo.usage", {TlvType::Text, "LINK,25G"}},
{"api.platform.lib.config.hwResourceId.1.portLed.3.type", {TlvType::Text, "PCA"}},
{"api.platform.lib.config.hwResourceId.1.portLed.3.pcaIo.index", {TlvType::Integer, "4"}},
{"api.platform.lib.config.hwResourceId.1.portLed.3.0.pcaIo.pin", {TlvType::Integer, "2"}},
{"api.platform.lib.config.hwResourceId.1.portLed.3.0.pcaIo.usage", {TlvType::Text, "LINK,10G"}},
{"api.platform.lib.config.hwResourceId.1.portLed.3.1.pcaIo.pin", {TlvType::Integer, "3"}},
{"api.platform.lib.config.hwResourceId.1.portLed.3.1.pcaIo.usage", {TlvType::Text, "LINK,25G"}},
@ -284,6 +296,8 @@ namespace FM10K {
{"api.platform.lib.config.hwResourceId.2.vrm.pcaMux.value", {TlvType::Integer, "0x04"}},
{"api.platform.config.switch.0.VDDS.hwResourceId", {TlvType::Integer, "2"}},
{"api.platform.lib.config.hwResourceId.3.type", {TlvType::Text, "VRM"}},
{"api.platform.lib.config.hwResourceId.3.vrm.busSelType", {TlvType::Text, "PCAMUX"}},
{"api.platform.lib.config.hwResourceId.3.vrm.bus", {TlvType::Integer, "0"}},

View file

@ -43,7 +43,7 @@ int main() {
port.m_portType = Port::PortType::EPL;
port.m_interfaceType = Port::InterfaceType::QSFP_LANE0;
if(fm10k.initializationSequence()){
if(fm10k.initialize()){
std::cout << "success" << std::endl;
}else{
std::cout << "fail" << std::endl;