habanalabs: allow setting HBM BAR to other regions
authorOhad Sharabi <osharabi@habana.ai>
Wed, 14 Sep 2022 05:53:29 +0000 (08:53 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Wed, 23 Nov 2022 14:13:43 +0000 (16:13 +0200)
commite325d5dbf34500fd42d5847d5b8c4e097f8030af
treeafefad8f07ccb3637edfdef3efd5000e11405c02
parent24fdfb359cadd222de8ba9d2d6a3f4dfc514878a
habanalabs: allow setting HBM BAR to other regions

Up until now the use-case in the driver was that the HBM is accessed
using the HBM BAR, yet the BAR sometimes cannot cover the whole HBM and
so we needed to set the BAR to other HBM offset.
Now we are facing the need to access other PCI memory regions that can
be covered by the HBM BAR.
To answer that we are allowing the caller to determine if the HBM BAR
need to be set or not regardless of the PCI memory region.

Signed-off-by: Ohad Sharabi <osharabi@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/common/device.c
drivers/misc/habanalabs/common/habanalabs.h