habanalabs: add MMU DRAM default page mapping
authorOmer Shpigelman <oshpigelman@habana.ai>
Thu, 28 Feb 2019 08:46:11 +0000 (10:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Feb 2019 12:04:59 +0000 (13:04 +0100)
commit27ca384cb7c44b8b16ea43f9aed930664140360e
tree9a8852fd2c48a5844dedf6799ec48d2473c70872
parent60b7dcca4570817cc0244a8487246d6899407b44
habanalabs: add MMU DRAM default page mapping

This patch provides a workaround for a H/W bug in Goya, where access to
RAZWI from TPC can cause PCI completion timeout.

The WA is to use the device MMU to map any unmapped DRAM memory to a
default page in the DRAM. That way, the TPC will never reach RAZWI upon
accessing a bad address in the DRAM.

When a DRAM page is mapped by the user, its default mapping is
overwritten. Once that page is unmapped, the MMU driver will map that page
to the default page.

To help debugging, the driver will set the default page area to 0x99 on
device initialization.

Signed-off-by: Omer Shpigelman <oshpigelman@habana.ai>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/habanalabs/goya/goya.c
drivers/misc/habanalabs/goya/goyaP.h
drivers/misc/habanalabs/habanalabs.h
drivers/misc/habanalabs/include/hw_ip/mmu/mmu_general.h
drivers/misc/habanalabs/memory.c
drivers/misc/habanalabs/mmu.c