Skip to content

Commit

Permalink
npu2: Advertise correct TCE page size
Browse files Browse the repository at this point in the history
[Upstream Commit 003ccd5]

The P9 NPU workbook says that only 4K/64K/16M/256M page size are supported
and in fact npu2_map_pe_dma_window() supports just these but in absence of
the "ibm,supported-tce-sizes" property Linux assumes the default P9 PHB4
page sizes - 4K/64K/2M/1G - so when Linux tries 2M/1G TCEs, we get lots of
"Unexpected TCE size" from npu2_tce_kill().

This advertises TCE page sizes so Linux could handle it correctly, i.e.
fall back to 4K/64K TCEs.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
  • Loading branch information
aik authored and Vasant Hegde committed Dec 14, 2018
1 parent f4afd85 commit 1259509
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions hw/npu2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1813,6 +1813,11 @@ static void npu2_add_phb_properties(struct npu2 *p)
NPU2_MAX_PE_NUM);
dt_add_property_cells(np, "ibm,opal-reserved-pe",
NPU2_RESERVED_PE_NUM);
dt_add_property_cells(np, "ibm,supported-tce-sizes",
12, // 4K
16, // 64K
24, // 16M
28); // 256M

mmio_atsd = (u64) p->regs +
NPU2_REG_OFFSET(NPU2_STACK_ATSD, NPU2_BLOCK_ATSD0, NPU2_XTS_MMIO_ATSD_LAUNCH);
Expand Down

0 comments on commit 1259509

Please sign in to comment.