Index: head/sys/arm/mv/mv_pci.c =================================================================== --- head/sys/arm/mv/mv_pci.c +++ head/sys/arm/mv/mv_pci.c @@ -100,6 +100,7 @@ }; #define FDT_RANGES_CELLS ((3 + 3 + 2) * 2) +#define PCI_SPACE_LEN 0x00100000 static void mv_pci_range_dump(struct mv_pci_range *range) @@ -122,6 +123,7 @@ pcell_t *rangesptr; pcell_t cell0, cell1, cell2; int tuple_size, tuples, i, rv, offset_cells, len; + int portid, is_io_space; /* * Retrieve 'ranges' property. @@ -163,11 +165,14 @@ rangesptr++; cell2 = fdt_data_get((void *)rangesptr, 1); rangesptr++; + portid = fdt_data_get((void *)(rangesptr+1), 1); if (cell0 & 0x02000000) { pci_space = mem_space; + is_io_space = 0; } else if (cell0 & 0x01000000) { pci_space = io_space; + is_io_space = 1; } else { rv = ERANGE; goto out; @@ -198,6 +203,12 @@ rangesptr += size_cells; pci_space->base_pci = cell2; + + if (pci_space->len == 0) { + pci_space->len = PCI_SPACE_LEN; + pci_space->base_parent = fdt_immr_va + + PCI_SPACE_LEN * ( 2 * portid + is_io_space); + } } rv = 0; out: Index: head/sys/dts/arm/armada-380.dtsi =================================================================== --- head/sys/dts/arm/armada-380.dtsi +++ head/sys/dts/arm/armada-380.dtsi @@ -103,8 +103,8 @@ #address-cells = <3>; #size-cells = <2>; #interrupt-cells = <1>; - ranges = <0x82000000 0x0 0x0 0x82000000 0x0 0xf1200000 0x0 0x00100000 - 0x81000000 0x0 0x0 0x81000000 0x0 0xf1300000 0x0 0x00100000>; + ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0 + 0x81000000 0 0 0x81000000 0x1 0 1 0>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>; interrupt-parent = <&gic>; @@ -122,8 +122,8 @@ #address-cells = <3>; #size-cells = <2>; #interrupt-cells = <1>; - ranges = <0x82000000 0x0 0x0 0x82000000 0x0 0xf1400000 0x0 0x00100000 - 0x81000000 0x0 0x0 0x81000000 0x0 0xf1500000 0x0 0x00100000>; + ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0 + 0x81000000 0 0 0x81000000 0x2 0 1 0>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>; interrupt-parent = <&gic>; @@ -141,8 +141,8 @@ #address-cells = <3>; #size-cells = <2>; #interrupt-cells = <1>; - ranges = <0x82000000 0x0 0x0 0x82000000 0x0 0xf1600000 0x0 0x00100000 - 0x81000000 0x0 0x0 0x81000000 0x0 0xf1700000 0x0 0x00100000>; + ranges = <0x82000000 0 0 0x82000000 0x3 0 1 0 + 0x81000000 0 0 0x81000000 0x3 0 1 0>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>; interrupt-parent = <&gic>; Index: head/sys/dts/arm/armada-385.dtsi =================================================================== --- head/sys/dts/arm/armada-385.dtsi +++ head/sys/dts/arm/armada-385.dtsi @@ -115,8 +115,8 @@ #address-cells = <3>; #size-cells = <2>; #interrupt-cells = <1>; - ranges = <0x82000000 0x0 0x0 0x82000000 0x0 0xf1200000 0x0 0x00100000 - 0x81000000 0x0 0x0 0x81000000 0x0 0xf1300000 0x0 0x00100000>; + ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0 + 0x81000000 0 0 0x81000000 0x1 0 1 0>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>; marvell,pcie-port = <0>; @@ -133,8 +133,8 @@ #address-cells = <3>; #size-cells = <2>; #interrupt-cells = <1>; - ranges = <0x82000000 0x0 0x0 0x82000000 0x0 0xf1400000 0x0 0x00100000 - 0x81000000 0x0 0x0 0x81000000 0x0 0xf1500000 0x0 0x00100000>; + ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0 + 0x81000000 0 0 0x81000000 0x2 0 1 0>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>; marvell,pcie-port = <1>; @@ -151,8 +151,8 @@ #address-cells = <3>; #size-cells = <2>; #interrupt-cells = <1>; - ranges = <0x82000000 0x0 0x0 0x82000000 0x0 0xf1600000 0x0 0x00100000 - 0x81000000 0x0 0x0 0x81000000 0x0 0xf1700000 0x0 0x00100000>; + ranges = <0x82000000 0 0 0x82000000 0x3 0 1 0 + 0x81000000 0 0 0x81000000 0x3 0 1 0>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>; marvell,pcie-port = <2>; @@ -172,8 +172,8 @@ #address-cells = <3>; #size-cells = <2>; #interrupt-cells = <1>; - ranges = <0x82000000 0x0 0x0 0x82000000 0x0 0xf1800000 0x0 0x00100000 - 0x81000000 0x0 0x0 0x81000000 0x0 0xf1900000 0x0 0x00100000>; + ranges = <0x82000000 0 0 0x82000000 0x4 0 1 0 + 0x81000000 0 0 0x81000000 0x4 0 1 0>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>; marvell,pcie-port = <3>;