From b35a986d252a461da785c6985f5c7c34f3cd0714 Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Fri, 10 Nov 2017 14:02:12 +0000 Subject: [PATCH] Make physical address of init segment available in the priv of mlx5 core. This change is needed by mlx5ib(4). Sponsored by: Mellanox Technologies MFC after: 1 week --- sys/dev/mlx5/driver.h | 1 + sys/dev/mlx5/mlx5_core/mlx5_main.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/mlx5/driver.h b/sys/dev/mlx5/driver.h index 05cc0836a582..aca94a056e4c 100644 --- a/sys/dev/mlx5/driver.h +++ b/sys/dev/mlx5/driver.h @@ -590,6 +590,7 @@ struct mlx5_core_dev { struct mlx5_port_caps port_caps[MLX5_MAX_PORTS]; u32 hca_caps_cur[MLX5_CAP_NUM][MLX5_UN_SZ_DW(hca_cap_union)]; u32 hca_caps_max[MLX5_CAP_NUM][MLX5_UN_SZ_DW(hca_cap_union)]; + phys_addr_t iseg_base; struct mlx5_init_seg __iomem *iseg; enum mlx5_device_state state; void (*event) (struct mlx5_core_dev *dev, diff --git a/sys/dev/mlx5/mlx5_core/mlx5_main.c b/sys/dev/mlx5/mlx5_core/mlx5_main.c index 07a04b232d07..357b64dd1f1a 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_main.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_main.c @@ -716,8 +716,8 @@ static int mlx5_dev_init(struct mlx5_core_dev *dev, struct pci_dev *pdev) goto err_clr_master; } - dev->iseg = ioremap(pci_resource_start(dev->pdev, 0), - sizeof(*dev->iseg)); + dev->iseg_base = pci_resource_start(dev->pdev, 0); + dev->iseg = ioremap(dev->iseg_base, sizeof(*dev->iseg)); if (!dev->iseg) { err = -ENOMEM; device_printf((&pdev->dev)->bsddev, "ERR: ""Failed mapping initialization segment, aborting\n");