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

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 @@ -92,6 +92,7 @@ target_link_libraries(led_manager_lib
morgan800cc_bsp
tahansb800bc_bsp
ladakh800bcls_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 @@ -182,6 +182,15 @@ target_link_libraries(ladakh800bcls_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 @@ -218,6 +227,7 @@ target_link_libraries(qsfp_bsp_core
tahan800bc_bsp
tahansb800bc_bsp
ladakh800bcls_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 @@ -39,6 +39,7 @@ target_link_libraries(qsfp_platforms_wedge
icetea800bc_platform_mapping
tahansb800bc_platform_mapping
ladakh800bcls_platform_mapping
darwin_platform_mapping
platform_base
qsfp_config
wedge400_i2c
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/developing/bsp_mapping.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
3 changes: 2 additions & 1 deletion fboss/led_service/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ cpp_library(
"Ladakh800bclsLedManager.cpp",
"LedManager.cpp",
"LedManagerInit.cpp",
"DarwinLedManager.cpp",
"Meru800bfaLedManager.cpp",
"Meru800biaLedManager.cpp",
"Minipack3NLedManager.cpp",
Expand Down Expand Up @@ -132,6 +133,7 @@ cpp_library(
"//fboss/lib/bsp/icetea800bc:icetea800bc_bsp",
"//fboss/lib/bsp/janga800bic:janga800bic_bsp",
"//fboss/lib/bsp/ladakh800bcls:ladakh800bcls_bsp",
"//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 @@ -142,7 +144,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 @@ -91,6 +91,7 @@ cpp_library(
"//fboss/lib:gpiod_line",
"//fboss/lib/bsp/icecube800bc:icecube800bc_bsp",
"//fboss/lib/bsp/icetea800bc:icetea800bc_bsp",
"//fboss/lib/bsp/darwin:darwin_bsp",
"//fboss/lib/bsp/janga800bic:janga800bic_bsp",
"//fboss/lib/bsp/ladakh800bcls:ladakh800bcls_bsp",
"//fboss/lib/bsp/meru400bfu:meru400bfu_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 @@ -5,6 +5,7 @@
#include <folly/Singleton.h>
#include "fboss/lib/bsp/icecube800bc/Icecube800bcBspPlatformMapping.h"
#include "fboss/lib/bsp/icetea800bc/Icetea800bcBspPlatformMapping.h"
#include "fboss/lib/bsp/darwin/DarwinBspPlatformMapping.h"
#include "fboss/lib/bsp/janga800bic/Janga800bicBspPlatformMapping.h"
#include "fboss/lib/bsp/ladakh800bcls/Ladakh800bclsBspPlatformMapping.h"
#include "fboss/lib/bsp/meru400bfu/Meru400bfuBspPlatformMapping.h"
Expand Down Expand Up @@ -174,5 +175,14 @@ Ladakh800bclsSystemContainer::getInstance() {
return _Ladakh800bclsSystemContainer.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 @@ -49,6 +49,10 @@ const std::map<PlatformType, folly::StringPiece> kHardwareNameMap = {
kPortMappingTahansb800bcCsv},
{facebook::fboss::PlatformType::PLATFORM_LADAKH800BCLS,
kPortMappingLadakh800bclsCsv},
{facebook::fboss::PlatformType::PLATFORM_DARWIN,
kPortMappingDarwinCsv},
{facebook::fboss::PlatformType::PLATFORM_DARWIN48V,
kPortMappingDarwinCsv},
};

// Helper function to generate PHY CSV filename from regular CSV filename
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 @@ -39,6 +39,8 @@ inline constexpr folly::StringPiece kPortMappingTahansb800bcCsv{
"Tahansb800bc_BspMapping.csv"};
inline constexpr folly::StringPiece kPortMappingLadakh800bclsCsv{
"Ladakh800bcls_BspMapping.csv"};
inline constexpr folly::StringPiece kPortMappingDarwinCsv{
"Darwin_BspMapping.csv"};

class Parser {
public:
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/xcvr_reset_1,1,0,/run/devmap/xcvrs/xcvr_ctrl_1/xcvr_present_1,1,0,1,I2C,/run/devmap/xcvrs/xcvr_io_1,1,/sys/class/leds/port1_led1:green:status,/sys/class/leds/port1_led1:amber:status
2,1 2 3 4 5 6 7 8,1,2,CPLD,/run/devmap/xcvrs/xcvr_ctrl_2/xcvr_reset_2,1,0,/run/devmap/xcvrs/xcvr_ctrl_2/xcvr_present_2,1,0,2,I2C,/run/devmap/xcvrs/xcvr_io_2,2,/sys/class/leds/port2_led1:green:status,/sys/class/leds/port2_led1:amber:status
3,1 2 3 4 5 6 7 8,1,3,CPLD,/run/devmap/xcvrs/xcvr_ctrl_3/xcvr_reset_3,1,0,/run/devmap/xcvrs/xcvr_ctrl_3/xcvr_present_3,1,0,3,I2C,/run/devmap/xcvrs/xcvr_io_3,3,/sys/class/leds/port3_led1:green:status,/sys/class/leds/port3_led1:amber:status
4,1 2 3 4 5 6 7 8,1,4,CPLD,/run/devmap/xcvrs/xcvr_ctrl_4/xcvr_reset_4,1,0,/run/devmap/xcvrs/xcvr_ctrl_4/xcvr_present_4,1,0,4,I2C,/run/devmap/xcvrs/xcvr_io_4,4,/sys/class/leds/port4_led1:green:status,/sys/class/leds/port4_led1:amber:status
5,1 2 3 4 5 6 7 8,1,5,CPLD,/run/devmap/xcvrs/xcvr_ctrl_5/xcvr_reset_5,1,0,/run/devmap/xcvrs/xcvr_ctrl_5/xcvr_present_5,1,0,5,I2C,/run/devmap/xcvrs/xcvr_io_5,5,/sys/class/leds/port5_led1:green:status,/sys/class/leds/port5_led1:amber:status
6,1 2 3 4 5 6 7 8,1,6,CPLD,/run/devmap/xcvrs/xcvr_ctrl_6/xcvr_reset_6,1,0,/run/devmap/xcvrs/xcvr_ctrl_6/xcvr_present_6,1,0,6,I2C,/run/devmap/xcvrs/xcvr_io_6,6,/sys/class/leds/port6_led1:green:status,/sys/class/leds/port6_led1:amber:status
7,1 2 3 4 5 6 7 8,1,7,CPLD,/run/devmap/xcvrs/xcvr_ctrl_7/xcvr_reset_7,1,0,/run/devmap/xcvrs/xcvr_ctrl_7/xcvr_present_7,1,0,7,I2C,/run/devmap/xcvrs/xcvr_io_7,7,/sys/class/leds/port7_led1:green:status,/sys/class/leds/port7_led1:amber:status
8,1 2 3 4 5 6 7 8,1,8,CPLD,/run/devmap/xcvrs/xcvr_ctrl_8/xcvr_reset_8,1,0,/run/devmap/xcvrs/xcvr_ctrl_8/xcvr_present_8,1,0,8,I2C,/run/devmap/xcvrs/xcvr_io_8,8,/sys/class/leds/port8_led1:green:status,/sys/class/leds/port8_led1:amber:status
9,1 2 3 4 5 6 7 8,1,9,CPLD,/run/devmap/xcvrs/xcvr_ctrl_9/xcvr_reset_9,1,0,/run/devmap/xcvrs/xcvr_ctrl_9/xcvr_present_9,1,0,9,I2C,/run/devmap/xcvrs/xcvr_io_9,9,/sys/class/leds/port9_led1:green:status,/sys/class/leds/port9_led1:amber:status
10,1 2 3 4 5 6 7 8,1,10,CPLD,/run/devmap/xcvrs/xcvr_ctrl_10/xcvr_reset_10,1,0,/run/devmap/xcvrs/xcvr_ctrl_10/xcvr_present_10,1,0,10,I2C,/run/devmap/xcvrs/xcvr_io_10,10,/sys/class/leds/port10_led1:green:status,/sys/class/leds/port10_led1:amber:status
11,1 2 3 4 5 6 7 8,1,11,CPLD,/run/devmap/xcvrs/xcvr_ctrl_11/xcvr_reset_11,1,0,/run/devmap/xcvrs/xcvr_ctrl_11/xcvr_present_11,1,0,11,I2C,/run/devmap/xcvrs/xcvr_io_11,11,/sys/class/leds/port11_led1:green:status,/sys/class/leds/port11_led1:amber:status
12,1 2 3 4 5 6 7 8,1,12,CPLD,/run/devmap/xcvrs/xcvr_ctrl_12/xcvr_reset_12,1,0,/run/devmap/xcvrs/xcvr_ctrl_12/xcvr_present_12,1,0,12,I2C,/run/devmap/xcvrs/xcvr_io_12,12,/sys/class/leds/port12_led1:green:status,/sys/class/leds/port12_led1:amber:status
13,1 2 3 4 5 6 7 8,1,13,CPLD,/run/devmap/xcvrs/xcvr_ctrl_13/xcvr_reset_13,1,0,/run/devmap/xcvrs/xcvr_ctrl_13/xcvr_present_13,1,0,13,I2C,/run/devmap/xcvrs/xcvr_io_13,13,/sys/class/leds/port13_led1:green:status,/sys/class/leds/port13_led1:amber:status
14,1 2 3 4 5 6 7 8,1,14,CPLD,/run/devmap/xcvrs/xcvr_ctrl_14/xcvr_reset_14,1,0,/run/devmap/xcvrs/xcvr_ctrl_14/xcvr_present_14,1,0,14,I2C,/run/devmap/xcvrs/xcvr_io_14,14,/sys/class/leds/port14_led1:green:status,/sys/class/leds/port14_led1:amber:status
15,1 2 3 4 5 6 7 8,1,15,CPLD,/run/devmap/xcvrs/xcvr_ctrl_15/xcvr_reset_15,1,0,/run/devmap/xcvrs/xcvr_ctrl_15/xcvr_present_15,1,0,15,I2C,/run/devmap/xcvrs/xcvr_io_15,15,/sys/class/leds/port15_led1:green:status,/sys/class/leds/port15_led1:amber:status
16,1 2 3 4 5 6 7 8,1,16,CPLD,/run/devmap/xcvrs/xcvr_ctrl_16/xcvr_reset_16,1,0,/run/devmap/xcvrs/xcvr_ctrl_16/xcvr_present_16,1,0,16,I2C,/run/devmap/xcvrs/xcvr_io_16,16,/sys/class/leds/port16_led1:green:status,/sys/class/leds/port16_led1:amber:status
17,1 2 3 4 5 6 7 8,1,17,CPLD,/run/devmap/xcvrs/xcvr_ctrl_17/xcvr_reset_17,1,0,/run/devmap/xcvrs/xcvr_ctrl_17/xcvr_present_17,1,0,17,I2C,/run/devmap/xcvrs/xcvr_io_17,17,/sys/class/leds/port17_led1:green:status,/sys/class/leds/port17_led1:amber:status
18,1 2 3 4 5 6 7 8,1,18,CPLD,/run/devmap/xcvrs/xcvr_ctrl_18/xcvr_reset_18,1,0,/run/devmap/xcvrs/xcvr_ctrl_18/xcvr_present_18,1,0,18,I2C,/run/devmap/xcvrs/xcvr_io_18,18,/sys/class/leds/port18_led1:green:status,/sys/class/leds/port18_led1:amber:status
19,1 2 3 4 5 6 7 8,1,19,CPLD,/run/devmap/xcvrs/xcvr_ctrl_19/xcvr_reset_19,1,0,/run/devmap/xcvrs/xcvr_ctrl_19/xcvr_present_19,1,0,19,I2C,/run/devmap/xcvrs/xcvr_io_19,19,/sys/class/leds/port19_led1:green:status,/sys/class/leds/port19_led1:amber:status
20,1 2 3 4 5 6 7 8,1,20,CPLD,/run/devmap/xcvrs/xcvr_ctrl_20/xcvr_reset_20,1,0,/run/devmap/xcvrs/xcvr_ctrl_20/xcvr_present_20,1,0,20,I2C,/run/devmap/xcvrs/xcvr_io_20,20,/sys/class/leds/port20_led1:green:status,/sys/class/leds/port20_led1:amber:status
21,1 2 3 4 5 6 7 8,1,21,CPLD,/run/devmap/xcvrs/xcvr_ctrl_21/xcvr_reset_21,1,0,/run/devmap/xcvrs/xcvr_ctrl_21/xcvr_present_21,1,0,21,I2C,/run/devmap/xcvrs/xcvr_io_21,21,/sys/class/leds/port21_led1:green:status,/sys/class/leds/port21_led1:amber:status
22,1 2 3 4 5 6 7 8,1,22,CPLD,/run/devmap/xcvrs/xcvr_ctrl_22/xcvr_reset_22,1,0,/run/devmap/xcvrs/xcvr_ctrl_22/xcvr_present_22,1,0,22,I2C,/run/devmap/xcvrs/xcvr_io_22,22,/sys/class/leds/port22_led1:green:status,/sys/class/leds/port22_led1:amber:status
23,1 2 3 4 5 6 7 8,1,23,CPLD,/run/devmap/xcvrs/xcvr_ctrl_23/xcvr_reset_23,1,0,/run/devmap/xcvrs/xcvr_ctrl_23/xcvr_present_23,1,0,23,I2C,/run/devmap/xcvrs/xcvr_io_23,23,/sys/class/leds/port23_led1:green:status,/sys/class/leds/port23_led1:amber:status
24,1 2 3 4 5 6 7 8,1,24,CPLD,/run/devmap/xcvrs/xcvr_ctrl_24/xcvr_reset_24,1,0,/run/devmap/xcvrs/xcvr_ctrl_24/xcvr_present_24,1,0,24,I2C,/run/devmap/xcvrs/xcvr_io_24,24,/sys/class/leds/port24_led1:green:status,/sys/class/leds/port24_led1:amber:status
25,1 2 3 4 5 6 7 8,1,25,CPLD,/run/devmap/xcvrs/xcvr_ctrl_25/xcvr_reset_25,1,0,/run/devmap/xcvrs/xcvr_ctrl_25/xcvr_present_25,1,0,25,I2C,/run/devmap/xcvrs/xcvr_io_25,25,/sys/class/leds/port25_led1:green:status,/sys/class/leds/port25_led1:amber:status
26,1 2 3 4 5 6 7 8,1,26,CPLD,/run/devmap/xcvrs/xcvr_ctrl_26/xcvr_reset_26,1,0,/run/devmap/xcvrs/xcvr_ctrl_26/xcvr_present_26,1,0,26,I2C,/run/devmap/xcvrs/xcvr_io_26,26,/sys/class/leds/port26_led1:green:status,/sys/class/leds/port26_led1:amber:status
27,1 2 3 4 5 6 7 8,1,27,CPLD,/run/devmap/xcvrs/xcvr_ctrl_27/xcvr_reset_27,1,0,/run/devmap/xcvrs/xcvr_ctrl_27/xcvr_present_27,1,0,27,I2C,/run/devmap/xcvrs/xcvr_io_27,27,/sys/class/leds/port27_led1:green:status,/sys/class/leds/port27_led1:amber:status
28,1 2 3 4 5 6 7 8,1,28,CPLD,/run/devmap/xcvrs/xcvr_ctrl_28/xcvr_reset_28,1,0,/run/devmap/xcvrs/xcvr_ctrl_28/xcvr_present_28,1,0,28,I2C,/run/devmap/xcvrs/xcvr_io_28,28,/sys/class/leds/port28_led1:green:status,/sys/class/leds/port28_led1:amber:status
29,1 2 3 4 5 6 7 8,1,29,CPLD,/run/devmap/xcvrs/xcvr_ctrl_29/xcvr_reset_29,1,0,/run/devmap/xcvrs/xcvr_ctrl_29/xcvr_present_29,1,0,29,I2C,/run/devmap/xcvrs/xcvr_io_29,29,/sys/class/leds/port29_led1:green:status,/sys/class/leds/port29_led1:amber:status
30,1 2 3 4 5 6 7 8,1,30,CPLD,/run/devmap/xcvrs/xcvr_ctrl_30/xcvr_reset_30,1,0,/run/devmap/xcvrs/xcvr_ctrl_30/xcvr_present_30,1,0,30,I2C,/run/devmap/xcvrs/xcvr_io_30,30,/sys/class/leds/port30_led1:green:status,/sys/class/leds/port30_led1:amber:status
31,1 2 3 4 5 6 7 8,1,31,CPLD,/run/devmap/xcvrs/xcvr_ctrl_31/xcvr_reset_31,1,0,/run/devmap/xcvrs/xcvr_ctrl_31/xcvr_present_31,1,0,31,I2C,/run/devmap/xcvrs/xcvr_io_31,31,/sys/class/leds/port31_led1:green:status,/sys/class/leds/port31_led1:amber:status
32,1 2 3 4 5 6 7 8,1,32,CPLD,/run/devmap/xcvrs/xcvr_ctrl_32/xcvr_reset_32,1,0,/run/devmap/xcvrs/xcvr_ctrl_32/xcvr_present_32,1,0,32,I2C,/run/devmap/xcvrs/xcvr_io_32,32,/sys/class/leds/port32_led1:green:status,/sys/class/leds/port32_led1:amber:status
6 changes: 6 additions & 0 deletions fboss/lib/bsp/bspmapping/test/ParserTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ TEST(ParserTest, GetNameForTests) {
facebook::fboss::Parser::getNameFor(
facebook::fboss::PlatformType::PLATFORM_LADAKH800BCLS),
"ladakh800bcls");
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