]> git.baikalelectronics.ru Git - uboot.git/commit
Revert "pci: Scale MAX_PCI_REGIONS based on CONFIG_NR_DRAM_BANKS"
authorSimon Glass <sjg@chromium.org>
Wed, 8 May 2019 03:41:15 +0000 (21:41 -0600)
committerBin Meng <bmeng.cn@gmail.com>
Wed, 8 May 2019 05:02:10 +0000 (13:02 +0800)
commita9766cec04e622bd844f355b8ea4874c85039c75
tree19fc1590c5d9f7984016a9e0d7bf3d737cf3fce1
parentb3cf3e1cb450465ea04ceba0412a346315613e0d
Revert "pci: Scale MAX_PCI_REGIONS based on CONFIG_NR_DRAM_BANKS"

This reverts commit d8d79b9e7dbeb3d6cc591b23ca2c0f9b0a6116bb.

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.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
include/pci.h