All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robherring2@gmail.com>
To: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	Russell King <linux@arm.linux.org.uk>,
	Lior Amsalem <alior@marvell.com>, Andrew Lunn <andrew@lunn.ch>,
	Jason Cooper <jason@lakedaemon.net>,
	linux-pci@vger.kernel.org, devicetree-discuss@lists.ozlabs.org,
	Jason Gunthorpe <jgunthorpe@obsidianresearch.com>,
	Maen Suleiman <maen@marvell.com>,
	Andrew Murray <andrew.murray@arm.com>,
	Tawfik Bayouk <tawfik@marvell.com>,
	linux-arm-kernel@lists.infradead.org,
	Mitch Bradley <wmb@firmworks.com>
Subject: Re: [PATCHv8 05/19] of/pci: Add of_pci_parse_bus_range() function
Date: Wed, 10 Apr 2013 13:37:04 -0500	[thread overview]
Message-ID: <5165B150.6050809@gmail.com> (raw)
In-Reply-To: <1365541601-14095-6-git-send-email-thomas.petazzoni@free-electrons.com>

On 04/09/2013 04:06 PM, Thomas Petazzoni wrote:
> From: Thierry Reding <thierry.reding@avionic-design.de>
> 
> This function can be used to parse a bus-range property as specified by
> device nodes representing PCI bridges.
> 
> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>

Reviewed-by: Rob Herring <rob.herring@calxeda.com>

> ---
>  drivers/of/of_pci.c    |   25 +++++++++++++++++++++++++
>  include/linux/of_pci.h |    1 +
>  2 files changed, 26 insertions(+)
> 
> diff --git a/drivers/of/of_pci.c b/drivers/of/of_pci.c
> index b77e8d8..e9106dc 100644
> --- a/drivers/of/of_pci.c
> +++ b/drivers/of/of_pci.c
> @@ -232,3 +232,28 @@ int of_pci_get_devfn(struct device_node *np)
>  	return (be32_to_cpup(reg) >> 8) & 0xff;
>  }
>  EXPORT_SYMBOL_GPL(of_pci_get_devfn);
> +
> +/**
> + * of_pci_parse_bus_range() - parse the bus-range property of a PCI device
> + * @node: device node
> + * @res: address to a struct resource to return the bus-range
> + *
> + * Returns 0 on success or a negative error-code on failure.
> + */
> +int of_pci_parse_bus_range(struct device_node *node, struct resource *res)
> +{
> +	const __be32 *values;
> +	int len;
> +
> +	values = of_get_property(node, "bus-range", &len);
> +	if (!values || len < sizeof(*values) * 2)
> +		return -EINVAL;
> +
> +	res->name = node->name;
> +	res->start = be32_to_cpup(values++);
> +	res->end = be32_to_cpup(values);
> +	res->flags = IORESOURCE_BUS;
> +
> +	return 0;
> +}
> +EXPORT_SYMBOL_GPL(of_pci_parse_bus_range);
> diff --git a/include/linux/of_pci.h b/include/linux/of_pci.h
> index 302aca0..be97a6f 100644
> --- a/include/linux/of_pci.h
> +++ b/include/linux/of_pci.h
> @@ -12,6 +12,7 @@ struct device_node;
>  struct device_node *of_pci_find_child_device(struct device_node *parent,
>  					     unsigned int devfn);
>  int of_pci_get_devfn(struct device_node *np);
> +int of_pci_parse_bus_range(struct device_node *node, struct resource *res);
>  
>  void pci_process_bridge_OF_ranges(struct pci_controller *hose,
>  			struct device_node *dev, int primary);
> 


WARNING: multiple messages have this Message-ID (diff)
From: robherring2@gmail.com (Rob Herring)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv8 05/19] of/pci: Add of_pci_parse_bus_range() function
Date: Wed, 10 Apr 2013 13:37:04 -0500	[thread overview]
Message-ID: <5165B150.6050809@gmail.com> (raw)
In-Reply-To: <1365541601-14095-6-git-send-email-thomas.petazzoni@free-electrons.com>

On 04/09/2013 04:06 PM, Thomas Petazzoni wrote:
> From: Thierry Reding <thierry.reding@avionic-design.de>
> 
> This function can be used to parse a bus-range property as specified by
> device nodes representing PCI bridges.
> 
> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>

Reviewed-by: Rob Herring <rob.herring@calxeda.com>

> ---
>  drivers/of/of_pci.c    |   25 +++++++++++++++++++++++++
>  include/linux/of_pci.h |    1 +
>  2 files changed, 26 insertions(+)
> 
> diff --git a/drivers/of/of_pci.c b/drivers/of/of_pci.c
> index b77e8d8..e9106dc 100644
> --- a/drivers/of/of_pci.c
> +++ b/drivers/of/of_pci.c
> @@ -232,3 +232,28 @@ int of_pci_get_devfn(struct device_node *np)
>  	return (be32_to_cpup(reg) >> 8) & 0xff;
>  }
>  EXPORT_SYMBOL_GPL(of_pci_get_devfn);
> +
> +/**
> + * of_pci_parse_bus_range() - parse the bus-range property of a PCI device
> + * @node: device node
> + * @res: address to a struct resource to return the bus-range
> + *
> + * Returns 0 on success or a negative error-code on failure.
> + */
> +int of_pci_parse_bus_range(struct device_node *node, struct resource *res)
> +{
> +	const __be32 *values;
> +	int len;
> +
> +	values = of_get_property(node, "bus-range", &len);
> +	if (!values || len < sizeof(*values) * 2)
> +		return -EINVAL;
> +
> +	res->name = node->name;
> +	res->start = be32_to_cpup(values++);
> +	res->end = be32_to_cpup(values);
> +	res->flags = IORESOURCE_BUS;
> +
> +	return 0;
> +}
> +EXPORT_SYMBOL_GPL(of_pci_parse_bus_range);
> diff --git a/include/linux/of_pci.h b/include/linux/of_pci.h
> index 302aca0..be97a6f 100644
> --- a/include/linux/of_pci.h
> +++ b/include/linux/of_pci.h
> @@ -12,6 +12,7 @@ struct device_node;
>  struct device_node *of_pci_find_child_device(struct device_node *parent,
>  					     unsigned int devfn);
>  int of_pci_get_devfn(struct device_node *np);
> +int of_pci_parse_bus_range(struct device_node *node, struct resource *res);
>  
>  void pci_process_bridge_OF_ranges(struct pci_controller *hose,
>  			struct device_node *dev, int primary);
> 

  reply	other threads:[~2013-04-10 18:37 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-09 21:06 [PATCHv8 00/19] PCIe support for the Armada 370 and Armada XP SoCs Thomas Petazzoni
2013-04-09 21:06 ` Thomas Petazzoni
2013-04-09 21:06 ` [PATCHv8 01/19] of/pci: Unify pci_process_bridge_OF_ranges from Microblaze and PowerPC Thomas Petazzoni
2013-04-09 21:06   ` Thomas Petazzoni
2013-04-09 21:06 ` [PATCHv8 02/19] of/pci: Provide support for parsing PCI DT ranges property Thomas Petazzoni
2013-04-09 21:06   ` Thomas Petazzoni
2013-04-09 21:06 ` [PATCHv8 03/19] of/pci: mips: convert to common of_pci_range_parser Thomas Petazzoni
2013-04-09 21:06   ` Thomas Petazzoni
2013-04-09 21:06 ` [PATCHv8 04/19] of/pci: Add of_pci_get_devfn() function Thomas Petazzoni
2013-04-09 21:06   ` Thomas Petazzoni
2013-04-10 18:33   ` Rob Herring
2013-04-10 18:33     ` Rob Herring
2013-04-09 21:06 ` [PATCHv8 05/19] of/pci: Add of_pci_parse_bus_range() function Thomas Petazzoni
2013-04-09 21:06   ` Thomas Petazzoni
2013-04-10 18:37   ` Rob Herring [this message]
2013-04-10 18:37     ` Rob Herring
2013-04-09 21:06 ` [PATCHv8 06/19] pci: infrastructure to add drivers in drivers/pci/host Thomas Petazzoni
2013-04-09 21:06   ` Thomas Petazzoni
2013-04-09 21:06 ` [PATCHv8 07/19] arm: pci: add a align_resource hook Thomas Petazzoni
2013-04-09 21:06   ` Thomas Petazzoni
2013-04-15 16:36   ` Jason Cooper
2013-04-15 16:36     ` Jason Cooper
2013-04-15 16:36     ` Jason Cooper
2013-04-17 14:08     ` Jason Cooper
2013-04-17 14:08       ` Jason Cooper
2013-04-17 14:08       ` Jason Cooper
2013-04-19 14:33     ` Russell King - ARM Linux
2013-04-19 14:33       ` Russell King - ARM Linux
2013-04-09 21:06 ` [PATCHv8 08/19] clk: mvebu: create parent-child relation for PCIe clocks on Armada 370 Thomas Petazzoni
2013-04-09 21:06   ` Thomas Petazzoni
2013-04-09 21:06 ` [PATCHv8 09/19] clk: mvebu: add more PCIe clocks for Armada XP Thomas Petazzoni
2013-04-09 21:06   ` Thomas Petazzoni
2013-04-09 21:06 ` [PATCHv8 10/19] pci: PCIe driver for Marvell Armada 370/XP systems Thomas Petazzoni
2013-04-09 21:06   ` Thomas Petazzoni
2013-04-09 21:12   ` Bjorn Helgaas
2013-04-09 21:12     ` Bjorn Helgaas
2013-04-09 21:22     ` Thomas Petazzoni
2013-04-09 21:22       ` Thomas Petazzoni
2013-04-09 21:06 ` [PATCHv8 11/19] arm: mvebu: PCIe support is now available on mvebu Thomas Petazzoni
2013-04-09 21:06   ` Thomas Petazzoni
2013-04-09 21:06 ` [PATCHv8 12/19] arm: mvebu: add PCIe Device Tree informations for Armada 370 Thomas Petazzoni
2013-04-09 21:06   ` Thomas Petazzoni
2013-04-12  0:28   ` Jason Cooper
2013-04-12  0:28     ` Jason Cooper
2013-04-12  0:28     ` Jason Cooper
2013-04-12  0:48     ` Jason Cooper
2013-04-12  0:48       ` Jason Cooper
2013-04-12  0:48       ` Jason Cooper
2013-04-09 21:06 ` [PATCHv8 13/19] arm: mvebu: add PCIe Device Tree informations for Armada XP Thomas Petazzoni
2013-04-09 21:06   ` Thomas Petazzoni
2013-04-09 21:06 ` [PATCHv8 14/19] arm: mvebu: PCIe Device Tree informations for OpenBlocks AX3-4 Thomas Petazzoni
2013-04-09 21:06   ` Thomas Petazzoni
2013-04-09 21:06 ` [PATCHv8 15/19] arm: mvebu: PCIe Device Tree informations for Armada XP DB Thomas Petazzoni
2013-04-09 21:06   ` Thomas Petazzoni
2013-04-09 21:06 ` [PATCHv8 16/19] arm: mvebu: PCIe Device Tree informations for Armada 370 Mirabox Thomas Petazzoni
2013-04-09 21:06   ` Thomas Petazzoni
2013-04-09 21:06 ` [PATCHv8 17/19] arm: mvebu: PCIe Device Tree informations for Armada 370 DB Thomas Petazzoni
2013-04-09 21:06   ` Thomas Petazzoni
2013-04-09 21:06 ` [PATCHv8 18/19] arm: mvebu: PCIe Device Tree informations for Armada XP GP Thomas Petazzoni
2013-04-09 21:06   ` Thomas Petazzoni
2013-04-09 21:06 ` [PATCHv8 19/19] arm: mvebu: update defconfig with PCI and USB support Thomas Petazzoni
2013-04-09 21:06   ` Thomas Petazzoni
2013-04-15 15:46 ` [PATCHv8 00/19] PCIe support for the Armada 370 and Armada XP SoCs Jason Cooper
2013-04-15 15:46   ` Jason Cooper
2013-04-15 15:46   ` Jason Cooper
2013-04-15 16:36   ` Thomas Petazzoni
2013-04-15 16:36     ` Thomas Petazzoni
2013-04-15 16:38     ` Jason Cooper
2013-04-15 16:38       ` Jason Cooper
2013-04-15 16:40       ` Thomas Petazzoni
2013-04-15 16:40         ` Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5165B150.6050809@gmail.com \
    --to=robherring2@gmail.com \
    --cc=alior@marvell.com \
    --cc=andrew.murray@arm.com \
    --cc=andrew@lunn.ch \
    --cc=bhelgaas@google.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=jason@lakedaemon.net \
    --cc=jgunthorpe@obsidianresearch.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=maen@marvell.com \
    --cc=tawfik@marvell.com \
    --cc=thomas.petazzoni@free-electrons.com \
    --cc=wmb@firmworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.