* [PATCH] ARM: Kirkwood: Use hw_pci.ops instead of hw_pci.scan
@ 2012-11-21 7:15 Jason Gunthorpe
2012-11-21 9:02 ` Andrew Lunn
2012-11-21 17:41 ` Andrew Lunn
0 siblings, 2 replies; 4+ messages in thread
From: Jason Gunthorpe @ 2012-11-21 7:15 UTC (permalink / raw)
To: linux-arm-kernel
The kirkwood_pcie_scan_bus function duplicates the common code in
bios32.c, passing ops in will use the common code..
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
---
arch/arm/mach-kirkwood/pcie.c | 18 +-----------------
1 files changed, 1 insertions(+), 17 deletions(-)
Just a little clean up I found while reviewing the PCI-E code.
diff --git a/arch/arm/mach-kirkwood/pcie.c b/arch/arm/mach-kirkwood/pcie.c
index ec54491..d5aedf6 100644
--- a/arch/arm/mach-kirkwood/pcie.c
+++ b/arch/arm/mach-kirkwood/pcie.c
@@ -224,22 +224,6 @@ static void __devinit rc_pci_fixup(struct pci_dev *dev)
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL, PCI_ANY_ID, rc_pci_fixup);
-static struct pci_bus __init *
-kirkwood_pcie_scan_bus(int nr, struct pci_sys_data *sys)
-{
- struct pci_bus *bus;
-
- if (nr < num_pcie_ports) {
- bus = pci_scan_root_bus(NULL, sys->busnr, &pcie_ops, sys,
- &sys->resources);
- } else {
- bus = NULL;
- BUG();
- }
-
- return bus;
-}
-
static int __init kirkwood_pcie_map_irq(const struct pci_dev *dev, u8 slot,
u8 pin)
{
@@ -251,8 +235,8 @@ static int __init kirkwood_pcie_map_irq(const struct pci_dev *dev, u8 slot,
static struct hw_pci kirkwood_pci __initdata = {
.setup = kirkwood_pcie_setup,
- .scan = kirkwood_pcie_scan_bus,
.map_irq = kirkwood_pcie_map_irq,
+ .ops = &pcie_ops,
};
static void __init add_pcie_port(int index, void __iomem *base)
--
1.7.4.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] ARM: Kirkwood: Use hw_pci.ops instead of hw_pci.scan
2012-11-21 7:15 [PATCH] ARM: Kirkwood: Use hw_pci.ops instead of hw_pci.scan Jason Gunthorpe
@ 2012-11-21 9:02 ` Andrew Lunn
2012-11-21 17:33 ` Jason Gunthorpe
2012-11-21 17:41 ` Andrew Lunn
1 sibling, 1 reply; 4+ messages in thread
From: Andrew Lunn @ 2012-11-21 9:02 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Nov 21, 2012 at 12:15:11AM -0700, Jason Gunthorpe wrote:
> The kirkwood_pcie_scan_bus function duplicates the common code in
> bios32.c, passing ops in will use the common code..
>
> Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
> ---
> arch/arm/mach-kirkwood/pcie.c | 18 +-----------------
> 1 files changed, 1 insertions(+), 17 deletions(-)
>
> Just a little clean up I found while reviewing the PCI-E code.
Hi Jason
Have you tested this on a kirkwood platform? Its hard for me to test,
i don't have a kirkwood with a used PICE slot.
Thanks
Andrew
>
> diff --git a/arch/arm/mach-kirkwood/pcie.c b/arch/arm/mach-kirkwood/pcie.c
> index ec54491..d5aedf6 100644
> --- a/arch/arm/mach-kirkwood/pcie.c
> +++ b/arch/arm/mach-kirkwood/pcie.c
> @@ -224,22 +224,6 @@ static void __devinit rc_pci_fixup(struct pci_dev *dev)
> }
> DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL, PCI_ANY_ID, rc_pci_fixup);
>
> -static struct pci_bus __init *
> -kirkwood_pcie_scan_bus(int nr, struct pci_sys_data *sys)
> -{
> - struct pci_bus *bus;
> -
> - if (nr < num_pcie_ports) {
> - bus = pci_scan_root_bus(NULL, sys->busnr, &pcie_ops, sys,
> - &sys->resources);
> - } else {
> - bus = NULL;
> - BUG();
> - }
> -
> - return bus;
> -}
> -
> static int __init kirkwood_pcie_map_irq(const struct pci_dev *dev, u8 slot,
> u8 pin)
> {
> @@ -251,8 +235,8 @@ static int __init kirkwood_pcie_map_irq(const struct pci_dev *dev, u8 slot,
>
> static struct hw_pci kirkwood_pci __initdata = {
> .setup = kirkwood_pcie_setup,
> - .scan = kirkwood_pcie_scan_bus,
> .map_irq = kirkwood_pcie_map_irq,
> + .ops = &pcie_ops,
> };
>
> static void __init add_pcie_port(int index, void __iomem *base)
> --
> 1.7.4.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] ARM: Kirkwood: Use hw_pci.ops instead of hw_pci.scan
2012-11-21 9:02 ` Andrew Lunn
@ 2012-11-21 17:33 ` Jason Gunthorpe
0 siblings, 0 replies; 4+ messages in thread
From: Jason Gunthorpe @ 2012-11-21 17:33 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Nov 21, 2012 at 10:02:31AM +0100, Andrew Lunn wrote:
> On Wed, Nov 21, 2012 at 12:15:11AM -0700, Jason Gunthorpe wrote:
> > The kirkwood_pcie_scan_bus function duplicates the common code in
> > bios32.c, passing ops in will use the common code..
> >
> > Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
> > arch/arm/mach-kirkwood/pcie.c | 18 +-----------------
> > 1 files changed, 1 insertions(+), 17 deletions(-)
> >
> > Just a little clean up I found while reviewing the PCI-E code.
>
> Hi Jason
>
> Have you tested this on a kirkwood platform? Its hard for me to test,
> i don't have a kirkwood with a used PICE slot.
Yes, I have a system that uses the PCI-E.
CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=00053977
Kirkwood: MV88F6282-Rev-A1, TCLK=200000000.
PCI: bus0 uses PCIe port 0
PCI host bridge to bus 0000:00
pci_bus 0000:00: root bus resource [mem 0xe0000000-0xe7ffffff]
pci_bus 0000:00: root bus resource [io 0x1000-0xffff]
pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
pci 0000:00:00.0: [11ab:6282] type 00 class 0x058000
pci 0000:00:00.0: reg 10: [mem 0xf1000000-0xf10fffff]
pci 0000:00:00.0: reg 18: [mem 0x00000000-0x07ffffff]
pci 0000:00:00.0: supports D1 D2
PCI: bus0: Fast back to back transfers disabled
pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 00
pci 0000:00:01.0: [170c:0001] type 00 class 0x058000
pci 0000:00:01.0: reg 10: [mem 0x00000000-0x0000ffff]
pci 0000:00:01.0: PME# supported from D0 D1 D2 D3hot
pci 0000:00:01.0: BAR 0: assigned [mem 0xe0000000-0xe000ffff]
PCI: enabling device 0000:00:01.0 (0000 -> 0002)
Jason
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] ARM: Kirkwood: Use hw_pci.ops instead of hw_pci.scan
2012-11-21 7:15 [PATCH] ARM: Kirkwood: Use hw_pci.ops instead of hw_pci.scan Jason Gunthorpe
2012-11-21 9:02 ` Andrew Lunn
@ 2012-11-21 17:41 ` Andrew Lunn
1 sibling, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2012-11-21 17:41 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Nov 21, 2012 at 12:15:11AM -0700, Jason Gunthorpe wrote:
> The kirkwood_pcie_scan_bus function duplicates the common code in
> bios32.c, passing ops in will use the common code..
>
> Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
> ---
> arch/arm/mach-kirkwood/pcie.c | 18 +-----------------
> 1 files changed, 1 insertions(+), 17 deletions(-)
>
> Just a little clean up I found while reviewing the PCI-E code.
Acked-by: Andrew Lunn <andrew@lunn.ch>
Andrew
>
> diff --git a/arch/arm/mach-kirkwood/pcie.c b/arch/arm/mach-kirkwood/pcie.c
> index ec54491..d5aedf6 100644
> --- a/arch/arm/mach-kirkwood/pcie.c
> +++ b/arch/arm/mach-kirkwood/pcie.c
> @@ -224,22 +224,6 @@ static void __devinit rc_pci_fixup(struct pci_dev *dev)
> }
> DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL, PCI_ANY_ID, rc_pci_fixup);
>
> -static struct pci_bus __init *
> -kirkwood_pcie_scan_bus(int nr, struct pci_sys_data *sys)
> -{
> - struct pci_bus *bus;
> -
> - if (nr < num_pcie_ports) {
> - bus = pci_scan_root_bus(NULL, sys->busnr, &pcie_ops, sys,
> - &sys->resources);
> - } else {
> - bus = NULL;
> - BUG();
> - }
> -
> - return bus;
> -}
> -
> static int __init kirkwood_pcie_map_irq(const struct pci_dev *dev, u8 slot,
> u8 pin)
> {
> @@ -251,8 +235,8 @@ static int __init kirkwood_pcie_map_irq(const struct pci_dev *dev, u8 slot,
>
> static struct hw_pci kirkwood_pci __initdata = {
> .setup = kirkwood_pcie_setup,
> - .scan = kirkwood_pcie_scan_bus,
> .map_irq = kirkwood_pcie_map_irq,
> + .ops = &pcie_ops,
> };
>
> static void __init add_pcie_port(int index, void __iomem *base)
> --
> 1.7.4.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-11-21 17:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-21 7:15 [PATCH] ARM: Kirkwood: Use hw_pci.ops instead of hw_pci.scan Jason Gunthorpe
2012-11-21 9:02 ` Andrew Lunn
2012-11-21 17:33 ` Jason Gunthorpe
2012-11-21 17:41 ` Andrew Lunn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).