forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-04 1543e317f1da31b75942316931e8f491a8920811
kernel/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
....@@ -1,19 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*******************************************************************************
23 This contains the functions to handle the normal descriptors.
34
45 Copyright (C) 2007-2009 STMicroelectronics Ltd
56
6
- This program is free software; you can redistribute it and/or modify it
7
- under the terms and conditions of the GNU General Public License,
8
- version 2, as published by the Free Software Foundation.
9
-
10
- This program is distributed in the hope it will be useful, but WITHOUT
11
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13
- more details.
14
-
15
- The full GNU General Public License is included in this distribution in
16
- the file called "COPYING".
177
188 Author: Giuseppe Cavallaro <peppe.cavallaro@st.com>
199 *******************************************************************************/
....@@ -279,19 +269,22 @@
279269 return 1;
280270 }
281271
282
-static void ndesc_display_ring(void *head, unsigned int size, bool rx)
272
+static void ndesc_display_ring(void *head, unsigned int size, bool rx,
273
+ dma_addr_t dma_rx_phy, unsigned int desc_size)
283274 {
284275 struct dma_desc *p = (struct dma_desc *)head;
276
+ dma_addr_t dma_addr;
285277 int i;
286278
287279 pr_info("%s descriptor ring:\n", rx ? "RX" : "TX");
288280
289281 for (i = 0; i < size; i++) {
290282 u64 x;
283
+ dma_addr = dma_rx_phy + i * sizeof(*p);
291284
292285 x = *(u64 *)p;
293
- pr_info("%03d [0x%x]: 0x%x 0x%x 0x%x 0x%x",
294
- i, (unsigned int)virt_to_phys(p),
286
+ pr_info("%03d [%pad]: 0x%x 0x%x 0x%x 0x%x",
287
+ i, &dma_addr,
295288 (unsigned int)x, (unsigned int)(x >> 32),
296289 p->des2, p->des3);
297290 p++;