Skip to content

Commit

Permalink
DARWIN48V: platform definition & led_manager (#293)
Browse files Browse the repository at this point in the history
Summary:
# Description
Combines #257, #258 and  #263.

#263 fails builds due to a dependencies found in #257 and  #258.

Pull Request resolved: #293

Reviewed By: somasun, mikechoifb

Differential Revision: D65801211

Pulled By: joancaneus

fbshipit-source-id: 2724e1073e2369fe802c4d144555ce93e95e6c6f
  • Loading branch information
aalamsi22 authored and facebook-github-bot committed Dec 4, 2024
1 parent c645744 commit 08e131f
Show file tree
Hide file tree
Showing 14 changed files with 120 additions and 5 deletions.
3 changes: 2 additions & 1 deletion fboss/agent/hw/bcm/tests/BcmSwitchEnsemble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@ void BcmSwitchEnsemble::init(
PlatformType::PLATFORM_MINIPACK,
PlatformType::PLATFORM_YAMP,
PlatformType::PLATFORM_WEDGE400,
PlatformType::PLATFORM_DARWIN};
PlatformType::PLATFORM_DARWIN,
PlatformType::PLATFORM_DARWIN48V};
std::unordered_set<PlatformType> th4BcmPlatforms = {
PlatformType::PLATFORM_FUJI, PlatformType::PLATFORM_ELBERT};
bool th3Platform = false;
Expand Down
3 changes: 3 additions & 0 deletions fboss/agent/hw/sai/diag/DiagShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ std::unique_ptr<Repl> DiagShell::makeRepl() const {
case PlatformType::PLATFORM_FUJI:
case PlatformType::PLATFORM_ELBERT:
case PlatformType::PLATFORM_DARWIN:
case PlatformType::PLATFORM_DARWIN48V:
case PlatformType::PLATFORM_MERU400BIU:
case PlatformType::PLATFORM_MERU800BIA:
case PlatformType::PLATFORM_MERU800BIAB:
Expand Down Expand Up @@ -395,6 +396,7 @@ std::string DiagCmdServer::getDelimiterDiagCmd(const std::string& UUID) const {
case PlatformType::PLATFORM_FUJI:
case PlatformType::PLATFORM_ELBERT:
case PlatformType::PLATFORM_DARWIN:
case PlatformType::PLATFORM_DARWIN48V:
case PlatformType::PLATFORM_MERU400BIU:
case PlatformType::PLATFORM_MERU800BIA:
case PlatformType::PLATFORM_MERU800BIAB:
Expand Down Expand Up @@ -445,6 +447,7 @@ std::string& DiagCmdServer::cleanUpOutput(
case PlatformType::PLATFORM_FUJI:
case PlatformType::PLATFORM_ELBERT:
case PlatformType::PLATFORM_DARWIN:
case PlatformType::PLATFORM_DARWIN48V:
case PlatformType::PLATFORM_MERU400BIU:
case PlatformType::PLATFORM_MERU800BIA:
case PlatformType::PLATFORM_MERU800BIAB:
Expand Down
1 change: 1 addition & 0 deletions fboss/agent/hw/test/ProdConfigFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ uint16_t uplinksCountFromSwitch(PlatformType mode) {
case PM::PLATFORM_GALAXY_LC:
case PM::PLATFORM_GALAXY_FC:
case PM::PLATFORM_DARWIN:
case PM::PLATFORM_DARWIN48V:
case PM::PLATFORM_MONTBLANC:
return 4;
default:
Expand Down
1 change: 1 addition & 0 deletions fboss/agent/platforms/common/PlatformMappingUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ std::unique_ptr<PlatformMapping> initPlatformMapping(PlatformType type) {
? std::make_unique<CloudRipperPlatformMapping>()
: std::make_unique<CloudRipperPlatformMapping>(platformMappingStr);
case PlatformType::PLATFORM_DARWIN:
case PlatformType::PLATFORM_DARWIN48V:
return platformMappingStr.empty()
? std::make_unique<DarwinPlatformMapping>()
: std::make_unique<DarwinPlatformMapping>(platformMappingStr);
Expand Down
4 changes: 3 additions & 1 deletion fboss/agent/platforms/sai/SaiPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,9 @@ void SaiPlatform::initPorts() {
platformMode == PlatformType::PLATFORM_WEDGE400 ||
platformMode == PlatformType::PLATFORM_WEDGE400_GRANDTETON) {
saiPort = std::make_unique<SaiBcmWedge400PlatformPort>(portId, this);
} else if (platformMode == PlatformType::PLATFORM_DARWIN) {
} else if (
platformMode == PlatformType::PLATFORM_DARWIN ||
platformMode == PlatformType::PLATFORM_DARWIN48V) {
saiPort = std::make_unique<SaiBcmDarwinPlatformPort>(portId, this);
} else if (platformMode == PlatformType::PLATFORM_MINIPACK) {
saiPort = std::make_unique<SaiBcmMinipackPlatformPort>(portId, this);
Expand Down
4 changes: 3 additions & 1 deletion fboss/agent/platforms/sai/SaiPlatformInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ std::unique_ptr<SaiPlatform> chooseSaiPlatform(
auto type = productInfo->getType();
return std::make_unique<SaiBcmWedge400Platform>(
std::move(productInfo), type, localMac, platformMappingStr);
} else if (productInfo->getType() == PlatformType::PLATFORM_DARWIN) {
} else if (
productInfo->getType() == PlatformType::PLATFORM_DARWIN ||
productInfo->getType() == PlatformType::PLATFORM_DARWIN48V) {
return std::make_unique<SaiBcmDarwinPlatform>(
std::move(productInfo), localMac, platformMappingStr);
} else if (productInfo->getType() == PlatformType::PLATFORM_MINIPACK) {
Expand Down
4 changes: 3 additions & 1 deletion fboss/agent/platforms/tests/utils/CreateTestPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ std::unique_ptr<Platform> createTestPlatform() {
return std::make_unique<BcmTestYampPlatform>(std::move(productInfo));
} else if (mode == PlatformType::PLATFORM_WEDGE400) {
return std::make_unique<BcmTestWedge400Platform>(std::move(productInfo));
} else if (mode == PlatformType::PLATFORM_DARWIN) {
} else if (
mode == PlatformType::PLATFORM_DARWIN ||
mode == PlatformType::PLATFORM_DARWIN48V) {
return std::make_unique<BcmTestDarwinPlatform>(std::move(productInfo));
} else if (mode == PlatformType::PLATFORM_FUJI) {
return std::make_unique<BcmTestFujiPlatform>(std::move(productInfo));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ TEST_F(AgentRouteOverflowTest, overflowRoutes) {
case PlatformType::PLATFORM_MINIPACK:
case PlatformType::PLATFORM_YAMP:
case PlatformType::PLATFORM_DARWIN:
case PlatformType::PLATFORM_DARWIN48V:
/*
* A route distribution 200,000 /128 does overflow the ASIC tables
* but it takes 15min to generate, program and clean up such a
Expand Down
4 changes: 3 additions & 1 deletion fboss/led_service/LedManagerInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ std::unique_ptr<LedManager> createLedManager() {
return std::make_unique<YampLedManager>();
} else if (mode == PlatformType::PLATFORM_ELBERT) {
return std::make_unique<ElbertLedManager>();
} else if (mode == PlatformType::PLATFORM_DARWIN) {
} else if (
mode == PlatformType::PLATFORM_DARWIN ||
mode == PlatformType::PLATFORM_DARWIN48V) {
return std::make_unique<DarwinLedManager>();
} else if (mode == PlatformType::PLATFORM_WEDGE400) {
return std::make_unique<Wedge400LedManager>();
Expand Down
1 change: 1 addition & 0 deletions fboss/lib/if/fboss_common.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ enum PlatformType {
PLATFORM_MERU800BFA_P1 = 34,
PLATFORM_MERU800BIAB = 35,
PLATFORM_YANGRA = 36,
PLATFORM_DARWIN48V = 37,
}
2 changes: 2 additions & 0 deletions fboss/lib/platforms/PlatformMode.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ inline std::string toString(PlatformType mode) {
return "CLOUDRIPPER";
case PlatformType::PLATFORM_DARWIN:
return "DARWIN";
case PlatformType::PLATFORM_DARWIN48V:
return "DARWIN48V";
case PlatformType::PLATFORM_LASSEN_DEPRECATED:
return "LASSEN";
case PlatformType::PLATFORM_SANDIA:
Expand Down
2 changes: 2 additions & 0 deletions fboss/lib/platforms/PlatformProductInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ void PlatformProductInfo::initMode() {
} else if (
modelName.find("Wedge400") == 0 || modelName.find("WEDGE400") == 0) {
type_ = PlatformType::PLATFORM_WEDGE400;
} else if (modelName.find("DARWIN48V") == 0) {
type_ = PlatformType::PLATFORM_DARWIN48V;
} else if (
modelName.find("Darwin") == 0 || modelName.find("DARWIN") == 0 ||
modelName.find("DCS-7060") == 0 || modelName.find("Rackhawk") == 0) {
Expand Down
94 changes: 94 additions & 0 deletions fboss/platform/configs/darwin48v/led_manager.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
"systemLedConfig": {
"presentLedColor": 1,
"presentLedSysfsPath": "/sys/class/leds/sys_led:green:status/brightness",
"absentLedColor": 2,
"absentLedSysfsPath": "/sys/class/leds/sys_led:red:status/brightness"
},
"fruTypeLedConfigs": {
"FAN": {
"presentLedColor": 1,
"presentLedSysfsPath": "/sys/class/leds/fan_led:green:status/brightness",
"absentLedColor": 2,
"absentLedSysfsPath": "/sys/class/leds/fan_led:red:status/brightness"
},
"PSU": {
"presentLedColor": 1,
"presentLedSysfsPath": "/sys/class/leds/psu_led:green:status/brightness",
"absentLedColor": 2,
"absentLedSysfsPath": "/sys/class/leds/psu_led:red:status/brightness"
}
},
"fruConfigs": [
{
"fruName": "FAN1",
"fruType": "FAN",
"presenceDetection": {
"sysfsFileHandle": {
"presenceFilePath": "/run/devmap/sensors/FAN_CPLD/fan1_present",
"desiredValue": 1
}
}
},
{
"fruName": "FAN2",
"fruType": "FAN",
"presenceDetection": {
"sysfsFileHandle": {
"presenceFilePath": "/run/devmap/sensors/FAN_CPLD/fan2_present",
"desiredValue": 1
}
}
},
{
"fruName": "FAN3",
"fruType": "FAN",
"presenceDetection": {
"sysfsFileHandle": {
"presenceFilePath": "/run/devmap/sensors/FAN_CPLD/fan3_present",
"desiredValue": 1
}
}
},
{
"fruName": "FAN4",
"fruType": "FAN",
"presenceDetection": {
"sysfsFileHandle": {
"presenceFilePath": "/run/devmap/sensors/FAN_CPLD/fan4_present",
"desiredValue": 1
}
}
},
{
"fruName": "FAN5",
"fruType": "FAN",
"presenceDetection": {
"sysfsFileHandle": {
"presenceFilePath": "/run/devmap/sensors/FAN_CPLD/fan5_present",
"desiredValue": 1
}
}
},
{
"fruName": "FAN6",
"fruType": "FAN",
"presenceDetection": {
"sysfsFileHandle": {
"presenceFilePath": "/run/devmap/fpgas/SCD_FPGA/rackmon_present",
"desiredValue": 1
}
}
},
{
"fruName": "PSU1",
"fruType": "PSU",
"presenceDetection": {
"sysfsFileHandle": {
"presenceFilePath": "/run/devmap/fpgas/SCD_FPGA/pem_present",
"desiredValue": 1
}
}
}
]
}
1 change: 1 addition & 0 deletions fboss/qsfp_service/test/hw_test/HwXphyFirmwareTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ TEST_F(HwXphyFirmwareTest, CheckDefaultXphyFirmwareVersion) {
case PlatformType::PLATFORM_WEDGE400:
case PlatformType::PLATFORM_WEDGE400_GRANDTETON:
case PlatformType::PLATFORM_DARWIN:
case PlatformType::PLATFORM_DARWIN48V:
case PlatformType::PLATFORM_LASSEN_DEPRECATED:
case PlatformType::PLATFORM_MERU400BIU:
case PlatformType::PLATFORM_MERU800BIA:
Expand Down

0 comments on commit 08e131f

Please sign in to comment.