]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[thunderx] Fix hardware deinitialization
authorBartosz Szczepanek <bartosz.szczepanek@cavium.com>
Tue, 7 Feb 2017 11:20:18 +0000 (12:20 +0100)
committerMichael Brown <mcb30@ipxe.org>
Tue, 7 Feb 2017 11:54:57 +0000 (11:54 +0000)
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>
src/drivers/net/thunderx.c

index 306adc459db6d60f734c0c4657d8e6ebffb49ab0..901ecba11247f2c6d2e688dd46f71bfb00510893 100644 (file)
@@ -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 );