Browse Source

[thunderx] Fix hardware deinitialization

It is required to reset BGX context state for the LMAC using
BGX_CMR_CONFIG register.

This solves problem with network connectivity in Linux booted from
iPXE.

Signed-off-by: Bartosz Szczepanek <bartosz.szczepanek@cavium.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Bartosz Szczepanek 7 years ago
parent
commit
ed864feb3a
1 changed files with 7 additions and 0 deletions
  1. 7
    0
      src/drivers/net/thunderx.c

+ 7
- 0
src/drivers/net/thunderx.c View File

@@ -1146,10 +1146,17 @@ static int txnic_lmac_probe ( struct txnic_lmac *lmac ) {
1146 1146
  * @v lmac		Logical MAC
1147 1147
  */
1148 1148
 static void txnic_lmac_remove ( struct txnic_lmac *lmac ) {
1149
+	uint64_t config;
1149 1150
 
1150 1151
 	/* Sanity check */
1151 1152
 	assert ( lmac->vnic != NULL );
1152 1153
 
1154
+	/* Disable packet receive and transmit */
1155
+	config = readq ( lmac->regs + BGX_CMR_CONFIG );
1156
+	config &= ~( BGX_CMR_CONFIG_DATA_PKT_TX_EN |
1157
+		     BGX_CMR_CONFIG_DATA_PKT_RX_EN );
1158
+	writeq ( config, ( lmac->regs + BGX_CMR_CONFIG ) );
1159
+
1153 1160
 	/* Unregister network device */
1154 1161
 	unregister_netdev ( lmac->vnic->netdev );
1155 1162
 

Loading…
Cancel
Save