Skip to contentSkip to conversation

pci: Fix register for determining type of IO base address

PATCH In review Pali Rohár 3 participants 3 messages Nov 25, 2021 – Jan 13, 2022 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pci: Fix register for determining type of IO base address

Function dm_pciauto_prescan_setup_bridge() configures base address registers, therefore it should read type of IO from base address registers (and not from limit address registers).

Note that base and limit address registers should have same type, so this change is just usage correction and has no functional change on correctly working hardware.

Fixes 8e85f36a8fab ("pci: Fix configuring io/memory base and limit registers of PCI bridges")
---
 drivers/pci/pci_auto.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/pci_auto.c +1 -1
index 5af4ee6e56df..7e6ee54be087 100644
@@ -197,7 +197,7 @@ void dm_pciauto_prescan_setup_bridge(struct udevice *dev, int sub_bus)
 	dm_pci_read_config16(dev, PCI_COMMAND, &cmdstat);
 	dm_pci_read_config16(dev, PCI_PREF_MEMORY_BASE, &prefechable_64);
 	prefechable_64 &= PCI_PREF_RANGE_TYPE_MASK;
-	dm_pci_read_config8(dev, PCI_IO_LIMIT, &io_32);
+	dm_pci_read_config8(dev, PCI_IO_BASE, &io_32);
 	io_32 &= PCI_IO_RANGE_TYPE_MASK;
 
 	/* Configure bus number registers */
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Pali Rohár

Function dm_pciauto_prescan_setup_bridge() configures base address registers, therefore it should read type of IO from base address registers (and not from limit address registers).

Note that base and limit address registers should have same type, so this change is just usage correction and has no functional change on correctly working hardware.

Fixes 8e85f36a8fab ("pci: Fix configuring io/memory base and limit registers of PCI bridges")

Thanks,
Stefan

Quoted 10 lines
---
  drivers/pci/pci_auto.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/pci_auto.c +0 -0
index 5af4ee6e56df..7e6ee54be087 100644

drivers/pci/pci_auto.c void dm_pciauto_prescan_setup_bridge(struct udevice *dev, int sub_bus) · line 203

Quoted 8 lines
drivers/pci/pci_auto.c +1 -1
@@ -197,7 +197,7 @@ void dm_pciauto_prescan_setup_bridge(struct udevice *dev, int sub_bus)
  	dm_pci_read_config16(dev, PCI_COMMAND, &cmdstat);
  	dm_pci_read_config16(dev, PCI_PREF_MEMORY_BASE, &prefechable_64);
  	prefechable_64 &= PCI_PREF_RANGE_TYPE_MASK;
-	dm_pci_read_config8(dev, PCI_IO_LIMIT, &io_32);
+	dm_pci_read_config8(dev, PCI_IO_BASE, &io_32);
  	io_32 &= PCI_IO_RANGE_TYPE_MASK;
 
  	/* Configure bus number registers */

Viele Grüße,
Stefan Roese

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
#2 lore raw
In reply to Pali Rohár
Quoted 11 lines · Pali Rohár

Function dm_pciauto_prescan_setup_bridge() configures base address registers, therefore it should read type of IO from base address registers (and not from limit address registers).

Note that base and limit address registers should have same type, so this change is just usage correction and has no functional change on correctly working hardware.

Fixes 8e85f36a8fab ("pci: Fix configuring io/memory base and limit registers of PCI bridges")

Applied to u-boot/master, thanks!

Signature · 1 line
Tom