summaryrefslogtreecommitdiff
path: root/drivers/soc
diff options
context:
space:
mode:
authorAndrew Davis <afd@ti.com>2022-09-20 08:42:14 -0500
committerPraneeth Bajjuri <praneeth@ti.com>2022-09-21 18:17:49 -0500
commit7ecc25ce1c038c2e8180a94f12b88cafb82a7b93 (patch)
tree061ee005174c5d775308efe9c11915613a5b6fed /drivers/soc
parentc8d72cff5bda580f2f9621d4957773c3d11fe2fb (diff)
soc: ti: pat: Only allow building when DMA address type is 64bit
This allows 32bit compile tests to still work but only if DMA addresses are 64bit wide. Also cleanup physical address type printing. Signed-off-by: Andrew Davis <afd@ti.com>
Diffstat (limited to 'drivers/soc')
-rw-r--r--drivers/soc/ti/Kconfig1
-rw-r--r--drivers/soc/ti/ti-pat.c6
2 files changed, 4 insertions, 3 deletions
diff --git a/drivers/soc/ti/Kconfig b/drivers/soc/ti/Kconfig
index 07e09707e56e..56c41eac33f8 100644
--- a/drivers/soc/ti/Kconfig
+++ b/drivers/soc/ti/Kconfig
@@ -108,6 +108,7 @@ config TI_PRUSS
config TI_PAT
tristate "TI PAT DMA-BUF exporter"
depends on ARCH_K3 || COMPILE_TEST
+ depends on ARCH_DMA_ADDR_T_64BIT
select REGMAP
help
Driver for TI Page-based Address Translator (PAT). This driver
diff --git a/drivers/soc/ti/ti-pat.c b/drivers/soc/ti/ti-pat.c
index 91e497d1a023..1671b32faf38 100644
--- a/drivers/soc/ti/ti-pat.c
+++ b/drivers/soc/ti/ti-pat.c
@@ -274,7 +274,7 @@ static struct sg_table *ti_pat_dma_buf_map(struct dma_buf_attachment *attachment
}
/* And program PAT area for this set of pages */
- page_id = (buffer->offset - pat->window_base) / pat->page_size;
+ page_id = (size_t)(buffer->offset - pat->window_base) / pat->page_size;
for_each_sg(buffer->sgt->sgl, s, buffer->sgt->nents, i) {
if (s->offset) {
dev_err(pat->dev, "Cannot use offset buffers\n");
@@ -323,7 +323,7 @@ static void ti_pat_dma_buf_unmap(struct dma_buf_attachment *attachment,
/* Last mapping we unmap from parent */
if (!buffer->map_count) {
/* Disable PAT pages for this area */
- size_t page_start = (buffer->offset - pat->window_base) / pat->page_size;
+ size_t page_start = (size_t)(buffer->offset - pat->window_base) / pat->page_size;
size_t page_end = page_start + (buffer->size / pat->page_size);
for (; page_start < page_end; page_start++)
@@ -588,7 +588,7 @@ static int ti_pat_probe(struct platform_device *pdev)
/* 256 pages per 4KB of table space */
size = resource_size(res);
if (size != (pat->page_count << 4))
- dev_warn(pat->dev, "TABLE region size (%llu) does not match reported page count\n", size);
+ dev_warn(pat->dev, "TABLE region size (%pa) does not match reported page count\n", &size);
table_map = devm_regmap_init_mmio(pat->dev, base, &ti_pat_regmap_config);
if (IS_ERR(table_map)) {