Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 60b2a46c authored by Randy Vinson's avatar Randy Vinson Committed by Paul Mackerras
Browse files

[POWERPC] Fix IO Window Updates on P2P bridges.



When update_bridge_base() updates the IO window on a PCI-to-PCI
bridge, it fails to zero the upper 16 bits of the base and limit
registers if the window size is less than 64K.  This fixes it.

Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 8ba738c2
Loading
Loading
Loading
Loading
+6 −6
Original line number Original line Diff line number Diff line
@@ -441,14 +441,14 @@ update_bridge_base(struct pci_bus *bus, int i)
		end = res->end - off;
		end = res->end - off;
		io_base_lo = (start >> 8) & PCI_IO_RANGE_MASK;
		io_base_lo = (start >> 8) & PCI_IO_RANGE_MASK;
		io_limit_lo = (end >> 8) & PCI_IO_RANGE_MASK;
		io_limit_lo = (end >> 8) & PCI_IO_RANGE_MASK;
		if (end > 0xffff) {
		if (end > 0xffff)
			io_base_lo |= PCI_IO_RANGE_TYPE_32;
		else
			io_base_lo |= PCI_IO_RANGE_TYPE_16;
		pci_write_config_word(dev, PCI_IO_BASE_UPPER16,
		pci_write_config_word(dev, PCI_IO_BASE_UPPER16,
				start >> 16);
				start >> 16);
		pci_write_config_word(dev, PCI_IO_LIMIT_UPPER16,
		pci_write_config_word(dev, PCI_IO_LIMIT_UPPER16,
				end >> 16);
				end >> 16);
			io_base_lo |= PCI_IO_RANGE_TYPE_32;
		} else
			io_base_lo |= PCI_IO_RANGE_TYPE_16;
		pci_write_config_byte(dev, PCI_IO_BASE, io_base_lo);
		pci_write_config_byte(dev, PCI_IO_BASE, io_base_lo);
		pci_write_config_byte(dev, PCI_IO_LIMIT, io_limit_lo);
		pci_write_config_byte(dev, PCI_IO_LIMIT, io_limit_lo);