All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Harvey <tharvey@gateworks.com>
To: u-boot@lists.denx.de
Subject: [U-Boot]  [RFC 09/22] pci: fix pce enumeration on thunderx
Date: Fri, 22 Feb 2019 10:03:06 -0800	[thread overview]
Message-ID: <20190222180319.32221-10-tharvey@gateworks.com> (raw)
In-Reply-To: <20190222180319.32221-1-tharvey@gateworks.com>

TODO:
 - determine proper workaround for disabling found_multi
 - determine proper workaround for decode_regions

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
 drivers/pci/pci-uclass.c | 12 ++++++++++++
 include/pci.h            |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c
index 0720ffe5b4..845e280a60 100644
--- a/drivers/pci/pci-uclass.c
+++ b/drivers/pci/pci-uclass.c
@@ -783,8 +783,11 @@ int pci_bind_bus_devices(struct udevice *bus)
 		struct udevice *dev;
 		ulong class;
 
+/* causes devices beyond the internal bridge on the Octeon TX to not enum */
+#if !defined(CONFIG_ARCH_THUNDERX)
 		if (!PCI_FUNC(bdf))
 			found_multi = false;
+#endif
 		if (PCI_FUNC(bdf) && !found_multi)
 			continue;
 		/* Check only the first access, we don't expect problems */
@@ -910,6 +913,9 @@ static void decode_regions(struct pci_controller *hose, ofnode parent_node,
 			continue;
 		}
 
+#if defined(CONFIG_ARCH_THUNDERX)
+		pos = hose->region_count++;
+#else
 		pos = -1;
 		for (i = 0; i < hose->region_count; i++) {
 			if (hose->regions[i].flags == type)
@@ -917,10 +923,16 @@ static void decode_regions(struct pci_controller *hose, ofnode parent_node,
 		}
 		if (pos == -1)
 			pos = hose->region_count++;
+#endif
 		debug(" - type=%d, pos=%d\n", type, pos);
 		pci_set_region(hose->regions + pos, pci_addr, addr, size, type);
 	}
 
+	if (hose->region_count == MAX_PCI_REGIONS) {
+		printf("PCI region count reached limit, cannot add local memory region");
+		return;
+	}
+
 	/* Add a region for our local memory */
 #ifdef CONFIG_NR_DRAM_BANKS
 	bd_t *bd = gd->bd;
diff --git a/include/pci.h b/include/pci.h
index 033d5adf2a..38d44d5b67 100644
--- a/include/pci.h
+++ b/include/pci.h
@@ -567,7 +567,7 @@ extern void pci_cfgfunc_do_nothing(struct pci_controller* hose, pci_dev_t dev,
 extern void pci_cfgfunc_config_device(struct pci_controller* hose, pci_dev_t dev,
 				      struct pci_config_table *);
 
-#define MAX_PCI_REGIONS		7
+#define MAX_PCI_REGIONS		10
 
 #define INDIRECT_TYPE_NO_PCIE_LINK	1
 
-- 
2.17.1

  parent reply	other threads:[~2019-02-22 18:03 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-22 18:02 [U-Boot] [RFC 00/22] Add support for Cavium Octeon-TX CN80XX/CN81XX Tim Harvey
2019-02-22 18:02 ` [U-Boot] [RFC 01/22] arm: introduce ARCH_THUNDERX Tim Harvey
2019-02-24 16:08   ` Alexander Graf
2019-02-24 16:13   ` Alexander Graf
2019-02-22 18:02 ` [U-Boot] [RFC 02/22] arm: add thunderx_81xx Tim Harvey
2019-02-24 16:35   ` Alexander Graf
2019-02-22 18:03 ` [U-Boot] [RFC 03/22] thunderx: add FDT support Tim Harvey
2019-02-24 16:39   ` Alexander Graf
2019-02-22 18:03 ` [U-Boot] [RFC 04/22] thunderx: add thunderx register definitions and misc functions Tim Harvey
2019-02-24 16:42   ` Alexander Graf
2019-02-22 18:03 ` [U-Boot] [RFC 05/22] thunderx: move DRAM prints to debug Tim Harvey
2019-02-22 18:03 ` [U-Boot] [RFC 06/22] dm: pci: add PCI SR-IOV EA support Tim Harvey
2019-02-22 18:03 ` [U-Boot] [RFC 07/22] fdt: add fdtdec_get_pci_bus_range Tim Harvey
2019-02-22 18:03 ` [U-Boot] [RFC 08/22] pci: add thunderx pci/ecam driver Tim Harvey
2019-02-22 18:03 ` Tim Harvey [this message]
2019-02-22 18:03 ` [U-Boot] [RFC 10/22] arm: include 64bit io accessors Tim Harvey
2019-02-22 18:03 ` [U-Boot] [RFC 11/22] gpio: add thunderx gpio driver Tim Harvey
2019-02-22 18:03 ` [U-Boot] [RFC 12/22] i2c: add thunderx I2C driver Tim Harvey
2019-02-22 18:03 ` [U-Boot] [RFC 13/22] spi: add thunderx SPI driver Tim Harvey
2019-02-22 18:03 ` [U-Boot] [RFC 14/22] xhci: add support for cavium thunderx XHCI Tim Harvey
2019-02-22 18:03 ` [U-Boot] [RFC 15/22] thunderx_81xx: add support for XHCI Tim Harvey
2019-02-22 18:03 ` [U-Boot] [RFC 16/22] thunderx_81xx: enable usb mass storage and usb ethernet Tim Harvey
2019-02-22 18:03 ` [U-Boot] [RFC 17/22] ahci: support 64bit systems Tim Harvey
2019-02-22 18:03 ` [U-Boot] [RFC 18/22] ahci: set n_ports from host caps Tim Harvey
2019-02-22 18:03 ` [U-Boot] [RFC 19/22] ahci: add support for ThunderX AHCI Tim Harvey
2019-02-22 18:03 ` [U-Boot] [RFC 20/22] thunderx_81xx: add AHCI support Tim Harvey
2019-02-22 18:03 ` [U-Boot] [RFC 21/22] net: add thunderx vnic drivers Tim Harvey
2019-02-22 18:03 ` [U-Boot] [RFC 22/22] pci: auto probe thunderx NIC devices Tim Harvey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190222180319.32221-10-tharvey@gateworks.com \
    --to=tharvey@gateworks.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.