Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'pci-v3.18-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci

Pull PCI fix from Bjorn Helgaas:
"This fixes a Tegra20 regression that we introduced during the v3.18
merge window"

* tag 'pci-v3.18-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
PCI: tegra: Use physical range for I/O mapping

+20 -8
+20 -8
drivers/pci/host/pci-tegra.c
··· 276 276 277 277 struct resource all; 278 278 struct resource io; 279 + struct resource pio; 279 280 struct resource mem; 280 281 struct resource prefetch; 281 282 struct resource busn; ··· 659 658 { 660 659 struct tegra_pcie *pcie = sys_to_pcie(sys); 661 660 int err; 662 - phys_addr_t io_start; 663 661 664 662 err = devm_request_resource(pcie->dev, &pcie->all, &pcie->mem); 665 663 if (err < 0) ··· 668 668 if (err) 669 669 return err; 670 670 671 - io_start = pci_pio_to_address(pcie->io.start); 672 - 673 671 pci_add_resource_offset(&sys->resources, &pcie->mem, sys->mem_offset); 674 672 pci_add_resource_offset(&sys->resources, &pcie->prefetch, 675 673 sys->mem_offset); 676 674 pci_add_resource(&sys->resources, &pcie->busn); 677 675 678 - pci_ioremap_io(nr * SZ_64K, io_start); 676 + pci_ioremap_io(pcie->pio.start, pcie->io.start); 679 677 680 678 return 1; 681 679 } ··· 784 786 static void tegra_pcie_setup_translations(struct tegra_pcie *pcie) 785 787 { 786 788 u32 fpci_bar, size, axi_address; 787 - phys_addr_t io_start = pci_pio_to_address(pcie->io.start); 788 789 789 790 /* Bar 0: type 1 extended configuration space */ 790 791 fpci_bar = 0xfe100000; ··· 796 799 /* Bar 1: downstream IO bar */ 797 800 fpci_bar = 0xfdfc0000; 798 801 size = resource_size(&pcie->io); 799 - axi_address = io_start; 802 + axi_address = pcie->io.start; 800 803 afi_writel(pcie, axi_address, AFI_AXI_BAR1_START); 801 804 afi_writel(pcie, size >> 12, AFI_AXI_BAR1_SZ); 802 805 afi_writel(pcie, fpci_bar, AFI_FPCI_BAR1); ··· 1687 1690 1688 1691 switch (res.flags & IORESOURCE_TYPE_BITS) { 1689 1692 case IORESOURCE_IO: 1690 - memcpy(&pcie->io, &res, sizeof(res)); 1691 - pcie->io.name = np->full_name; 1693 + memcpy(&pcie->pio, &res, sizeof(res)); 1694 + pcie->pio.name = np->full_name; 1695 + 1696 + /* 1697 + * The Tegra PCIe host bridge uses this to program the 1698 + * mapping of the I/O space to the physical address, 1699 + * so we override the .start and .end fields here that 1700 + * of_pci_range_to_resource() converted to I/O space. 1701 + * We also set the IORESOURCE_MEM type to clarify that 1702 + * the resource is in the physical memory space. 1703 + */ 1704 + pcie->io.start = range.cpu_addr; 1705 + pcie->io.end = range.cpu_addr + range.size - 1; 1706 + pcie->io.flags = IORESOURCE_MEM; 1707 + pcie->io.name = "I/O"; 1708 + 1709 + memcpy(&res, &pcie->io, sizeof(res)); 1692 1710 break; 1693 1711 1694 1712 case IORESOURCE_MEM: