trusty: Set dma_mask
Set dma_mask to 48 bits. This is the current limit of our encoded page
information. Allow sharing memory above 4GB with trusty on platforms
where the default dma_mask is 32 bits.
Bug: 157705770
Change-Id: Ic386fc9f1213123c183a675157d2bcc290a2cf43
Signed-off-by: Arve Hjønnevåg <arve@android.com>
diff --git a/drivers/trusty/trusty.c b/drivers/trusty/trusty.c
index 2150d80..789c48a 100644
--- a/drivers/trusty/trusty.c
+++ b/drivers/trusty/trusty.c
@@ -591,6 +591,11 @@
s->dev->dma_parms = &s->dma_parms;
dma_set_max_seg_size(s->dev, 0xfffff000); /* dma_parms limit */
+ /*
+ * Set dma mask to 48 bits. This is the current limit of
+ * trusty_encode_page_info.
+ */
+ dma_coerce_mask_and_coherent(s->dev, DMA_BIT_MASK(48));
platform_set_drvdata(pdev, s);