* [PATCH 1/2] fixup! of: import pci range parser from linux
2014-10-01 19:14 [PATCH 0/2] Increamental fixes for the PCI series Lucas Stach
@ 2014-10-01 19:14 ` Lucas Stach
2014-10-01 19:14 ` [PATCH 2/2] MIPS: malta: fix pci IO resource assignment Lucas Stach
1 sibling, 0 replies; 3+ messages in thread
From: Lucas Stach @ 2014-10-01 19:14 UTC (permalink / raw)
To: barebox
Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
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(-)
diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig
index 8195506..39cd138 100644
--- a/drivers/of/Kconfig
+++ b/drivers/of/Kconfig
@@ -30,6 +30,7 @@ config OF_GPIO
config OF_PCI
bool
depends on PCI
+ select OF_ADDRESS_PCI
help
OpenFirmware PCI bus accessors
diff --git a/drivers/of/address.c b/drivers/of/address.c
index 15f3ade..8018d78 100644
--- a/drivers/of/address.c
+++ b/drivers/of/address.c
@@ -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
diff --git a/include/of_address.h b/include/of_address.h
index f9c3c0f..cef785e 100644
--- a/include/of_address.h
+++ b/include/of_address.h
@@ -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 */
--
1.9.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 2/2] MIPS: malta: fix pci IO resource assignment
2014-10-01 19:14 [PATCH 0/2] Increamental fixes for the PCI series Lucas Stach
2014-10-01 19:14 ` [PATCH 1/2] fixup! of: import pci range parser from linux Lucas Stach
@ 2014-10-01 19:14 ` Lucas Stach
1 sibling, 0 replies; 3+ messages in thread
From: Lucas Stach @ 2014-10-01 19:14 UTC (permalink / raw)
To: barebox
Does the same thing as the Linux kernel now.
Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
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(-)
diff --git a/arch/mips/mach-malta/pci.c b/arch/mips/mach-malta/pci.c
index 9035175..47c0e22 100644
--- a/arch/mips/mach-malta/pci.c
+++ b/arch/mips/mach-malta/pci.c
@@ -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;
--
1.9.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread