1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018 Advanced Micro Devices, Inc. All rights reserved.
3 * Copyright(c) 2018 Synopsys, Inc. All rights reserved.
6 #include "axgbe_ethdev.h"
7 #include "axgbe_common.h"
10 static int __axgbe_exit(struct axgbe_port *pdata)
12 unsigned int count = 2000;
14 /* Issue a software reset */
15 AXGMAC_IOWRITE_BITS(pdata, DMA_MR, SWR, 1);
18 /* Poll Until Poll Condition */
19 while (--count && AXGMAC_IOREAD_BITS(pdata, DMA_MR, SWR))
28 static int axgbe_exit(struct axgbe_port *pdata)
32 /* To guard against possible incorrectly generated interrupts,
33 * issue the software reset twice.
35 ret = __axgbe_exit(pdata);
39 return __axgbe_exit(pdata);
42 void axgbe_init_function_ptrs_dev(struct axgbe_hw_if *hw_if)
44 hw_if->exit = axgbe_exit;