habanalabs: support hint addresses range reservation
authorfarah kassabri <fkassabri@habana.ai>
Sun, 31 Jan 2021 16:56:03 +0000 (18:56 +0200)
committerOded Gabbay <ogabbay@kernel.org>
Sun, 29 Aug 2021 06:47:44 +0000 (09:47 +0300)
commit1ae32b9094984efa39ca6d22d4106963458dfd20
tree2df339a7060bd4afa9f4d26902ff9fe02bdd3a42
parent0dc3ad3f859d3a65b335c861ec342d31d91e8bc8
habanalabs: support hint addresses range reservation

Add support for pre-determined driver-reserved device VA address ranges.
This is needed for future ASIC support where some contents must be
mapped into these pre-determined ranges because the H/W will be
configured using these ranges.

In case the user asks to map a VA without a hint address, avoid
allocating the device VA from the reserved ranges.

Make sure the validation checks of the hint address take into account
situation where the DRAM page size is not pow of 2.

Signed-off-by: farah kassabri <fkassabri@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/memory.c