summaryrefslogtreecommitdiffstats
path: root/src/drivers
diff options
context:
space:
mode:
authorBartosz Szczepanek2017-02-07 12:20:18 +0100
committerMichael Brown2017-02-07 12:54:57 +0100
commited864feb3aedcde41040d4a5293608ccd2d3361a (patch)
treeb33fb5fd2a381c6ab7c009d2f8a385e061f66609 /src/drivers
parent[http] Cleanly shut down potentially looped interfaces (diff)
downloadipxe-ed864feb3aedcde41040d4a5293608ccd2d3361a.tar.gz
ipxe-ed864feb3aedcde41040d4a5293608ccd2d3361a.tar.xz
ipxe-ed864feb3aedcde41040d4a5293608ccd2d3361a.zip
[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>
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/net/thunderx.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/drivers/net/thunderx.c b/src/drivers/net/thunderx.c
index 306adc45..901ecba1 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 );