diff options
author | Andrew Turner <andrew@FreeBSD.org> | 2022-06-30 18:08:32 +0000 |
---|---|---|
committer | Andrew Turner <andrew@FreeBSD.org> | 2022-07-04 14:27:00 +0000 |
commit | 1c799a6f29cadc7616362941c279dd0693c24645 (patch) | |
tree | bab1c6a2b4b77c12597d5e4b61c4d30db434e0ee /sys/arm64/rockchip/rk_pcie.c | |
parent | 66548259075788d2084e9da1c5df7b88f44c4b4d (diff) | |
download | src-1c799a6f29cadc7616362941c279dd0693c24645.tar.gz src-1c799a6f29cadc7616362941c279dd0693c24645.zip |
Support decoding mem32 memory in the rk pcie driver
This is needed with some dtb files.
While here use a switch statement as the two options are mutually
exclusive in any iteration of the loop.
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35680
Diffstat (limited to 'sys/arm64/rockchip/rk_pcie.c')
-rw-r--r-- | sys/arm64/rockchip/rk_pcie.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/arm64/rockchip/rk_pcie.c b/sys/arm64/rockchip/rk_pcie.c index 8d07cad84e6d..1711d52d2b3e 100644 --- a/sys/arm64/rockchip/rk_pcie.c +++ b/sys/arm64/rockchip/rk_pcie.c @@ -405,17 +405,17 @@ rk_pcie_decode_ranges(struct rk_pcie_softc *sc, struct ofw_pci_range *ranges, int i; for (i = 0; i < nranges; i++) { - if ((ranges[i].pci_hi & OFW_PCI_PHYS_HI_SPACEMASK) == - OFW_PCI_PHYS_HI_SPACE_IO) { + switch(ranges[i].pci_hi & OFW_PCI_PHYS_HI_SPACEMASK) { + case OFW_PCI_PHYS_HI_SPACE_IO: if (sc->io_range.size != 0) { device_printf(sc->dev, "Duplicated IO range found in DT\n"); return (ENXIO); } sc->io_range = ranges[i]; - } - if (((ranges[i].pci_hi & OFW_PCI_PHYS_HI_SPACEMASK) == - OFW_PCI_PHYS_HI_SPACE_MEM64)) { + break; + case OFW_PCI_PHYS_HI_SPACE_MEM32: + case OFW_PCI_PHYS_HI_SPACE_MEM64: if (ranges[i].pci_hi & OFW_PCI_PHYS_HI_PREFETCHABLE) { if (sc->pref_mem_range.size != 0) { device_printf(sc->dev, |