hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/vfio/platform/reset/vfio_platform_amdxgbe.c
....@@ -1,21 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * VFIO platform driver specialized for AMD xgbe reset
34 * reset code is inherited from AMD xgbe native driver
45 *
56 * Copyright (c) 2015 Linaro Ltd.
67 * www.linaro.org
7
- *
8
- * This program is free software; you can redistribute it and/or modify it
9
- * under the terms and conditions of the GNU General Public License,
10
- * version 2, as published by the Free Software Foundation.
11
- *
12
- * This program is distributed in the hope it will be useful, but WITHOUT
13
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15
- * more details.
16
- *
17
- * You should have received a copy of the GNU General Public License along with
18
- * this program. If not, see <http://www.gnu.org/licenses/>.
198 */
209
2110 #include <linux/module.h>
....@@ -25,7 +14,7 @@
2514 #include <uapi/linux/mdio.h>
2615 #include <linux/delay.h>
2716
28
-#include "vfio_platform_private.h"
17
+#include "../vfio_platform_private.h"
2918
3019 #define DMA_MR 0x3000
3120 #define MAC_VR 0x0110
....@@ -35,7 +24,7 @@
3524 #define MDIO_AN_INT 0x8002
3625 #define MDIO_AN_INTMASK 0x8001
3726
38
-static unsigned int xmdio_read(void *ioaddr, unsigned int mmd,
27
+static unsigned int xmdio_read(void __iomem *ioaddr, unsigned int mmd,
3928 unsigned int reg)
4029 {
4130 unsigned int mmd_address, value;
....@@ -46,7 +35,7 @@
4635 return value;
4736 }
4837
49
-static void xmdio_write(void *ioaddr, unsigned int mmd,
38
+static void xmdio_write(void __iomem *ioaddr, unsigned int mmd,
5039 unsigned int reg, unsigned int value)
5140 {
5241 unsigned int mmd_address;
....@@ -65,13 +54,13 @@
6554
6655 if (!xgmac_regs->ioaddr) {
6756 xgmac_regs->ioaddr =
68
- ioremap_nocache(xgmac_regs->addr, xgmac_regs->size);
57
+ ioremap(xgmac_regs->addr, xgmac_regs->size);
6958 if (!xgmac_regs->ioaddr)
7059 return -ENOMEM;
7160 }
7261 if (!xpcs_regs->ioaddr) {
7362 xpcs_regs->ioaddr =
74
- ioremap_nocache(xpcs_regs->addr, xpcs_regs->size);
63
+ ioremap(xpcs_regs->addr, xpcs_regs->size);
7564 if (!xpcs_regs->ioaddr)
7665 return -ENOMEM;
7766 }
....@@ -89,7 +78,8 @@
8978 } while ((pcs_value & MDIO_CTRL1_RESET) && --count);
9079
9180 if (pcs_value & MDIO_CTRL1_RESET)
92
- pr_warn("%s XGBE PHY reset timeout\n", __func__);
81
+ dev_warn(vdev->device, "%s: XGBE PHY reset timeout\n",
82
+ __func__);
9383
9484 /* disable auto-negotiation */
9585 value = xmdio_read(xpcs_regs->ioaddr, MDIO_MMD_AN, MDIO_CTRL1);
....@@ -114,7 +104,7 @@
114104 usleep_range(500, 600);
115105
116106 if (!count)
117
- pr_warn("%s MAC SW reset failed\n", __func__);
107
+ dev_warn(vdev->device, "%s: MAC SW reset failed\n", __func__);
118108
119109 return 0;
120110 }