Skip to content

Commit 222c458

Browse files
committed
24.07 2024.08.01.
New features: - None. Major bugfix. - Port link stability for X732Q-T.
1 parent eb1dc02 commit 222c458

File tree

12 files changed

+1025
-1016
lines changed

12 files changed

+1025
-1016
lines changed

CMakeLists.txt

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
cmake_minimum_required(VERSION 3.5)
99

10-
option(LASER_ON "Force default laser enabled when modules plugged-in" OFF)
1110
option(THRIFT-DRIVER "Build with thrift support" ON)
12-
option(ASTERFUSION-DIAGS "Build Asterfusion Diags" OFF)
11+
option(LASER_ON "Build for forcely enabling laser when modules plugged-in" OFF)
12+
option(ASTERFUSION-DIAGS "Build Asterfusion Diags <TBD>" OFF)
1313
option(FORCE32 "Force a 32bit compile on 64bit" OFF)
1414
option(COVERAGE "Build with gcov" OFF)
1515

@@ -211,7 +211,7 @@ add_library(asterfusionbf_driver_o OBJECT
211211
)
212212
add_library(asterfusionbf_driver SHARED $<TARGET_OBJECTS:asterfusionbf_driver_o>)
213213
set_target_properties(asterfusionbf_driver PROPERTIES VERSION 0.0.0 SOVERSION 0)
214-
target_link_libraries(asterfusionbf_driver ${bfsys_lib} curl usb-1.0 ${bfutils_lib} ${private_lib})
214+
target_link_libraries(asterfusionbf_driver ${bfsys_lib} curl usb-1.0 ${bfutils_lib} ${private_lib} ${i2c_lib})
215215
add_library(pltfm_driver_o OBJECT
216216
drivers/src/bf_bd_cfg/bf_bd_cfg_intf.c
217217
drivers/src/bf_bd_cfg/bf_bd_cfg_intf_ucli.c
@@ -300,13 +300,13 @@ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/syseeprom_util DESTINATION bin)
300300

301301
include_directories(platforms/asterfusion-bf/diags)
302302
if(ASTERFUSION-DIAGS)
303-
add_library(accton_mav_diags SHARED
304-
platforms/asterfusion-bf/diags/mavericks/diag_server.c
305-
platforms/asterfusion-bf/diags/mavericks/diag_handler.c
306-
platforms/asterfusion-bf/diags/mavericks/diag_ucli.c
303+
add_library(asterfusion_diags SHARED
304+
platforms/asterfusion-bf/diags/xt/diag_server.c
305+
platforms/asterfusion-bf/diags/xt/diag_handler.c
306+
platforms/asterfusion-bf/diags/xt/diag_ucli.c
307307
)
308-
install(FILES platforms/asterfusion-bf/diags/mavericks/swutil DESTINATION bin)
309-
configure_file(platforms/asterfusion-bf/diags/mavericks/targets/tofino/mav_diag.conf.in tofino/mav_diag.conf)
308+
install(FILES platforms/asterfusion-bf/diags/xt/swutil DESTINATION bin)
309+
configure_file(platforms/asterfusion-bf/diags/xt/targets/tofino/mav_diag.conf.in tofino/mav_diag.conf)
310310
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tofino DESTINATION share/p4/targets)
311311
endif()
312312
install(PROGRAMS platforms/asterfusion-bf/utils/tofino_pci_bringup.sh DESTINATION bin)
@@ -320,10 +320,11 @@ install(PROGRAMS platforms/asterfusion-bf/utils/xt-clean.sh DESTINATION bin)
320320
install(PROGRAMS platforms/asterfusion-bf/utils/xt-diags.sh DESTINATION bin)
321321
install(PROGRAMS platforms/asterfusion-bf/utils/xt-setup.sh DESTINATION bin)
322322

323-
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/platforms/asterfusion-bf/src/board-maps/
324-
DESTINATION share/platforms/board-maps/accton
323+
# It is also done to install pltfm_bd_map_*.json to $SDE_INSTALL/share/platforms/board-maps/asterfusion by autogen.sh.
324+
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/platforms/asterfusion-bf/src/platform_mgr/
325+
DESTINATION share/platforms/board-maps/asterfusion
325326
FILES_MATCHING
326-
PATTERN "board_lane_map*.json"
327+
PATTERN "pltfm_bd_map_*.json"
327328
PATTERN "*.py" EXCLUDE
328329
PATTERN "*.csv" EXCLUDE
329330
)

README.md

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Table of Contents
77
- [Build BSP](#build-bsp)
88
- [Clone repo](#clone-repo)
99
- [Build BSP via CMake](#build-bsp-via-cmake)
10-
- [Build BSP via an Outdated Way](#build-bsp-via-an-outdated-way)
1110
- [Launch](#launch)
1211
- [Generate Launching Variables](#generate-launching-variables)
1312
- [Launch X-T Platforms](#launch-x-t-platforms)
@@ -87,10 +86,9 @@ root@localhost:~# cd bf-bsp-lts
8786
root@localhost:~/bf-bsp-lts#
8887
```
8988

90-
There're `2 ways` to build BSP.
9189

9290
#### <a name="build-bsp-via-cmake"></a>Build BSP via CMake
93-
The `1st` (also recommended) one is by cmake:
91+
The proccedure of building bsp by cmake is texted below:
9492
```
9593
root@localhost:~/bf-bsp-lts# ./autogen.sh
9694
root@localhost:~/bf-bsp-lts# mkdir build && cd build/
@@ -113,34 +111,13 @@ The defaut value of supported variables are listed below if none of them passed
113111

114112
`LASER_ON=off`
115113

116-
#### <a name="build-bsp-via-an-outdated-way"></a>Build BSP via an Outdated Way
117-
118-
Skip to `Generate Configuration Variables` if `1st` building method is choosed. Otherwise, the `2nd` one, which will be disabled at `the end of July 2024`, is:
114+
Finally, `libasterfusionbf*`, `libplatform_thrift*`, `libpltfm_driver*`, `libpltfm_mgr*` will be installed to `$SDE_INSTALL/lib`, and all headers exposed by bsp will be installed to `$SDE_INSTALL/include`.
119115

120-
Optionally changes to fit your SDE manually:
121-
```
122-
root@localhost:~/bf-bsp-lts# vi drivers/include/bf_pltfm_types/bf_pltfm_types.h +34
123-
Modify SDE_VERSION to value '990','9110','9120'or '9130' ...
124-
```
125116
TIPS: In order to be compatible with different SDE versions and different base systems, we have introduced two macro variables in the BSP, one is `SDE_VERSION` and the other is `OS_VERSION`.
126-
They are defined in `$BSP/drivers/include/bf_pltfm_types/bf_pltfm_type.h`. Amend `SDE_VERSION` to the one you're using.
127-
128-
129-
Build and Install
130-
```
131-
root@localhost:~/bf-bsp-lts# ./autogen.sh
132-
root@localhost:~/bf-bsp-lts# ./configure --prefix=$SDE_INSTALL --enable-thrift
133-
root@localhost:~/bf-bsp-lts# make -j7 install
134-
```
117+
They are defined in `$BSP/drivers/include/bf_pltfm_types/bf_pltfm_type.h`.
135118

136-
To be highlighted, during the evolution of SDE, the installation paths of the third party dependencies have been changed, so did the generated dependencies. Therefore, a minor changes in bsp sources must be done to accommodate those changes. For SDE version equal with or higher than `9.9.x`, the changes as following:
137-
```
138-
root@localhost:~# mkdir /usr/local/include
139-
root@localhost:~# ln -s $SDE_INSTALL/include/thrift/ /usr/local/include/thrift
140-
```
141119

142120

143-
Finally, `libasterfusionbf*`, `libplatform_thrift*`, `libpltfm_driver*`, `libpltfm_mgr*` will be installed to `$SDE_INSTALL/lib`, and all headers exposed by bsp will be installed to `$SDE_INSTALL/include`.
144121

145122
### <a name="launch"></a>Launch
146123

drivers/include/bf_qsfp/sff.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,8 @@ typedef enum {
414414
HOST_TYPE_RESERVED_0x1E_0x24 = 0x1E,
415415
HOST_TYPE_RESERVED_0x24_0x1E = 0x24,
416416
/* 0x25 - 0x40 for other kind of ethernet */
417+
HOST_TYPE_IB_EDR = 0x30,
418+
HOST_TYPE_IB_HDR = 0x31,
417419
HOST_TYPE_CAUI_4_C2M_NO_FEC = 0x41,
418420
HOST_TYPE_CAUI_4_C2M_RS_FEC = 0x42,
419421
HOST_TYPE_50GBASE_CR2_RS_FEC = 0x43,
@@ -460,6 +462,7 @@ typedef enum {
460462
MEDIA_TYPE_MMF_200GBASE_VR2 = 0x1E,
461463
MEDIA_TYPE_MMF_400GBASE_VR4 = 0x1F,
462464

465+
QSFPDD_200GBASE_SR4 = MEDIA_TYPE_MMF_200GBASE_SR4,
463466
QSFPDD_400GBASE_SR8 = MEDIA_TYPE_MMF_400GBASE_SR8,
464467
QSFPDD_400GBASE_SR4 = MEDIA_TYPE_MMF_400GBASE_SR4,
465468
} Module_MMF_media_interface_code;

drivers/src/bf_port_mgmt/bf_pm_intf_tf2.c

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -710,16 +710,18 @@ static void bf_pm_interface_fsm_run(bf_pm_intf_cfg_t *icfg,
710710
int module_chan, rc;
711711
bool rx_los_flag, rx_lol_flag, rx_lol_sup, rx_los_sup;
712712
int delay_ms = 0;
713+
bf_pm_port_dir_e dir_mode = PM_PORT_DIR_DEFAULT;
713714

714715
if ((!icfg) || (!intf) || (!qsfp_info)) return;
715716

716717
port_hdl.conn_id = icfg->conn_id;
717718
port_hdl.chnl_id = icfg->channel;
718719
next_st = st = pm_intf_fsm_st[port_hdl.conn_id][port_hdl.chnl_id];
719720

721+
bf_pm_port_direction_get (icfg->dev_id, &port_hdl, &dir_mode);
720722
// handle qsfp-removal in any state
721723
if ((!bf_bd_is_this_port_internal(icfg->conn_id, icfg->channel)) &&
722-
(!qsfp_info->is_present) && !bf_pltfm_pm_is_ha_mode()) {
724+
(!qsfp_info->is_present) && !bf_pltfm_pm_is_ha_mode() && (dir_mode != PM_PORT_DIR_TX_ONLY)) {
723725
bf_pm_handle_intf_disable(icfg, intf, qsfp_info);
724726
// since fsm-runs only on admin-enabled, move state to init
725727
if (icfg->admin_up) {
@@ -738,6 +740,9 @@ static void bf_pm_interface_fsm_run(bf_pm_intf_cfg_t *icfg,
738740
next_st = PM_INTF_FSM_MEDIA_DETECTED;
739741
} else if (bf_pltfm_pm_is_ha_mode()) {
740742
next_st = PM_INTF_FSM_HA_WAIT_LINK_ST;
743+
} else if((!qsfp_info->is_present) && (dir_mode == PM_PORT_DIR_TX_ONLY)){
744+
bf_pal_pm_front_port_ready_for_bringup(icfg->dev_id, &port_hdl, true);
745+
next_st = PM_INTF_FSM_WAIT_LINK_ST;
741746
}
742747
break;
743748
case PM_INTF_FSM_MEDIA_DETECTED:
@@ -785,8 +790,21 @@ static void bf_pm_interface_fsm_run(bf_pm_intf_cfg_t *icfg,
785790
bf_pm_pltfm_front_port_eligible_for_autoneg(
786791
icfg->dev_id, &port_hdl, false);
787792
bf_pal_pm_front_port_ready_for_bringup(icfg->dev_id, &port_hdl, true);
793+
bf_pm_port_direction_get (icfg->dev_id, &port_hdl, &dir_mode);
788794
if (!bf_pltfm_pm_is_ha_mode()) {
789-
next_st = PM_INTF_FSM_WAIT_SERDES_TX_INIT;
795+
if (dir_mode == PM_PORT_DIR_TX_ONLY) {
796+
module_chan =
797+
bf_bd_first_conn_ch_get(port_hdl.conn_id) + port_hdl.chnl_id;
798+
// Tell the qsfp_ch_fsm that its ok to enable the lanes in this link.
799+
// Loop through all lanes since we only run the pm_intf_fsm
800+
// for head channels
801+
for (ch = 0; ch < icfg->intf_nlanes; ch++) {
802+
qsfp_fsm_ch_enable(icfg->dev_id, port_hdl.conn_id, module_chan + ch);
803+
}
804+
next_st = PM_INTF_FSM_WAIT_LINK_ST;
805+
} else {
806+
next_st = PM_INTF_FSM_WAIT_SERDES_TX_INIT;
807+
}
790808
} else {
791809
// Wait for link-state notification from SDK for next action
792810
next_st = PM_INTF_FSM_HA_WAIT_LINK_ST;
@@ -830,9 +848,14 @@ static void bf_pm_interface_fsm_run(bf_pm_intf_cfg_t *icfg,
830848
case PM_INTF_FSM_WAIT_SERDES_TX_INIT:
831849
// Wait for the SERDES TX init to complete
832850
// This state is only used for optical cables
833-
bf_pm_port_serdes_tx_ready_get(
834-
icfg->dev_id, &port_hdl, &asic_serdes_tx_ready);
851+
bf_pm_port_direction_get (icfg->dev_id, &port_hdl, &dir_mode);
835852

853+
if (dir_mode == PM_PORT_DIR_RX_ONLY) {
854+
asic_serdes_tx_ready = true;
855+
} else {
856+
bf_pm_port_serdes_tx_ready_get(
857+
icfg->dev_id, &port_hdl, &asic_serdes_tx_ready);
858+
}
836859
if (!asic_serdes_tx_ready) { // keep waiting
837860
break;
838861
}
@@ -920,7 +943,7 @@ static void bf_pm_interface_fsm_run(bf_pm_intf_cfg_t *icfg,
920943
next_st = PM_INTF_FSM_LINK_UP;
921944
break;
922945
case PM_INTF_FSM_WAIT_MEDIA_RX_LOS:
923-
if (!bf_pltfm_pm_is_ha_mode()) {
946+
if ((!bf_pltfm_pm_is_ha_mode()) && qsfp_info->is_present) {
924947
rx_los_sup = false;
925948
rx_los_flag = true;
926949
module_chan =
@@ -947,7 +970,7 @@ static void bf_pm_interface_fsm_run(bf_pm_intf_cfg_t *icfg,
947970
}
948971
break;
949972
case PM_INTF_FSM_WAIT_MEDIA_RX_LOL:
950-
if (!bf_pltfm_pm_is_ha_mode()) {
973+
if ((!bf_pltfm_pm_is_ha_mode()) && qsfp_info->is_present) {
951974
rx_lol_sup = false;
952975
rx_lol_flag = true;
953976
module_chan =
@@ -970,7 +993,7 @@ static void bf_pm_interface_fsm_run(bf_pm_intf_cfg_t *icfg,
970993
}
971994
break;
972995
case PM_INTF_FSM_SET_RX_READY:
973-
if (!bf_pltfm_pm_is_ha_mode()) {
996+
if ((!bf_pltfm_pm_is_ha_mode()) && qsfp_info->is_present) {
974997
/* If Rx not ready, bf_pm_fsm_run will keep in BF_PM_FSM_ST_WAIT_SIGNAL_OK state. */
975998
bf_pm_port_serdes_rx_ready_for_bringup_set(
976999
icfg->dev_id, &port_hdl, true);

drivers/src/bf_qsfp/bf_qsfp_comm.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,8 @@ cmis_app_host_if_speed_map[] = {
663663
{HOST_TYPE_100GBASE_CR2, BF_SPEED_100G, "100GBASE-CR2 2 x 26.5625Gbd PAM4"},
664664
{HOST_TYPE_200GBASE_CR4, BF_SPEED_200G, "200GBASE-CR4 4 x 26.5625Gbd PAM4"},
665665
{HOST_TYPE_400GBASE_CR8, BF_SPEED_400G, "400GBASE-CR8 8 x 26.5625Gbd PAM4"},
666+
{HOST_TYPE_IB_EDR, BF_SPEED_400G, "IB EDR 1,2,4,8,12 x 25.78125Gbd NRZ"}, /* by SunZheng, 2024/07/02. */
667+
{HOST_TYPE_IB_HDR, BF_SPEED_100G, "IB HDR 1,2,4,8,12 x 26.5625Gbd PAM4"}, /* by SunZheng, 2024/07/02. */
666668
{HOST_TYPE_CAUI_4_C2M_NO_FEC, BF_SPEED_100G, "CAUI-4 NO FEC 4 x 25.78125Gbd NRZ"}, /* by Hang Tsi, 2024/01/23. */
667669
{HOST_TYPE_CAUI_4_C2M_RS_FEC, BF_SPEED_100G, "CAUI-4 RS FEC 4 x 25.78125Gbd NRZ"}, /* by Hang Tsi, 2024/02/26. */
668670
{HOST_TYPE_100GBASE_CR1, BF_SPEED_100G, "100GBASE-CR1 1 x 53.125GBd PAM4"},
@@ -4809,7 +4811,7 @@ static int cmis_calc_application_count (int port,
48094811
bf_qsfp_field_read_onebank (port,
48104812
APSEL9_HOST_ID,
48114813
0,
4812-
((*app_count - 9) * BYTES_PER_APP),
4814+
((*app_count - 8) * BYTES_PER_APP),
48134815
1,
48144816
&host_id);
48154817
(*app_count)++;
@@ -6790,6 +6792,8 @@ const char *bf_cmis_get_media_type_string (
67906792
return "400G-SR8";
67916793
case QSFPDD_400GBASE_SR4:
67926794
return "400G-SR4";
6795+
case QSFPDD_200GBASE_SR4:
6796+
return "200G-SR4";
67936797
}
67946798
break;
67956799
case MEDIA_TYPE_SMF:
@@ -7754,7 +7758,8 @@ void bf_pltfm_qsfp_load_conf ()
77547758

77557759
length = sprintf (entry, "%-16s %-16s %-8x\n", "Asterfusion", "14060165-1", 0x00030000);
77567760
fwrite (entry, 1, length, fp);
7757-
7761+
length = sprintf (entry, "%-16s %-16s %-8x\n", "XSL", "OM3660FX102", 0x00010000);
7762+
fwrite (entry, 1, length, fp);
77587763
fflush(fp);
77597764
}
77607765

platforms/asterfusion-bf/diags/xt/TBD

Whitespace-only changes.

platforms/asterfusion-bf/diags/xt/diag_handler.c

Whitespace-only changes.

platforms/asterfusion-bf/diags/xt/diag_server.c

Whitespace-only changes.

platforms/asterfusion-bf/diags/xt/diag_ucli.c

Whitespace-only changes.

platforms/asterfusion-bf/diags/xt/swutil.c

Whitespace-only changes.

0 commit comments

Comments
 (0)