habanalabs: fix endianness handling for internal QMAN submission
authorOded Gabbay <oded.gabbay@gmail.com>
Thu, 8 Aug 2019 12:45:58 +0000 (15:45 +0300)
committerOded Gabbay <oded.gabbay@gmail.com>
Mon, 12 Aug 2019 06:01:10 +0000 (09:01 +0300)
commitb9040c99414ba5b85090595a61abc686a5dbb388
tree9f54aa00eb5b48078e8edd906d8e46438bf8e357
parent4e87334a0ef43663019dbaf3638ad10fd8c3320c
habanalabs: fix endianness handling for internal QMAN submission

The PQs of internal H/W queues (QMANs) can be located in different memory
areas for different ASICs. Therefore, when writing PQEs, we need to use
the correct function according to the location of the PQ. e.g. if the PQ
is located in the device's memory (SRAM or DRAM), we need to use
memcpy_toio() so it would work in architectures that have separate
address ranges for IO memory.

This patch makes the code that writes the PQE to be ASIC-specific so we
can handle this properly per ASIC.

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Tested-by: Ben Segal <bpsegal20@gmail.com>
drivers/misc/habanalabs/goya/goya.c
drivers/misc/habanalabs/goya/goyaP.h
drivers/misc/habanalabs/habanalabs.h
drivers/misc/habanalabs/hw_queue.c