Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions fboss/platform/platform_manager/PciExplorer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@ std::vector<uint16_t> PciExplorer::createI2cAdapter(
uint32_t instanceId) {
auto auxData = getAuxData(*i2cAdapterConfig.fpgaIpBlockConfig(), instanceId);
auxData.i2c_data.num_channels = *i2cAdapterConfig.numberOfAdapters();
if (i2cAdapterConfig.busFreqHz().has_value()) {
auxData.i2c_data.bus_freq_hz = *i2cAdapterConfig.busFreqHz();
}
create(pciDevice, *i2cAdapterConfig.fpgaIpBlockConfig(), auxData);
return getI2cAdapterBusNums(pciDevice, i2cAdapterConfig, instanceId);
}
Expand Down
4 changes: 4 additions & 0 deletions fboss/platform/platform_manager/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,10 @@ std::vector<I2cAdapterConfig> Utils::createI2cAdapterConfigs(
i2cAdapterConfig.numberOfAdapters() =
*i2cAdapterBlockConfig.numBusesPerAdapter();

if (i2cAdapterBlockConfig.busFreqHz().has_value()) {
i2cAdapterConfig.busFreqHz() = *i2cAdapterBlockConfig.busFreqHz();
}

i2cAdapterConfigs.push_back(i2cAdapterConfig);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,12 @@ struct FpgaIpBlockConfig {
// `fpgaIpBlockConfig`: See FgpaIpBlockConfig above
//
// `numberOfAdapters`: Number of I2C Adapters created by this block.
//
// `busFreqHz`: I2C bus clock frequency in Hz. Applies to all buses in this block.
struct I2cAdapterConfig {
1: FpgaIpBlockConfig fpgaIpBlockConfig;
2: i32 numberOfAdapters;
3: optional i32 busFreqHz;
}

// Defines generic I2C Adapter block in FPGAs.
Expand Down Expand Up @@ -366,6 +369,8 @@ struct I2cAdapterConfig {
// adapterIndex=2, startAdapterIndex=1:
// iobufOffsetCalc: "0x2000 + 1*0x100"
// iobufOffsetCalc: "0x2100"
//
// `busFreqHz`: I2C bus clock frequency in Hz. Applies to all buses in this block.
struct I2cAdapterBlockConfig {
1: string pmUnitScopedNamePrefix;
2: string deviceName;
Expand All @@ -374,6 +379,7 @@ struct I2cAdapterBlockConfig {
5: i32 numAdapters;
6: i32 numBusesPerAdapter = 1;
7: string iobufOffsetCalc;
8: optional i32 busFreqHz;
}

// Defines a Spi Device in FPGAs.
Expand Down
Loading