0059-PCI-designware-Remove-incorrect-RC-memory-base-limit.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. From ae717a9744a3e18f2ed0a6aa44e279c89ad5052c Mon Sep 17 00:00:00 2001
  2. From: Gabriele Paoloni <gabriele.paoloni@huawei.com>
  3. Date: Sat, 16 Apr 2016 12:03:39 +0100
  4. Subject: [PATCH 59/70] PCI: designware: Remove incorrect RC memory base/limit
  5. configuration
  6. Currently dw_pcie_setup_rc() configures memory base and memory limit in the
  7. type1 configuration header for the root complex. In doing so it uses the
  8. CPU address (pp->mem_base) rather than the bus address (pp->mem_bus_addr).
  9. This is wrong and it is useless since the configuration is overwritten
  10. later on when pci_bus_assign_resources() is called.
  11. Remove this configuration from dw_pcie_setup_rc().
  12. Signed-off-by: Gabriele Paoloni <gabriele.paoloni@huawei.com>
  13. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
  14. Acked-by: Pratyush Anand <pratyush.anand@gmail.com>
  15. ---
  16. drivers/pci/host/pcie-designware.c | 8 --------
  17. 1 file changed, 8 deletions(-)
  18. --- a/drivers/pci/host/pcie-designware.c
  19. +++ b/drivers/pci/host/pcie-designware.c
  20. @@ -708,8 +708,6 @@ static struct pci_ops dw_pcie_ops = {
  21. void dw_pcie_setup_rc(struct pcie_port *pp)
  22. {
  23. u32 val;
  24. - u32 membase;
  25. - u32 memlimit;
  26. /* set the number of lanes */
  27. dw_pcie_readl_rc(pp, PCIE_PORT_LINK_CONTROL, &val);
  28. @@ -768,12 +766,6 @@ void dw_pcie_setup_rc(struct pcie_port *
  29. val |= 0x00010100;
  30. dw_pcie_writel_rc(pp, val, PCI_PRIMARY_BUS);
  31. - /* setup memory base, memory limit */
  32. - membase = ((u32)pp->mem_base & 0xfff00000) >> 16;
  33. - memlimit = (pp->mem_size + (u32)pp->mem_base) & 0xfff00000;
  34. - val = memlimit | membase;
  35. - dw_pcie_writel_rc(pp, val, PCI_MEMORY_BASE);
  36. -
  37. /* setup command register */
  38. dw_pcie_readl_rc(pp, PCI_COMMAND, &val);
  39. val &= 0xffff0000;