summaryrefslogtreecommitdiff
path: root/drivers/ata
diff options
context:
space:
mode:
authorYong Wu <yong.wu@mediatek.com>2019-08-24 11:01:50 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-01-27 14:46:44 +0100
commit91f098c085ceb891302fa9707d3da94be6a88524 (patch)
tree1cf2cc7e6b2d4c82c85f6cd23482bb7e2bb2d81f /drivers/ata
parent0972c51f346f0be5581620d61afdea6857c08503 (diff)
iommu/mediatek: Fix iova_to_phys PA start for 4GB mode
[ Upstream commit 76ce65464fcd2c21db84391572b7938b716aceb0 ] In M4U 4GB mode, the physical address is remapped as below: CPU Physical address: ==================== 0 1G 2G 3G 4G 5G |---A---|---B---|---C---|---D---|---E---| +--I/O--+------------Memory-------------+ IOMMU output physical address: ============================= 4G 5G 6G 7G 8G |---E---|---B---|---C---|---D---| +------------Memory-------------+ The Region 'A'(I/O) can not be mapped by M4U; For Region 'B'/'C'/'D', the bit32 of the CPU physical address always is needed to set, and for Region 'E', the CPU physical address keep as is. something looks like this: CPU PA -> M4U OUTPUT PA 0x4000_0000 0x1_4000_0000 (Add bit32) 0x8000_0000 0x1_8000_0000 ... 0xc000_0000 0x1_c000_0000 ... 0x1_0000_0000 0x1_0000_0000 (No change) Additionally, the iommu consumers always use the CPU phyiscal address. The PA in the iova_to_phys that is got from v7s always is u32, But from the CPU point of view, PA only need add BIT(32) when PA < 0x4000_0000. Fixes: 30e2fccf9512 ("iommu/mediatek: Enlarge the validate PA range for 4GB mode") Signed-off-by: Yong Wu <yong.wu@mediatek.com> Signed-off-by: Joerg Roedel <jroedel@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/ata')
0 files changed, 0 insertions, 0 deletions