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 cmake/LedService.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ add_library(led_manager_lib
fboss/led_service/Wedge800BACTLedManager.cpp
fboss/led_service/Wedge800CACTLedManager.cpp
fboss/led_service/Ladakh800bclsLedManager.cpp
fboss/led_service/Blackwolf800banwLedManager.cpp
)

target_link_libraries(led_manager_lib
Expand All @@ -95,6 +96,7 @@ target_link_libraries(led_manager_lib
morgan800cc_bsp
tahansb800bc_bsp
ladakh800bcls_bsp
blackwolf800banw_bsp
darwin_platform_mapping
elbert_platform_mapping
fuji_platform_mapping
Expand All @@ -110,6 +112,7 @@ target_link_libraries(led_manager_lib
tahan800bc_platform_mapping
tahansb800bc_platform_mapping
ladakh800bcls_platform_mapping
blackwolf800banw_platform_mapping
wedge400_fpga
wedge400_platform_mapping
wedge800bact_platform_mapping
Expand Down
4 changes: 4 additions & 0 deletions fboss/led_service/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ cpp_library(
name = "led_manager",
srcs = [
"BspLedManager.cpp",
"Blackwolf800banwLedManager.cpp",
"FsdbSwitchStateSubscriber.cpp",
"Icecube800bcLedManager.cpp",
"Icetea800bcLedManager.cpp",
Expand Down Expand Up @@ -72,6 +73,7 @@ cpp_library(
"facebook/YampLedManager.cpp",
],
headers = [
"Blackwolf800banwLedManager.h",
"BspLedManager.h",
"DarwinLedManager.h",
"ElbertLedManager.h",
Expand Down Expand Up @@ -110,6 +112,7 @@ cpp_library(
"//fboss/agent/platforms/common/darwin:darwin_platform_mapping",
"//fboss/agent/platforms/common/elbert:elbert_platform_mapping",
"//fboss/agent/platforms/common/fuji:fuji_platform_mapping",
"//fboss/agent/platforms/common/blackwolf800banw:blackwolf800banw_platform_mapping",
"//fboss/agent/platforms/common/icecube800bc:icecube800bc_platform_mapping",
"//fboss/agent/platforms/common/icetea800bc:icetea800bc_platform_mapping",
"//fboss/agent/platforms/common/janga800bic:janga800bic_platform_mapping",
Expand All @@ -134,6 +137,7 @@ cpp_library(
"//fboss/lib:common_file_utils",
"//fboss/lib:common_port_utils",
"//fboss/lib/bsp:bsp_core",
"//fboss/lib/bsp/blackwolf800banw:blackwolf800banw_bsp",
"//fboss/lib/bsp/icecube800bc:icecube800bc_bsp",
"//fboss/lib/bsp/icetea800bc:icetea800bc_bsp",
"//fboss/lib/bsp/janga800bic:janga800bic_bsp",
Expand Down
21 changes: 21 additions & 0 deletions fboss/led_service/Blackwolf800banwLedManager.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.

#include "fboss/led_service/Blackwolf800banwLedManager.h"
#include "fboss/agent/platforms/common/blackwolf800banw/Blackwolf800banwPlatformMapping.h"
#include "fboss/lib/bsp/BspGenericSystemContainer.h"
#include "fboss/lib/bsp/blackwolf800banw/Blackwolf800banwBspPlatformMapping.h"

namespace facebook::fboss {

/*
* Blackwolf800banwLedManager ctor()
*
* Blackwolf800banwLedManager constructor will create the LedManager object for
* blackwolf800banw platform
*/
Blackwolf800banwLedManager::Blackwolf800banwLedManager() : BspLedManager() {
init<Blackwolf800banwBspPlatformMapping, Blackwolf800banwPlatformMapping>();
XLOG(INFO) << "Created Blackwolf800banw BSP LED Manager";
}

} // namespace facebook::fboss
35 changes: 35 additions & 0 deletions fboss/led_service/Blackwolf800banwLedManager.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright (c) 2018-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#pragma once

#include "fboss/led_service/BspLedManager.h"
#include "fboss/lib/bsp/BspSystemContainer.h"

namespace facebook::fboss {

/*
* Blackwolf800banwLedManager class definition:
*
* The BspLedManager class managing all LED in the system. The object is spawned
* by LED Service. This will subscribe to Fsdb to get Switch state update and
* then update the LED in hardware
*/
class Blackwolf800banwLedManager : public BspLedManager {
public:
Blackwolf800banwLedManager();
virtual ~Blackwolf800banwLedManager() override {}

// Forbidden copy constructor and assignment operator
Blackwolf800banwLedManager(Blackwolf800banwLedManager const&) = delete;
Blackwolf800banwLedManager& operator=(Blackwolf800banwLedManager const&) =
delete;
};

} // namespace facebook::fboss
3 changes: 3 additions & 0 deletions fboss/led_service/LedManagerInit.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.

#include "fboss/led_service/LedManagerInit.h"
#include "fboss/led_service/Blackwolf800banwLedManager.h"
#include "fboss/led_service/DarwinLedManager.h"
#include "fboss/led_service/ElbertLedManager.h"
#include "fboss/led_service/FujiLedManager.h"
Expand Down Expand Up @@ -80,6 +81,8 @@ std::unique_ptr<LedManager> createLedManager() {
return std::make_unique<Wedge800CACTLedManager>();
} else if (mode == PlatformType::PLATFORM_LADAKH800BCLS) {
return std::make_unique<Ladakh800bclsLedManager>();
} else if (mode == PlatformType::PLATFORM_BLACKWOLF800BANW) {
return std::make_unique<Blackwolf800banwLedManager>();
}
return nullptr;
}
Expand Down
2 changes: 2 additions & 0 deletions fboss/platform/config_lib/ConfigLibTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const std::string kMeru800bfa = "meru800bfa";
const std::string kMorgan800cc = "morgan800cc";
const std::string kJanga800bic = "janga800bic";
const std::string kTahan800bc = "tahan800bc";
const std::string kBlackwolf800banw = "blackwolf800banw";
const std::string kSample = "sample";
const std::string kNonExistentPlatform = "nonExistentPlatform";
} // namespace
Expand Down Expand Up @@ -68,6 +69,7 @@ TEST(ConfigLibTest, Basic) {
// LedManager Configs
EXPECT_NO_THROW(ConfigLib().getLedManagerConfig(kDarwin));
EXPECT_NO_THROW(ConfigLib().getLedManagerConfig(kMorgan800cc));
EXPECT_NO_THROW(ConfigLib().getLedManagerConfig(kBlackwolf800banw));
EXPECT_THROW(
ConfigLib().getLedManagerConfig(kNonExistentPlatform),
std::runtime_error);
Expand Down
108 changes: 108 additions & 0 deletions fboss/platform/configs/blackwolf800banw/led_manager.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
{
"systemLedConfig": {
"presentLedSysfsPath": "/sys/class/leds/sys_led:blue:status/brightness",
"absentLedSysfsPath": "/sys/class/leds/sys_led:amber:status/brightness"
},
"fruTypeLedConfigs": {
"FAN": {
"presentLedSysfsPath": "/sys/class/leds/fan_led:blue:status/brightness",
"absentLedSysfsPath": "/sys/class/leds/fan_led:amber:status/brightness"
},
"PSU": {
"presentLedSysfsPath": "/sys/class/leds/psu_led:blue:status/brightness",
"absentLedSysfsPath": "/sys/class/leds/psu_led:amber: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": "PSU1",
"fruType": "PSU",
"presenceDetection": {
"sysfsFileHandle": {
"presenceFilePath": "/run/devmap/cplds/CHASSIS_CPLD/psu1_present",
"desiredValue": 1
}
}
},
{
"fruName": "PSU2",
"fruType": "PSU",
"presenceDetection": {
"sysfsFileHandle": {
"presenceFilePath": "/run/devmap/cplds/CHASSIS_CPLD/psu2_present",
"desiredValue": 1
}
}
},
{
"fruName": "PSU3",
"fruType": "PSU",
"presenceDetection": {
"sysfsFileHandle": {
"presenceFilePath": "/run/devmap/cplds/CHASSIS_CPLD/psu3_present",
"desiredValue": 1
}
}
},
{
"fruName": "PSU4",
"fruType": "PSU",
"presenceDetection": {
"sysfsFileHandle": {
"presenceFilePath": "/run/devmap/cplds/CHASSIS_CPLD/psu4_present",
"desiredValue": 1
}
}
}
]
}
Loading