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
1 change: 1 addition & 0 deletions cmake/LedService.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ target_link_libraries(led_manager_lib
meru800bia_bsp
meru800bfa_bsp
morgan800cc_bsp
darwin_bsp
darwin_platform_mapping
elbert_platform_mapping
fuji_platform_mapping
Expand Down
10 changes: 10 additions & 0 deletions cmake/QsfpService.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,15 @@ target_link_libraries(tahan800bc_bsp
FBThrift::thriftcpp2
)

add_library(darwin_bsp
fboss/lib/bsp/darwin/DarwinBspPlatformMapping.cpp
)

target_link_libraries(darwin_bsp
bsp_platform_mapping_cpp2
FBThrift::thriftcpp2
)

add_library(qsfp_bsp_core
fboss/lib/bsp/BspGenericSystemContainer.cpp
fboss/lib/bsp/BspIOBus.cpp
Expand Down Expand Up @@ -176,6 +185,7 @@ target_link_libraries(qsfp_bsp_core
morgan800cc_bsp
janga800bic_bsp
tahan800bc_bsp
darwin_bsp
device_mdio
fpga_device
phy_management_base
Expand Down
1 change: 1 addition & 0 deletions cmake/QsfpServicePlatformsWedge.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ target_link_libraries(qsfp_platforms_wedge
janga800bic_platform_mapping
tahan800bc_platform_mapping
icecube800bc_platform_mapping
darwin_platform_mapping
platform_base
qsfp_config
wedge400_i2c
Expand Down
4 changes: 2 additions & 2 deletions fboss/led_service/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ cpp_library(
"FsdbSwitchStateSubscriber.cpp",
"LedManager.cpp",
"LedManagerInit.cpp",
"DarwinLedManager.cpp",
"Meru800bfaLedManager.cpp",
"Meru800biaLedManager.cpp",
"Minipack3NLedManager.cpp",
"MinipackBaseLedManager.cpp",
"MontblancLedManager.cpp",
"Morgan800ccLedManager.cpp",
"facebook/DarwinLedManager.cpp",
"facebook/ElbertLedManager.cpp",
"facebook/FsdbSwitchStateSubscriber.cpp",
"facebook/FujiLedManager.cpp",
Expand Down Expand Up @@ -104,6 +104,7 @@ cpp_library(
"//fboss/lib:common_file_utils",
"//fboss/lib:common_port_utils",
"//fboss/lib/bsp:bsp_core",
"//fboss/lib/bsp/darwin:darwin_bsp",
"//fboss/lib/bsp/meru800bfa:meru800bfa_bsp",
"//fboss/lib/bsp/meru800bia:meru800bia_bsp",
"//fboss/lib/bsp/minipack3n:minipack3n_bsp",
Expand All @@ -112,7 +113,6 @@ cpp_library(
"//fboss/lib/fpga:minipack_base_container",
"//fboss/lib/fpga:minipack_container",
"//fboss/lib/fpga:wedge400_fpga",
"//fboss/lib/fpga/facebook/darwin:darwin_fpga",
"//fboss/lib/fpga/facebook/elbert:elbert_fpga",
"//fboss/lib/fpga/facebook/fuji:fuji_container",
"//fboss/lib/fpga/facebook/yamp:yamp_base_fpga",
Expand Down
21 changes: 21 additions & 0 deletions fboss/led_service/DarwinLedManager.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/DarwinLedManager.h"
#include "fboss/agent/platforms/common/darwin/DarwinPlatformMapping.h"
#include "fboss/lib/bsp/BspGenericSystemContainer.h"
#include "fboss/lib/bsp/darwin/DarwinBspPlatformMapping.h"

namespace facebook::fboss {

/*
* DarwinLedManager ctor()
*
* DarwinLedManager constructor will create the LedManager object for
* Darwin platform
*/
DarwinLedManager::DarwinLedManager() : BspLedManager() {
init<DarwinBspPlatformMapping, DarwinPlatformMapping>();
XLOG(INFO) << "Created Darwin BSP LED Manager";
}

} // namespace facebook::fboss
1 change: 1 addition & 0 deletions fboss/lib/bsp/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ cpp_library(
"//fboss/agent:fboss-error",
"//fboss/lib:common_file_utils",
"//fboss/lib:gpiod_line",
"//fboss/lib/bsp/darwin:darwin_bsp",
"//fboss/lib/bsp/janga800bic:janga800bic_bsp",
"//fboss/lib/bsp/meru400bfu:meru400bfu_bsp",
"//fboss/lib/bsp/meru400bia:meru400bia_bsp",
Expand Down
10 changes: 10 additions & 0 deletions fboss/lib/bsp/BspGenericSystemContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "fboss/lib/bsp/BspGenericSystemContainer.h"
#include <folly/FileUtil.h>
#include <folly/Singleton.h>
#include "fboss/lib/bsp/darwin/DarwinBspPlatformMapping.h"
#include "fboss/lib/bsp/janga800bic/Janga800bicBspPlatformMapping.h"
#include "fboss/lib/bsp/meru400bfu/Meru400bfuBspPlatformMapping.h"
#include "fboss/lib/bsp/meru400bia/Meru400biaBspPlatformMapping.h"
Expand Down Expand Up @@ -134,5 +135,14 @@ Tahan800bcSystemContainer::getInstance() {
return _tahan800bcSystemContainer.try_get();
}

using DarwinSystemContainer =
BspGenericSystemContainer<DarwinBspPlatformMapping>;
folly::Singleton<DarwinSystemContainer> _darwinSystemContainer;
template <>
std::shared_ptr<DarwinSystemContainer>
DarwinSystemContainer::getInstance() {
return _darwinSystemContainer.try_get();
}

} // namespace fboss
} // namespace facebook
4 changes: 4 additions & 0 deletions fboss/lib/bsp/bspmapping/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ const std::map<PlatformType, folly::StringPiece> kHardwareNameMap = {
kPortMappingTahan800bcCsv},
{facebook::fboss::PlatformType::PLATFORM_MORGAN800CC,
kPortMappingMorgan800ccCsv},
{facebook::fboss::PlatformType::PLATFORM_DARWIN,
kPortMappingDarwinCsv},
{facebook::fboss::PlatformType::PLATFORM_DARWIN48V,
kPortMappingDarwinCsv},
};

int cliMain(int argc, char* argv[]) {
Expand Down
2 changes: 2 additions & 0 deletions fboss/lib/bsp/bspmapping/Parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ inline constexpr folly::StringPiece kPortMappingTahan800bcCsv{
"Tahan800bc_BspMapping.csv"};
inline constexpr folly::StringPiece kPortMappingMorgan800ccCsv{
"Morgan800cc_BspMapping.csv"};
inline constexpr folly::StringPiece kPortMappingDarwinCsv{
"Darwin_BspMapping.csv"};

class Parser {
public:
Expand Down
2 changes: 1 addition & 1 deletion fboss/lib/bsp/bspmapping/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ This will write the configs for each platform to a directory called `generated_c

| JSON File Name | C++ File Location |
|------------------------------------|-------------------------------------------------------------|
| generated_configs/darwin.json | fboss/lib/bsp/darwin/DarwinBspPlatformMapping.cpp |
| generated_configs/janga800bic.json | fboss/lib/bsp/janga800bic/Janga800bicBspPlatformMapping.cpp |
| generated_configs/meru400bfu.json | fboss/lib/bsp/meru400bfu/Meru400bfuBspPlatformMapping.cpp |
| generated_configs/meru400biu.json | fboss/lib/bsp/meru400biu/Meru400biuBspPlatformMapping.cpp |
Expand All @@ -46,7 +47,6 @@ This will write the configs for each platform to a directory called `generated_c
| generated_configs/morgan800cc.json | fboss/lib/bsp/morgan800cc/Morgan800ccBspPlatformMapping.cpp |
| generated_configs/tahan800bc.json | fboss/lib/bsp/tahan800bc/Tahan800bcBspPlatformMapping.cpp |


## Instructions (Meta-Internal)

Running this script internally can be done via buck:
Expand Down
33 changes: 33 additions & 0 deletions fboss/lib/bsp/bspmapping/input/Darwin_BspMapping.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
TcvrId,TcvrLaneIdList,PimId,AccessControllerId,AccessControlType,ResetPath,ResetMask,ResetHoldHi,PresentPath,PresentMask,PresentHoldHi,IoControllerId,IoControlType,IoPath,LedId,LedBluePath,LedYellowPath
1,1 2 3 4 5 6 7 8,1,1,CPLD,/run/devmap/xcvrs/xcvr_ctrl_1/xcvr1_reset,1,0,/run/devmap/xcvrs/xcvr_ctrl_1/xcvr1_present,1,0,1,I2C,/run/devmap/xcvrs/xcvr_io_1,1,/sys/class/leds/port1_led1:green:status,/sys/class/leds/port1_led1:yellow:status
2,1 2 3 4 5 6 7 8,1,2,CPLD,/run/devmap/xcvrs/xcvr_ctrl_2/xcvr2_reset,1,0,/run/devmap/xcvrs/xcvr_ctrl_2/xcvr2_present,1,0,2,I2C,/run/devmap/xcvrs/xcvr_io_2,2,/sys/class/leds/port2_led1:green:status,/sys/class/leds/port2_led1:yellow:status
3,1 2 3 4 5 6 7 8,1,3,CPLD,/run/devmap/xcvrs/xcvr_ctrl_3/xcvr3_reset,1,0,/run/devmap/xcvrs/xcvr_ctrl_3/xcvr3_present,1,0,3,I2C,/run/devmap/xcvrs/xcvr_io_3,3,/sys/class/leds/port3_led1:green:status,/sys/class/leds/port3_led1:yellow:status
4,1 2 3 4 5 6 7 8,1,4,CPLD,/run/devmap/xcvrs/xcvr_ctrl_4/xcvr4_reset,1,0,/run/devmap/xcvrs/xcvr_ctrl_4/xcvr4_present,1,0,4,I2C,/run/devmap/xcvrs/xcvr_io_4,4,/sys/class/leds/port4_led1:green:status,/sys/class/leds/port4_led1:yellow:status
5,1 2 3 4 5 6 7 8,1,5,CPLD,/run/devmap/xcvrs/xcvr_ctrl_5/xcvr5_reset,1,0,/run/devmap/xcvrs/xcvr_ctrl_5/xcvr5_present,1,0,5,I2C,/run/devmap/xcvrs/xcvr_io_5,5,/sys/class/leds/port5_led1:green:status,/sys/class/leds/port5_led1:yellow:status
6,1 2 3 4 5 6 7 8,1,6,CPLD,/run/devmap/xcvrs/xcvr_ctrl_6/xcvr6_reset,1,0,/run/devmap/xcvrs/xcvr_ctrl_6/xcvr6_present,1,0,6,I2C,/run/devmap/xcvrs/xcvr_io_6,6,/sys/class/leds/port6_led1:green:status,/sys/class/leds/port6_led1:yellow:status
7,1 2 3 4 5 6 7 8,1,7,CPLD,/run/devmap/xcvrs/xcvr_ctrl_7/xcvr7_reset,1,0,/run/devmap/xcvrs/xcvr_ctrl_7/xcvr7_present,1,0,7,I2C,/run/devmap/xcvrs/xcvr_io_7,7,/sys/class/leds/port7_led1:green:status,/sys/class/leds/port7_led1:yellow:status
8,1 2 3 4 5 6 7 8,1,8,CPLD,/run/devmap/xcvrs/xcvr_ctrl_8/xcvr8_reset,1,0,/run/devmap/xcvrs/xcvr_ctrl_8/xcvr8_present,1,0,8,I2C,/run/devmap/xcvrs/xcvr_io_8,8,/sys/class/leds/port8_led1:green:status,/sys/class/leds/port8_led1:yellow:status
9,1 2 3 4 5 6 7 8,1,9,CPLD,/run/devmap/xcvrs/xcvr_ctrl_9/xcvr9_reset,1,0,/run/devmap/xcvrs/xcvr_ctrl_9/xcvr9_present,1,0,9,I2C,/run/devmap/xcvrs/xcvr_io_9,9,/sys/class/leds/port9_led1:green:status,/sys/class/leds/port9_led1:yellow:status
10,1 2 3 4 5 6 7 8,1,10,CPLD,/run/devmap/xcvrs/xcvr_ctrl_10/xcvr10_reset,1,0,/run/devmap/xcvrs/xcvr_ctrl_10/xcvr10_present,1,0,10,I2C,/run/devmap/xcvrs/xcvr_io_10,10,/sys/class/leds/port10_led1:green:status,/sys/class/leds/port10_led1:yellow:status
11,1 2 3 4 5 6 7 8,1,11,CPLD,/run/devmap/xcvrs/xcvr_ctrl_11/xcvr11_reset,1,0,/run/devmap/xcvrs/xcvr_ctrl_11/xcvr11_present,1,0,11,I2C,/run/devmap/xcvrs/xcvr_io_11,11,/sys/class/leds/port11_led1:green:status,/sys/class/leds/port11_led1:yellow:status
12,1 2 3 4 5 6 7 8,1,12,CPLD,/run/devmap/xcvrs/xcvr_ctrl_12/xcvr12_reset,1,0,/run/devmap/xcvrs/xcvr_ctrl_12/xcvr12_present,1,0,12,I2C,/run/devmap/xcvrs/xcvr_io_12,12,/sys/class/leds/port12_led1:green:status,/sys/class/leds/port12_led1:yellow:status
13,1 2 3 4 5 6 7 8,1,13,CPLD,/run/devmap/xcvrs/xcvr_ctrl_13/xcvr13_reset,1,0,/run/devmap/xcvrs/xcvr_ctrl_13/xcvr13_present,1,0,13,I2C,/run/devmap/xcvrs/xcvr_io_13,13,/sys/class/leds/port13_led1:green:status,/sys/class/leds/port13_led1:yellow:status
14,1 2 3 4 5 6 7 8,1,14,CPLD,/run/devmap/xcvrs/xcvr_ctrl_14/xcvr14_reset,1,0,/run/devmap/xcvrs/xcvr_ctrl_14/xcvr14_present,1,0,14,I2C,/run/devmap/xcvrs/xcvr_io_14,14,/sys/class/leds/port14_led1:green:status,/sys/class/leds/port14_led1:yellow:status
15,1 2 3 4 5 6 7 8,1,15,CPLD,/run/devmap/xcvrs/xcvr_ctrl_15/xcvr15_reset,1,0,/run/devmap/xcvrs/xcvr_ctrl_15/xcvr15_present,1,0,15,I2C,/run/devmap/xcvrs/xcvr_io_15,15,/sys/class/leds/port15_led1:green:status,/sys/class/leds/port15_led1:yellow:status
16,1 2 3 4 5 6 7 8,1,16,CPLD,/run/devmap/xcvrs/xcvr_ctrl_16/xcvr16_reset,1,0,/run/devmap/xcvrs/xcvr_ctrl_16/xcvr16_present,1,0,16,I2C,/run/devmap/xcvrs/xcvr_io_16,16,/sys/class/leds/port16_led1:green:status,/sys/class/leds/port16_led1:yellow:status
17,1 2 3 4 5 6 7 8,1,17,CPLD,/run/devmap/xcvrs/xcvr_ctrl_17/xcvr17_reset,1,0,/run/devmap/xcvrs/xcvr_ctrl_17/xcvr17_present,1,0,17,I2C,/run/devmap/xcvrs/xcvr_io_17,17,/sys/class/leds/port17_led1:green:status,/sys/class/leds/port17_led1:yellow:status
18,1 2 3 4 5 6 7 8,1,18,CPLD,/run/devmap/xcvrs/xcvr_ctrl_18/xcvr18_reset,1,0,/run/devmap/xcvrs/xcvr_ctrl_18/xcvr18_present,1,0,18,I2C,/run/devmap/xcvrs/xcvr_io_18,18,/sys/class/leds/port18_led1:green:status,/sys/class/leds/port18_led1:yellow:status
19,1 2 3 4 5 6 7 8,1,19,CPLD,/run/devmap/xcvrs/xcvr_ctrl_19/xcvr19_reset,1,0,/run/devmap/xcvrs/xcvr_ctrl_19/xcvr19_present,1,0,19,I2C,/run/devmap/xcvrs/xcvr_io_19,19,/sys/class/leds/port19_led1:green:status,/sys/class/leds/port19_led1:yellow:status
20,1 2 3 4 5 6 7 8,1,20,CPLD,/run/devmap/xcvrs/xcvr_ctrl_20/xcvr20_reset,1,0,/run/devmap/xcvrs/xcvr_ctrl_20/xcvr20_present,1,0,20,I2C,/run/devmap/xcvrs/xcvr_io_20,20,/sys/class/leds/port20_led1:green:status,/sys/class/leds/port20_led1:yellow:status
21,1 2 3 4 5 6 7 8,1,21,CPLD,/run/devmap/xcvrs/xcvr_ctrl_21/xcvr21_reset,1,0,/run/devmap/xcvrs/xcvr_ctrl_21/xcvr21_present,1,0,21,I2C,/run/devmap/xcvrs/xcvr_io_21,21,/sys/class/leds/port21_led1:green:status,/sys/class/leds/port21_led1:yellow:status
22,1 2 3 4 5 6 7 8,1,22,CPLD,/run/devmap/xcvrs/xcvr_ctrl_22/xcvr22_reset,1,0,/run/devmap/xcvrs/xcvr_ctrl_22/xcvr22_present,1,0,22,I2C,/run/devmap/xcvrs/xcvr_io_22,22,/sys/class/leds/port22_led1:green:status,/sys/class/leds/port22_led1:yellow:status
23,1 2 3 4 5 6 7 8,1,23,CPLD,/run/devmap/xcvrs/xcvr_ctrl_23/xcvr23_reset,1,0,/run/devmap/xcvrs/xcvr_ctrl_23/xcvr23_present,1,0,23,I2C,/run/devmap/xcvrs/xcvr_io_23,23,/sys/class/leds/port23_led1:green:status,/sys/class/leds/port23_led1:yellow:status
24,1 2 3 4 5 6 7 8,1,24,CPLD,/run/devmap/xcvrs/xcvr_ctrl_24/xcvr24_reset,1,0,/run/devmap/xcvrs/xcvr_ctrl_24/xcvr24_present,1,0,24,I2C,/run/devmap/xcvrs/xcvr_io_24,24,/sys/class/leds/port24_led1:green:status,/sys/class/leds/port24_led1:yellow:status
25,1 2 3 4 5 6 7 8,1,25,CPLD,/run/devmap/xcvrs/xcvr_ctrl_25/xcvr25_reset,1,0,/run/devmap/xcvrs/xcvr_ctrl_25/xcvr25_present,1,0,25,I2C,/run/devmap/xcvrs/xcvr_io_25,25,/sys/class/leds/port25_led1:green:status,/sys/class/leds/port25_led1:yellow:status
26,1 2 3 4 5 6 7 8,1,26,CPLD,/run/devmap/xcvrs/xcvr_ctrl_26/xcvr26_reset,1,0,/run/devmap/xcvrs/xcvr_ctrl_26/xcvr26_present,1,0,26,I2C,/run/devmap/xcvrs/xcvr_io_26,26,/sys/class/leds/port26_led1:green:status,/sys/class/leds/port26_led1:yellow:status
27,1 2 3 4 5 6 7 8,1,27,CPLD,/run/devmap/xcvrs/xcvr_ctrl_27/xcvr27_reset,1,0,/run/devmap/xcvrs/xcvr_ctrl_27/xcvr27_present,1,0,27,I2C,/run/devmap/xcvrs/xcvr_io_27,27,/sys/class/leds/port27_led1:green:status,/sys/class/leds/port27_led1:yellow:status
28,1 2 3 4 5 6 7 8,1,28,CPLD,/run/devmap/xcvrs/xcvr_ctrl_28/xcvr28_reset,1,0,/run/devmap/xcvrs/xcvr_ctrl_28/xcvr28_present,1,0,28,I2C,/run/devmap/xcvrs/xcvr_io_28,28,/sys/class/leds/port28_led1:green:status,/sys/class/leds/port28_led1:yellow:status
29,1 2 3 4 5 6 7 8,1,29,CPLD,/run/devmap/xcvrs/xcvr_ctrl_29/xcvr29_reset,1,0,/run/devmap/xcvrs/xcvr_ctrl_29/xcvr29_present,1,0,29,I2C,/run/devmap/xcvrs/xcvr_io_29,29,/sys/class/leds/port29_led1:green:status,/sys/class/leds/port29_led1:yellow:status
30,1 2 3 4 5 6 7 8,1,30,CPLD,/run/devmap/xcvrs/xcvr_ctrl_30/xcvr30_reset,1,0,/run/devmap/xcvrs/xcvr_ctrl_30/xcvr30_present,1,0,30,I2C,/run/devmap/xcvrs/xcvr_io_30,30,/sys/class/leds/port30_led1:green:status,/sys/class/leds/port30_led1:yellow:status
31,1 2 3 4 5 6 7 8,1,31,CPLD,/run/devmap/xcvrs/xcvr_ctrl_31/xcvr31_reset,1,0,/run/devmap/xcvrs/xcvr_ctrl_31/xcvr31_present,1,0,31,I2C,/run/devmap/xcvrs/xcvr_io_31,31,/sys/class/leds/port31_led1:green:status,/sys/class/leds/port31_led1:yellow:status
32,1 2 3 4 5 6 7 8,1,32,CPLD,/run/devmap/xcvrs/xcvr_ctrl_32/xcvr32_reset,1,0,/run/devmap/xcvrs/xcvr_ctrl_32/xcvr32_present,1,0,32,I2C,/run/devmap/xcvrs/xcvr_io_32,32,/sys/class/leds/port32_led1:green:status,/sys/class/leds/port32_led1:yellow:status
8 changes: 8 additions & 0 deletions fboss/lib/bsp/bspmapping/test/ParserTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ TEST(ParserTest, GetNameForTests) {
facebook::fboss::Parser::getNameFor(
facebook::fboss::PlatformType::PLATFORM_MORGAN800CC),
"morgan800cc");
EXPECT_EQ(
facebook::fboss::Parser::getNameFor(
facebook::fboss::PlatformType::PLATFORM_DARWIN),
"darwin");
EXPECT_EQ(
facebook::fboss::Parser::getNameFor(
facebook::fboss::PlatformType::PLATFORM_DARWIN48V),
"darwin48v");
}

TEST(ParserTest, GetTransceiverConfigRowFromCsvLine) {
Expand Down
19 changes: 19 additions & 0 deletions fboss/lib/bsp/darwin/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# @autodeps
load("@fbcode_macros//build_defs:cpp_library.bzl", "cpp_library")

oncall("fboss_optics_phy")

cpp_library(
name = "darwin_bsp",
srcs = [
"DarwinBspPlatformMapping.cpp",
],
headers = [
"DarwinBspPlatformMapping.h",
],
exported_deps = [
"//fboss/lib/bsp:bsp_platform_mapping-cpp2-types",
"//fboss/lib/bsp:bsp_platform_mapping_lib",
"//thrift/lib/cpp2/protocol:protocol",
],
)
Loading
Loading