Skip to contentSkip to conversation

Increamental fixes for the PCI series

PATCH New Lucas Stach 1 participant 3 messages Oct 1, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Increamental fixes for the PCI series

Those two patches fix the remaining issues with my previous PCI series. It fixes the regression on malta reported by Antony and another potential issue where function dependencies weren't exactly right.

Lucas Stach (2):
fixup! of: import pci range parser from linux
MIPS: malta: fix pci IO resource assignment

 arch/mips/mach-malta/pci.c |  4 ++--
 drivers/of/Kconfig         |  1 +
 drivers/of/address.c       |  4 ++--
 include/of_address.h       | 22 +++++++++++++++-------
 4 files changed, 20 insertions(+), 11 deletions(-)
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

PATCH 1/2 fixup! of: import pci range parser from linux

---
Correct dependencies and put function definitions under correct ifdef to avoid build warnings/errors on systems with PCI but without OF.

---
 drivers/of/Kconfig   |  1 +
 drivers/of/address.c |  4 ++--
 include/of_address.h | 22 +++++++++++++++-------
 3 files changed, 18 insertions(+), 9 deletions(-)
drivers/of/Kconfig +1 -0
index 8195506..39cd138 100644
@@ -30,6 +30,7 @@ config OF_GPIO
 config OF_PCI
 	bool
 	depends on PCI
+	select OF_ADDRESS_PCI
 	help
 	  OpenFirmware PCI bus accessors
 
drivers/of/address.c +2 -2
index 15f3ade..8018d78 100644
@@ -179,7 +179,7 @@ static int of_bus_pci_translate(__be32 *addr, u64 offset, int na)
 }
 #endif /* CONFIG_OF_ADDRESS_PCI */
 
-#ifdef CONFIG_PCI
+#ifdef CONFIG_OF_PCI
 int of_pci_range_parser_init(struct of_pci_range_parser *parser,
 				struct device_node *node)
 {
@@ -245,7 +245,7 @@ struct of_pci_range *of_pci_range_parser_one(struct of_pci_range_parser *parser,
 	return range;
 }
 EXPORT_SYMBOL_GPL(of_pci_range_parser_one);
-#endif /* CONFIG_PCI */
+#endif /* CONFIG_OF_PCI */
 
 /*
  * Array of bus specific translators
include/of_address.h +15 -7
index f9c3c0f..cef785e 100644
@@ -55,11 +55,7 @@ extern struct device_node *of_find_matching_node_by_address(
 	struct device_node *from, const struct of_device_id *matches,
 	u64 base_address);
 extern void __iomem *of_iomap(struct device_node *np, int index);
-extern int of_pci_range_parser_init(struct of_pci_range_parser *parser,
-			struct device_node *node);
-extern struct of_pci_range *of_pci_range_parser_one(
-			struct of_pci_range_parser *parser,
-			struct of_pci_range *range);
+
 #else /* CONFIG_OFTREE */
 
 static inline u64 of_translate_address(struct device_node *dev,
@@ -103,6 +99,20 @@ static inline void __iomem *of_iomap(struct device_node *np, int index)
 	return NULL;
 }
 
+#endif /* CONFIG_OFTREE */
+
+#ifdef CONFIG_OF_PCI
+
+extern int of_pci_range_parser_init(struct of_pci_range_parser *parser,
+			struct device_node *node);
+
+extern struct of_pci_range *of_pci_range_parser_one(
+			struct of_pci_range_parser *parser,
+			struct of_pci_range *range);
+
+#else
+
+#endif /* CONFIG_OF_PCI */
 static inline int of_pci_range_parser_init(struct of_pci_range_parser *parser,
 			struct device_node *node)
 {
@@ -116,6 +126,4 @@ static inline struct of_pci_range *of_pci_range_parser_one(
 	return NULL;
 }
 
-#endif /* CONFIG_OFTREE */
-
 #endif /* __OF_ADDRESS_H */
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

PATCH 2/2 MIPS: malta: fix pci IO resource assignment

In reply to Lucas Stach

Does the same thing as the Linux kernel now.

---
I tested this with qemu-malta and at least barebox is now again able to enumerate all 4 PCI devices.

---
 arch/mips/mach-malta/pci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/mips/mach-malta/pci.c +2 -2
index 9035175..47c0e22 100644
@@ -151,7 +151,7 @@ static struct pci_controller gt64120_controller = {
 
 static int pcibios_init(void)
 {
-	resource_size_t start, end, map, start1, end1, map1, mask, res_end;
+	resource_size_t start, end, map, start1, end1, map1, mask;
 
 	/*
 	 * Due to a bug in the Galileo system controller, we need
@@ -207,7 +207,7 @@ static int pcibios_init(void)
 	BUG_ON((start & GT_PCI_HD_MSK) != (map & GT_PCI_HD_MSK) &&
 		mask != ~((mask & -mask) - 1));
 	gt64120_io_resource.start = map & mask;
-	res_end = (map & mask) | ~mask;
+	gt64120_io_resource.end = (map & mask) | ~mask;
 	gt64120_controller.io_offset = 0;
 	/* Addresses are 36-bit, so do shifts in the destinations. */
 	gt64120_io_resource.start <<= GT_PCI_DCRM_SHF;
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox