habanalabs: expose ASIC specific PCI info to common code
authorOhad Sharabi <osharabi@habana.ai>
Wed, 21 Apr 2021 10:03:21 +0000 (13:03 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Fri, 18 Jun 2021 12:23:39 +0000 (15:23 +0300)
commitc592c270fe1f24668ba9c9991d762e850333e63d
tree0d92731b0707b7bf4b5256822ed7364589cfd26a
parent22a795b4af5a7bc66335166054805c1f103c3e4d
habanalabs: expose ASIC specific PCI info to common code

LKD has interfaces in which it receives device address.
For instance the debugfs_read/write variants receives device address for
CFG/SRAM/DRAM for read/write and need to translate to the mapped PCI BAR
address.

In addition, the dynamic FW load protocol dictates that the address to
which the LKD will copy the image for the next FW component will be
received as a device address and can be placed either in SRAM or DRAM.

We need to distinguish those regions as the access methods to those
regions are different (in DRAM we possibly need to set the BAR base).

Looking forward this code will be used to remove duplicated code in the
debugfs_read/write that search the memory region for the input device
address.

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/habanalabs.h
drivers/misc/habanalabs/common/pci/pci.c
drivers/misc/habanalabs/gaudi/gaudi.c
drivers/misc/habanalabs/goya/goya.c