drivers/lib: Move basic mlx5_core files to dedicated place

Perform basic and initial move of mlx5_core files, which are
clearly belong to low level code and shared across various
auxiliary drivers.

Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
diff --git a/drivers/lib/nvidia/mlx5/Makefile b/drivers/lib/nvidia/mlx5/Makefile
index a4e40e5..c43f71a 100644
--- a/drivers/lib/nvidia/mlx5/Makefile
+++ b/drivers/lib/nvidia/mlx5/Makefile
@@ -1 +1,8 @@
 # SPDX-License-Identifier: GPL-2.0-only
+
+mlx5_core-$(CONFIG_MLX5_CORE) := cmd.o debugfs.o
+
+ifdef CONFIG_MLXFW
+ccflags-y += -I$(srctree)/drivers/net/ethernet/mellanox/mlxfw
+mlx5_core-$(CONFIG_MLX5_CORE) += fw.o
+endif #CONFIG_MLXFW
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c b/drivers/lib/nvidia/mlx5/cmd.c
similarity index 100%
rename from drivers/net/ethernet/mellanox/mlx5/core/cmd.c
rename to drivers/lib/nvidia/mlx5/cmd.c
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c b/drivers/lib/nvidia/mlx5/debugfs.c
similarity index 100%
rename from drivers/net/ethernet/mellanox/mlx5/core/debugfs.c
rename to drivers/lib/nvidia/mlx5/debugfs.c
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fw.c b/drivers/lib/nvidia/mlx5/fw.c
similarity index 100%
rename from drivers/net/ethernet/mellanox/mlx5/core/fw.c
rename to drivers/lib/nvidia/mlx5/fw.c
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/Makefile b/drivers/net/ethernet/mellanox/mlx5/core/Makefile
index 6f678a2..9a2896c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/Makefile
+++ b/drivers/net/ethernet/mellanox/mlx5/core/Makefile
@@ -11,7 +11,7 @@
 #
 # mlx5 core basic
 #
-mlx5_core-y +=	main.o cmd.o debugfs.o fw.o eq.o uar.o pagealloc.o \
+mlx5_core-y +=	main.o eq.o uar.o pagealloc.o \
 		health.o mcg.o cq.o alloc.o port.o mr.o pd.o \
 		transobj.o vport.o sriov.o fs_cmd.o fs_core.o pci_irq.o \
 		fs_counters.o fs_ft_pool.o rl.o lag/debugfs.o lag/lag.o dev.o events.o wq.o lib/gid.o \
@@ -19,6 +19,13 @@
 		diag/fw_tracer.o diag/crdump.o devlink.o diag/rsc_dump.o diag/reporter_vnic.o \
 		fw_reset.o qos.o lib/tout.o lib/aso.o wc.o fs_pool.o
 
+# mlx5 which were moved to proper plac
+mlx5_core-y += ../../../../../lib/nvidia/mlx5/cmd.o
+mlx5_core-y +=	../../../../../lib/nvidia/mlx5/debugfs.o
+ifdef CONFIG_MLXFW
+mlx5_core-y +=	../../../../../lib/nvidia/mlx5/fw.o
+endif #CONFIG_MLXFW
+
 #
 # Netdev basic
 #