@@ -1032,8 +1032,8 @@ static void read_vc_remote_fabric(struct hfi1_devdata *dd, u8 *vau, u8 *z,
1032
1032
u8 * vcu , u16 * vl15buf , u8 * crc_sizes );
1033
1033
static void read_vc_remote_link_width (struct hfi1_devdata * dd ,
1034
1034
u8 * remote_tx_rate , u16 * link_widths );
1035
- static void read_vc_local_link_width (struct hfi1_devdata * dd , u8 * misc_bits ,
1036
- u8 * flag_bits , u16 * link_widths );
1035
+ static void read_vc_local_link_mode (struct hfi1_devdata * dd , u8 * misc_bits ,
1036
+ u8 * flag_bits , u16 * link_widths );
1037
1037
static void read_remote_device_id (struct hfi1_devdata * dd , u16 * device_id ,
1038
1038
u8 * device_rev );
1039
1039
static void read_local_lni (struct hfi1_devdata * dd , u8 * enable_lane_rx );
@@ -6350,6 +6350,18 @@ static void handle_8051_request(struct hfi1_pportdata *ppd)
6350
6350
dd_dev_info (dd , "8051 request: request 0x%x not supported\n" ,
6351
6351
type );
6352
6352
hreq_response (dd , HREQ_NOT_SUPPORTED , 0 );
6353
+ break ;
6354
+ case HREQ_LCB_RESET :
6355
+ /* Put the LCB, RX FPE and TX FPE into reset */
6356
+ write_csr (dd , DCC_CFG_RESET , LCB_RX_FPE_TX_FPE_INTO_RESET );
6357
+ /* Make sure the write completed */
6358
+ (void )read_csr (dd , DCC_CFG_RESET );
6359
+ /* Hold the reset long enough to take effect */
6360
+ udelay (1 );
6361
+ /* Take the LCB, RX FPE and TX FPE out of reset */
6362
+ write_csr (dd , DCC_CFG_RESET , LCB_RX_FPE_TX_FPE_OUT_OF_RESET );
6363
+ hreq_response (dd , HREQ_SUCCESS , 0 );
6364
+
6353
6365
break ;
6354
6366
case HREQ_CONFIG_DONE :
6355
6367
hreq_response (dd , HREQ_SUCCESS , 0 );
@@ -6461,8 +6473,7 @@ static void lcb_shutdown(struct hfi1_devdata *dd, int abort)
6461
6473
dd -> lcb_err_en = read_csr (dd , DC_LCB_ERR_EN );
6462
6474
reg = read_csr (dd , DCC_CFG_RESET );
6463
6475
write_csr (dd , DCC_CFG_RESET , reg |
6464
- (1ull << DCC_CFG_RESET_RESET_LCB_SHIFT ) |
6465
- (1ull << DCC_CFG_RESET_RESET_RX_FPE_SHIFT ));
6476
+ DCC_CFG_RESET_RESET_LCB | DCC_CFG_RESET_RESET_RX_FPE );
6466
6477
(void )read_csr (dd , DCC_CFG_RESET ); /* make sure the write completed */
6467
6478
if (!abort ) {
6468
6479
udelay (1 ); /* must hold for the longer of 16cclks or 20ns */
@@ -6527,7 +6538,7 @@ static void _dc_start(struct hfi1_devdata *dd)
6527
6538
__func__ );
6528
6539
6529
6540
/* Take away reset for LCB and RX FPE (set in lcb_shutdown). */
6530
- write_csr (dd , DCC_CFG_RESET , 0x10 );
6541
+ write_csr (dd , DCC_CFG_RESET , LCB_RX_FPE_TX_FPE_OUT_OF_RESET );
6531
6542
/* lcb_shutdown() with abort=1 does not restore these */
6532
6543
write_csr (dd , DC_LCB_ERR_EN , dd -> lcb_err_en );
6533
6544
dd -> dc_shutdown = 0 ;
@@ -7348,7 +7359,7 @@ static void get_linkup_widths(struct hfi1_devdata *dd, u16 *tx_width,
7348
7359
u8 misc_bits , local_flags ;
7349
7360
u16 active_tx , active_rx ;
7350
7361
7351
- read_vc_local_link_width (dd , & misc_bits , & local_flags , & widths );
7362
+ read_vc_local_link_mode (dd , & misc_bits , & local_flags , & widths );
7352
7363
tx = widths >> 12 ;
7353
7364
rx = (widths >> 8 ) & 0xf ;
7354
7365
@@ -8820,29 +8831,29 @@ static int write_vc_local_fabric(struct hfi1_devdata *dd, u8 vau, u8 z, u8 vcu,
8820
8831
GENERAL_CONFIG , frame );
8821
8832
}
8822
8833
8823
- static void read_vc_local_link_width (struct hfi1_devdata * dd , u8 * misc_bits ,
8824
- u8 * flag_bits , u16 * link_widths )
8834
+ static void read_vc_local_link_mode (struct hfi1_devdata * dd , u8 * misc_bits ,
8835
+ u8 * flag_bits , u16 * link_widths )
8825
8836
{
8826
8837
u32 frame ;
8827
8838
8828
- read_8051_config (dd , VERIFY_CAP_LOCAL_LINK_WIDTH , GENERAL_CONFIG ,
8839
+ read_8051_config (dd , VERIFY_CAP_LOCAL_LINK_MODE , GENERAL_CONFIG ,
8829
8840
& frame );
8830
8841
* misc_bits = (frame >> MISC_CONFIG_BITS_SHIFT ) & MISC_CONFIG_BITS_MASK ;
8831
8842
* flag_bits = (frame >> LOCAL_FLAG_BITS_SHIFT ) & LOCAL_FLAG_BITS_MASK ;
8832
8843
* link_widths = (frame >> LINK_WIDTH_SHIFT ) & LINK_WIDTH_MASK ;
8833
8844
}
8834
8845
8835
- static int write_vc_local_link_width (struct hfi1_devdata * dd ,
8836
- u8 misc_bits ,
8837
- u8 flag_bits ,
8838
- u16 link_widths )
8846
+ static int write_vc_local_link_mode (struct hfi1_devdata * dd ,
8847
+ u8 misc_bits ,
8848
+ u8 flag_bits ,
8849
+ u16 link_widths )
8839
8850
{
8840
8851
u32 frame ;
8841
8852
8842
8853
frame = (u32 )misc_bits << MISC_CONFIG_BITS_SHIFT
8843
8854
| (u32 )flag_bits << LOCAL_FLAG_BITS_SHIFT
8844
8855
| (u32 )link_widths << LINK_WIDTH_SHIFT ;
8845
- return load_8051_config (dd , VERIFY_CAP_LOCAL_LINK_WIDTH , GENERAL_CONFIG ,
8856
+ return load_8051_config (dd , VERIFY_CAP_LOCAL_LINK_MODE , GENERAL_CONFIG ,
8846
8857
frame );
8847
8858
}
8848
8859
@@ -9312,8 +9323,16 @@ static int set_local_link_attributes(struct hfi1_pportdata *ppd)
9312
9323
if (loopback == LOOPBACK_SERDES )
9313
9324
misc_bits |= 1 << LOOPBACK_SERDES_CONFIG_BIT_MASK_SHIFT ;
9314
9325
9315
- ret = write_vc_local_link_width (dd , misc_bits , 0 ,
9316
- opa_to_vc_link_widths (
9326
+ /*
9327
+ * An external device configuration request is used to reset the LCB
9328
+ * to retry to obtain operational lanes when the first attempt is
9329
+ * unsuccesful.
9330
+ */
9331
+ if (dd -> dc8051_ver >= dc8051_ver (1 , 25 , 0 ))
9332
+ misc_bits |= 1 << EXT_CFG_LCB_RESET_SUPPORTED_SHIFT ;
9333
+
9334
+ ret = write_vc_local_link_mode (dd , misc_bits , 0 ,
9335
+ opa_to_vc_link_widths (
9317
9336
ppd -> link_width_enabled ));
9318
9337
if (ret != HCMD_SUCCESS )
9319
9338
goto set_local_link_attributes_fail ;
0 commit comments