From a66e8666dd1e8617ff67e2f516e578445287310a Mon Sep 17 00:00:00 2001 From: patrick Date: Mon, 22 Mar 2021 20:34:45 +0000 Subject: [PATCH] Now that MSI pages are properly mapped, all that debug code in smmu(4) can be removed. The only thing left to implement for smmu(4) to work out of the box with PCIe devices is to reserve the PCIe MMIO windows. Let's see how we can do this properly. --- sys/arch/arm64/dev/smmu.c | 36 ++---------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) diff --git a/sys/arch/arm64/dev/smmu.c b/sys/arch/arm64/dev/smmu.c index b25c4f1d58d..344e0b92f3f 100644 --- a/sys/arch/arm64/dev/smmu.c +++ b/sys/arch/arm64/dev/smmu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smmu.c,v 1.10 2021/03/15 22:48:57 patrick Exp $ */ +/* $OpenBSD: smmu.c,v 1.11 2021/03/22 20:34:45 patrick Exp $ */ /* * Copyright (c) 2008-2009,2014-2016 Dale Rahn * Copyright (c) 2021 Patrick Wildt @@ -754,41 +754,9 @@ smmu_domain_create(struct smmu_softc *sc, uint32_t sid) M_DEVBUF, NULL, 0, EX_WAITOK | EX_NOCOALESCE); #if 0 - /* FIXME MSI map & PCIe address space */ + /* FIXME PCIe address space */ { -#if 0 - /* Reserve and map Ampere MSI */ - paddr_t msi_pa = 0x78020000; - size_t msi_len = 0x20000; -#endif -#if 0 - /* Reserve and map LX2K MSI */ - paddr_t msi_pa = 0x6020000; - size_t msi_len = 0x20000; -#endif -#if 1 - /* Reserve and map 8040 GICv2M */ - paddr_t msi_pa = 0xf0280000; - size_t msi_len = 0x40000; -#endif - extent_alloc_region(dom->sd_iovamap, msi_pa, msi_len, EX_WAITOK); - while (msi_len) { - smmu_enter(dom, msi_pa, msi_pa, PROT_READ | PROT_WRITE, - PROT_READ | PROT_WRITE, PMAP_CACHE_WB); - smmu_map(dom, msi_pa, msi_pa, PROT_READ | PROT_WRITE, - PROT_READ | PROT_WRITE, PMAP_CACHE_WB); - msi_pa += PAGE_SIZE; - msi_len -= PAGE_SIZE; - } #if 1 - /* Reserve and map 8040 GICP */ - msi_pa = 0xf03f0000; - msi_len = 0x1000; - extent_alloc_region(dom->sd_iovamap, msi_pa, msi_len, EX_WAITOK); - smmu_enter(dom, msi_pa, msi_pa, PROT_READ | PROT_WRITE, - PROT_READ | PROT_WRITE, PMAP_CACHE_WB); - smmu_map(dom, msi_pa, msi_pa, PROT_READ | PROT_WRITE, - PROT_READ | PROT_WRITE, PMAP_CACHE_WB); /* Reserve 8040 PCI address space */ extent_alloc_region(dom->sd_iovamap, 0xc0000000, 0x20000000, EX_WAITOK); -- 2.20.1