]> asedeno.scripts.mit.edu Git - linux.git/commit
habanalabs: use ASIC functions interface for rreg/wreg
authorOded Gabbay <oded.gabbay@gmail.com>
Mon, 22 Apr 2019 08:49:06 +0000 (11:49 +0300)
committerOded Gabbay <oded.gabbay@gmail.com>
Mon, 22 Apr 2019 08:49:06 +0000 (11:49 +0300)
commitb2377e032f17c3dd87739a97699f144ed00edf05
tree6ec7f4fa6d95dd602877df4ab8431be16daa5125
parentd691171d61b635fa36860ca65c4f8fde718abd09
habanalabs: use ASIC functions interface for rreg/wreg

This patch slightly changes the macros of RREG32 and WREG32, which are
used when reading or writing from registers.

Instead of directly calling a function in the common code from these
macros, the new code calls a function from the ASIC functions interface.

This change allows us to share much more code between real ASICs and
simulators, which in turn reduces the maintenance burden and
the chances for forgetting to port code between the ASIC files.

The patch also implements the hl_poll_timeout macro, instead of calling
the generic readl_poll_timeout macro. This is required to allow use of
this macro in the simulator files.

As a result from this change, more functions in goya.c are shared with the
simulator and therefore, should not be defined as static.

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