Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/powernv: Use it_page_shift in TCE build

This makes use of iommu_table::it_page_shift instead of TCE_SHIFT and
TCE_RPN_SHIFT hardcoded values.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

authored by

Alexey Kardashevskiy and committed by
Benjamin Herrenschmidt
bc32057e b0376c9b

+3 -2
+3 -2
arch/powerpc/platforms/powernv/pci.c
··· 564 564 proto_tce |= TCE_PCI_WRITE; 565 565 566 566 tces = tcep = ((__be64 *)tbl->it_base) + index - tbl->it_offset; 567 - rpn = __pa(uaddr) >> TCE_SHIFT; 567 + rpn = __pa(uaddr) >> tbl->it_page_shift; 568 568 569 569 while (npages--) 570 - *(tcep++) = cpu_to_be64(proto_tce | (rpn++ << TCE_RPN_SHIFT)); 570 + *(tcep++) = cpu_to_be64(proto_tce | 571 + (rpn++ << tbl->it_page_shift)); 571 572 572 573 /* Some implementations won't cache invalid TCEs and thus may not 573 574 * need that flush. We'll probably turn it_type into a bit mask