habanalabs: adjust pci controller init to new firmware
authorOded Gabbay <ogabbay@kernel.org>
Wed, 9 Dec 2020 17:50:46 +0000 (19:50 +0200)
committerOded Gabbay <ogabbay@kernel.org>
Mon, 28 Dec 2020 06:47:39 +0000 (08:47 +0200)
commit377182a3cc5ae6cc17fb04d06864c975f9f71c18
treed10bd352b17ce001d9e0018dac5fc69eb7378fb6
parent90ffe170a390d5a620f8fe66758514e369e85d24
habanalabs: adjust pci controller init to new firmware

When the firmware security is enabled, the pcie_aux_dbi_reg_addr
register in the PCI controller is blocked. Therefore, ignore
the result of writing to this register and assume it worked. Also
remove the prints on errors in the internal ELBI write function.

If the security is enabled, the firmware is responsible for setting
this register correctly so we won't have any problem.

If the security is disabled, the write will work (unless something
is totally broken at the PCI level and then the whole sequence
will fail).

In addition, remove a write to register pcie_aux_dbi_reg_addr+4,
which was never actually needed.

Moreover, PCIE_DBI registers are blocked to access from host when
firmware security is enabled. Use a different register to flush the
writes.

Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/common/pci.c
drivers/misc/habanalabs/gaudi/gaudi.c
drivers/misc/habanalabs/gaudi/gaudi_coresight.c