Skip to contentSkip to conversation

pci: Remove CONFIG_PCI_ENUM_ONLY as it's not used (any more)

PATCH New Stefan Roese 3 participants 3 messages Jan 12, 2021 – Jan 28, 2021 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pci: Remove CONFIG_PCI_ENUM_ONLY as it's not used (any more)

This patch completely removes CONFIG_PCI_ENUM_ONLY from the PCI code as it is not configured for any board (any more). With this removal, some PCI related files get cleaned up a bit.

Additional, dm_pciauto_setup_device() is now static, as it's not referenced from any code outside of this C file.

---
 README                       |   7 ---
 drivers/pci/pci_auto.c       | 104 ++++++++++++++---------------------
 drivers/pci/pci_auto_old.c   |  18 ------
 scripts/config_whitelist.txt |   1 -
 4 files changed, 41 insertions(+), 89 deletions(-)
README +0 -7
index 7b73a1c97321..edadfe98a5f2 100644
@@ -2777,13 +2777,6 @@ Low Level (hardware related) configuration options:
   CONFIG_SYS_OR3_PRELIM, CONFIG_SYS_BR3_PRELIM:
 		Memory Controller Definitions: BR2/3 and OR2/3 (SDRAM)
 
-- CONFIG_PCI_ENUM_ONLY
-		Only scan through and get the devices on the buses.
-		Don't do any setup work, presumably because someone or
-		something has already done it, and we don't need to do it
-		a second time.	Useful for platforms that are pre-booted
-		by coreboot or similar.
-
 - CONFIG_PCI_INDIRECT_BRIDGE:
 		Enable support for indirect PCI bridges.
 
drivers/pci/pci_auto.c +41 -63

185 lines not on this page · raw message

drivers/pci/pci_auto_old.c +0 -18
index 8b67cfa92b41..c56ff53c4f9f 100644
@@ -36,13 +36,11 @@ void pciauto_setup_device(struct pci_controller *hose,
 	pci_size_t bar_size;
 	u16 cmdstat = 0;
 	int bar, bar_nr = 0;
-#ifndef CONFIG_PCI_ENUM_ONLY
 	u8 header_type;
 	int rom_addr;
 	pci_addr_t bar_value;
 	struct pci_region *bar_res;
 	int found_mem64 = 0;
-#endif
 	u16 class;
 
 	pci_hose_read_config_word(hose, dev, PCI_COMMAND, &cmdstat);
@@ -51,26 +49,20 @@ void pciauto_setup_device(struct pci_controller *hose,
 	for (bar = PCI_BASE_ADDRESS_0;
 		bar < PCI_BASE_ADDRESS_0 + (bars_num * 4); bar += 4) {
 		/* Tickle the BAR and get the response */
-#ifndef CONFIG_PCI_ENUM_ONLY
 		pci_hose_write_config_dword(hose, dev, bar, 0xffffffff);
-#endif
 		pci_hose_read_config_dword(hose, dev, bar, &bar_response);
 
 		/* If BAR is not implemented go to the next BAR */
 		if (!bar_response)
 			continue;
 
-#ifndef CONFIG_PCI_ENUM_ONLY
 		found_mem64 = 0;
-#endif
 
 		/* Check the BAR type and set our address mask */
 		if (bar_response & PCI_BASE_ADDRESS_SPACE) {
 			bar_size = ((~(bar_response & PCI_BASE_ADDRESS_IO_MASK))
 				   & 0xffff) + 1;
-#ifndef CONFIG_PCI_ENUM_ONLY
 			bar_res = io;
-#endif
 
 			debug("PCI Autoconfig: BAR %d, I/O, size=0x%llx, ",
 			      bar_nr, (unsigned long long)bar_size);
@@ -80,23 +72,18 @@ void pciauto_setup_device(struct pci_controller *hose,
 				u32 bar_response_upper;
 				u64 bar64;
 
-#ifndef CONFIG_PCI_ENUM_ONLY
 				pci_hose_write_config_dword(hose, dev, bar + 4,
 					0xffffffff);
-#endif
 				pci_hose_read_config_dword(hose, dev, bar + 4,
 					&bar_response_upper);
 
 				bar64 = ((u64)bar_response_upper << 32) | bar_response;
 
 				bar_size = ~(bar64 & PCI_BASE_ADDRESS_MEM_MASK) + 1;
-#ifndef CONFIG_PCI_ENUM_ONLY
 				found_mem64 = 1;
-#endif
 			} else {
 				bar_size = (u32)(~(bar_response & PCI_BASE_ADDRESS_MEM_MASK) + 1);
 			}
-#ifndef CONFIG_PCI_ENUM_ONLY
 			if (prefetch && (bar_response & PCI_BASE_ADDRESS_MEM_PREFETCH))
 				bar_res = prefetch;
 			else
@@ -105,10 +92,8 @@ void pciauto_setup_device(struct pci_controller *hose,
 			debug("PCI Autoconfig: BAR %d, %s, size=0x%llx, ",
 			      bar_nr, bar_res == prefetch ? "Prf" : "Mem",
 			      (unsigned long long)bar_size);
-#endif
 		}
 
-#ifndef CONFIG_PCI_ENUM_ONLY
 		if (pciauto_region_allocate(bar_res, bar_size,
 					    &bar_value, found_mem64) == 0) {
 			/* Write it out and update our limit */
@@ -129,7 +114,6 @@ void pciauto_setup_device(struct pci_controller *hose,
 			}
 
 		}
-#endif
 		cmdstat |= (bar_response & PCI_BASE_ADDRESS_SPACE) ?
 			PCI_COMMAND_IO : PCI_COMMAND_MEMORY;
 
@@ -138,7 +122,6 @@ void pciauto_setup_device(struct pci_controller *hose,
 		bar_nr++;
 	}
 
-#ifndef CONFIG_PCI_ENUM_ONLY
 	/* Configure the expansion ROM address */
 	pci_hose_read_config_byte(hose, dev, PCI_HEADER_TYPE, &header_type);
 	header_type &= 0x7f;
@@ -160,7 +143,6 @@ void pciauto_setup_device(struct pci_controller *hose,
 			debug("\n");
 		}
 	}
-#endif
 
 	/* PCI_COMMAND_IO must be set for VGA device */
 	pci_hose_read_config_word(hose, dev, PCI_CLASS_DEVICE, &class);
scripts/config_whitelist.txt +0 -1
index 55acc38d0679..518d8d75e799 100644
@@ -1222,7 +1222,6 @@ CONFIG_PCI_CLK_FREQ
 CONFIG_PCI_CONFIG_HOST_BRIDGE
 CONFIG_PCI_EHCI_DEVICE
 CONFIG_PCI_EHCI_DEVNO
-CONFIG_PCI_ENUM_ONLY
 CONFIG_PCI_FIXUP_DEV
 CONFIG_PCI_GT64120
 CONFIG_PCI_INDIRECT_BRIDGE
Signature · 1 line
2.30.0
#1 lore raw

PATCH 1/1 pci: Remove CONFIG_PCI_ENUM_ONLY as it's not used (any more)

Quoted 11 lines · Stefan Roese

This patch completely removes CONFIG_PCI_ENUM_ONLY from the PCI code as it is not configured for any board (any more). With this removal, some PCI related files get cleaned up a bit.

Additional, dm_pciauto_setup_device() is now static, as it's not referenced from any code outside of this C file.

Quoted 7 lines
---
 README                       |   7 ---
 drivers/pci/pci_auto.c       | 104 ++++++++++++++---------------------
 drivers/pci/pci_auto_old.c   |  18 ------
 scripts/config_whitelist.txt |   1 -
 4 files changed, 41 insertions(+), 89 deletions(-)

Yes we handle this at run-time now.

#2 lore raw

PATCH 1/1 pci: Remove CONFIG_PCI_ENUM_ONLY as it's not used (any more)

In reply to Stefan Roese
Quoted 11 lines · Stefan Roese

This patch completely removes CONFIG_PCI_ENUM_ONLY from the PCI code as it is not configured for any board (any more). With this removal, some PCI related files get cleaned up a bit.

Additional, dm_pciauto_setup_device() is now static, as it's not referenced from any code outside of this C file.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210128/c3b76d4f/attachment.sig>