From: Bartosz Szczepanek Date: Tue, 7 Feb 2017 11:20:18 +0000 (+0100) Subject: [thunderx] Fix hardware deinitialization X-Git-Tag: v1.20.1~311 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed864feb3aedcde41040d4a5293608ccd2d3361a;p=thirdparty%2Fipxe.git [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 Modified-by: Michael Brown Signed-off-by: Michael Brown --- diff --git a/src/drivers/net/thunderx.c b/src/drivers/net/thunderx.c index 306adc459..901ecba11 100644 --- a/src/drivers/net/thunderx.c +++ b/src/drivers/net/thunderx.c @@ -1146,10 +1146,17 @@ static int txnic_lmac_probe ( struct txnic_lmac *lmac ) { * @v lmac Logical MAC */ static void txnic_lmac_remove ( struct txnic_lmac *lmac ) { + uint64_t config; /* Sanity check */ assert ( lmac->vnic != NULL ); + /* Disable packet receive and transmit */ + config = readq ( lmac->regs + BGX_CMR_CONFIG ); + config &= ~( BGX_CMR_CONFIG_DATA_PKT_TX_EN | + BGX_CMR_CONFIG_DATA_PKT_RX_EN ); + writeq ( config, ( lmac->regs + BGX_CMR_CONFIG ) ); + /* Unregister network device */ unregister_netdev ( lmac->vnic->netdev );