Commit 1c799a6f authored by Andrew Turner's avatar Andrew Turner
Browse files

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
parent 66548259
...@@ -405,17 +405,17 @@ rk_pcie_decode_ranges(struct rk_pcie_softc *sc, struct ofw_pci_range *ranges, ...@@ -405,17 +405,17 @@ rk_pcie_decode_ranges(struct rk_pcie_softc *sc, struct ofw_pci_range *ranges,
int i; int i;
for (i = 0; i < nranges; i++) { for (i = 0; i < nranges; i++) {
if ((ranges[i].pci_hi & OFW_PCI_PHYS_HI_SPACEMASK) == switch(ranges[i].pci_hi & OFW_PCI_PHYS_HI_SPACEMASK) {
OFW_PCI_PHYS_HI_SPACE_IO) { case OFW_PCI_PHYS_HI_SPACE_IO:
if (sc->io_range.size != 0) { if (sc->io_range.size != 0) {
device_printf(sc->dev, device_printf(sc->dev,
"Duplicated IO range found in DT\n"); "Duplicated IO range found in DT\n");
return (ENXIO); return (ENXIO);
} }
sc->io_range = ranges[i]; sc->io_range = ranges[i];
} break;
if (((ranges[i].pci_hi & OFW_PCI_PHYS_HI_SPACEMASK) == case OFW_PCI_PHYS_HI_SPACE_MEM32:
OFW_PCI_PHYS_HI_SPACE_MEM64)) { case OFW_PCI_PHYS_HI_SPACE_MEM64:
if (ranges[i].pci_hi & OFW_PCI_PHYS_HI_PREFETCHABLE) { if (ranges[i].pci_hi & OFW_PCI_PHYS_HI_PREFETCHABLE) {
if (sc->pref_mem_range.size != 0) { if (sc->pref_mem_range.size != 0) {
device_printf(sc->dev, device_printf(sc->dev,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment