Skip to content

Commit f1bc9fc

Browse files
fidomaxkuba-moo
authored andcommitted
net: axienet: Move reset before 64-bit DMA detection
64-bit DMA detection will fail if axienet was started before (by boot loader, boot ROM, etc). In this state axienet will not start properly. XAXIDMA_TX_CDESC_OFFSET + 4 register (MM2S_CURDESC_MSB) is used to detect 64-bit DMA capability here. But datasheet says: When DMACR.RS is 1 (axienet is in enabled state), CURDESC_PTR becomes Read Only (RO) and is used to fetch the first descriptor. So iowrite32()/ioread32() trick to this register to detect 64-bit DMA will not work. So move axienet reset before 64-bit DMA detection. Fixes: f735c40 ("net: axienet: Autodetect 64-bit DMA capability") Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru> Reviewed-by: Robert Hancock <robert.hancock@calian.com> Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com> Link: https://lore.kernel.org/r/20230622192245.116864-1-fido_max@inbox.ru Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent ce3aee7 commit f1bc9fc

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

drivers/net/ethernet/xilinx/xilinx_axienet_main.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2042,6 +2042,11 @@ static int axienet_probe(struct platform_device *pdev)
20422042
goto cleanup_clk;
20432043
}
20442044

2045+
/* Reset core now that clocks are enabled, prior to accessing MDIO */
2046+
ret = __axienet_device_reset(lp);
2047+
if (ret)
2048+
goto cleanup_clk;
2049+
20452050
/* Autodetect the need for 64-bit DMA pointers.
20462051
* When the IP is configured for a bus width bigger than 32 bits,
20472052
* writing the MSB registers is mandatory, even if they are all 0.
@@ -2096,11 +2101,6 @@ static int axienet_probe(struct platform_device *pdev)
20962101
lp->coalesce_count_tx = XAXIDMA_DFT_TX_THRESHOLD;
20972102
lp->coalesce_usec_tx = XAXIDMA_DFT_TX_USEC;
20982103

2099-
/* Reset core now that clocks are enabled, prior to accessing MDIO */
2100-
ret = __axienet_device_reset(lp);
2101-
if (ret)
2102-
goto cleanup_clk;
2103-
21042104
ret = axienet_mdio_setup(lp);
21052105
if (ret)
21062106
dev_warn(&pdev->dev,

0 commit comments

Comments
 (0)