git: 1c799a6f29ca - main - Support decoding mem32 memory in the rk pcie driver
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 04 Jul 2022 14:27:18 UTC
The branch main has been updated by andrew:
URL: https://cgit.FreeBSD.org/src/commit/?id=1c799a6f29cadc7616362941c279dd0693c24645
commit 1c799a6f29cadc7616362941c279dd0693c24645
Author: Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2022-06-30 18:08:32 +0000
Commit: Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2022-07-04 14:27:00 +0000
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
---
sys/arm64/rockchip/rk_pcie.c | 10 +++++-----
1 file 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,