From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Thu, 2 May 2019 10:52:23 -0600 Subject: [U-Boot] [PATCH v3 13/18] Revert "pci: Scale MAX_PCI_REGIONS based on CONFIG_NR_DRAM_BANKS" In-Reply-To: <20190502165229.203099-1-sjg@chromium.org> References: <20190502165229.203099-1-sjg@chromium.org> Message-ID: <20190502165229.203099-14-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de This reverts commit aec4298ccb337106fd0115b91d846a022fdf301d. Unfortunately this has a dramatic impact on the pre-relocation memory used on x86 platforms (increasing it by 2KB) since it increases the overhead for each PCI device from 220 bytes to 412 bytes. The offending line is in UCLASS_DRIVER(pci): .per_device_auto_alloc_size = sizeof(struct pci_controller), This means that all PCI devices have the controller struct associated with them. The solution is to move the regions[] member out of the array, makes its size dynamic, or split UCLASS_PCI into controllers and non-controllers, as the comment suggests. For now, revert the commit to get things running again. Reviewed-by: Bin Meng Signed-off-by: Simon Glass --- Changes in v3: None Changes in v2: None include/pci.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/include/pci.h b/include/pci.h index 066238a9c3c..508f7bca81c 100644 --- a/include/pci.h +++ b/include/pci.h @@ -546,11 +546,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 *); -#ifdef CONFIG_NR_DRAM_BANKS -#define MAX_PCI_REGIONS (CONFIG_NR_DRAM_BANKS + 7) -#else -#define MAX_PCI_REGIONS 7 -#endif +#define MAX_PCI_REGIONS 7 #define INDIRECT_TYPE_NO_PCIE_LINK 1 -- 2.21.0.1020.gf2820cf01a-goog